




'''simple docstring'''
import requests

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





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










'''simple docstring'''
from unittest.mock import patch

import datasets
from datasets import Dataset





def  lowerCamelCase(       )		->		Any:
			A_       		=   Dataset.from_dict({'col_1': [3, 2, 0, 1]}    )

			with patch('tqdm.auto.tqdm'    ) as mock_tqdm:
						datasets.disable_progress_bar()
						dset.map(lambda SCREAMING_SNAKE_CASE_    : {"col_2": x["col_1"] + 1}    )
						mock_tqdm.assert_not_called()

						mock_tqdm.reset_mock()

						datasets.enable_progress_bar()
						dset.map(lambda SCREAMING_SNAKE_CASE_    : {"col_2": x["col_1"] + 1}    )
						mock_tqdm.assert_called()




