


'''simple docstring'''



from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

__A		={"""UserAgent""": UserAgent().random}







def       _UpperCamelCase (						UpperCamelCase__   ):
   UpperCAmelCase__					:   int       				=       script.contents[0]
   UpperCAmelCase__					:   Any       				=       json.loads(data[data.find("""{\"config\""""   ) : -1]   )
   return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]


class 						_snake_case   :




     def __init__( self							,							_lowerCamelCase):
        UpperCAmelCase__					:   List[Any]       				=       f'''https://www.instagram.com/{username}/'''
        UpperCAmelCase__					:   Dict       				=       self.get_json()




     def 			snake_case__  ( self):
        UpperCAmelCase__					:   str       				=       requests.get(self.url							,							headers=a_).text
        UpperCAmelCase__					:   str       				=       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):
        return f'''{self.__class__.__name__}(\'{self.username}\')'''




     def __str__( self):
        return f'''{self.fullname} ({self.username}) is {self.biography}'''




     @property
     def 			snake_case__  ( self):
        return self.user_data["username"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["full_name"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["biography"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["business_email"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["external_url"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["edge_followed_by"]["count"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["edge_follow"]["count"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["edge_owner_to_timeline_media"]["count"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["profile_pic_url_hd"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["is_verified"]




     @property
     def 			snake_case__  ( self):
        return self.user_data["is_private"]







def       _UpperCamelCase (						UpperCamelCase__ = "github"   ):
   import os

   if os.environ.get("""CI"""   ):
      return  # test failing on GitHub Actions
   UpperCAmelCase__					:   Dict       				=       InstagramUser(_snake_case   )
   assert instagram_user.user_data
   assert isinstance(instagram_user.user_data	, _snake_case   )
   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_5_0
   assert instagram_user.number_of_followers > 1_2_0_0_0_0
   assert instagram_user.number_of_followings > 1_5
   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()
  __A		=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'''



import functools







def       _UpperCamelCase (						UpperCamelCase__	, UpperCamelCase__   ):

			# Validation
			if not isinstance(UpperCamelCase__	, UpperCamelCase__   ) or not all(isinstance(UpperCamelCase__	, UpperCamelCase__   ) for day in days   ):
						raise ValueError("""The parameter days should be a list of integers"""   )

			if len(UpperCamelCase__   ) != 3 or not all(isinstance(UpperCamelCase__	, UpperCamelCase__   ) for cost in costs   ):
						raise ValueError("""The parameter costs should be a list of three integers"""   )

			if len(UpperCamelCase__   ) == 0:
						return 0

			if min(UpperCamelCase__   ) <= 0:
						raise ValueError("""All days elements should be greater than 0"""   )

			if max(UpperCamelCase__   ) >= 3_6_6:
						raise ValueError("""All days elements should be less than 366"""   )

			UpperCAmelCase__					:   Union[str, Any]       				=       set(UpperCamelCase__   )

			@functools.cache
			def dynamic_programming(UpperCamelCase__   ) -> int:
						if index > 3_6_5:
									return 0

						if index not in days_set:
									return dynamic_programming(index + 1   )

						return min(
						    costs[0] + dynamic_programming(index + 1   )	, costs[1] + dynamic_programming(index + 7   )	, costs[2] + dynamic_programming(index + 3_0   )	, )

			return dynamic_programming(1   )


if __name__ == "__main__":
		import doctest

		doctest.testmod()