
'''simple docstring'''







import importlib
import shutil
import threading
import warnings
from typing import List

import fsspec
import fsspec.asyn

from . import compression
from .hffilesystem import HfFileSystem


_lowercase			:  str   							=	importlib.util.find_spec("s3fs") is not None

if _has_safs:
							from .safilesystem import SaFileSystem  # noqa: F401

_lowercase			:  List[compression.BaseCompressedFileFileSystem]   							=	[
    compression.BzaFileSystem,
    compression.GzipFileSystem,
    compression.LzaFileSystem,
    compression.XzFileSystem,
    compression.ZstdFileSystem,
]

# Register custom filesystems
for fs_class in COMPRESSION_FILESYSTEMS + [HfFileSystem]:
							if fs_class.protocol in fsspec.registry and fsspec.registry[fs_class.protocol] is not fs_class:
														warnings.warn(f"""A filesystem protocol was already set for {fs_class.protocol} and will be overwritten.""")
							fsspec.register_implementation(fs_class.protocol, fs_class, clobber=True)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			str							):



						"""simple docstring"""





						if "://" in dataset_path:
												lowercase_     :					Dict													=	dataset_path.split('''://'''							)[1]
						return dataset_path
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			fsspec.AbstractFileSystem							):



						"""simple docstring"""





						if fs is not None and fs.protocol != "file":
												return True
						else:
												return False
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			fsspec.AbstractFileSystem				,				__SCREAMING_SNAKE_CASE :			str				,				__SCREAMING_SNAKE_CASE :			str							):



						"""simple docstring"""





						lowercase_     :					Optional[Any]													=	not is_remote_filesystem(__SCREAMING_SNAKE_CASE							)
						if is_local:
												# LocalFileSystem.mv does copy + rm, it is more efficient to simply move a local directory
												shutil.move(fs._strip_protocol(__SCREAMING_SNAKE_CASE							)				,				fs._strip_protocol(__SCREAMING_SNAKE_CASE							)							)
						else:
												fs.mv(__SCREAMING_SNAKE_CASE				,				__SCREAMING_SNAKE_CASE				,				recursive=__SCREAMING_SNAKE_CASE							)




def  snake_case_		(    ):



						"""simple docstring"""





						if hasattr(fsspec.asyn				,				'''reset_lock'''							):
												# for future fsspec>2022.05.0
												fsspec.asyn.reset_lock()
						else:
												lowercase_     :					Optional[int]													=	None
												lowercase_     :					Optional[int]													=	None
												lowercase_     :					Union[str, Any]													=	threading.Lock()





'''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)}""")



