"""simple docstring"""

import requests

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


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




"""simple docstring"""

def    lowerCAmelCase			(__UpperCamelCase							:    int							,					__UpperCamelCase							:    int			):
							"""simple docstring"""


							return (input_a, input_a).count(0			) % 2


def    lowerCAmelCase			():
							"""simple docstring"""


							assert xor_gate(0							,					0			) == 0
							assert xor_gate(0							,					1			) == 1
							assert xor_gate(1							,					0			) == 1
							assert xor_gate(1							,					1			) == 0


if __name__ == "__main__":
				print(xor_gate(0, 0))
				print(xor_gate(0, 1))



