


'''simple docstring'''







def 			lowercase				(_A   ,						_A = False					):







       """simple docstring"""







       if not isinstance(_A   ,						_A					):
              _lowerCAmelCase    :							Optional[Any]   			=       f'Expected string as input, found {type(_A					)}'
              raise ValueError(_A					)
       if not isinstance(_A   ,						_A					):
              _lowerCAmelCase    :							Any   			=       f'Expected boolean as use_pascal parameter, found {type(_A					)}'
              raise ValueError(_A					)

       _lowerCAmelCase    :							List[Any]   			=       input_str.split('_'					)

       _lowerCAmelCase    :							Optional[int]   			=       0 if use_pascal else 1

       _lowerCAmelCase    :							List[Any]   			=       words[start_index:]

       _lowerCAmelCase    :							Any   			=       [word[0].upper() + word[1:] for word in words_to_capitalize]

       _lowerCAmelCase    :							str   			=       '' if use_pascal else words[0]

       return "".join([initial_word, *capitalized_words]					)


if __name__ == "__main__":
       from doctest import testmod

       testmod()





'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_speech_available,
    is_torch_available,
)


lowerCAmelCase    :     int					=						{
    """configuration_trocr""": ["""TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP""", """TrOCRConfig"""],
    """processing_trocr""": ["""TrOCRProcessor"""],
}


try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase    :     Optional[Any]					=						[
           """TROCR_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """TrOCRForCausalLM""",
           """TrOCRPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig
       from .processing_trocr import TrOCRProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel

else:
       import sys

       lowerCAmelCase    :     Any					=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

