






"""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			):




  """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'''			)












"""simple docstring"""


from itertools import product



def  lowerCAmelCase    (   __UpperCamelCase = 1_5			):




  """simple docstring"""







  __A						      =			0.0
  __A						      =			42
  __A						      =			42
  __A						      =			42
  __A						      =			42
  __A						      =			42
  __A						      =			42

  for series in product(range(2			)		,	repeat=__UpperCamelCase			):
    __A						      =			series.count(1			)
    __A						      =			num_turns - num_blue
    if num_red >= num_blue:
      continue
    __A						      =			1.0
    for ind, col in enumerate(__UpperCamelCase		,	2			):
      if col == 0:
        prob *= (ind - 1) / ind
      else:
        prob *= 1 / ind

    total_prob += prob

  return int(1 / total_prob			)


if __name__ == "__main__":
       print(F'''{solution() = }''')




