here is an example of using these functions to set up processing pipelinewwwlogs find("www","access-log*"files opener(wwwlogslines cat(filespylines grep("python"linesfor line in pylinessys stdout write(linein this examplethe program is processing all lines in all "access-log*files found within all subdirectories of top-level directory "wwweach "access-logis tested for file compression and opened using an appropriate file opener lines are concatenated together and processed through filter that is looking for substring "pythonthe entire program is being driven by the for statement at the end each iteration of this loop pulls new value through the pipeline and consumes it moreoverthe implementation is highly memory-efficient because no temporary lists or other large data structures are ever created coroutines can be used to write programs based on data-flow processing programs organized in this way look like inverted pipelines instead of pulling values through sequence of generator functions using for loopyou send values into collection of linked coroutines here is an example of coroutine functions written to mimic the generator functions shown previouslyimport os import fnmatch @coroutine def find_files(target)while truetopdirpattern (yieldfor pathdirnamefilelist in os walk(topdir)for name in filelistif fnmatch fnmatch(name,pattern)target send(os path join(path,name)import gzipbz @coroutine def opener(target)while truename (yieldif name endswith(gz") gzip open(nameelif name endswith(bz ") bz bz file(nameelsef open(nametarget send( @coroutine def cat(target)while truef (yieldfor line in ftarget send(linef lib fl ff