code: 
  '''simple docstring'''
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       List[Any]		)    ->						list:
    _lowerCAmelCase       :  Union[str, Any]   				=					[True for i in range(n + 1		)]
    _lowerCAmelCase       :  List[Any]   				=					[i - 1 for i in range(n + 1		)]
    _lowerCAmelCase       :  Optional[Any]   				=					[]
    for i in range(2  ,      n + 1		):
      if is_prime[i]:
        primes.append(_lowerCamelCase		)
      for j in range(0  ,      len(_lowerCamelCase		)		):
        if i * primes[j] >= n:
          break
        _lowerCAmelCase       :  List[str]   				=					False
  
        if i % primes[j] == 0:
          _lowerCAmelCase       :  Optional[int]   				=					totients[i] * primes[j]
          break
  
        _lowerCAmelCase       :  Optional[Any]   				=					totients[i] * (primes[j] - 1)
  
    return totients
  
  
  if __name__ == "__main__":
       import doctest
  
       doctest.testmod()
  
  
  
style_context: 
  '''simple docstring'''
  
  import sys
  from collections.abc import Mapping
  
  import numpy as np
  import pyarrow as pa
  
  from .. import config
  from ..utils.py_utils import map_nested
  from .formatting import TensorFormatter
  
  
  class   a_  (TensorFormatter[Mapping, np.ndarray, Mapping]    ):
  
  
  
  
         def __init__(     self   ,   snake_case_=None   ,   **snake_case_  ):
           super().__init__(features=snake_case_  )
           _lowerCAmelCase       :  Any   				=					np_array_kwargs
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           if isinstance(snake_case_   ,   snake_case_  ):
             if column and all(
                 isinstance(snake_case_   ,   np.ndarray  ) and x.shape == column[0].shape and x.dtype == column[0].dtype for x in column  ):
               return np.stack(snake_case_  )
             else:
               # don't use np.array(column, dtype=object)
               # since it fails in certain cases
               # see https://stackoverflow.com/q/51005699
               _lowerCAmelCase       :  str   				=					np.empty(len(snake_case_  )   ,   dtype=snake_case_  )
               _lowerCAmelCase       :  List[Any]   				=					column
               return out
           return column
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           if isinstance(snake_case_   ,   (str, bytes, type(snake_case_  ))  ):
             return value
           elif isinstance(snake_case_   ,   (np.character, np.ndarray)  ) and np.issubdtype(value.dtype   ,   np.character  ):
             return value
           elif isinstance(snake_case_   ,   np.number  ):
             return value
  
           _lowerCAmelCase       :  List[Any]   				=					{}
  
           if isinstance(snake_case_   ,   np.ndarray  ) and np.issubdtype(value.dtype   ,   np.integer  ):
             _lowerCAmelCase       :  Union[str, Any]   				=					{"""dtype""": np.intaa}
           elif isinstance(snake_case_   ,   np.ndarray  ) and np.issubdtype(value.dtype   ,   np.floating  ):
             _lowerCAmelCase       :  Tuple   				=					{"""dtype""": np.floataa}
           elif config.PIL_AVAILABLE and "PIL" in sys.modules:
             import PIL.Image
  
             if isinstance(snake_case_   ,   PIL.Image.Image  ):
               return np.asarray(snake_case_   ,   **self.np_array_kwargs  )
  
           return np.asarray(snake_case_   ,   **{**default_dtype, **self.np_array_kwargs}  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           # support for torch, tf, jax etc.
           if config.TORCH_AVAILABLE and "torch" in sys.modules:
             import torch
  
             if isinstance(snake_case_   ,   torch.Tensor  ):
               return self._tensorize(data_struct.detach().cpu().numpy()[()]  )
           if hasattr(snake_case_   ,   """__array__"""  ) and not isinstance(snake_case_   ,   (np.ndarray, np.character, np.number)  ):
             _lowerCAmelCase       :  List[Any]   				=					data_struct.__array__()
           # support for nested types like struct of list of struct
           if isinstance(snake_case_   ,   np.ndarray  ):
             if data_struct.dtype == object:
               return self._consolidate([self.recursive_tensorize(snake_case_  ) for substruct in data_struct]  )
           if isinstance(snake_case_   ,   (list, tuple)  ):
             return self._consolidate([self.recursive_tensorize(snake_case_  ) for substruct in data_struct]  )
           return self._tensorize(snake_case_  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           return map_nested(self._recursive_tensorize   ,   snake_case_   ,   map_list=snake_case_  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           _lowerCAmelCase       :  Optional[Any]   				=					self.numpy_arrow_extractor().extract_row(snake_case_  )
           _lowerCAmelCase       :  Any   				=					self.python_features_decoder.decode_row(snake_case_  )
           return self.recursive_tensorize(snake_case_  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           _lowerCAmelCase       :  List[Any]   				=					self.numpy_arrow_extractor().extract_column(snake_case_  )
           _lowerCAmelCase       :  Tuple   				=					self.python_features_decoder.decode_column(snake_case_   ,   pa_table.column_names[0]  )
           _lowerCAmelCase       :  Optional[int]   				=					self.recursive_tensorize(snake_case_  )
           _lowerCAmelCase       :  Optional[Any]   				=					self._consolidate(snake_case_  )
           return column
  
  
  
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           _lowerCAmelCase       :  List[Any]   				=					self.numpy_arrow_extractor().extract_batch(snake_case_  )
           _lowerCAmelCase       :  str   				=					self.python_features_decoder.decode_batch(snake_case_  )
           _lowerCAmelCase       :  Dict   				=					self.recursive_tensorize(snake_case_  )
           for column_name in batch:
             _lowerCAmelCase       :  int   				=					self._consolidate(batch[column_name]  )
           return batch
  
  
  