def find_data_files(base, globs):
 rv_dirs = [root for (root, dirs, files) in os.walk(base)]
 rv = []
 for rv_dir in rv_dirs:
  files = []
  for pat in globs:
   files += glob.glob(os.path.join(rv_dir, pat))
  if (not files):
   continue
  target = os.path.join('lib', 'mypy', rv_dir)
  rv.append((target, files))
 return rv

def find_data_files ( base , globs ) : rv_dirs = [ root for ( root , dirs , files ) in os . walk ( base ) ] rv = [ ] for rv_dir in rv_dirs : files = [ ] for pat in globs : files += glob . glob ( os . path . join ( rv_dir , pat ) ) if ( not files ) : continue target = os . path . join ( 'lib' , 'mypy' , rv_dir ) rv . append ( ( target , files ) ) return rv
find ipythons data_files .