this coroutine acceptsas its argumentan existing coroutine in this caseit' an instance of nearest_neighbors this code basically proxies all the values sent into it through that nearest_neighbors instance then it does some processing on the result to get the most common color out of the values that were returned in this caseit would probably make just as much sense to adapt the original coroutine to return namesince it isn' being used for anything else howeverthere are many cases where it is useful to pass coroutines aroundthis is how we do it now all we have to do is connect these various coroutines and pipelines togetherand kick off the process with single function calldef process_colors(dataset_filename="colors csv")model_colors load_colors(dataset_filenameget_neighbors nearest_neighbors(model_colors get_color_name name_colors(get_neighborsoutput write_results(next(outputnext(get_neighborsnext(get_color_namefor color in generate_colors()name get_color_name send(coloroutput send((colorname)process_colors(sothis functionunlike almost every other function we've definedis perfectly normal function without any yield statements it doesn' get turned into coroutine or generator object it doeshoweverconstruct generator and three coroutines notice how the get_neighbors coroutine is passed into the constructor for name_colorspay attention to how all three coroutines are advanced to their first yield statements by calls to next once all the pipes are createdwe use for loop to send each of the generated colors into the get_color_name coroutineand then we pipe each of the values yielded by that coroutine to the output coroutinewhich writes it to file and that' iti created second kivy app that loads the resulting csv file and presents the colors to the user the user can select either yes or no depending on whether they think the choice made by the machine-learning algorithm matches the choice they would have made this is not scientifically accurate (it' ripe for observation bias)but it' good enough for playing around using my eyesit succeeded about percent of the timewhich is better than my grade average not bad for our first ever machine learning experienceeh