






_a				     =  {
    '''kilogram''': 1,
    '''gram''': pow(10, 3),
    '''milligram''': pow(10, 6),
    '''metric-ton''': pow(10, -3),
    '''long-ton''': 0.00_09_84_20_73,
    '''short-ton''': 0.00_11_02_31_22,
    '''pound''': 2.20_46_24_42_02,
    '''stone''': 0.15_74_73_17_28,
    '''ounce''': 35.2_73_99_07_23,
    '''carrat''': 5000,
    '''atomic-mass-unit''': 6.0_2213_6652e26,
}

_a				     =  {
    '''kilogram''': 1,
    '''gram''': pow(10, -3),
    '''milligram''': pow(10, -6),
    '''metric-ton''': pow(10, 3),
    '''long-ton''': 1016.04608,
    '''short-ton''': 907.184,
    '''pound''': 0.45_35_92,
    '''stone''': 6.3_50_29,
    '''ounce''': 0.0_28_34_95,
    '''carrat''': 0.00_02,
    '''atomic-mass-unit''': 1.6_6054_0199e-27,
}


def __A   (				__lowerCAmelCase			,		__lowerCAmelCase			,		__lowerCAmelCase     )->  float:





						"""simple docstring"""



						if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
												_UpperCAmelCase     =      (
												    F"""Invalid 'from_type' or 'to_type' value: {from_type!r}, {to_type!r}\n"""
												    F"""Supported values are: {", ".join(__lowerCAmelCase     )}"""
												)
												raise ValueError(__lowerCAmelCase     )
						return value * KILOGRAM_CHART[to_type] * WEIGHT_TYPE_CHART[from_type]


if __name__ == "__main__":
		import doctest

		doctest.testmod()








import unittest
import warnings
from dataclasses import dataclass

from transformers.convert_slow_tokenizer import SpmConverter
from transformers.testing_utils import get_tests_dir





@dataclass
class __lowerCamelCase			:





	"""simple docstring"""






	UpperCamelCase__								=				42





class __lowerCamelCase			(				unittest.TestCase):





	"""simple docstring"""






	def 	UpperCamelCase   (							self   ):
							"""simple docstring"""







							_UpperCAmelCase     =      get_tests_dir('fixtures/test_sentencepiece.model'   )
							_UpperCAmelCase     =      get_tests_dir('fixtures/test_sentencepiece_with_bytefallback.model'   )

							_UpperCAmelCase     =      FakeOriginalTokenizer(vocab_file=UpperCAmelCase   )

							with warnings.catch_warnings(record=UpperCAmelCase   ) as w:
													_UpperCAmelCase     =      SpmConverter(UpperCAmelCase   )
							self.assertEqual(len(UpperCAmelCase   )	,   0   )

							_UpperCAmelCase     =      FakeOriginalTokenizer(vocab_file=UpperCAmelCase   )

							with warnings.catch_warnings(record=UpperCAmelCase   ) as w:
													_UpperCAmelCase     =      SpmConverter(UpperCAmelCase   )
							self.assertEqual(len(UpperCAmelCase   )	,   1   )

							self.assertIn(
							    'The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option'
							    ' which is not implemented in the fast tokenizers.'	,   str(w[0].message   )	,   )
