






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					(   __lowerCAmelCase			)->						List[Any]:





						"""simple docstring"""



						_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(__lowerCAmelCase				,	'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(__lowerCAmelCase				,	data={'secret': secret_key, 'response': client_key}			)
						# if the recaptcha api verified our keys
						if response.json().get('success'				,	__lowerCAmelCase			):
												# authenticate the user
												_UpperCAmelCase             =    authenticate(__lowerCAmelCase				,	username=__lowerCAmelCase				,	password=__lowerCAmelCase			)
												if user_in_database:
																		login(__lowerCAmelCase				,	__lowerCAmelCase			)
																		return redirect('/your-webpage'			)
						return render(__lowerCAmelCase				,	'login.html'			)








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_a   			=						{'''configuration_qdqbert''': ['''QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''QDQBertConfig''']}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_a   			=						[
		    '''QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''QDQBertForMaskedLM''',
		    '''QDQBertForMultipleChoice''',
		    '''QDQBertForNextSentencePrediction''',
		    '''QDQBertForQuestionAnswering''',
		    '''QDQBertForSequenceClassification''',
		    '''QDQBertForTokenClassification''',
		    '''QDQBertLayer''',
		    '''QDQBertLMHeadModel''',
		    '''QDQBertModel''',
		    '''QDQBertPreTrainedModel''',
		    '''load_tf_weights_in_qdqbert''',
		]


if TYPE_CHECKING:
		from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_qdqbert import (
				    QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    QDQBertForMaskedLM,
				    QDQBertForMultipleChoice,
				    QDQBertForNextSentencePrediction,
				    QDQBertForQuestionAnswering,
				    QDQBertForSequenceClassification,
				    QDQBertForTokenClassification,
				    QDQBertLayer,
				    QDQBertLMHeadModel,
				    QDQBertModel,
				    QDQBertPreTrainedModel,
				    load_tf_weights_in_qdqbert,
				)


else:
		import sys

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