






'''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


_A			:    List[str]					  =importlib.util.find_spec('''s3fs''') is not None

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

_A			:    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 				SCREAMING_SNAKE_CASE_ (UpperCamelCase   )   -> str:
							if "://" in dataset_path:
														lowerCamelCase__      :			Dict 						= dataset_path.split("""://"""   )[1]
							return dataset_path





def 				SCREAMING_SNAKE_CASE_ (UpperCamelCase   )   -> bool:
							if fs is not None and fs.protocol != "file":
														return True
							else:
														return False





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





def 				SCREAMING_SNAKE_CASE_ ()   -> None:
							if hasattr(fsspec.asyn       ,    """reset_lock"""   ):
														# for future fsspec>2022.05.0
														fsspec.asyn.reset_lock()
							else:
														lowerCamelCase__      :			List[Any] 						= None
														lowerCamelCase__      :			Any 						= None
														lowerCamelCase__      :			int 						= threading.Lock()









'''simple docstring'''







from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A			:    Union[str, Any]					  =logging.get_logger(__name__)

_A			:    List[str]					  ={
    '''MIT/ast-finetuned-audioset-10-10-0.4593''': (
        '''https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json'''
    ),
}

class _lowercase			(       _lowercase	):
							a          = """audio-spectrogram-transformer"""




							def __init__(							self:       str    ,							UpperCamelCase__:       Any=768    ,							UpperCamelCase__:       Union[str, Any]=12    ,							UpperCamelCase__:       List[Any]=12    ,							UpperCamelCase__:       int=3_072    ,							UpperCamelCase__:       Optional[Any]="gelu"    ,							UpperCamelCase__:       Optional[int]=0.0    ,							UpperCamelCase__:       Tuple=0.0    ,							UpperCamelCase__:       Union[str, Any]=0.02    ,							UpperCamelCase__:       Dict=1e-12    ,							UpperCamelCase__:       List[str]=16    ,							UpperCamelCase__:       List[str]=True    ,							UpperCamelCase__:       Any=10    ,							UpperCamelCase__:       List[str]=10    ,							UpperCamelCase__:       Any=1_024    ,							UpperCamelCase__:       Optional[Any]=128    ,							**UpperCamelCase__:       Union[str, Any]    ,							):
														super().__init__(**UpperCamelCase__  )

														lowerCamelCase__      :			List[Any] 						= hidden_size
														lowerCamelCase__      :			int 						= num_hidden_layers
														lowerCamelCase__      :			List[str] 						= num_attention_heads
														lowerCamelCase__      :			Optional[int] 						= intermediate_size
														lowerCamelCase__      :			List[Any] 						= hidden_act
														lowerCamelCase__      :			List[Any] 						= hidden_dropout_prob
														lowerCamelCase__      :			str 						= attention_probs_dropout_prob
														lowerCamelCase__      :			Dict 						= initializer_range
														lowerCamelCase__      :			List[str] 						= layer_norm_eps
														lowerCamelCase__      :			List[Any] 						= patch_size
														lowerCamelCase__      :			List[str] 						= qkv_bias
														lowerCamelCase__      :			Dict 						= frequency_stride
														lowerCamelCase__      :			List[Any] 						= time_stride
														lowerCamelCase__      :			str 						= max_length
														lowerCamelCase__      :			Dict 						= num_mel_bins

