

"""simple docstring"""






from __future__ import annotations

import math

def 		lowerCamelCase__		(					_lowerCamelCase ,   _lowerCamelCase   ):

  '''simple docstring'''



  if len(_lowerCamelCase   ) != 2 or len(a[0]   ) != 2 or len(_lowerCamelCase   ) != 2 or len(b[0]   ) != 2:
    raise Exception('Matrices are not 2x2'   )
  _lowerCAmelCase       :   Union[str, Any]  =    [
      [a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1]],
      [a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1]],
  ]
  return new_matrix

def 		lowerCamelCase__		(					_lowerCamelCase ,   _lowerCamelCase   ):

  '''simple docstring'''



  return [
      [matrix_a[row][col] + matrix_b[row][col] for col in range(len(matrix_a[row]   )   )]
      for row in range(len(_lowerCamelCase   )   )
  ]

def 		lowerCamelCase__		(					_lowerCamelCase ,   _lowerCamelCase   ):

  '''simple docstring'''



  return [
      [matrix_a[row][col] - matrix_b[row][col] for col in range(len(matrix_a[row]   )   )]
      for row in range(len(_lowerCamelCase   )   )
  ]

def 		lowerCamelCase__		(					_lowerCamelCase   ):

  '''simple docstring'''



  if len(_lowerCamelCase   ) % 2 != 0 or len(a[0]   ) % 2 != 0:
    raise Exception('Odd matrices are not supported!'   )

  _lowerCAmelCase       :   str  =    len(_lowerCamelCase   )
  _lowerCAmelCase       :   int  =    matrix_length // 2

  _lowerCAmelCase       :   Union[str, Any]  =    [[a[i][j] for j in range(_lowerCamelCase ,   _lowerCamelCase   )] for i in range(_lowerCamelCase   )]
  _lowerCAmelCase       :   List[Any]  =    [
      [a[i][j] for j in range(_lowerCamelCase ,   _lowerCamelCase   )] for i in range(_lowerCamelCase ,   _lowerCamelCase   )
  ]

  _lowerCAmelCase       :   Dict  =    [[a[i][j] for j in range(_lowerCamelCase   )] for i in range(_lowerCamelCase   )]
  _lowerCAmelCase       :   Any  =    [[a[i][j] for j in range(_lowerCamelCase   )] for i in range(_lowerCamelCase ,   _lowerCamelCase   )]

  return top_left, top_right, bot_left, bot_right

def 		lowerCamelCase__		(					_lowerCamelCase   ):

  '''simple docstring'''



  return len(_lowerCamelCase   ), len(matrix[0]   )

def 		lowerCamelCase__		(					_lowerCamelCase   ):

  '''simple docstring'''



  print('\n'.join(str(_lowerCamelCase   ) for line in matrix   )   )

def 		lowerCamelCase__		(					_lowerCamelCase ,   _lowerCamelCase   ):

  '''simple docstring'''



  if matrix_dimensions(_lowerCamelCase   ) == (2, 2):
    return default_matrix_multiplication(_lowerCamelCase ,   _lowerCamelCase   )

  _lowerCAmelCase,					_lowerCAmelCase,					_lowerCAmelCase,					_lowerCAmelCase       :   List[str]  =    split_matrix(_lowerCamelCase   )
  _lowerCAmelCase,					_lowerCAmelCase,					_lowerCAmelCase,					_lowerCAmelCase       :   Optional[int]  =    split_matrix(_lowerCamelCase   )

  _lowerCAmelCase       :   List[Any]  =    actual_strassen(_lowerCamelCase ,   matrix_subtraction(_lowerCamelCase ,   _lowerCamelCase   )   )
  _lowerCAmelCase       :   Dict  =    actual_strassen(matrix_addition(_lowerCamelCase ,   _lowerCamelCase   ) ,   _lowerCamelCase   )
  _lowerCAmelCase       :   int  =    actual_strassen(matrix_addition(_lowerCamelCase ,   _lowerCamelCase   ) ,   _lowerCamelCase   )
  _lowerCAmelCase       :   Optional[Any]  =    actual_strassen(_lowerCamelCase ,   matrix_subtraction(_lowerCamelCase ,   _lowerCamelCase   )   )
  _lowerCAmelCase       :   Dict  =    actual_strassen(matrix_addition(_lowerCamelCase ,   _lowerCamelCase   ) ,   matrix_addition(_lowerCamelCase ,   _lowerCamelCase   )   )
  _lowerCAmelCase       :   List[str]  =    actual_strassen(matrix_subtraction(_lowerCamelCase ,   _lowerCamelCase   ) ,   matrix_addition(_lowerCamelCase ,   _lowerCamelCase   )   )
  _lowerCAmelCase       :   str  =    actual_strassen(matrix_subtraction(_lowerCamelCase ,   _lowerCamelCase   ) ,   matrix_addition(_lowerCamelCase ,   _lowerCamelCase   )   )

  _lowerCAmelCase       :   List[str]  =    matrix_addition(matrix_subtraction(matrix_addition(_lowerCamelCase ,   _lowerCamelCase   ) ,   _lowerCamelCase   ) ,   _lowerCamelCase   )
  _lowerCAmelCase       :   List[str]  =    matrix_addition(_lowerCamelCase ,   _lowerCamelCase   )
  _lowerCAmelCase       :   List[str]  =    matrix_addition(_lowerCamelCase ,   _lowerCamelCase   )
  _lowerCAmelCase       :   str  =    matrix_subtraction(matrix_subtraction(matrix_addition(_lowerCamelCase ,   _lowerCamelCase   ) ,   _lowerCamelCase   ) ,   _lowerCamelCase   )

  # construct the new matrix from our 4 quadrants
  _lowerCAmelCase       :   Any  =    []
  for i in range(len(_lowerCamelCase   )   ):
    new_matrix.append(top_left[i] + top_right[i]   )
  for i in range(len(_lowerCamelCase   )   ):
    new_matrix.append(bot_left[i] + bot_right[i]   )
  return new_matrix

