





import requests

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




def        lowerCAmelCase_       (							UpperCamelCase_     )   ->						int:
       # Enter your recaptcha secret key here
       UpperCamelCase_      				=     "secretKey"
       UpperCamelCase_      				=     "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
       UpperCamelCase_      				=     request.POST.get("username"     )
       UpperCamelCase_      				=     request.POST.get("password"     )
       UpperCamelCase_      				=     request.POST.get("g-recaptcha-response"     )

       # post recaptcha response to Google's recaptcha api
       UpperCamelCase_      				=     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
              UpperCamelCase_      				=     authenticate(UpperCamelCase_    ,						username=UpperCamelCase_    ,						password=UpperCamelCase_     )
              if user_in_database:
                     login(UpperCamelCase_    ,						UpperCamelCase_     )
                     return redirect("/your-webpage"     )
       return render(UpperCamelCase_    ,						"login.html"     )








from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCAmelCase				       = {
    'configuration_mpnet': ['MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MPNetConfig'],
    'tokenization_mpnet': ['MPNetTokenizer'],
}

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = ['MPNetTokenizerFast']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = [
         'MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
         'MPNetForMaskedLM',
         'MPNetForMultipleChoice',
         'MPNetForQuestionAnswering',
         'MPNetForSequenceClassification',
         'MPNetForTokenClassification',
         'MPNetLayer',
         'MPNetModel',
         'MPNetPreTrainedModel',
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = [
         'TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
         'TFMPNetEmbeddings',
         'TFMPNetForMaskedLM',
         'TFMPNetForMultipleChoice',
         'TFMPNetForQuestionAnswering',
         'TFMPNetForSequenceClassification',
         'TFMPNetForTokenClassification',
         'TFMPNetMainLayer',
         'TFMPNetModel',
         'TFMPNetPreTrainedModel',
     ]


if TYPE_CHECKING:
     from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
     from .tokenization_mpnet import MPNetTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_mpnet_fast import MPNetTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_mpnet import (
              MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              MPNetForMaskedLM,
              MPNetForMultipleChoice,
              MPNetForQuestionAnswering,
              MPNetForSequenceClassification,
              MPNetForTokenClassification,
              MPNetLayer,
              MPNetModel,
              MPNetPreTrainedModel,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_mpnet import (
              TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFMPNetEmbeddings,
              TFMPNetForMaskedLM,
              TFMPNetForMultipleChoice,
              TFMPNetForQuestionAnswering,
              TFMPNetForSequenceClassification,
              TFMPNetForTokenClassification,
              TFMPNetMainLayer,
              TFMPNetModel,
              TFMPNetPreTrainedModel,
          )

else:
     import sys

     _UpperCAmelCase				       = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

