


'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__magic_name__								=   {
    'configuration_electra': ['ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ElectraConfig', 'ElectraOnnxConfig'],
    'tokenization_electra': ['ElectraTokenizer'],
}

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__								=   ['ElectraTokenizerFast']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__								=   [
         'ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST',
         'ElectraForCausalLM',
         'ElectraForMaskedLM',
         'ElectraForMultipleChoice',
         'ElectraForPreTraining',
         'ElectraForQuestionAnswering',
         'ElectraForSequenceClassification',
         'ElectraForTokenClassification',
         'ElectraModel',
         'ElectraPreTrainedModel',
         'load_tf_weights_in_electra',
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__								=   [
         'TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST',
         'TFElectraForMaskedLM',
         'TFElectraForMultipleChoice',
         'TFElectraForPreTraining',
         'TFElectraForQuestionAnswering',
         'TFElectraForSequenceClassification',
         'TFElectraForTokenClassification',
         'TFElectraModel',
         'TFElectraPreTrainedModel',
     ]

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__								=   [
         'FlaxElectraForCausalLM',
         'FlaxElectraForMaskedLM',
         'FlaxElectraForMultipleChoice',
         'FlaxElectraForPreTraining',
         'FlaxElectraForQuestionAnswering',
         'FlaxElectraForSequenceClassification',
         'FlaxElectraForTokenClassification',
         'FlaxElectraModel',
         'FlaxElectraPreTrainedModel',
     ]


if TYPE_CHECKING:
     from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
     from .tokenization_electra import ElectraTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_electra_fast import ElectraTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_electra import (
              ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
              ElectraForCausalLM,
              ElectraForMaskedLM,
              ElectraForMultipleChoice,
              ElectraForPreTraining,
              ElectraForQuestionAnswering,
              ElectraForSequenceClassification,
              ElectraForTokenClassification,
              ElectraModel,
              ElectraPreTrainedModel,
              load_tf_weights_in_electra,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_electra import (
              TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFElectraForMaskedLM,
              TFElectraForMultipleChoice,
              TFElectraForPreTraining,
              TFElectraForQuestionAnswering,
              TFElectraForSequenceClassification,
              TFElectraForTokenClassification,
              TFElectraModel,
              TFElectraPreTrainedModel,
          )

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_electra import (
              FlaxElectraForCausalLM,
              FlaxElectraForMaskedLM,
              FlaxElectraForMultipleChoice,
              FlaxElectraForPreTraining,
              FlaxElectraForQuestionAnswering,
              FlaxElectraForSequenceClassification,
              FlaxElectraForTokenClassification,
              FlaxElectraModel,
              FlaxElectraPreTrainedModel,
          )

else:
     import sys

     __magic_name__								=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


'''simple docstring'''
import os
from collections.abc import Iterator




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ = "."			)  ->							Iterator[str]:


		'''simple docstring'''


		for dir_path, dir_names, filenames in os.walk(SCREAMING_SNAKE_CASE__			):
				snake_case  :       Optional[Any]     			=						[d for d in dir_names if d != '''scripts''' and d[0] not in '''._''']
				for filename in filenames:
						if filename == "__init__.py":
								continue
						if os.path.splitext(SCREAMING_SNAKE_CASE__			)[1] in (".py", ".ipynb"):
								yield os.path.join(SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			).lstrip('''./'''			)




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__			)  ->							List[str]:


		'''simple docstring'''


		return F'{i * "  "}*' if i else "\n##"




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)  ->							str:


		'''simple docstring'''


		snake_case  :       Union[str, Any]     			=						old_path.split(os.sep			)
		for i, new_part in enumerate(new_path.split(os.sep			)			):
				if (i + 1 > len(SCREAMING_SNAKE_CASE__			) or old_parts[i] != new_part) and new_part:
						print(F'{md_prefix(SCREAMING_SNAKE_CASE__			)} {new_part.replace("_" ,       " "			).title()}'			)
		return new_path




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ = "."			)  ->							None:


		'''simple docstring'''


		snake_case  :       List[Any]     			=						''''''
		for filepath in sorted(good_file_paths(SCREAMING_SNAKE_CASE__			)			):
				snake_case			,snake_case  :       Optional[Any]     			=						os.path.split(SCREAMING_SNAKE_CASE__			)
				if filepath != old_path:
						snake_case  :       Dict     			=						print_path(SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)
				snake_case  :       int     			=						(filepath.count(os.sep			) + 1) if filepath else 0
				snake_case  :       int     			=						F'{filepath}/{filename}'.replace(''' ''' ,       '''%20'''			)
				snake_case  :       int     			=						os.path.splitext(filename.replace('''_''' ,       ''' '''			).title()			)[0]
				print(F'{md_prefix(SCREAMING_SNAKE_CASE__			)} [{filename}]({url})'			)


if __name__ == "__main__":
						print_directory_md(".")


