


'''simple docstring'''
import requests

try:
    from django.contrib.auth import authenticate, login
    from django.shortcuts import redirect, render
except ImportError:
    lowerCAmelCase  =				lowerCAmelCase  =				lowerCAmelCase  =				lowerCAmelCase  =				print

def 				lowerCamelCase_   (   __UpperCamelCase				:					int		)				->  List[str]:







     """simple docstring"""
     # Enter your recaptcha secret key here
     _A				=       'secretKey'
     _A				=       'https://www.google.com/recaptcha/api/siteverify'

     # when method is not POST, direct user to login page
     if request.method != "POST":
          return render(__UpperCamelCase       ,						'login.html'		)

     # from the frontend, get username, password, and client_key
     _A				=       request.POST.get('username'		)
     _A				=       request.POST.get('password'		)
     _A				=       request.POST.get('g-recaptcha-response'		)

     # post recaptcha response to Google's recaptcha api
     _A				=       requests.post(__UpperCamelCase       ,						data={'secret': secret_key, 'response': client_key}		)
     # if the recaptcha api verified our keys
     if response.json().get('success'       ,						__UpperCamelCase		):
          # authenticate the user
          _A				=       authenticate(__UpperCamelCase       ,						username=__UpperCamelCase       ,						password=__UpperCamelCase		)
          if user_in_database:
               login(__UpperCamelCase       ,						__UpperCamelCase		)
               return redirect('/your-webpage'		)
     return render(__UpperCamelCase       ,						'login.html'		)









'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


lowerCAmelCase  =				{
    """configuration_segformer""": ["""SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SegformerConfig""", """SegformerOnnxConfig"""]
}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase  =				["""SegformerFeatureExtractor"""]
    lowerCAmelCase  =				["""SegformerImageProcessor"""]

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase  =				[
        """SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """SegformerDecodeHead""",
        """SegformerForImageClassification""",
        """SegformerForSemanticSegmentation""",
        """SegformerLayer""",
        """SegformerModel""",
        """SegformerPreTrainedModel""",
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase  =				[
        """TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """TFSegformerDecodeHead""",
        """TFSegformerForImageClassification""",
        """TFSegformerForSemanticSegmentation""",
        """TFSegformerModel""",
        """TFSegformerPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_segformer import SegformerFeatureExtractor
        from .image_processing_segformer import SegformerImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_segformer import (
            SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            SegformerDecodeHead,
            SegformerForImageClassification,
            SegformerForSemanticSegmentation,
            SegformerLayer,
            SegformerModel,
            SegformerPreTrainedModel,
        )
    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_segformer import (
            TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFSegformerDecodeHead,
            TFSegformerForImageClassification,
            TFSegformerForSemanticSegmentation,
            TFSegformerModel,
            TFSegformerPreTrainedModel,
        )

else:
    import sys

    lowerCAmelCase  =				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





