"""simple docstring"""






from ..utils import DummyObject, requires_backends
class 							snake_case			(					metaclass=__UpperCAmelCase							):




					"""simple docstring"""

					snake_case__							       =					["torch", "librosa"]







					def __init__(							self  :      List[Any]       ,*lowerCamelCase__  :      Optional[int]       ,**lowerCamelCase__  :      List[str]     ):
									requires_backends(self       ,['torch', 'librosa']     )







					@classmethod
					def 						__lowerCAmelCase		(							cls  :      Optional[Any]       ,*lowerCamelCase__  :      Dict       ,**lowerCamelCase__  :      int     ):
									requires_backends(cls       ,['torch', 'librosa']     )







					@classmethod
					def 						__lowerCAmelCase		(							cls  :      List[Any]       ,*lowerCamelCase__  :      int       ,**lowerCamelCase__  :      Optional[int]     ):
									requires_backends(cls       ,['torch', 'librosa']     )






class 							snake_case			(					metaclass=__UpperCAmelCase							):




					"""simple docstring"""

					snake_case__							       =					["torch", "librosa"]







					def __init__(							self  :      Union[str, Any]       ,*lowerCamelCase__  :      int       ,**lowerCamelCase__  :      List[str]     ):
									requires_backends(self       ,['torch', 'librosa']     )







					@classmethod
					def 						__lowerCAmelCase		(							cls  :      Optional[Any]       ,*lowerCamelCase__  :      str       ,**lowerCamelCase__  :      Dict     ):
									requires_backends(cls       ,['torch', 'librosa']     )







					@classmethod
					def 						__lowerCAmelCase		(							cls  :      Union[str, Any]       ,*lowerCamelCase__  :      int       ,**lowerCamelCase__  :      Tuple     ):
									requires_backends(cls       ,['torch', 'librosa']     )




"""simple docstring"""






import requests

try:
						from django.contrib.auth import authenticate, login
						from django.shortcuts import redirect, render
except ImportError:
						lowerCAmelCase__    :    Union[str, Any]			=      print



def     a_		(   lowerCamelCase			):
				# 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(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'			)



