




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 						lowercase_					(						__lowerCamelCase  ):
      UpperCamelCase_    :	List[str]		   =       'mock'



      def __init__(    self   :       Tuple    ,      *A__   :       Any    ,      A__   :       str    ,      **A__   :       str	)					->  int:
        super().__init__()
        _snake_case		=							LocalFileSystem(*A__    ,      **A__	)
        _snake_case		=							Path(A__	).resolve().as_posix() + '''/'''



      def 		UpperCamelCase_	(    self   :       Optional[int]    ,      A__   :       int    ,      *A__   :       Any    ,      **A__   :       Tuple	)					->  Union[str, Any]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.mkdir(A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       List[Any]    ,      A__   :       Union[str, Any]    ,      *A__   :       Any    ,      **A__   :       Dict	)					->  List[Any]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.makedirs(A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       int    ,      A__   :       int	)					->  Dict:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.rmdir(A__	)



      def 		UpperCamelCase_	(    self   :       int    ,      A__   :       List[str]    ,      A__   :       Optional[Any]=True    ,      *A__   :       Union[str, Any]    ,      **A__   :       Optional[int]	)					->  Optional[Any]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        _snake_case		=							self._fs.ls(A__    ,      detail=A__    ,      *A__    ,      **A__	)
        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 		UpperCamelCase_	(    self   :       Tuple    ,      A__   :       Dict    ,      *A__   :       Dict    ,      **A__   :       Optional[Any]	)					->  Any:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        _snake_case		=							dict(self._fs.info(A__    ,      *A__    ,      **A__	)	)
        _snake_case		=							out['''name'''][len(self.local_root_dir	) :]
        return out



      def 		UpperCamelCase_	(    self   :       Any    ,      A__   :       Any    ,      A__   :       Dict    ,      *A__   :       str    ,      **A__   :       Optional[Any]	)					->  List[str]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.cp_file(A__    ,      A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       Optional[Any]    ,      A__   :       List[str]    ,      *A__   :       List[str]    ,      **A__   :       Union[str, Any]	)					->  Any:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.rm_file(A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       Union[str, Any]    ,      A__   :       Optional[int]    ,      *A__   :       Tuple    ,      **A__   :       Any	)					->  List[str]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.rm(A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       List[Any]    ,      A__   :       List[str]    ,      *A__   :       Union[str, Any]    ,      **A__   :       Union[str, Any]	)					->  Tuple:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs._open(A__    ,      *A__    ,      **A__	)



      def 		UpperCamelCase_	(    self   :       Tuple    ,      A__   :       Tuple	)					->  Optional[Any]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.created(A__	)



      def 		UpperCamelCase_	(    self   :       Any    ,      A__   :       Any	)					->  List[Any]:
        _snake_case		=							posixpath.join(self.local_root_dir    ,      self._strip_protocol(A__	)	)
        return self._fs.modified(A__	)







      @classmethod
      def 		UpperCamelCase_	(    cls   :       int    ,      A__   :       Optional[Any]	)					->  Tuple:
        _snake_case		=							stringify_path(A__	)
        if path.startswith('''mock://'''	):
          _snake_case		=							path[7:]
        return path



class 						lowercase_					(						__lowerCamelCase  ):
      UpperCamelCase_    :	Optional[int]		   =       'tmp'
      UpperCamelCase_    :	List[Any]		   =       None



      def __init__(    self   :       Optional[int]    ,      *A__   :       str    ,      **A__   :       Dict	)					->  int:
        assert self.tmp_dir is not None, "TmpDirFileSystem.tmp_dir is not set"
        super().__init__(*A__    ,      **A__    ,      local_root_dir=self.tmp_dir    ,      auto_mkdir=A__	)







      @classmethod
      def 		UpperCamelCase_	(    cls   :       str    ,      A__   :       List[Any]	)					->  str:
        _snake_case		=							stringify_path(A__	)
        if path.startswith('''tmp://'''	):
          _snake_case		=							path[6:]
        return path



@pytest.fixture
def    snake_case_()							->			Optional[int]:



  """simple docstring"""






  _snake_case		=							MockFileSystem
  _snake_case		=							TmpDirFileSystem
  yield
  del _fsspec_registry["mock"]
  del _fsspec_registry["tmp"]



@pytest.fixture
def    snake_case_(_UpperCamelCase				, _UpperCamelCase  )							->			Tuple:



  """simple docstring"""






  _snake_case		=							tmp_path_factory.mktemp('''mockfs'''  )
  return MockFileSystem(local_root_dir=_UpperCamelCase				, auto_mkdir=_UpperCamelCase  )



@pytest.fixture
def    snake_case_(_UpperCamelCase				, _UpperCamelCase  )							->			str:



  """simple docstring"""






  _snake_case		=							tmp_path_factory.mktemp('''tmpfs'''  )
  with patch.object(_UpperCamelCase				, '''tmp_dir'''				, _UpperCamelCase  ):
    yield TmpDirFileSystem()




import numpy as np



def    snake_case_(_UpperCamelCase  )							->			Any:



  """simple docstring"""






  _snake_case		=							np.exp(_UpperCamelCase  )

  # Add up the all the exponentials
  _snake_case		=							np.sum(_UpperCamelCase  )

  # Divide every exponent by the sum of all exponents
  _snake_case		=							exponent_vector / sum_of_exponents

  return softmax_vector


if __name__ == "__main__":
 print(softmax((0,)))

