
"""simple docstring"""



from statistics import mean, stdev
def 					lowerCamelCase   (     _snake_case    ,_snake_case = 3 ):
    UpperCAmelCase__	:      Tuple     							=					min(_snake_case )
    UpperCAmelCase__	:      Any     							=					max(_snake_case )
    # normalize data
    return [round((x - x_min) / (x_max - x_min)    ,_snake_case ) for x in data]

def 					lowerCamelCase   (     _snake_case    ,_snake_case = 3 ):
    UpperCAmelCase__	:      Optional[Any]     							=					mean(_snake_case )
    UpperCAmelCase__	:      Optional[int]     							=					stdev(_snake_case )
    # standardize data
    return [round((x - mu) / (sigma)    ,_snake_case ) for x in data]



"""simple docstring"""



UpperCamelCase__          =	{
    'meter': 'm',
    'kilometer': 'km',
    'megametre': 'Mm',
    'gigametre': 'Gm',
    'terametre': 'Tm',
    'petametre': 'Pm',
    'exametre': 'Em',
    'zettametre': 'Zm',
    'yottametre': 'Ym',
}
# Exponent of the factor(meter)
UpperCamelCase__          =	{
    'm': 0,
    'km': 3,
    'Mm': 6,
    'Gm': 9,
    'Tm': 12,
    'Pm': 15,
    'Em': 18,
    'Zm': 21,
    'Ym': 24,
}
def 					lowerCamelCase   (     _snake_case    ,_snake_case    ,_snake_case ):
    UpperCAmelCase__	:      int     							=					from_type.lower().strip('s' )
    UpperCAmelCase__	:      List[Any]     							=					to_type.lower().strip('s' )

    UpperCAmelCase__	:      Optional[int]     							=					UNIT_SYMBOL.get(_snake_case    ,_snake_case )
    UpperCAmelCase__	:      Optional[Any]     							=					UNIT_SYMBOL.get(_snake_case    ,_snake_case )

    if from_sanitized not in METRIC_CONVERSION:
        UpperCAmelCase__	:      Optional[int]     							=					(
            F'''Invalid \'from_type\' value: {from_type!r}.\n'''
            F'''Conversion abbreviations are: {', '.join(_snake_case )}'''
        )
        raise ValueError(_snake_case )
    if to_sanitized not in METRIC_CONVERSION:
        UpperCAmelCase__	:      int     							=					(
            F'''Invalid \'to_type\' value: {to_type!r}.\n'''
            F'''Conversion abbreviations are: {', '.join(_snake_case )}'''
        )
        raise ValueError(_snake_case )
    UpperCAmelCase__	:      str     							=					METRIC_CONVERSION[from_sanitized]
    UpperCAmelCase__	:      Optional[int]     							=					METRIC_CONVERSION[to_sanitized]
    UpperCAmelCase__	:      int     							=					1

    if from_exponent > to_exponent:
        UpperCAmelCase__	:      List[str]     							=					from_exponent - to_exponent
    else:
        UpperCAmelCase__	:      int     							=					-(to_exponent - from_exponent)

    return value * pow(10    ,_snake_case )


if __name__ == "__main__":
    from doctest import testmod

    testmod()

