




'''simple docstring'''






from collections import OrderedDict
from dataclasses import fields
from typing import Any, Tuple

import numpy as np

from .import_utils import is_torch_available

def       __lowerCAmelCase (   snake_case__						):
   if is_torch_available():
      import torch

      if isinstance(snake_case__ ,				torch.Tensor						):
         return True

   return isinstance(snake_case__ ,				np.ndarray						)




class  A		(			SCREAMING_SNAKE_CASE__		):




    '''simple docstring'''





    def 	a_	(self      )     ->	Dict:
       __UpperCamelCase				:      str									=       fields(self      )

       # Safety and consistency checks
       if not len(_UpperCAmelCase      ):
          raise ValueError(f"{self.__class__.__name__} has no fields."      )

       __UpperCamelCase				:      Optional[Any]									=       getattr(self			,  class_fields[0].name      )
       __UpperCamelCase				:      Optional[int]									=       all(getattr(self			,  field.name      ) is None for field in class_fields[1:]      )

       if other_fields_are_none and isinstance(_UpperCAmelCase			,  _UpperCAmelCase      ):
          for key, value in first_field.items():
             __UpperCamelCase				:      List[Any]									=       value
       else:
          for field in class_fields:
             __UpperCamelCase				:      Any									=       getattr(self			,  field.name      )
             if v is not None:
                __UpperCamelCase				:      Dict									=       v
    def __delitem__(self			,  *_UpperCAmelCase			,  **_UpperCAmelCase      )     ->	Union[str, Any]:
       raise Exception(f"You cannot use ``__delitem__`` on a {self.__class__.__name__} instance."      )
    def 	a_	(self			,  *_UpperCAmelCase			,  **_UpperCAmelCase      )     ->	Union[str, Any]:
       raise Exception(f"You cannot use ``setdefault`` on a {self.__class__.__name__} instance."      )
    def 	a_	(self			,  *_UpperCAmelCase			,  **_UpperCAmelCase      )     ->	Dict:
       raise Exception(f"You cannot use ``pop`` on a {self.__class__.__name__} instance."      )
    def 	a_	(self			,  *_UpperCAmelCase			,  **_UpperCAmelCase      )     ->	Optional[Any]:
       raise Exception(f"You cannot use ``update`` on a {self.__class__.__name__} instance."      )
    def __getitem__(self			,  _UpperCAmelCase      )     ->	str:
       if isinstance(_UpperCAmelCase			,  _UpperCAmelCase      ):
          __UpperCamelCase				:      str									=       dict(self.items()      )
          return inner_dict[k]
       else:
          return self.to_tuple()[k]
    def __setattr__(self			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	Tuple:
       if name in self.keys() and value is not None:
          # Don't call self.__setitem__ to avoid recursion errors
          super().__setitem__(_UpperCAmelCase			,  _UpperCAmelCase      )
       super().__setattr__(_UpperCAmelCase			,  _UpperCAmelCase      )
    def __setitem__(self			,  _UpperCAmelCase			,  _UpperCAmelCase      )     ->	List[Any]:
       # Will raise a KeyException if needed
       super().__setitem__(_UpperCAmelCase			,  _UpperCAmelCase      )
       # Don't call self.__setattr__ to avoid recursion errors
       super().__setattr__(_UpperCAmelCase			,  _UpperCAmelCase      )





    def 	a_	(self      )     ->	Tuple[Any]:
       return tuple(self[k] for k in self.keys()      )









'''simple docstring'''






def       __lowerCAmelCase (   snake_case__ = 4_000_000						):
			__UpperCamelCase				:      Tuple									=       1
			__UpperCamelCase				:      int									=       2
			__UpperCamelCase				:      str									=       0
			while j <= n:
						if j % 2 == 0:
									total += j
						__UpperCamelCase		, __UpperCamelCase				:      List[Any]									=       j, i + j

			return total


if __name__ == "__main__":
				print(f'{solution() = }')



