'''simple docstring'''
def  _UpperCamelCase (     _a	:	int | float | str			):




    """simple docstring"""



    try:
        __UpperCamelCase	:	Optional[Any]		    =  float(_a			)
    except ValueError:
        raise ValueError('Please enter a valid number'			)
    __UpperCamelCase	:	Union[str, Any]		    =  decimal - int(_a			)
    if fractional_part == 0:
        return int(_a			), 1
    else:
        __UpperCamelCase	:	int		    =  len(str(_a			).split('.'			)[1]			)
        __UpperCamelCase	:	Dict		    =  int(decimal * (1_0**number_of_frac_digits)			)
        __UpperCamelCase	:	Tuple		    =  1_0**number_of_frac_digits
        __UpperCamelCase    ,					__UpperCamelCase	:	Dict		    =  denominator, numerator
        while True:
            __UpperCamelCase	:	int		    =  dividend % divisor
            if remainder == 0:
                break
            __UpperCamelCase    ,					__UpperCamelCase	:	Optional[int]		    =  divisor, remainder
        __UpperCamelCase    ,					__UpperCamelCase	:	int		    =  numerator / divisor, denominator / divisor
        return int(_a			), int(_a			)


if __name__ == "__main__":
  print(F"""{decimal_to_fraction(2) = }""")
  print(F"""{decimal_to_fraction(89.0) = }""")
  print(F"""{decimal_to_fraction("67") = }""")
  print(F"""{decimal_to_fraction("45.0") = }""")
  print(F"""{decimal_to_fraction(1.5) = }""")
  print(F"""{decimal_to_fraction("6.25") = }""")
  print(F"""{decimal_to_fraction("78td") = }""")




'''simple docstring'''
from urllib.parse import quote

import pytest

from datasets.utils.hub import hf_hub_url







@pytest.mark.parametrize('repo_id'				,     ['canonical_dataset_name', 'org-name/dataset-name']			)
@pytest.mark.parametrize('path'				,     ['filename.csv', 'filename with blanks.csv']			)
@pytest.mark.parametrize('revision'				,     [None, 'v2']			)
def  _UpperCamelCase (     _a	:	Any				,     _a	:	int				,     _a	:	Dict			):




    """simple docstring"""



    __UpperCamelCase	:	List[Any]		    =  hf_hub_url(repo_id=_a				,     path=_a				,     revision=_a			)
    assert url == f"""https://huggingface.co/datasets/{repo_id}/resolve/{revision or 'main'}/{quote(_a			)}"""



