


from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

__snake_case   							=						{'''UserAgent''': UserAgent().random}






def 		_A		(		_lowercase )					-> dict:


     """simple docstring"""


     __UpperCamelCase =			script.contents[0]
     __UpperCamelCase =			json.loads(data[data.find('{"config"' ) : -1] )
     return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]



class 	__lowerCamelCase			:







       def __init__(			self: Tuple,A_: int					):






            '''simple docstring'''




            __UpperCamelCase =			F'''https://www.instagram.com/{username}/'''
            __UpperCamelCase =			self.get_json()







       def 		snake_case_	(			self: Union[str, Any]					):






            '''simple docstring'''




            __UpperCamelCase =			requests.get(self.url,headers=A_					).text
            __UpperCamelCase =			BeautifulSoup(A_,'html.parser'					).find_all('script'					)
            try:
                 return extract_user_profile(scripts[4]					)
            except (json.decoder.JSONDecodeError, KeyError):
                 return extract_user_profile(scripts[3]					)







       def __repr__(			self: List[Any]					):






            '''simple docstring'''




            return F'''{self.__class__.__name__}(\'{self.username}\')'''







       def __str__(			self: str					):






            '''simple docstring'''




            return F'''{self.fullname} ({self.username}) is {self.biography}'''







       @property
       def 		snake_case_	(			self: Optional[int]					):






            '''simple docstring'''




            return self.user_data["username"]







       @property
       def 		snake_case_	(			self: Optional[Any]					):






            '''simple docstring'''




            return self.user_data["full_name"]







       @property
       def 		snake_case_	(			self: List[str]					):






            '''simple docstring'''




            return self.user_data["biography"]







       @property
       def 		snake_case_	(			self: str					):






            '''simple docstring'''




            return self.user_data["business_email"]







       @property
       def 		snake_case_	(			self: Dict					):






            '''simple docstring'''




            return self.user_data["external_url"]







       @property
       def 		snake_case_	(			self: str					):






            '''simple docstring'''




            return self.user_data["edge_followed_by"]["count"]







       @property
       def 		snake_case_	(			self: Tuple					):






            '''simple docstring'''




            return self.user_data["edge_follow"]["count"]







       @property
       def 		snake_case_	(			self: Optional[int]					):






            '''simple docstring'''




            return self.user_data["edge_owner_to_timeline_media"]["count"]







       @property
       def 		snake_case_	(			self: Any					):






            '''simple docstring'''




            return self.user_data["profile_pic_url_hd"]







       @property
       def 		snake_case_	(			self: Dict					):






            '''simple docstring'''




            return self.user_data["is_verified"]







       @property
       def 		snake_case_	(			self: int					):






            '''simple docstring'''




            return self.user_data["is_private"]






def 		_A		(		_lowercase = "github" )					-> None:


     """simple docstring"""


     import os

     if os.environ.get('CI' ):
          return  # test failing on GitHub Actions
     __UpperCamelCase =			InstagramUser(_lowercase )
     assert instagram_user.user_data
     assert isinstance(instagram_user.user_data					,  _lowercase )
     assert instagram_user.username == username
     if username != "github":
          return
     assert instagram_user.fullname == "GitHub"
     assert instagram_user.biography == "Built for developers."
     assert instagram_user.number_of_posts > 1_50
     assert instagram_user.number_of_followers > 12_00_00
     assert instagram_user.number_of_followings > 15
     assert instagram_user.email == "support@github.com"
     assert instagram_user.website == "https://github.com/readme"
     assert instagram_user.profile_picture_url.startswith('https://instagram.' )
     assert instagram_user.is_verified is True
     assert instagram_user.is_private is False


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    __snake_case   							=						InstagramUser('''github''')
    print(instagram_user)
    print(f"""{instagram_user.number_of_posts = }""")
    print(f"""{instagram_user.number_of_followers = }""")
    print(f"""{instagram_user.number_of_followings = }""")
    print(f"""{instagram_user.email = }""")
    print(f"""{instagram_user.website = }""")
    print(f"""{instagram_user.profile_picture_url = }""")
    print(f"""{instagram_user.is_verified = }""")
    print(f"""{instagram_user.is_private = }""")






'''simple docstring'''






from __future__ import annotations

__UpperCAmelCase       							=				list[list[int]]

# assigning initial values to the grid
__UpperCAmelCase       							=				[
    [3, 0, 6, 5, 0, 8, 4, 0, 0],
    [5, 2, 0, 0, 0, 0, 0, 0, 0],
    [0, 8, 7, 0, 0, 0, 0, 3, 1],
    [0, 0, 3, 0, 1, 0, 0, 8, 0],
    [9, 0, 0, 8, 6, 3, 0, 0, 5],
    [0, 5, 0, 0, 9, 0, 6, 0, 0],
    [1, 3, 0, 0, 0, 0, 2, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 7, 4],
    [0, 0, 5, 2, 0, 6, 3, 0, 0],
]

# a grid with no solution
__UpperCAmelCase       							=				[
    [5, 0, 6, 5, 0, 8, 4, 0, 3],
    [5, 2, 0, 0, 0, 0, 0, 0, 2],
    [1, 8, 7, 0, 0, 0, 0, 3, 1],
    [0, 0, 3, 0, 1, 0, 0, 8, 0],
    [9, 0, 0, 8, 6, 3, 0, 0, 5],
    [0, 5, 0, 0, 9, 0, 6, 0, 0],
    [1, 3, 0, 0, 0, 0, 2, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 7, 4],
    [0, 0, 5, 2, 0, 6, 3, 0, 0],
]


def    _snake_case  (	A					,       A					,       A					,       A			)		->       bool:
							for i in range(9			):
														if grid[row][i] == n or grid[i][column] == n:
																					return False

							for i in range(3			):
														for j in range(3			):
																					if grid[(row - row % 3) + i][(column - column % 3) + j] == n:
																												return False

							return True


def    _snake_case  (	A			)		->       tuple[int, int] | None:
							for i in range(9			):
														for j in range(9			):
																					if grid[i][j] == 0:
																												return i, j
							return None


def    _snake_case  (	A			)		->       Matrix | None:
							if location := find_empty_location(A			):
														lowerCAmelCase__  ,   lowerCAmelCase__			  =      location
							else:
														# If the location is ``None``, then the grid is solved.
														return grid

							for digit in range(1					,       10			):
														if is_safe(A					,       A					,       A					,       A			):
																					lowerCAmelCase__			  =      digit

																					if sudoku(A			) is not None:
																												return grid

																					lowerCAmelCase__			  =      0

							return None


def    _snake_case  (	A			)		->       None:
							for row in grid:
														for cell in row:
																					print(A					,       end=''' '''			)
														print()


if __name__ == "__main__":
		# make a copy of grid so that you can compare with the unmodified grid
		for example_grid in (initial_grid, no_solution):
				print('''\nExample grid:\n''' + '''=''' * 20)
				print_solution(example_grid)
				print('''\nExample grid solution:''')
				__UpperCAmelCase       							=				sudoku(example_grid)
				if solution is not None:
						print_solution(solution)
				else:
						print('''Cannot find a solution.''')