



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


__a          =		[
    "EAGER",
    "AOT_EAGER",
    "INDUCTOR",
    "NVFUSER",
    "AOT_NVFUSER",
    "AOT_CUDAGRAPHS",
    "OFI",
    "FX2TRT",
    "ONNXRT",
    "IPEX",
]





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase=None     ,   _lowerCAmelCase=None     ,   _lowerCAmelCase=None		)		-> str:
      snake_case__  :    Union[str, Any]    						=      True
      while ask_again:
            snake_case__  :    Optional[Any]    						=      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 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase=[]     ,   _lowerCAmelCase=None     ,   _lowerCAmelCase=0		)		-> Optional[Any]:
      snake_case__  :    Tuple    						=      BulletMenu(_lowerCAmelCase     ,   _lowerCAmelCase		)
      snake_case__  :    Any    						=      menu.run(default_choice=_lowerCAmelCase		)
      return convert_value(_lowerCAmelCase		) if convert_value is not None else result





def 						__snake_case(				_lowerCAmelCase		)		-> Union[str, Any]:
      snake_case__  :    Optional[int]    						=      int(_lowerCAmelCase		)
      return ComputeEnvironment(["""LOCAL_MACHINE""", """AMAZON_SAGEMAKER"""][value]		)





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





def 						__snake_case(				_lowerCAmelCase		)		-> str:
      snake_case__  :    str    						=      int(_lowerCAmelCase		)
      return DynamoBackend(DYNAMO_BACKENDS[value]		).value





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





def 						__snake_case(				_lowerCAmelCase		)		-> Dict:
      snake_case__  :    Dict    						=      int(_lowerCAmelCase		)
      return SageMakerDistributedType(["""NO""", """DATA_PARALLEL""", """MODEL_PARALLEL"""][value]		)





def 						__snake_case(				_lowerCAmelCase		)		-> Dict:
      return {"yes": True, "no": False}[value.lower()]







class     UpperCAmelCase_       (       argparse.RawDescriptionHelpFormatter	):
    """simple docstring"""







    def lowerCamelCase       (    self					:     Union[str, Any] ,     snake_case_					:     Optional[Any] ,     snake_case_					:     Any ,     snake_case_					:     str ,     snake_case_					:     Union[str, Any]						):
          snake_case__  :    Tuple    						=      super()._format_usage(snake_case_ ,     snake_case_ ,     snake_case_ ,     snake_case_						)
          snake_case__  :    Optional[int]    						=      usage.replace("""<command> [<args>] """ ,     """"""						)
          return usage





'''simple docstring'''





import warnings

from ...utils import logging
from .image_processing_beit import BeitImageProcessor


__a          =		logging.get_logger(__name__)







class     UpperCAmelCase_       (       _a	):
    """simple docstring"""







    def __init__(    self					:     List[str] ,     *snake_case_					:     str ,     **snake_case_					:     List[str]						):
          warnings.warn(
              """The class BeitFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"""
              """ use BeitImageProcessor instead.""" ,     snake_case_ ,     )
          super().__init__(*snake_case_ ,     **snake_case_						)
