def get_example_filenames(example_dir):
 for (dirpath, dirnames, filenames) in os.walk(example_dir):
  for fname in sorted(filenames):
   if (not fname.endswith('.py')):
    continue
   filename = op.join(dirpath, fname)
   name = filename[len(example_dir):].lstrip('/\\')[:(-3)]
   name = name.replace('\\', '/')
   (yield (filename, name))

def get_example_filenames ( example_dir ) : for ( dirpath , dirnames , filenames ) in os . walk ( example_dir ) : for fname in sorted ( filenames ) : if ( not fname . endswith ( '.py' ) ) : continue filename = op . join ( dirpath , fname ) name = filename [ len ( example_dir ) : ] . lstrip ( '/\\' ) [ : ( - 3 ) ] name = name . replace ( '\\' , '/' ) ( yield ( filename , name ) )
yield elements for all examples .