



import requests

try:
						from django.contrib.auth import authenticate, login
						from django.shortcuts import redirect, render
except ImportError:
						__a     =    __a     =    __a     =    __a     =    print
def        A_  (      _lowercase     ):







						'''simple docstring'''


						snake_case_			:Tuple						=      'secretKey'
						snake_case_			:Union[str, Any]						=      'https://www.google.com/recaptcha/api/siteverify'

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

						# from the frontend, get username, password, and client_key
						snake_case_			:str						=      request.POST.get("""username"""     )
						snake_case_			:Optional[Any]						=      request.POST.get("""password"""     )
						snake_case_			:List[Any]						=      request.POST.get("""g-recaptcha-response"""     )

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





"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


__a     =    {
    "configuration_xlm_prophetnet": ["XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMProphetNetConfig"],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a     =    ["XLMProphetNetTokenizer"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a     =    [
						    "XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "XLMProphetNetDecoder",
						    "XLMProphetNetEncoder",
						    "XLMProphetNetForCausalLM",
						    "XLMProphetNetForConditionalGeneration",
						    "XLMProphetNetModel",
						    "XLMProphetNetPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_xlm_prophetnet import (
												    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    XLMProphetNetDecoder,
												    XLMProphetNetEncoder,
												    XLMProphetNetForCausalLM,
												    XLMProphetNetForConditionalGeneration,
												    XLMProphetNetModel,
												    XLMProphetNetPreTrainedModel,
												)

else:
						import sys

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