def 		lowerCamelCase__		(					_lowerCamelCase ,   _lowerCamelCase   ):

  '''simple docstring'''



  if matrix_dimensions(_lowerCamelCase   )[1] != matrix_dimensions(_lowerCamelCase   )[0]:
    _lowerCAmelCase       :   Union[str, Any]  =    (
        'Unable to multiply these matrices, please check the dimensions.\n'
        f"""Matrix A: {matrixa}\n"""
        f"""Matrix B: {matrixa}"""
    )
    raise Exception(_lowerCamelCase   )
  _lowerCAmelCase       :   Any  =    matrix_dimensions(_lowerCamelCase   )
  _lowerCAmelCase       :   Union[str, Any]  =    matrix_dimensions(_lowerCamelCase   )

  if dimensiona[0] == dimensiona[1] and dimensiona[0] == dimensiona[1]:
    return [matrixa, matrixa]

  _lowerCAmelCase       :   Dict  =    max(*_lowerCamelCase ,   *_lowerCamelCase   )
  _lowerCAmelCase       :   List[Any]  =    int(math.pow(2 ,   math.ceil(math.loga(_lowerCamelCase   )   )   )   )
  _lowerCAmelCase       :   Any  =    matrixa
  _lowerCAmelCase       :   Any  =    matrixa

  # Adding zeros to the matrices so that the arrays dimensions are the same and also
  # power of 2
  for i in range(0 ,   _lowerCamelCase   ):
    if i < dimensiona[0]:
      for _ in range(dimensiona[1] ,   _lowerCamelCase   ):
        new_matrixa[i].append(0   )
    else:
      new_matrixa.append([0] * maxim   )
    if i < dimensiona[0]:
      for _ in range(dimensiona[1] ,   _lowerCamelCase   ):
        new_matrixa[i].append(0   )
    else:
      new_matrixa.append([0] * maxim   )

  _lowerCAmelCase       :   Tuple  =    actual_strassen(_lowerCamelCase ,   _lowerCamelCase   )

  # Removing the additional zeros
  for i in range(0 ,   _lowerCamelCase   ):
    if i < dimensiona[0]:
      for _ in range(dimensiona[1] ,   _lowerCamelCase   ):
        final_matrix[i].pop()
    else:
      final_matrix.pop()
  return final_matrix


if __name__ == "__main__":
 _lowerCAmelCase						=		[
     [2, 3, 4, 5],
     [6, 4, 3, 1],
     [2, 3, 6, 7],
     [3, 1, 2, 4],
     [2, 3, 4, 5],
     [6, 4, 3, 1],
     [2, 3, 6, 7],
     [3, 1, 2, 4],
     [2, 3, 4, 5],
     [6, 2, 3, 1],
 ]
 _lowerCAmelCase						=		[[0, 2, 1, 1], [1_6, 2, 3, 3], [2, 2, 7, 7], [1_3, 1_1, 2_2, 4]]
 print(strassen(matrixa, matrixa))








"""simple docstring"""






from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

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

def 		lowerCamelCase__		(					_lowerCamelCase   ):

    '''simple docstring'''



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







class 	__UpperCamelCase    :

  def __init__(		self    ,_A      ):
      '''simple docstring'''

      _lowerCAmelCase       :   Optional[Any]  =    F"""https://www.instagram.com/{username}/"""
      _lowerCAmelCase       :   str  =    self.get_json()

  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      _lowerCAmelCase       :   str  =    requests.get(self.url    ,headers=_A      ).text
      _lowerCAmelCase       :   Optional[Any]  =    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      ):
      '''simple docstring'''

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

  def __str__(		self      ):
      '''simple docstring'''

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

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["username"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["full_name"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["biography"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["business_email"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["external_url"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

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

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

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

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

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

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["profile_pic_url_hd"]

  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["is_verified"]







  @property
  def __lowerCamelCase		(		self      ):
      '''simple docstring'''

      return self.user_data["is_private"]





def 		lowerCamelCase__		(					_lowerCamelCase = "github"   ):

    '''simple docstring'''



    import os

    if os.environ.get('CI'   ):
        return  # test failing on GitHub Actions
    _lowerCAmelCase       :   Tuple  =    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()
 _lowerCAmelCase						=		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 = }''')





