
'''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
_lowercase			:  List[str]   							=	"src/transformers"


# This is to make sure the transformers module imported is the one in the repo.
_lowercase			:  Union[str, Any]   							=	direct_transformers_import(PATH_TO_TRANSFORMERS)

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


_lowercase			:  str   							=	{
    "DecisionTransformerConfig",
    "EncoderDecoderConfig",
    "MusicgenConfig",
    "RagConfig",
    "SpeechEncoderDecoderConfig",
    "TimmBackboneConfig",
    "VisionEncoderDecoderConfig",
    "VisionTextDualEncoderConfig",
    "LlamaConfig",
}
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			List[str]							):



						"""simple docstring"""





						lowercase_     :					int													=	None

						# source code of `config_class`
						lowercase_     :					Optional[Any]													=	inspect.getsource(__SCREAMING_SNAKE_CASE							)
						lowercase_     :					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('''/'''							):
																		lowercase_     :					Dict													=	ckpt_link[:-1]

												# verify the checkpoint name corresponds to the checkpoint link
												lowercase_     :					int													=	F'''https://huggingface.co/{ckpt_name}'''
												if ckpt_link == ckpt_link_from_name:
																		lowercase_     :					List[str]													=	ckpt_name
																		break

						return checkpoint
def  snake_case_		(    ):



						"""simple docstring"""





						lowercase_     :					Optional[Any]													=	[]

						for config_class in list(CONFIG_MAPPING.values()							):
												# Skip deprecated models
												if "models.deprecated" in config_class.__module__:
																		continue
												lowercase_     :					Tuple													=	get_checkpoint_from_config_class(__SCREAMING_SNAKE_CASE							)

												lowercase_     :					Optional[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:
												lowercase_     :					str													=	'''\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()





'''simple docstring'''







import qiskit
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			int				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					List[Any]													=	qiskit.Aer.get_backend('''aer_simulator'''							)

						# Create a Quantum Circuit acting on the q register
						lowercase_     :					Dict													=	qiskit.QuantumCircuit(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE							)

						# Map the quantum measurement to the classical bits
						circuit.measure([0]				,				[0]							)

						# Execute the circuit on the simulator
						lowercase_     :					Union[str, Any]													=	qiskit.execute(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE				,				shots=1000							)

						# Return the histogram data of the results of the experiment.
						return job.result().get_counts(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							print(f"""Total count for various states are: {single_qubit_measure(1, 1)}""")



