code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  import posixpath
  from pathlib import Path
  from unittest.mock import patch
  
  import pytest
  from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
  from fsspec.registry import _registry as _fsspec_registry
  
  
  
  
  
  class 					_UpperCAmelCase							(		__UpperCAmelCase     ):
  		a     :     List[str]     						="""mock"""
  		def __init__(						self,*__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					super().__init__()
  					__lowerCAmelCase      		=       LocalFileSystem(*lowercase_,**lowercase_    )
  					__lowerCAmelCase      		=       Path(lowercase_    ).resolve().as_posix() + '''/'''
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.mkdir(lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.makedirs(lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.rmdir(lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE=True,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					__lowerCAmelCase      		=       self._fs.ls(lowercase_,detail=lowercase_,*lowercase_,**lowercase_    )
  					if detail:
  								return [{**info, "name": info["name"][len(self.local_root_dir    ) :]} for info in out]
  					else:
  								return [name[len(self.local_root_dir    ) :] for name in out]
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					__lowerCAmelCase      		=       dict(self._fs.info(lowercase_,*lowercase_,**lowercase_    )    )
  					__lowerCAmelCase      		=       out['''name'''][len(self.local_root_dir    ) :]
  					return out
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.cp_file(lowercase_,lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.rm_file(lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.rm(lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs._open(lowercase_,*lowercase_,**lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.created(lowercase_    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       posixpath.join(self.local_root_dir,self._strip_protocol(lowercase_    )    )
  					return self._fs.modified(lowercase_    )
  
  
  
  
  
  
  
  		@classmethod
  		def 						lowerCamelCase__    (						cls,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       stringify_path(lowercase_    )
  					if path.startswith("""mock://"""    ):
  								__lowerCAmelCase      		=       path[7:]
  					return path
  
  
  
  
  
  class 					_UpperCAmelCase							(		__UpperCAmelCase     ):
  		a     :     Union[str, Any]     						="""tmp"""
  		a     :     Union[str, Any]     						=None
  		def __init__(						self,*__SCREAMING_SNAKE_CASE,**__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					assert self.tmp_dir is not None, "TmpDirFileSystem.tmp_dir is not set"
  					super().__init__(*lowercase_,**lowercase_,local_root_dir=self.tmp_dir,auto_mkdir=lowercase_    )
  
  
  
  
  
  
  
  		@classmethod
  		def 						lowerCamelCase__    (						cls,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       stringify_path(lowercase_    )
  					if path.startswith("""tmp://"""    ):
  								__lowerCAmelCase      		=       path[6:]
  					return path
  
  
  
  
  
  @pytest.fixture
  def      _lowerCAmelCase		(		)      ->      Tuple:
  			__lowerCAmelCase      		=       MockFileSystem
  			__lowerCAmelCase      		=       TmpDirFileSystem
  			yield
  			del _fsspec_registry["mock"]
  			del _fsspec_registry["tmp"]
  
  
  
  
  
  @pytest.fixture
  def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      str:
  			__lowerCAmelCase      		=       tmp_path_factory.mktemp("""mockfs"""			)
  			return MockFileSystem(local_root_dir=lowercase_      ,			auto_mkdir=lowercase_			)
  
  
  
  
  
  
  
  @pytest.fixture
  def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      List[Any]:
  			__lowerCAmelCase      		=       tmp_path_factory.mktemp("""tmpfs"""			)
  			with patch.object(lowercase_      ,			"""tmp_dir"""      ,			lowercase_			):
  						yield TmpDirFileSystem()
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  from __future__ import annotations
  
  from collections.abc import Iterable, Iterator
  from typing import Any, Generic, TypeVar
  
  _a      :				Dict											=					TypeVar("""T""", bound=bool)
  
  
  
  
  
  class 					_UpperCAmelCase							(		Generic[T]     ):
  		def __init__(						self,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       value
  					__lowerCAmelCase      		=       None
  					__lowerCAmelCase      		=       None
  		@property
  		def 						lowerCamelCase__    (						self    ):
  
  
  
  					'''simple docstring'''
  
  					return self._value
  
  
  
  
  
  
  
  		@staticmethod
  		def 						lowerCamelCase__    (						__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					if not roota:
  								return roota
  
  					if not roota:
  								return roota
  
  					if roota.value > roota.value:
  								__lowerCAmelCase		, __lowerCAmelCase      		=       roota, roota
  
  					__lowerCAmelCase      		=       roota
  					__lowerCAmelCase      		=       roota.right
  					__lowerCAmelCase      		=       roota.left
  					__lowerCAmelCase      		=       SkewNode.merge(__SCREAMING_SNAKE_CASE,__SCREAMING_SNAKE_CASE    )
  
  					return result
  
  
  
  
  
  class 					_UpperCAmelCase							(		Generic[T]     ):
  		def __init__(						self,__SCREAMING_SNAKE_CASE = ()    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       None
  					if data:
  								for item in data:
  											self.insert(__SCREAMING_SNAKE_CASE    )
  		def __bool__(						self    ):
  
  
  
  					'''simple docstring'''
  
  					return self._root is not None
  		def __iter__(						self    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       []
  					while self:
  								result.append(self.pop()    )
  
  					# Pushing items back to the heap not to clear it.
  					for item in result:
  								self.insert(__SCREAMING_SNAKE_CASE    )
  
  					return iter(__SCREAMING_SNAKE_CASE    )
  		def 						lowerCamelCase__    (						self,__SCREAMING_SNAKE_CASE    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       SkewNode.merge(self._root,SkewNode(__SCREAMING_SNAKE_CASE    )    )
  		def 						lowerCamelCase__    (						self    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       self.top()
  					__lowerCAmelCase      		=       (
  					    SkewNode.merge(self._root.left,self._root.right    ) if self._root else None
  					)
  
  					return result
  		def 						lowerCamelCase__    (						self    ):
  
  
  
  					'''simple docstring'''
  
  					if not self._root:
  								raise IndexError("""Can't get top element for the empty heap."""    )
  					return self._root.value
  
  
  
  
  
  
  
  		def 						lowerCamelCase__    (						self    ):
  
  
  
  					'''simple docstring'''
  
  					__lowerCAmelCase      		=       None
  
  
  if __name__ == "__main__":
  	import doctest
  
  	doctest.testmod()
  
  