
from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

_UpperCAmelCase :			int              =	{"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     lowercase :



		def __init__(			self    ,				A_	)  -> str:
				"""simple docstring"""
				UpperCamelCase          =					F'''https://www.instagram.com/{username}/'''
				UpperCamelCase          =					self.get_json()



		def __UpperCamelCase			(			self	)  -> dict:
				"""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	)  -> str:
				"""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 __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["username"]



		@property
		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["full_name"]



		@property
		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["biography"]



		@property
		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["business_email"]



		@property
		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["external_url"]



		@property
		def __UpperCamelCase			(			self	)  -> int:
				"""simple docstring"""
				return self.user_data["edge_followed_by"]["count"]



		@property
		def __UpperCamelCase			(			self	)  -> int:
				"""simple docstring"""
				return self.user_data["edge_follow"]["count"]



		@property
		def __UpperCamelCase			(			self	)  -> int:
				"""simple docstring"""
				return self.user_data["edge_owner_to_timeline_media"]["count"]



		@property
		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				return self.user_data["profile_pic_url_hd"]



		@property
		def __UpperCamelCase			(			self	)  -> bool:
				"""simple docstring"""
				return self.user_data["is_verified"]



		@property
		def __UpperCamelCase			(			self	)  -> bool:
				"""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 > 150
		assert instagram_user.number_of_followers > 120_000
		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()
					_UpperCAmelCase :			List[Any]              =	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 = }''')


from __future__ import annotations


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  list:
		'''simple docstring'''

		UpperCamelCase          =					[]
		UpperCamelCase     ,  UpperCamelCase          =					input_list[low:mid], input_list[mid : high + 1]
		while left and right:
				result.append((left if left[0] <= right[0] else right).pop(0			)			)
		UpperCamelCase          =					result + left + right
		return input_list


def 				A	( lowercase			)       ->  list:
		'''simple docstring'''

		if len(lowercase			) <= 1:
				return input_list
		UpperCamelCase          =					list(lowercase			)

		# iteration for two-way merging
		UpperCamelCase          =					2
		while p <= len(lowercase			):
				# getting low, high and middle value for merge-sort of single list
				for i in range(0   ,	len(lowercase			)   ,	lowercase			):
						UpperCamelCase          =					i
						UpperCamelCase          =					i + p - 1
						UpperCamelCase          =					(low + high + 1) // 2
						UpperCamelCase          =					merge(lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)
				# final merge of last two parts
				if p * 2 >= len(lowercase			):
						UpperCamelCase          =					i
						UpperCamelCase          =					merge(lowercase   ,	0   ,	lowercase   ,	len(lowercase			) - 1			)
						break
				p *= 2

		return input_list


if __name__ == "__main__":
					_UpperCAmelCase :			Any              =	input("Enter numbers separated by a comma:\n").strip()
					if user_input == "":
										_UpperCAmelCase :			Optional[Any]              =	[]
					else:
										_UpperCAmelCase :			Any              =	[int(item.strip()) for item in user_input.split(",")]
					print(iter_merge_sort(unsorted))
