





class 					A__   :





      def __init__( self       ,							A_       ,							A_=None       ,							A_=None   ):
       '''simple docstring'''




       UpperCamelCase	:					List[str]       	=   data
       UpperCamelCase	:					Optional[int]       	=   previous
       UpperCamelCase	:					Optional[Any]       	=   next_node





      def __str__( self   ):
       '''simple docstring'''




       return F"""{self.data}"""





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return self.data





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return self.next





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return self.previous



class 					A__   :





      def __init__( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Optional[Any]       	=   head





      def __iter__( self   ):
       '''simple docstring'''




       return self





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       if not self.current:
        raise StopIteration
       else:
        UpperCamelCase	:					Optional[Any]       	=   self.current.get_data()
        UpperCamelCase	:					List[str]       	=   self.current.get_next()
        return value



class 					A__   :





      def __init__( self   ):
       '''simple docstring'''




       UpperCamelCase	:					Any       	=   None  # First node in list
       UpperCamelCase	:					Optional[int]       	=   None  # Last node in list





      def __str__( self   ):
       '''simple docstring'''




       UpperCamelCase	:					str       	=   self.head
       UpperCamelCase	:					Tuple       	=   []
       while current is not None:
        nodes.append(current.get_data()   )
        UpperCamelCase	:					Dict       	=   current.get_next()
       return " ".join(str(A_   ) for node in nodes   )





      def __contains__( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					int       	=   self.head
       while current:
        if current.get_data() == value:
         return True
        UpperCamelCase	:					Tuple       	=   current.get_next()
       return False





      def __iter__( self   ):
       '''simple docstring'''




       return LinkedListIterator(self.head   )





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       if self.head:
        return self.head.get_data()
       return None





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       if self.tail:
        return self.tail.get_data()
       return None





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if self.head is None:
        UpperCamelCase	:					List[Any]       	=   node
        UpperCamelCase	:					Union[str, Any]       	=   node
       else:
        self.insert_before_node(self.head       ,							A_   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if self.head is None:
        self.set_head(A_   )
       else:
        self.insert_after_node(self.tail       ,							A_   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Optional[int]       	=   Node(A_   )
       if self.head is None:
        self.set_head(A_   )
       else:
        self.set_tail(A_   )





      def        __UpperCamelCase( self       ,							A_       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Optional[int]       	=   node
       UpperCamelCase	:					List[Any]       	=   node.previous

       if node.get_previous() is None:
        UpperCamelCase	:					str       	=   node_to_insert
       else:
        UpperCamelCase	:					Dict       	=   node_to_insert

       UpperCamelCase	:					Optional[Any]       	=   node_to_insert





      def        __UpperCamelCase( self       ,							A_       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					int       	=   node
       UpperCamelCase	:					Optional[Any]       	=   node.next

       if node.get_next() is None:
        UpperCamelCase	:					List[str]       	=   node_to_insert
       else:
        UpperCamelCase	:					int       	=   node_to_insert

       UpperCamelCase	:					Union[str, Any]       	=   node_to_insert





      def        __UpperCamelCase( self       ,							A_       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					List[Any]       	=   1
       UpperCamelCase	:					Tuple       	=   Node(A_   )
       UpperCamelCase	:					Optional[int]       	=   self.head
       while node:
        if current_position == position:
         self.insert_before_node(A_       ,							A_   )
         return
        current_position += 1
        UpperCamelCase	:					Union[str, Any]       	=   node.next
       self.insert_after_node(self.tail       ,							A_   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Union[str, Any]       	=   self.head
       while node:
        if node.get_data() == item:
         return node
        UpperCamelCase	:					int       	=   node.get_next()
       raise Exception("Node not found"   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if (node := self.get_node(A_   )) is not None:
        if node == self.head:
         UpperCamelCase	:					Optional[Any]       	=   self.head.get_next()

        if node == self.tail:
         UpperCamelCase	:					Dict       	=   self.tail.get_previous()

        self.remove_node_pointers(A_   )





      @staticmethod
      def        __UpperCamelCase( A_   ):
       '''simple docstring'''




       if node.get_next():
        UpperCamelCase	:					List[str]       	=   node.previous

       if node.get_previous():
        UpperCamelCase	:					Dict       	=   node.next

       UpperCamelCase	:					Any       	=   None
       UpperCamelCase	:					Optional[Any]       	=   None





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return self.head is None



def 		A_				(     )						-> None:
 pass


if __name__ == "__main__":
    import doctest

    doctest.testmod()







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       :     str   =     """src/transformers"""


# This is to make sure the transformers module imported is the one in the repo.
__lowerCamelCase       :     Tuple   =     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       :     Optional[Any]   =     re.compile(r"""\[(.+?)\]\((https://huggingface\.co/.+?)\)""")


__lowerCamelCase       :     List[str]   =     {
    """DecisionTransformerConfig""",
    """EncoderDecoderConfig""",
    """MusicgenConfig""",
    """RagConfig""",
    """SpeechEncoderDecoderConfig""",
    """TimmBackboneConfig""",
    """VisionEncoderDecoderConfig""",
    """VisionTextDualEncoderConfig""",
    """LlamaConfig""",
}



def 		A_				(     _lowerCAmelCase     )						-> List[str]:
 UpperCamelCase	:					Optional[Any]       	=   None

 # source code of `config_class`
 UpperCamelCase	:					Tuple       	=   inspect.getsource(_lowerCAmelCase     )
 UpperCamelCase	:					Optional[Any]       	=   _re_checkpoint.findall(_lowerCAmelCase     )

 # 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	:					Dict       	=   ckpt_link[:-1]

  # verify the checkpoint name corresponds to the checkpoint link
  UpperCamelCase	:					Any       	=   F"""https://huggingface.co/{ckpt_name}"""
  if ckpt_link == ckpt_link_from_name:
   UpperCamelCase	:					List[Any]       	=   ckpt_name
   break

 return checkpoint



def 		A_				(     )						-> List[str]:
 UpperCamelCase	:					Optional[int]       	=   []

 for config_class in list(CONFIG_MAPPING.values()     ):
  # Skip deprecated models
  if "models.deprecated" in config_class.__module__:
   continue
  UpperCamelCase	:					Union[str, Any]       	=   get_checkpoint_from_config_class(_lowerCAmelCase     )

  UpperCamelCase	:					Optional[int]       	=   config_class.__name__
  if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
   configs_without_checkpoint.append(_lowerCAmelCase     )

 if len(_lowerCAmelCase     ) > 0:
  UpperCamelCase	:					Any       	=   "\n".join(sorted(_lowerCAmelCase     )     )
  raise ValueError(F"""The following configurations don't contain any valid checkpoint:\n{message}"""     )


if __name__ == "__main__":
    check_config_docstrings_have_checkpoints()
