

"""simple docstring"""






import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


snake_case_        =       parse(importlib.metadata.version("""torch"""))



def   lowercase_	(    _lowercase       :		Optional[int]							,      _lowercase       :		Tuple							,      _lowercase       :		List[Any]	):




					'''simple docstring'''






					if operation not in STR_OPERATION_TO_FUNC.keys():
										raise ValueError(F"""`operation` must be one of {list(STR_OPERATION_TO_FUNC.keys()	)}, received {operation}"""	)
					UpperCAmelCase			:   Optional[Any]      =				STR_OPERATION_TO_FUNC[operation]
					if isinstance(lowercase_							,      lowercase_	):
										UpperCAmelCase			:   Tuple      =				parse(importlib.metadata.version(lowercase_	)	)
					return operation(lowercase_							,      parse(lowercase_	)	)




def   lowercase_	(    _lowercase       :		Dict							,      _lowercase       :		Optional[Any]	):




					'''simple docstring'''






					return compare_versions(lowercase_							,      lowercase_							,      lowercase_	)





"""simple docstring"""






import os



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Union[str, Any]      =				os.path.join(os.path.dirname(_lowercase	)							,      "num.txt"	)
					with open(_lowercase	) as file_hand:
										return str(sum(int(_lowercase	) for line in file_hand	)	)[:10]


if __name__ == "__main__":
	print(solution())


