def did_you_mean_units(s, all_units, deprecated_units, format_decomposed):
 def fix_deprecated(x):
  if (x in deprecated_units):
   results = [(x + u' (deprecated)')]
   decomposed = _try_decomposed(all_units[x], format_decomposed)
   if (decomposed is not None):
    results.append(decomposed)
   return results
  return (x,)
 return did_you_mean(s, all_units, fix=fix_deprecated)

def did_you_mean_units ( s , all_units , deprecated_units , format_decomposed ) : def fix_deprecated ( x ) : if ( x in deprecated_units ) : results = [ ( x + u' (deprecated)' ) ] decomposed = _try_decomposed ( all_units [ x ] , format_decomposed ) if ( decomposed is not None ) : results . append ( decomposed ) return results return ( x , ) return did_you_mean ( s , all_units , fix = fix_deprecated )
a wrapper around astropy .