
import inspect
import tempfile
from collections import OrderedDict, UserDict
from collections.abc import MutableMapping
from contextlib import ExitStack, contextmanager
from dataclasses import fields
from enum import Enum
from typing import Any, ContextManager, List, Tuple

import numpy as np

from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy


if is_flax_available():
      import jax.numpy as jnp
class 			UpperCamelCase      (							__SCREAMING_SNAKE_CASE  ):
     def __get__(     self  ,     snake_case__  ,     snake_case__=None				):




       """simple docstring"""


       if obj is None:
         return self
       if self.fget is None:
         raise AttributeError("unreadable attribute"				)
       _SCREAMING_SNAKE_CASE   :				Any							    = "__cached_" + self.fget.__name__
       _SCREAMING_SNAKE_CASE   :				int							    = getattr(UpperCamelCase_  ,     UpperCamelCase_  ,     UpperCamelCase_				)
       if cached is None:
         _SCREAMING_SNAKE_CASE   :				Union[str, Any]							    = self.fget(UpperCamelCase_				)
         setattr(UpperCamelCase_  ,     UpperCamelCase_  ,     UpperCamelCase_				)
       return cached





def    _lowerCAmelCase    (     lowerCamelCase__							:							Dict				)  ->    Any:
  _SCREAMING_SNAKE_CASE   :				Optional[int]							    = val.lower()
  if val in {"y", "yes", "t", "true", "on", "1"}:
    return 1
  if val in {"n", "no", "f", "false", "off", "0"}:
    return 0
  raise ValueError(f'''invalid truth value {val!r}'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[str]				)  ->    Optional[int]:


  if is_torch_fx_proxy(lowerCamelCase__				):
    return True
  if is_torch_available():
    import torch

    if isinstance(lowerCamelCase__,						torch.Tensor				):
      return True
  if is_tf_available():
    import tensorflow as tf

    if isinstance(lowerCamelCase__,						tf.Tensor				):
      return True

  if is_flax_available():
    import jax.numpy as jnp
    from jax.core import Tracer

    if isinstance(lowerCamelCase__,						(jnp.ndarray, Tracer)				):
      return True

  return isinstance(lowerCamelCase__,						np.ndarray				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Tuple				)  ->    Optional[Any]:
  return isinstance(lowerCamelCase__,						np.ndarray				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[int]				)  ->    List[str]:
  return _is_numpy(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any				)  ->    Union[str, Any]:
  import torch

  return isinstance(lowerCamelCase__,						torch.Tensor				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Tuple				)  ->    Tuple:
  return False if not is_torch_available() else _is_torch(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							str				)  ->    int:
  import torch

  return isinstance(lowerCamelCase__,						torch.device				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any				)  ->    int:
  return False if not is_torch_available() else _is_torch_device(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[str]				)  ->    Any:
  import torch

  if isinstance(lowerCamelCase__,						lowerCamelCase__				):
    if hasattr(lowerCamelCase__,						lowerCamelCase__				):
      _SCREAMING_SNAKE_CASE   :				Optional[int]							    = getattr(lowerCamelCase__,						lowerCamelCase__				)
    else:
      return False
  return isinstance(lowerCamelCase__,						torch.dtype				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Tuple				)  ->    Tuple:
  return False if not is_torch_available() else _is_torch_dtype(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							str				)  ->    Union[str, Any]:
  import tensorflow as tf

  return isinstance(lowerCamelCase__,						tf.Tensor				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[str]				)  ->    Tuple:
  return False if not is_tf_available() else _is_tensorflow(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Dict				)  ->    Dict:
  import tensorflow as tf

  # the `is_symbolic_tensor` predicate is only available starting with TF 2.14
  if hasattr(lowerCamelCase__,						"is_symbolic_tensor"				):
    return tf.is_symbolic_tensor(lowerCamelCase__				)
  return type(lowerCamelCase__				) == tf.Tensor





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[Any]				)  ->    str:
  return False if not is_tf_available() else _is_tf_symbolic_tensor(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Tuple				)  ->    Tuple:
  import jax.numpy as jnp  # noqa: F811

  return isinstance(lowerCamelCase__,						jnp.ndarray				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any				)  ->    Optional[Any]:
  return False if not is_flax_available() else _is_jax(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[Any]				)  ->    str:


  if isinstance(lowerCamelCase__,						(dict, UserDict)				):
    return {k: to_py_obj(lowerCamelCase__				) for k, v in obj.items()}
  elif isinstance(lowerCamelCase__,						(list, tuple)				):
    return [to_py_obj(lowerCamelCase__				) for o in obj]
  elif is_tf_tensor(lowerCamelCase__				):
    return obj.numpy().tolist()
  elif is_torch_tensor(lowerCamelCase__				):
    return obj.detach().cpu().tolist()
  elif is_jax_tensor(lowerCamelCase__				):
    return np.asarray(lowerCamelCase__				).tolist()
  elif isinstance(lowerCamelCase__,						(np.ndarray, np.number)				):  # tolist also works on 0d np arrays
    return obj.tolist()
  else:
    return obj





def    _lowerCAmelCase    (     lowerCamelCase__							:							str				)  ->    List[str]:


  if isinstance(lowerCamelCase__,						(dict, UserDict)				):
    return {k: to_numpy(lowerCamelCase__				) for k, v in obj.items()}
  elif isinstance(lowerCamelCase__,						(list, tuple)				):
    return np.array(lowerCamelCase__				)
  elif is_tf_tensor(lowerCamelCase__				):
    return obj.numpy()
  elif is_torch_tensor(lowerCamelCase__				):
    return obj.detach().cpu().numpy()
  elif is_jax_tensor(lowerCamelCase__				):
    return np.asarray(lowerCamelCase__				)
  else:
    return obj
class 			UpperCamelCase      (							__SCREAMING_SNAKE_CASE  ):
     def 				__SCREAMING_SNAKE_CASE							(     self				):




       """simple docstring"""


       _SCREAMING_SNAKE_CASE   :				Optional[int]							    = fields(self				)

       # Safety and consistency checks
       if not len(UpperCamelCase_				):
         raise ValueError(F'''{self.__class__.__name__} has no fields.'''				)
       if not all(field.default is None for field in class_fields[1:]				):
         raise ValueError(F'''{self.__class__.__name__} should not have more than one required field.'''				)

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

       if other_fields_are_none and not is_tensor(UpperCamelCase_				):
         if isinstance(UpperCamelCase_  ,     UpperCamelCase_				):
           _SCREAMING_SNAKE_CASE   :				int							    = first_field.items()
           _SCREAMING_SNAKE_CASE   :				Any							    = True
         else:
           try:
             _SCREAMING_SNAKE_CASE   :				Any							    = iter(UpperCamelCase_				)
             _SCREAMING_SNAKE_CASE   :				str							    = True
           except TypeError:
             _SCREAMING_SNAKE_CASE   :				Any							    = False

            # if we provided an iterator as first field and the iterator is a (key, value) iterator
            # set the associated fields
         if first_field_iterator:
           for idx, element in enumerate(UpperCamelCase_				):
             if (
                 not isinstance(UpperCamelCase_  ,     (list, tuple)				)
                 or not len(UpperCamelCase_				) == 2
                 or not isinstance(element[0]  ,     UpperCamelCase_				)
             ):
               if idx == 0:
                 # If we do not have an iterator of key/values, set it as attribute
                 _SCREAMING_SNAKE_CASE   :				List[Any]							    = first_field
               else:
                 # If we have a mixed iterator, raise an error
                 raise ValueError(
                     F'''Cannot set key/value for {element}. It needs to be a tuple (key, value).'''				)
               break
             setattr(self  ,     element[0]  ,     element[1]				)
             if element[1] is not None:
               _SCREAMING_SNAKE_CASE   :				Tuple							    = element[1]
         elif first_field is not None:
           _SCREAMING_SNAKE_CASE   :				Dict							    = first_field
       else:
         for field in class_fields:
           _SCREAMING_SNAKE_CASE   :				int							    = getattr(self  ,     field.name				)
           if v is not None:
             _SCREAMING_SNAKE_CASE   :				Tuple							    = v
     def __delitem__(     self  ,     *snake_case__  ,     **snake_case__				):




       """simple docstring"""


       raise Exception(F'''You cannot use ``__delitem__`` on a {self.__class__.__name__} instance.'''				)
     def 				__SCREAMING_SNAKE_CASE							(     self  ,     *snake_case__  ,     **snake_case__				):




       """simple docstring"""


       raise Exception(F'''You cannot use ``setdefault`` on a {self.__class__.__name__} instance.'''				)
     def 				__SCREAMING_SNAKE_CASE							(     self  ,     *snake_case__  ,     **snake_case__				):




       """simple docstring"""


       raise Exception(F'''You cannot use ``pop`` on a {self.__class__.__name__} instance.'''				)
     def 				__SCREAMING_SNAKE_CASE							(     self  ,     *snake_case__  ,     **snake_case__				):




       """simple docstring"""


       raise Exception(F'''You cannot use ``update`` on a {self.__class__.__name__} instance.'''				)
     def __getitem__(     self  ,     snake_case__				):




       """simple docstring"""


       if isinstance(UpperCamelCase_  ,     UpperCamelCase_				):
         _SCREAMING_SNAKE_CASE   :				List[str]							    = dict(self.items()				)
         return inner_dict[k]
       else:
         return self.to_tuple()[k]
     def __setattr__(     self  ,     snake_case__  ,     snake_case__				):




       """simple docstring"""


       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  ,     snake_case__  ,     snake_case__				):




       """simple docstring"""


       super().__setitem__(UpperCamelCase_  ,     UpperCamelCase_				)
       # Don't call self.__setattr__ to avoid recursion errors
       super().__setattr__(UpperCamelCase_  ,     UpperCamelCase_				)




     def 				__SCREAMING_SNAKE_CASE							(     self				):




       """simple docstring"""


       return tuple(self[k] for k in self.keys()				)
class 			UpperCamelCase      (							__SCREAMING_SNAKE_CASE      ,       __SCREAMING_SNAKE_CASE  ):
     @classmethod
     def 				__SCREAMING_SNAKE_CASE							(     cls  ,     snake_case__				):




       """simple docstring"""


       raise ValueError(
           F'''{value} is not a valid {cls.__name__}, please select one of {list(cls._valueamember_map_.keys()				)}'''				)
class 			UpperCamelCase      (							__SCREAMING_SNAKE_CASE  ):
     A__      =			"longest"
     A__      =			"max_length"
     A__      =			"do_not_pad"
class 			UpperCamelCase      (							__SCREAMING_SNAKE_CASE  ):
     A__      =			"pt"
     A__      =			"tf"
     A__      =			"np"
     A__      =			"jax"
class 			UpperCamelCase      :
     def __init__(     self  ,     snake_case__				):




       """simple docstring"""


       _SCREAMING_SNAKE_CASE   :				Tuple							    = context_managers
       _SCREAMING_SNAKE_CASE   :				Optional[int]							    = ExitStack()
     def __enter__(     self				):




       """simple docstring"""


       for context_manager in self.context_managers:
         self.stack.enter_context(UpperCamelCase_				)




     def __exit__(     self  ,     *snake_case__  ,     **snake_case__				):




       """simple docstring"""


       self.stack.__exit__(*UpperCamelCase_  ,     **UpperCamelCase_				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[Any]				)  ->    str:
  _SCREAMING_SNAKE_CASE   :				List[str]							    = infer_framework(lowerCamelCase__				)
  if framework == "tf":
    _SCREAMING_SNAKE_CASE   :				List[Any]							    = inspect.signature(model_class.call				)  # TensorFlow models
  elif framework == "pt":
    _SCREAMING_SNAKE_CASE   :				Dict							    = inspect.signature(model_class.forward				)  # PyTorch models
  else:
    _SCREAMING_SNAKE_CASE   :				int							    = inspect.signature(model_class.__call__				)  # Flax models

  for p in signature.parameters:
    if p == "return_loss" and signature.parameters[p].default is True:
      return True

  return False





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[Any]				)  ->    Optional[Any]:
  _SCREAMING_SNAKE_CASE   :				List[str]							    = model_class.__name__
  _SCREAMING_SNAKE_CASE   :				Optional[int]							    = infer_framework(lowerCamelCase__				)
  if framework == "tf":
    _SCREAMING_SNAKE_CASE   :				int							    = inspect.signature(model_class.call				)  # TensorFlow models
  elif framework == "pt":
    _SCREAMING_SNAKE_CASE   :				List[Any]							    = inspect.signature(model_class.forward				)  # PyTorch models
  else:
    _SCREAMING_SNAKE_CASE   :				Any							    = inspect.signature(model_class.__call__				)  # Flax models

  if "QuestionAnswering" in model_name:
    return [p for p in signature.parameters if "label" in p or p in ("start_positions", "end_positions")]
  else:
    return [p for p in signature.parameters if "label" in p]





def    _lowerCAmelCase    (     lowerCamelCase__							:							Union[str, Any],						lowerCamelCase__							:							Optional[Any] = "",						lowerCamelCase__							:							str = "."				)  ->    Optional[Any]:


  def _flatten_dict(lowerCamelCase__							:							List[Any],						lowerCamelCase__							:							str="",						lowerCamelCase__							:							Tuple="."				):
    for k, v in d.items():
      _SCREAMING_SNAKE_CASE   :				Union[str, Any]							    = str(lowerCamelCase__				) + delimiter + str(lowerCamelCase__				) if parent_key else k
      if v and isinstance(lowerCamelCase__,						lowerCamelCase__				):
        yield from flatten_dict(lowerCamelCase__,						lowerCamelCase__,						delimiter=lowerCamelCase__				).items()
      else:
        yield key, v

  return dict(_flatten_dict(lowerCamelCase__,						lowerCamelCase__,						lowerCamelCase__				)				)





@contextmanager
def    _lowerCAmelCase    (     lowerCamelCase__							:							Union[str, Any],						lowerCamelCase__							:							str = False				)  ->    Dict:


  if use_temp_dir:
    with tempfile.TemporaryDirectory() as tmp_dir:
      yield tmp_dir
  else:
    yield working_dir





def    _lowerCAmelCase    (     lowerCamelCase__							:							str,						lowerCamelCase__							:							Union[str, Any]=None				)  ->    Optional[int]:


  if is_numpy_array(lowerCamelCase__				):
    return np.transpose(lowerCamelCase__,						axes=lowerCamelCase__				)
  elif is_torch_tensor(lowerCamelCase__				):
    return array.T if axes is None else array.permute(*lowerCamelCase__				)
  elif is_tf_tensor(lowerCamelCase__				):
    import tensorflow as tf

    return tf.transpose(lowerCamelCase__,						perm=lowerCamelCase__				)
  elif is_jax_tensor(lowerCamelCase__				):
    return jnp.transpose(lowerCamelCase__,						axes=lowerCamelCase__				)
  else:
    raise ValueError(f'''Type not supported for transpose: {type(lowerCamelCase__				)}.'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[Any],						lowerCamelCase__							:							Optional[int]				)  ->    List[Any]:


  if is_numpy_array(lowerCamelCase__				):
    return np.reshape(lowerCamelCase__,						lowerCamelCase__				)
  elif is_torch_tensor(lowerCamelCase__				):
    return array.reshape(*lowerCamelCase__				)
  elif is_tf_tensor(lowerCamelCase__				):
    import tensorflow as tf

    return tf.reshape(lowerCamelCase__,						lowerCamelCase__				)
  elif is_jax_tensor(lowerCamelCase__				):
    return jnp.reshape(lowerCamelCase__,						lowerCamelCase__				)
  else:
    raise ValueError(f'''Type not supported for reshape: {type(lowerCamelCase__				)}.'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any,						lowerCamelCase__							:							Any=None				)  ->    Tuple:


  if is_numpy_array(lowerCamelCase__				):
    return np.squeeze(lowerCamelCase__,						axis=lowerCamelCase__				)
  elif is_torch_tensor(lowerCamelCase__				):
    return array.squeeze() if axis is None else array.squeeze(dim=lowerCamelCase__				)
  elif is_tf_tensor(lowerCamelCase__				):
    import tensorflow as tf

    return tf.squeeze(lowerCamelCase__,						axis=lowerCamelCase__				)
  elif is_jax_tensor(lowerCamelCase__				):
    return jnp.squeeze(lowerCamelCase__,						axis=lowerCamelCase__				)
  else:
    raise ValueError(f'''Type not supported for squeeze: {type(lowerCamelCase__				)}.'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any,						lowerCamelCase__							:							Optional[Any]				)  ->    int:


  if is_numpy_array(lowerCamelCase__				):
    return np.expand_dims(lowerCamelCase__,						lowerCamelCase__				)
  elif is_torch_tensor(lowerCamelCase__				):
    return array.unsqueeze(dim=lowerCamelCase__				)
  elif is_tf_tensor(lowerCamelCase__				):
    import tensorflow as tf

    return tf.expand_dims(lowerCamelCase__,						axis=lowerCamelCase__				)
  elif is_jax_tensor(lowerCamelCase__				):
    return jnp.expand_dims(lowerCamelCase__,						axis=lowerCamelCase__				)
  else:
    raise ValueError(f'''Type not supported for expand_dims: {type(lowerCamelCase__				)}.'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Dict				)  ->    Any:


  if is_numpy_array(lowerCamelCase__				):
    return np.size(lowerCamelCase__				)
  elif is_torch_tensor(lowerCamelCase__				):
    return array.numel()
  elif is_tf_tensor(lowerCamelCase__				):
    import tensorflow as tf

    return tf.size(lowerCamelCase__				)
  elif is_jax_tensor(lowerCamelCase__				):
    return array.size
  else:
    raise ValueError(f'''Type not supported for expand_dims: {type(lowerCamelCase__				)}.'''				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Tuple,						lowerCamelCase__							:							Any				)  ->    List[Any]:


  for key, value in auto_map.items():
    if isinstance(lowerCamelCase__,						(tuple, list)				):
      _SCREAMING_SNAKE_CASE   :				List[Any]							    = [f'''{repo_id}--{v}''' if (v is not None and "--" not in v) else v for v in value]
    elif value is not None and "--" not in value:
      _SCREAMING_SNAKE_CASE   :				List[str]							    = f'''{repo_id}--{value}'''

  return auto_map





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[Any]				)  ->    int:


  for base_class in inspect.getmro(lowerCamelCase__				):
    _SCREAMING_SNAKE_CASE   :				Dict							    = base_class.__module__
    _SCREAMING_SNAKE_CASE   :				Dict							    = base_class.__name__
    if module.startswith("tensorflow"				) or module.startswith("keras"				) or name == "TFPreTrainedModel":
      return "tf"
    elif module.startswith("torch"				) or name == "PreTrainedModel":
      return "pt"
    elif module.startswith("flax"				) or module.startswith("jax"				) or name == "FlaxPreTrainedModel":
      return "flax"
  else:
    raise TypeError(f'''Could not infer framework from class {model_class}.'''				)





"""simple docstring"""
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


lowercase_       :						Tuple     					=	[
    '''EAGER''',
    '''AOT_EAGER''',
    '''INDUCTOR''',
    '''NVFUSER''',
    '''AOT_NVFUSER''',
    '''AOT_CUDAGRAPHS''',
    '''OFI''',
    '''FX2TRT''',
    '''ONNXRT''',
    '''IPEX''',
]





def    _lowerCAmelCase    (     lowerCamelCase__							:							Dict,						lowerCamelCase__							:							int=None,						lowerCamelCase__							:							Any=None,						lowerCamelCase__							:							Any=None				)  ->    Tuple:
  _SCREAMING_SNAKE_CASE   :				List[Any]							    = True
  while ask_again:
    _SCREAMING_SNAKE_CASE   :				List[str]							    = input(lowerCamelCase__				)
    try:
      if default is not None and len(lowerCamelCase__				) == 0:
        return default
      return convert_value(lowerCamelCase__				) if convert_value is not None else result
    except Exception:
      if error_message is not None:
        print(lowerCamelCase__				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Any,						lowerCamelCase__							:							Dict=[],						lowerCamelCase__							:							Optional[int]=None,						lowerCamelCase__							:							str=0				)  ->    str:
  _SCREAMING_SNAKE_CASE   :				int							    = BulletMenu(lowerCamelCase__,						lowerCamelCase__				)
  _SCREAMING_SNAKE_CASE   :				str							    = menu.run(default_choice=lowerCamelCase__				)
  return convert_value(lowerCamelCase__				) if convert_value is not None else result





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[int]				)  ->    Optional[int]:
  _SCREAMING_SNAKE_CASE   :				str							    = int(lowerCamelCase__				)
  return ComputeEnvironment(["LOCAL_MACHINE", "AMAZON_SAGEMAKER"][value]				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							str				)  ->    List[Any]:
  _SCREAMING_SNAKE_CASE   :				str							    = int(lowerCamelCase__				)
  return DistributedType(["NO", "MULTI_CPU", "MULTI_XPU", "MULTI_GPU", "MULTI_NPU", "TPU"][value]				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							Optional[Any]				)  ->    List[Any]:
  _SCREAMING_SNAKE_CASE   :				List[Any]							    = int(lowerCamelCase__				)
  return DynamoBackend(DYNAMO_BACKENDS[value]				).value





def    _lowerCAmelCase    (     lowerCamelCase__							:							int				)  ->    Dict:
  _SCREAMING_SNAKE_CASE   :				int							    = int(lowerCamelCase__				)
  return PrecisionType(["no", "fp16", "bf16", "fp8"][value]				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[Any]				)  ->    Any:
  _SCREAMING_SNAKE_CASE   :				Optional[Any]							    = int(lowerCamelCase__				)
  return SageMakerDistributedType(["NO", "DATA_PARALLEL", "MODEL_PARALLEL"][value]				)





def    _lowerCAmelCase    (     lowerCamelCase__							:							List[Any]				)  ->    Optional[Any]:
  return {"yes": True, "no": False}[value.lower()]





class 			UpperCamelCase      (							argparse.RawDescriptionHelpFormatter  ):
     def 				__SCREAMING_SNAKE_CASE							(     self  ,     snake_case__  ,     snake_case__  ,     snake_case__  ,     snake_case__				):




       """simple docstring"""


       _SCREAMING_SNAKE_CASE   :				Any							    = super()._format_usage(snake_case__  ,     snake_case__  ,     snake_case__  ,     snake_case__				)
       _SCREAMING_SNAKE_CASE   :				Any							    = usage.replace("<command> [<args>] "  ,     ""				)
       return usage



