"""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


UpperCamelCase__    							= [
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]




def        lowerCAmelCase_			(					__A,  __A=None,  __A=None,  __A=None							)					->    Union[str, Any]:







      '''simple docstring'''


      UpperCAmelCase__								=  True
      while ask_again:
            UpperCAmelCase__								=  input(UpperCamelCase__							)
            try:
                  if default is not None and len(UpperCamelCase__							) == 0:
                        return default
                  return convert_value(UpperCamelCase__							) if convert_value is not None else result
            except Exception:
                  if error_message is not None:
                        print(UpperCamelCase__							)




def        lowerCAmelCase_			(					__A,  __A=[],  __A=None,  __A=0							)					->    Tuple:







      '''simple docstring'''


      UpperCAmelCase__								=  BulletMenu(UpperCamelCase__,  UpperCamelCase__							)
      UpperCAmelCase__								=  menu.run(default_choice=UpperCamelCase__							)
      return convert_value(UpperCamelCase__							) if convert_value is not None else result




def        lowerCAmelCase_			(					__A							)					->    Any:







      '''simple docstring'''


      UpperCAmelCase__								=  int(UpperCamelCase__							)
      return ComputeEnvironment(["LOCAL_MACHINE", "AMAZON_SAGEMAKER"][value]							)




def        lowerCAmelCase_			(					__A							)					->    Union[str, Any]:







      '''simple docstring'''


      UpperCAmelCase__								=  int(UpperCamelCase__							)
      return DistributedType(["NO", "MULTI_CPU", "MULTI_XPU", "MULTI_GPU", "MULTI_NPU", "TPU"][value]							)




def        lowerCAmelCase_			(					__A							)					->    Dict:







      '''simple docstring'''


      UpperCAmelCase__								=  int(UpperCamelCase__							)
      return DynamoBackend(DYNAMO_BACKENDS[value]							).value




def        lowerCAmelCase_			(					__A							)					->    List[Any]:







      '''simple docstring'''


      UpperCAmelCase__								=  int(UpperCamelCase__							)
      return PrecisionType(["no", "fp16", "bf16", "fp8"][value]							)




def        lowerCAmelCase_			(					__A							)					->    Union[str, Any]:







      '''simple docstring'''


      UpperCAmelCase__								=  int(UpperCamelCase__							)
      return SageMakerDistributedType(["NO", "DATA_PARALLEL", "MODEL_PARALLEL"][value]							)




def        lowerCAmelCase_			(					__A							)					->    Any:







      '''simple docstring'''


      return {"yes": True, "no": False}[value.lower()]







class 					A							(    argparse.RawDescriptionHelpFormatter					):


   def       lowercase_				(self					:						Dict	,  __UpperCAmelCase					:						Union[str, Any]	,  __UpperCAmelCase					:						List[Any]	,  __UpperCAmelCase					:						Union[str, Any]	,  __UpperCAmelCase					:						Optional[int]		)						->    Tuple:
         """simple docstring"""



         UpperCAmelCase__								=  super()._format_usage(_a	,  _a	,  _a	,  _a		)
         UpperCAmelCase__								=  usage.replace("<command> [<args>] "	,  ""		)
         return usage




from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
      if not (is_transformers_available() and is_torch_available()):
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      from ...utils.dummy_torch_and_transformers_objects import ShapEPipeline
else:
      from .camera import create_pan_cameras
      from .pipeline_shap_e import ShapEPipeline
      from .pipeline_shap_e_img2img import ShapEImgaImgPipeline
      from .renderer import (
          BoundingBoxVolume,
          ImportanceRaySampler,
          MLPNeRFModelOutput,
          MLPNeRSTFModel,
          ShapEParamsProjModel,
          ShapERenderer,
          StratifiedRaySampler,
          VoidNeRFModel,
      )



