code: 
  
  
  
  
  
  '''simple docstring'''
  
  import torch.nn as nn
  
  from .imports import is_fpa_available
  
  
  if is_fpa_available():
        import transformer_engine.pytorch as te
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					str      , __lowerCamelCase				:					List[Any]=True      , __lowerCamelCase				:					Any=True      , __lowerCamelCase				:					List[str]=True					)		->List[str]:
      if not is_fpa_available():
          raise ImportError("""Using `convert_model` requires transformer_engine to be installed."""					)
      for name, module in model.named_children():
          if isinstance(__lowerCamelCase      , nn.Linear					) and to_transformer_engine and _convert_linear:
              # Return early if the linear layer weights are not multiples of 16
              if any(p % 16 != 0 for p in module.weight.shape					):
                  return
              _SCREAMING_SNAKE_CASE             =    module.bias is not None
              _SCREAMING_SNAKE_CASE             =    te.Linear(
                  module.in_features      , module.out_features      , bias=__lowerCamelCase      , params_dtype=module.weight.dtype					)
              _SCREAMING_SNAKE_CASE             =    module.weight.data.clone()
              if has_bias:
                  _SCREAMING_SNAKE_CASE             =    module.bias.data.clone()
  
              setattr(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
          elif isinstance(__lowerCamelCase      , nn.LayerNorm					) and to_transformer_engine and _convert_ln:
              _SCREAMING_SNAKE_CASE             =    te.LayerNorm(module.normalized_shape[0]      , eps=module.eps      , params_dtype=module.weight.dtype					)
              _SCREAMING_SNAKE_CASE             =    module.weight.data.clone()
              _SCREAMING_SNAKE_CASE             =    module.bias.data.clone()
  
              setattr(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
          elif isinstance(__lowerCamelCase      , te.Linear					) and not to_transformer_engine and _convert_linear:
              _SCREAMING_SNAKE_CASE             =    module.bias is not None
              _SCREAMING_SNAKE_CASE             =    nn.Linear(
                  module.in_features      , module.out_features      , bias=__lowerCamelCase      , params_dtype=module.weight.dtype					)
              _SCREAMING_SNAKE_CASE             =    module.weight.data.clone()
              if has_bias:
                  _SCREAMING_SNAKE_CASE             =    module.bias.data.clone()
  
              setattr(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
          elif isinstance(__lowerCamelCase      , te.LayerNorm					) and not to_transformer_engine and _convert_ln:
              _SCREAMING_SNAKE_CASE             =    nn.LayerNorm(module.normalized_shape[0]      , eps=module.eps      , params_dtype=module.weight.dtype					)
              _SCREAMING_SNAKE_CASE             =    module.weight.data.clone()
              _SCREAMING_SNAKE_CASE             =    module.bias.data.clone()
  
              setattr(__lowerCamelCase      , __lowerCamelCase      , __lowerCamelCase					)
          else:
              convert_model(
                  __lowerCamelCase      , to_transformer_engine=__lowerCamelCase      , _convert_linear=_convert_linear      , _convert_ln=_convert_ln      , )
  
  
  
  
  
  
  def lowerCamelCase		(  __lowerCamelCase				:					int					)		->Union[str, Any]:
      if not is_fpa_available():
          raise ImportError("""Using `has_transformer_engine_layers` requires transformer_engine to be installed."""					)
      for m in model.modules():
          if isinstance(__lowerCamelCase      , (te.LayerNorm, te.Linear)					):
              return True
      return False
  
  
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  def lowerCamelCase		(  __lowerCamelCase				:					int = 10**6					)		->int:
  
      if n <= 0:
          raise ValueError("""Please enter an integer greater than 0"""					)
  
      _SCREAMING_SNAKE_CASE             =    list(range(n + 1					)					)
      for number in range(2      , n + 1					):
          if phi[number] == number:
              phi[number] -= 1
              for multiple in range(number * 2      , n + 1      , __lowerCamelCase					):
                  _SCREAMING_SNAKE_CASE             =    (phi[multiple] // number) * (number - 1)
  
      _SCREAMING_SNAKE_CASE             =    1
      for number in range(1      , n + 1					):
          if (answer / phi[answer]) < (number / phi[number]):
              _SCREAMING_SNAKE_CASE             =    number
  
      return answer
  
  
  if __name__ == "__main__":
        print(solution())
  
  
  
  