def _findUnit(unit):
  if isinstance(unit, basestring):
    unit = eval(unit, _unit_table)
    for cruft in ['__builtins__', '__args__']:
      try:
        del _unit_table[cruft]
      except __HOLE__:
        pass

  if not isPhysicalUnit(unit):
    raise TypeError(str(unit) + ' is not a unit')
  return unit
dataset/ETHPy150Open kdart/pycopia/core/pycopia/physics/physical_quantities.py/_findUnit