



def  _lowerCAmelCase     (_lowerCAmelCase):
					UpperCamelCase_			= str(_lowerCAmelCase).strip()
					if not oct_string:
										raise ValueError("Empty string was passed to the function")
					UpperCamelCase_			= oct_string[0] == "-"
					if is_negative:
										UpperCamelCase_			= oct_string[1:]
					if not oct_string.isdigit() or not all(0 <= int(_lowerCAmelCase) <= 7 for char in oct_string):
										raise ValueError("Non-octal value was passed to the function")
					UpperCamelCase_			= 0
					for char in oct_string:
										UpperCamelCase_			= 8 * decimal_number + int(_lowerCAmelCase)
					if is_negative:
										UpperCamelCase_			= -decimal_number
					return decimal_number


if __name__ == "__main__":
	from doctest import testmod

	testmod()




'''simple docstring'''




import requests

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





def 				a_							(    lowercase     )      ->Any:






				'''simple docstring'''

				__lowerCamelCase		:   str           =       "secretKey"
				__lowerCamelCase		:   Optional[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
				__lowerCamelCase		:   str           =       request.POST.get("username"     )
				__lowerCamelCase		:   Dict           =       request.POST.get("password"     )
				__lowerCamelCase		:   List[str]           =       request.POST.get("g-recaptcha-response"     )

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





