functions and functional programming @coroutine def grep(patterntarget)while trueline (yieldif pattern in linetarget send(line@coroutine def printer()while trueline (yieldsys stdout write(linehere is how you would link these coroutines to create dataflow processing pipelinefinder find_files(opener(cat(grep("python",printer())))nowsend value finder send(("www","access-log*")finder send(("otherwww","access-log*")in this exampleeach coroutine sends data to another coroutine specified in the target argument to each coroutine unlike the generator exampleexecution is entirely driven by pushing data into the first coroutine find_files(this coroutinein turnpushes data to the next stage critical aspect of this example is that the coroutine pipeline remains active indefinitely or until close(is explicitly called on it because of thisa program can continue to feed data into coroutine for as long as necessary--for examplethe two repeated calls to send(shown in the example coroutines can be used to implement form of concurrency for examplea centralized task manager or event loop can schedule and send data into large collection of hundreds or even thousands of coroutines that carry out various processing tasks the fact that input data is "sentto coroutine also means that coroutines can often be easily mixed with programs that use message queues and message passing to communicate between program components further information on this can be found in "threads list comprehensions common operation involving functions is that of applying function to all of the items of listcreating new list with the results for examplenums [ squares [for in numssquares append( nbecause this type of operation is so commonit is has been turned into an operator known as list comprehension here is simple examplenums [ squares [ for in numsthe general syntax for list comprehension is as follows[expression for item in iterable if condition for item in iterable if condition for itemn in iterablen if conditionn lib fl ff