'''simple docstring'''




from __future__ import annotations

class       lowerCamelCase_      :
      '''simple docstring'''

      def __init__(			self		:							int		,   A		:							Optional[Any]=None			):
             _UpperCAmelCase	:    Union[str, Any]				 =       data
             _UpperCAmelCase	:    List[str]				 =       None





      def __repr__(			self		:							List[str]			):
             _UpperCAmelCase	:    Tuple				 =       []
             _UpperCAmelCase	:    Optional[Any]				 =       self
             while temp:
                    string_rep.append(F"""{temp.data}"""			)
                    _UpperCAmelCase	:    Any				 =       temp.next
             return "->".join(lowerCamelCase__			)

def       UpperCamelCase_				(   _UpperCAmelCase    : str       )       ->       Tuple:


       """simple docstring"""







       if not elements_list:
              raise Exception("The Elements List is empty"       )

       _UpperCAmelCase	:    Optional[Any]				 =       Node(elements_list[0]       )
       for i in range(1     ,      len(_UpperCAmelCase       )       ):
              _UpperCAmelCase	:    Union[str, Any]				 =       Node(elements_list[i]       )
              _UpperCAmelCase	:    Tuple				 =       current.next
       return head

def       UpperCamelCase_				(   _UpperCAmelCase    : str       )       ->       int:


       """simple docstring"""







       if head_node is not None and isinstance(_UpperCAmelCase     ,      _UpperCAmelCase       ):
              print_reverse(head_node.next       )
              print(head_node.data       )

def       UpperCamelCase_				(   )       ->       Dict:


       """simple docstring"""







       from doctest import testmod

       testmod()

       _UpperCAmelCase	:    Dict				 =       make_linked_list([14, 52, 14, 12, 43]       )
       print("Linked List:"       )
       print(_UpperCAmelCase       )
       print("Elements in Reverse:"       )
       print_reverse(_UpperCAmelCase       )


if __name__ == "__main__":
  main()




import inspect
import re

from transformers.utils import direct_transformers_import


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
_lowerCAmelCase  :      int			 ="""src/transformers"""


# This is to make sure the transformers module imported is the one in the repo.
_lowerCAmelCase  :      Dict			 =direct_transformers_import(PATH_TO_TRANSFORMERS)

_lowerCAmelCase  :      List[str]			 =transformers.models.auto.configuration_auto.CONFIG_MAPPING

# Regex pattern used to find the checkpoint mentioned in the docstring of `config_class`.
# For example, `[bert-base-uncased](https://huggingface.co/bert-base-uncased)`
_lowerCAmelCase  :      int			 =re.compile(r"""\[(.+?)\]\((https://huggingface\.co/.+?)\)""")


_lowerCAmelCase  :      Union[str, Any]			 ={
    """DecisionTransformerConfig""",
    """EncoderDecoderConfig""",
    """MusicgenConfig""",
    """RagConfig""",
    """SpeechEncoderDecoderConfig""",
    """TimmBackboneConfig""",
    """VisionEncoderDecoderConfig""",
    """VisionTextDualEncoderConfig""",
    """LlamaConfig""",
}



def 			_A	(      SCREAMING_SNAKE_CASE      ):
	UpperCAmelCase__:	str									= None

	# source code of `config_class`
	UpperCAmelCase__:	Optional[int]									= inspect.getsource(SCREAMING_SNAKE_CASE      )
	UpperCAmelCase__:	List[Any]									= _re_checkpoint.findall(SCREAMING_SNAKE_CASE      )

	# Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
	# For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
	for ckpt_name, ckpt_link in checkpoints:
		# allow the link to end with `/`
		if ckpt_link.endswith("/"      ):
			UpperCAmelCase__:	Any									= ckpt_link[:-1]

		# verify the checkpoint name corresponds to the checkpoint link
		UpperCAmelCase__:	int									= f"https://huggingface.co/{ckpt_name}"
		if ckpt_link == ckpt_link_from_name:
			UpperCAmelCase__:	Optional[int]									= ckpt_name
			break

	return checkpoint



def 			_A	(      ):
	UpperCAmelCase__:	List[str]									= []

	for config_class in list(CONFIG_MAPPING.values()      ):
		# Skip deprecated models
		if "models.deprecated" in config_class.__module__:
			continue
		UpperCAmelCase__:	Optional[Any]									= get_checkpoint_from_config_class(SCREAMING_SNAKE_CASE      )

		UpperCAmelCase__:	List[str]									= config_class.__name__
		if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
			configs_without_checkpoint.append(SCREAMING_SNAKE_CASE      )

	if len(SCREAMING_SNAKE_CASE      ) > 0:
		UpperCAmelCase__:	Dict									= "\n".join(sorted(SCREAMING_SNAKE_CASE      )      )
		raise ValueError(f"The following configurations don't contain any valid checkpoint:\n{message}"      )


if __name__ == "__main__":
					check_config_docstrings_have_checkpoints()