






from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

a		:       str			     = {"UserAgent": UserAgent().random}






def 				lowerCamelCase__      (    __lowerCamelCase			:     Optional[int]		):
  __UpperCAmelCase							:	Optional[int]           =  script.contents[0]
  __UpperCAmelCase							:	List[str]           =  json.loads(data[data.find("""{\"config\""""		) : -1]		)
  return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]
class     a    :



      """simple docstring"""


      def __init__(      self					:			Tuple		,      __lowercase					:			List[Any]					)							->      Tuple:
        __UpperCAmelCase							:	List[Any]           =  f"""https://www.instagram.com/{username}/"""
        __UpperCAmelCase							:	List[str]           =  self.get_json()
      def 	UpperCAmelCase      (      self					:			Optional[Any]					)							->      dict:
        __UpperCAmelCase							:	List[str]           =  requests.get(self.url		,      headers=__lowercase					).text
        __UpperCAmelCase							:	Optional[Any]           =  BeautifulSoup(__lowercase		,      """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					:			Union[str, Any]					)							->      str:
        return f"""{self.__class__.__name__}('{self.username}')"""
      def __str__(      self					:			Optional[Any]					)							->      str:
        return f"""{self.fullname} ({self.username}) is {self.biography}"""
      @property
      def 	UpperCAmelCase      (      self					:			Any					)							->      str:
        return self.user_data["username"]
      @property
      def 	UpperCAmelCase      (      self					:			List[Any]					)							->      str:
        return self.user_data["full_name"]
      @property
      def 	UpperCAmelCase      (      self					:			Tuple					)							->      str:
        return self.user_data["biography"]
      @property
      def 	UpperCAmelCase      (      self					:			Any					)							->      str:
        return self.user_data["business_email"]
      @property
      def 	UpperCAmelCase      (      self					:			Dict					)							->      str:
        return self.user_data["external_url"]
      @property
      def 	UpperCAmelCase      (      self					:			Dict					)							->      int:
        return self.user_data["edge_followed_by"]["count"]
      @property
      def 	UpperCAmelCase      (      self					:			Optional[int]					)							->      int:
        return self.user_data["edge_follow"]["count"]
      @property
      def 	UpperCAmelCase      (      self					:			List[str]					)							->      int:
        return self.user_data["edge_owner_to_timeline_media"]["count"]
      @property
      def 	UpperCAmelCase      (      self					:			Optional[Any]					)							->      str:
        return self.user_data["profile_pic_url_hd"]
      @property
      def 	UpperCAmelCase      (      self					:			int					)							->      bool:
        return self.user_data["is_verified"]




      @property
      def 	UpperCAmelCase      (      self					:			Union[str, Any]					)							->      bool:
        return self.user_data["is_private"]






def 				lowerCamelCase__      (    __lowerCamelCase			:     str = "github"		):
  import os

  if os.environ.get("""CI"""		):
    return  # test failing on GitHub Actions
  __UpperCAmelCase							:	str           =  InstagramUser(__lowerCamelCase		)
  assert instagram_user.user_data
  assert isinstance(instagram_user.user_data  ,		__lowerCamelCase		)
  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 > 120000
  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()
       a		:       int			     = 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

import typing
from collections.abc import Iterable

import numpy as np

a		:       Dict			     = typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
a		:       Any			     = typing.Union[np.floataa, int, float]  # noqa: UP007






def 				lowerCamelCase__      (    __lowerCamelCase			:     Vector  ,		__lowerCamelCase			:     Vector		):
  return np.sqrt(np.sum((np.asarray(__lowerCamelCase		) - np.asarray(__lowerCamelCase		)) ** 2		)		)






def 				lowerCamelCase__      (    __lowerCamelCase			:     Vector  ,		__lowerCamelCase			:     Vector		):
  return sum((va - va) ** 2 for va, va in zip(__lowerCamelCase  ,		__lowerCamelCase		)		) ** (1 / 2)


if __name__ == "__main__":






       def 				lowerCamelCase__      (    ):
         from timeit import timeit

         print("""Without Numpy"""		)
         print(
             timeit(
                 """euclidean_distance_no_np([1, 2, 3], [4, 5, 6])"""  ,		number=10000  ,		globals=globals()  ,		)		)
         print("""With Numpy"""		)
         print(
             timeit(
                 """euclidean_distance([1, 2, 3], [4, 5, 6])"""  ,		number=10000  ,		globals=globals()  ,		)		)







       benchmark()


