






import requests

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




def 				a (     UpperCamelCase_							:				str		)  ->		Dict:
 __A	:       Dict       =	'secretKey'
 __A	:       int       =	'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
 __A	:       int       =	request.POST.get('username'		)
 __A	:       List[str]       =	request.POST.get('password'		)
 __A	:       int       =	request.POST.get('g-recaptcha-response'		)

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













"""simple docstring"""


import math




def 				a (     UpperCamelCase_							:				int		)  ->		list[int]:
 if not isinstance(UpperCamelCase_     ,	UpperCamelCase_		):
  __A	:       Any       =	F"Input value of [number={number}] must be an integer"
  raise TypeError(UpperCamelCase_		)
 if number < 1:
  __A	:       int       =	F"Input value of [number={number}] must be a positive integer"
  raise ValueError(UpperCamelCase_		)
 __A	:       Optional[Any]       =	[number]
 while number != 1:
  if number % 2 == 0:
   __A	:       Optional[int]       =	math.floor(math.sqrt(UpperCamelCase_		)		)
  else:
   __A	:       List[str]       =	math.floor(
       math.sqrt(UpperCamelCase_		) * math.sqrt(UpperCamelCase_		) * math.sqrt(UpperCamelCase_		)		)
  sequence.append(UpperCamelCase_		)
 return sequence


if __name__ == "__main__":
   import doctest

   doctest.testmod()





