def gen_data_files(*dirs, **kwargs):
 results = []
 optional = kwargs.pop(u'optional', False)
 def filter_illegal_extensions(f):
  return (os.path.splitext(f)[1] != u'.pyc')
 for src_dir in dirs:
  if (not os.path.isdir(src_dir)):
   if optional:
    continue
   else:
    raise RuntimeError(u'{dir:s} does not exist, cannot continue'.format(dir=src_dir))
  for (root, dirs, files) in os.walk(src_dir):
   results.append((root, filter(filter_illegal_extensions, map((lambda f: os.path.join(root, f)), files))))
 return results

def gen_data_files ( * dirs , ** kwargs ) : results = [ ] optional = kwargs . pop ( u'optional' , False ) def filter_illegal_extensions ( f ) : return ( os . path . splitext ( f ) [ 1 ] != u'.pyc' ) for src_dir in dirs : if ( not os . path . isdir ( src_dir ) ) : if optional : continue else : raise RuntimeError ( u'{dir:s} does not exist, cannot continue' . format ( dir = src_dir ) ) for ( root , dirs , files ) in os . walk ( src_dir ) : results . append ( ( root , filter ( filter_illegal_extensions , map ( ( lambda f : os . path . join ( root , f ) ) , files ) ) ) ) return results
we can only link files .