def _find_unit_pattern(unit_id, locale=LC_NUMERIC):
 locale = Locale.parse(locale)
 unit_patterns = locale._data['unit_patterns']
 if (unit_id in unit_patterns):
  return unit_id
 for unit_pattern in sorted(unit_patterns, key=len):
  if unit_pattern.endswith(unit_id):
   return unit_pattern

def _find_unit_pattern ( unit_id , locale = LC_NUMERIC ) : locale = Locale . parse ( locale ) unit_patterns = locale . _data [ 'unit_patterns' ] if ( unit_id in unit_patterns ) : return unit_id for unit_pattern in sorted ( unit_patterns , key = len ) : if unit_pattern . endswith ( unit_id ) : return unit_pattern
expand an unit into a qualified form .