


"""simple docstring"""
from pathlib import PurePosixPath
from typing import Optional

import fsspec
from fsspec import AbstractFileSystem
from huggingface_hub.hf_api import DatasetInfo

from ..utils.file_utils import get_authentication_headers_for_url
from ..utils.hub import hf_hub_url





class      __A     (_snake_case):





							'''simple docstring'''

							__lowercase:		List[str]							      =    """"""
							__lowercase:		List[Any]							      =    """hf-legacy"""  # "hf://"" is reserved for hffs



							def __init__(				self							:      Optional[int]		,       UpperCAmelCase_							:      Optional[DatasetInfo] = None		,       UpperCAmelCase_							:      Optional[str] = None		,       **UpperCAmelCase_							:      Union[str, Any]		,       )					->Optional[Any]:



														"""simple docstring"""



														super().__init__(self		,       **lowerCAmelCase__       )
														snake_case_           =		repo_info
														snake_case_           =		token
														snake_case_           =		None



							def 		lowerCAmelCase       (				self							:      Dict       )					->Optional[Any]:



														"""simple docstring"""



														if self.dir_cache is None:
																					snake_case_           =		{}
																					for hf_file in self.repo_info.siblings:
																												# TODO(QL): add sizes
																												snake_case_           =		{
																												    """name""": hf_file.rfilename,
																												    """size""": None,
																												    """type""": """file""",
																												}
																												self.dir_cache.update(
																												    {
																												        str(lowerCAmelCase__       ): {"""name""": str(lowerCAmelCase__       ), """size""": None, """type""": """directory"""}
																												        for d in list(PurePosixPath(hf_file.rfilename       ).parents       )[:-1]
																												    }       )



							def 		lowerCAmelCase       (				self							:      List[Any]		,       UpperCAmelCase_							:      str		,       UpperCAmelCase_							:      str = "rb"		,       **UpperCAmelCase_							:      List[str]		,       )					->Dict:



														"""simple docstring"""



														if not isinstance(self.repo_info		,       lowerCAmelCase__       ):
																					raise NotImplementedError(F"""Open is only implemented for dataset repositories, but got {self.repo_info}"""       )
														snake_case_           =		hf_hub_url(self.repo_info.id		,       lowerCAmelCase__		,       revision=self.repo_info.sha       )
														return fsspec.open(
														    lowerCAmelCase__		,       mode=lowerCAmelCase__		,       headers=get_authentication_headers_for_url(lowerCAmelCase__		,       use_auth_token=self.token       )		,       client_kwargs={"""trust_env""": True}		,       ).open()



							def 		lowerCAmelCase       (				self							:      str		,       UpperCAmelCase_							:      Dict		,       **UpperCAmelCase_							:      int       )					->Optional[int]:



														"""simple docstring"""



														self._get_dirs()
														snake_case_           =		self._strip_protocol(lowerCAmelCase__       )
														if path in self.dir_cache:
																					return self.dir_cache[path]
														else:
																					raise FileNotFoundError(lowerCAmelCase__       )



							def 		lowerCAmelCase       (				self							:      Tuple		,       UpperCAmelCase_							:      str		,       UpperCAmelCase_							:      str=False		,       **UpperCAmelCase_							:      Any       )					->Union[str, Any]:



														"""simple docstring"""



														self._get_dirs()
														snake_case_           =		PurePosixPath(path.strip("""/"""       )       )
														snake_case_           =		{}
														for p, f in self.dir_cache.items():
																					snake_case_           =		PurePosixPath(p.strip("""/"""       )       )
																					snake_case_           =		p.parent
																					if root == path:
																												snake_case_           =		f
														snake_case_           =		list(paths.values()       )
														if detail:
																					return out
														else:
																					return sorted(f["""name"""] for f in out       )







"""simple docstring"""
from functools import reduce

__SCREAMING_SNAKE_CASE							:    Tuple		=    (
    '73167176531330624919225119674426574742355349194934'
    '96983520312774506326239578318016984801869478851843'
    '85861560789112949495459501737958331952853208805511'
    '12540698747158523863050715693290963295227443043557'
    '66896648950445244523161731856403098711121722383113'
    '62229893423380308135336276614282806444486645238749'
    '30358907296290491560440772390713810515859307960866'
    '70172427121883998797908792274921901699720888093776'
    '65727333001053367881220235421809751254540594752243'
    '52584907711670556013604839586446706324415722155397'
    '53697817977846174064955149290862569321978468622482'
    '83972241375657056057490261407972968652414535100474'
    '82166370484403199890008895243450658541227588666881'
    '16427171479924442928230863465674813919123162824586'
    '17866458359124566529476545682848912883142607690042'
    '24219022671055626321111109370544217506941658960408'
    '07198403850962455444362981230987879927244284909188'
    '84580156166097919133875499200524063689912560717606'
    '05886116467109405077541002256983155200055935729725'
    '71636269561882670428252483600823257530420752963450'
)







def 						_a				(      _SCREAMING_SNAKE_CASE = N				)    ->				int:
							return max(
							    # mypy cannot properly interpret reduce
							    int(reduce(lambda _SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				: str(int(_SCREAMING_SNAKE_CASE				) * int(_SCREAMING_SNAKE_CASE				)				)				, n[i : i + 13]				)				)
							    for i in range(len(_SCREAMING_SNAKE_CASE				) - 12				)				)


if __name__ == "__main__":
				print(f"""{solution() = }""")



