





import requests

try:
				from django.contrib.auth import authenticate, login
				from django.shortcuts import redirect, render
except ImportError:
				_UpperCamelCase   :							Optional[Any]     =	print
def 				__UpperCamelCase  (		snake_case     )  ->						Tuple:


			'''simple docstring'''







			__A				 =       '''secretKey'''
			__A				 =       '''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				 =       request.POST.get('''username'''     )
			__A				 =       request.POST.get('''password'''     )
			__A				 =       request.POST.get('''g-recaptcha-response'''     )

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








import numpy as np
def 				__UpperCamelCase  (		snake_case     )  ->						Any:


   '''simple docstring'''







   __A ,						__A				 =       a.shape
   __A				 =       min(snake_case    ,	snake_case     )
   __A				 =       np.eye(snake_case     )
   __A				 =       a.copy()

   for k in range(t - 1     ):
      # select a column of modified matrix A':
      __A				 =       r[k:, [k]]
      # construct first basis vector
      __A				 =       np.zeros_like(snake_case     )
      __A				 =       1.0
      # determine scaling factor
      __A				 =       np.linalg.norm(snake_case     )
      # construct vector v for Householder reflection
      __A				 =       x + np.sign(x[0]     ) * alpha * ea
      v /= np.linalg.norm(snake_case     )

      # construct the Householder matrix
      __A				 =       np.eye(m - k     ) - 2.0 * v @ v.T
      # pad with ones and zeros as necessary
      __A				 =       np.block([[np.eye(snake_case     ), np.zeros((k, m - k)     )], [np.zeros((m - k, k)     ), q_k]]     )

      __A				 =       q @ q_k.T
      __A				 =       q_k @ r

   return q, r


if __name__ == "__main__":
    import doctest

    doctest.testmod()

