





import requests

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


def        __snake_case       (						lowerCAmelCase_  )							->	Dict:
    # Enter your recaptcha secret key here
    SCREAMING_SNAKE_CASE__       							= '''secretKey'''
    SCREAMING_SNAKE_CASE__       							= '''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
    SCREAMING_SNAKE_CASE__       							= request.POST.get('''username'''  )
    SCREAMING_SNAKE_CASE__       							= request.POST.get('''password'''  )
    SCREAMING_SNAKE_CASE__       							= request.POST.get('''g-recaptcha-response'''  )

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








import numpy as np

_A				:							List[Any]							= [
    ["""a""", """b""", """c""", """d""", """e"""],
    ["""f""", """g""", """h""", """i""", """k"""],
    ["""l""", """m""", """n""", """o""", """p"""],
    ["""q""", """r""", """s""", """t""", """u"""],
    ["""v""", """w""", """x""", """y""", """z"""],
]



class 				__snake_case  :


    '''simple docstring'''







    def __init__(					self    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= np.array(A_    )



    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__							,		SCREAMING_SNAKE_CASE__       							= np.where(letter == self.SQUARE    )
        SCREAMING_SNAKE_CASE__       							= np.concatenate([indexa + 1, indexa + 1]    )
        return indexes



    def    lowercase_				(					self      ,							A_      ,							A_    ):





        '''simple docstring'''

        return self.SQUARE[indexa - 1, indexa - 1]



    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= message.lower()
        SCREAMING_SNAKE_CASE__       							= message.replace('''j'''      ,							'''i'''    )

        SCREAMING_SNAKE_CASE__       							= ''''''
        for letter_index in range(len(A_    )    ):
            if message[letter_index] != " ":
                SCREAMING_SNAKE_CASE__       							= self.letter_to_numbers(message[letter_index]    )
                SCREAMING_SNAKE_CASE__       							= encoded_message + str(numbers[0]    ) + str(numbers[1]    )
            elif message[letter_index] == " ":
                SCREAMING_SNAKE_CASE__       							= encoded_message + ''' '''

        return encoded_message




    def    lowercase_				(					self      ,							A_    ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__       							= message.replace(''' '''      ,							'''  '''    )
        SCREAMING_SNAKE_CASE__       							= ''''''
        for numbers_index in range(int(len(A_    ) / 2    )    ):
            if message[numbers_index * 2] != " ":
                SCREAMING_SNAKE_CASE__       							= message[numbers_index * 2]
                SCREAMING_SNAKE_CASE__       							= message[numbers_index * 2 + 1]

                SCREAMING_SNAKE_CASE__       							= self.numbers_to_letter(int(A_    )      ,							int(A_    )    )
                SCREAMING_SNAKE_CASE__       							= decoded_message + letter
            elif message[numbers_index * 2] == " ":
                SCREAMING_SNAKE_CASE__       							= decoded_message + ''' '''

        return decoded_message
