def get_script_from_egg(name, dist):
  if name in dist.metadata_listdir('scripts'):
    return (
        os.path.join(dist.egg_info, 'scripts', name),
        dist.get_metadata('scripts/%s' % name).replace('\r\n', '\n').replace('\r', '\n'))
  return None, None
Returns location, content of script in distribution or (None, None) if not there.
dataset/ETHPy150Open pantsbuild/pex/pex/finders.py/get_script_from_egg