def get_converter(from_unit, to_unit):
 try:
  scale = from_unit._to(to_unit)
 except UnitsError:
  return from_unit._apply_equivalencies(from_unit, to_unit, get_current_unit_registry().equivalencies)
 if (scale == 1.0):
  return None
 else:
  return (lambda val: (scale * val))

def get_converter ( from_unit , to_unit ) : try : scale = from_unit . _to ( to_unit ) except UnitsError : return from_unit . _apply_equivalencies ( from_unit , to_unit , get_current_unit_registry ( ) . equivalencies ) if ( scale == 1.0 ) : return None else : return ( lambda val : ( scale * val ) )
create a new converter for the given arguments or raise exception if the converter does not exist .