





"""simple docstring"""




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


# This is to make sure the transformers module imported is the one in the repo.
UpperCAmelCase     :     Optional[Any]							=	direct_transformers_import(PATH_TO_TRANSFORMERS)

UpperCAmelCase     :     List[Any]							=	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)`
UpperCAmelCase     :     Optional[int]							=	re.compile(r"""\[(.+?)\]\((https://huggingface\.co/.+?)\)""")


UpperCAmelCase     :     Dict							=	{
    """DecisionTransformerConfig""",
    """EncoderDecoderConfig""",
    """MusicgenConfig""",
    """RagConfig""",
    """SpeechEncoderDecoderConfig""",
    """TimmBackboneConfig""",
    """VisionEncoderDecoderConfig""",
    """VisionTextDualEncoderConfig""",
    """LlamaConfig""",
}
def 					_A	(		SCREAMING_SNAKE_CASE					:       Optional[int]						):





  """simple docstring"""



  a__     : Any  =None

  # source code of `config_class`
  a__     : Any  =inspect.getsource(SCREAMING_SNAKE_CASE						)
  a__     : List[str]  =_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("/"						):
      a__     : List[Any]  =ckpt_link[:-1]

    # verify the checkpoint name corresponds to the checkpoint link
    a__     : Optional[Any]  =f'''https://huggingface.co/{ckpt_name}'''
    if ckpt_link == ckpt_link_from_name:
      a__     : Union[str, Any]  =ckpt_name
      break

  return checkpoint
def 					_A	(		):





  """simple docstring"""



  a__     : Union[str, Any]  =[]

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

    a__     : Union[str, Any]  =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:
    a__     : int  ="\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()













from __future__ import annotations

import math
def 					_A	(		SCREAMING_SNAKE_CASE					:       int						):





  """simple docstring"""



  if num <= 0:
    a__     : List[str]  =f'''{num}: Invalid input, please enter a positive integer.'''
    raise ValueError(SCREAMING_SNAKE_CASE						)

  a__     : Union[str, Any]  =[True] * (num + 1)
  a__     : Union[str, Any]  =[]
  a__     : str  =2
  a__     : Any  =int(math.sqrt(SCREAMING_SNAKE_CASE						)						)

  while start <= end:
    # If start is a prime
    if sieve[start] is True:
      prime.append(SCREAMING_SNAKE_CASE						)

      # Set multiples of start be False
      for i in range(start * start	,	num + 1	,	SCREAMING_SNAKE_CASE						):
        if sieve[i] is True:
          a__     : Optional[int]  =False

    start += 1

  for j in range(end + 1	,	num + 1						):
    if sieve[j] is True:
      prime.append(SCREAMING_SNAKE_CASE						)

  return prime


if __name__ == "__main__":
     print(prime_sieve(int(input("""Enter a positive integer: """).strip())))






