"""simple docstring"""





import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


_UpperCamelCase  :		List[Any]           =       parse(importlib.metadata.version("torch"))





def 							a_	( _lowerCAmelCase    :					Any  ,					_lowerCAmelCase    :					Union[str, Any]  ,					_lowerCAmelCase    :					Tuple	):





       '''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}"""	)
       lowercase__     :						Union[str, Any]         =      STR_OPERATION_TO_FUNC[operation]
       if isinstance(_a  ,					_a	):
              lowercase__     :						Any         =      parse(importlib.metadata.version(_a	)	)
       return operation(_a  ,					parse(_a	)	)






def 							a_	( _lowerCAmelCase    :					List[Any]  ,					_lowerCAmelCase    :					Tuple	):





       '''simple docstring'''

       return compare_versions(_a  ,					_a  ,					_a	)




from __future__ import annotations

def 			lowerCamelCase__			(       _a):
	SCREAMING_SNAKE_CASE :   Optional[Any]					  =							2
	SCREAMING_SNAKE_CASE :   Optional[int]					  =							[]
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(_a)
	if n > 1:
		factors.append(_a)
	return factors


if __name__ == "__main__":
			import doctest

			doctest.testmod()