






"""simple docstring"""





from importlib import import_module

from .logging import get_logger


_SCREAMING_SNAKE_CASE					:				Union[str, Any]					    =						get_logger(__name__)






class      a						:






    def __init__(       self     :							Optional[Any]       ,						__SCREAMING_SNAKE_CASE     :							str       ,						__SCREAMING_SNAKE_CASE     :							Union[str, Any]=None					)     ->		Optional[Any]:
      lowerCamelCase_         =						attrs or []
      if module is not None:
        for key in module.__dict__:
          if key in attrs or not key.startswith('__'					):
            setattr(self       ,						__SCREAMING_SNAKE_CASE       ,						getattr(__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE					)					)
      lowerCamelCase_         =						module._original_module if isinstance(__SCREAMING_SNAKE_CASE       ,						_PatchedModuleObj					) else module






class      a						:
    SCREAMING_SNAKE_CASE						:     Dict						= []






    def __init__(       self     :							Optional[Any]       ,						__SCREAMING_SNAKE_CASE     :							Any       ,						__SCREAMING_SNAKE_CASE     :							str       ,						__SCREAMING_SNAKE_CASE     :							Tuple       ,						__SCREAMING_SNAKE_CASE     :							Dict=None					)     ->		Optional[int]:
      lowerCamelCase_         =						obj
      lowerCamelCase_         =						target
      lowerCamelCase_         =						new
      lowerCamelCase_         =						target.split('.'					)[0]
      lowerCamelCase_         =						{}
      lowerCamelCase_         =						attrs or []






    def __enter__(       self     :							Optional[Any]					)     ->		str:
      *lowerCamelCase_     ,	lowerCamelCase_         =						self.target.split('.'					)

      # Patch modules:
      # it's used to patch attributes of submodules like "os.path.join";
      # in this case we need to patch "os" and "os.path"

      for i in range(len(__SCREAMING_SNAKE_CASE					)					):
        try:
          lowerCamelCase_         =						import_module('.'.join(submodules[: i + 1]					)					)
        except ModuleNotFoundError:
          continue
        # We iterate over all the globals in self.obj in case we find "os" or "os.path"
        for attr in self.obj.__dir__():
          lowerCamelCase_         =						getattr(self.obj       ,						__SCREAMING_SNAKE_CASE					)
          # We don't check for the name of the global, but rather if its value *is* "os" or "os.path".
          # This allows to patch renamed modules like "from os import path as ospath".
          if obj_attr is submodule or (
              (isinstance(__SCREAMING_SNAKE_CASE       ,						_PatchedModuleObj					) and obj_attr._original_module is submodule)
          ):
            lowerCamelCase_         =						obj_attr
            # patch at top level
            setattr(self.obj       ,						__SCREAMING_SNAKE_CASE       ,						_PatchedModuleObj(__SCREAMING_SNAKE_CASE       ,						attrs=self.attrs					)					)
            lowerCamelCase_         =						getattr(self.obj       ,						__SCREAMING_SNAKE_CASE					)
            # construct lower levels patches
            for key in submodules[i + 1 :]:
              setattr(__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE       ,						_PatchedModuleObj(getattr(__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE					)       ,						attrs=self.attrs					)					)
              lowerCamelCase_         =						getattr(__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE					)
            # finally set the target attribute
            setattr(__SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE       ,						self.new					)

        # Patch attribute itself:
        # it's used for builtins like "open",
        # and also to patch "os.path.join" we may also need to patch "join"
        # itself if it was imported as "from os.path import join".

      if submodules:  # if it's an attribute of a submodule like "os.path.join"
        try:
          lowerCamelCase_         =						getattr(import_module('.'.join(__SCREAMING_SNAKE_CASE					)					)       ,						__SCREAMING_SNAKE_CASE					)
        except (AttributeError, ModuleNotFoundError):
          return
        # We iterate over all the globals in self.obj in case we find "os.path.join"
        for attr in self.obj.__dir__():
          # We don't check for the name of the global, but rather if its value *is* "os.path.join".
          # This allows to patch renamed attributes like "from os.path import join as pjoin".
          if getattr(self.obj       ,						__SCREAMING_SNAKE_CASE					) is attr_value:
            lowerCamelCase_         =						getattr(self.obj       ,						__SCREAMING_SNAKE_CASE					)
            setattr(self.obj       ,						__SCREAMING_SNAKE_CASE       ,						self.new					)
      elif target_attr in globals()["__builtins__"]:  # if it'a s builtin like "open"
        lowerCamelCase_         =						globals()['__builtins__'][target_attr]
        setattr(self.obj       ,						__SCREAMING_SNAKE_CASE       ,						self.new					)
      else:
        raise RuntimeError(F'''Tried to patch attribute {target_attr} instead of a submodule.'''					)






    def __exit__(       self     :							List[Any]       ,						*__SCREAMING_SNAKE_CASE     :							List[Any]					)     ->		Union[str, Any]:
      for attr in list(self.original					):
        setattr(self.obj       ,						__SCREAMING_SNAKE_CASE       ,						self.original.pop(__SCREAMING_SNAKE_CASE					)					)






    def    UpperCamelCase       (       self     :							Tuple					)     ->		List[Any]:
      self.__enter__()
      self._active_patches.append(self					)






    def    UpperCamelCase       (       self     :							Union[str, Any]					)     ->		List[str]:
      try:
        self._active_patches.remove(self					)
      except ValueError:
        # If the patch hasn't been started this will fail
        return None

      return self.__exit__()












"""simple docstring"""





from __future__ import annotations

import math







def      lowerCamelCase__       (							_lowerCamelCase       :		int )      ->				bool:

  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5		,				int(math.sqrt(_lowerCamelCase ) + 1 )		,				6 ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True







def      lowerCamelCase__       (							_lowerCamelCase       :		int )      ->				list[int]:
  lowerCamelCase_         =						str(_lowerCamelCase )
  lowerCamelCase_         =						[n]
  for i in range(1		,				len(_lowerCamelCase ) ):
    list_nums.append(int(str_num[i:] ) )
    list_nums.append(int(str_num[:-i] ) )
  return list_nums







def      lowerCamelCase__       (							_lowerCamelCase       :		int )      ->				bool:
  if len(str(_lowerCamelCase ) ) > 3:
    if not is_prime(int(str(_lowerCamelCase )[-3:] ) ) or not is_prime(int(str(_lowerCamelCase )[:3] ) ):
      return False
  return True







def      lowerCamelCase__       (							_lowerCamelCase       :		int = 11 )      ->				list[int]:
  lowerCamelCase_         =						[]
  lowerCamelCase_         =						13
  while len(_lowerCamelCase ) != count:
    if validate(_lowerCamelCase ):
      lowerCamelCase_         =						list_truncated_nums(_lowerCamelCase )
      if all(is_prime(_lowerCamelCase ) for i in list_nums ):
        list_truncated_primes.append(_lowerCamelCase )
    num += 2
  return list_truncated_primes







def      lowerCamelCase__       (							)      ->				int:
  return sum(compute_truncated_primes(11 ) )


if __name__ == "__main__":
  print(F'''{sum(compute_truncated_primes(11)) = }''')




