def get_color_func(self, word):
try:<EOL><INDENT>color_func = next(<EOL>color_func for (color_func, words) in self.color_func_to_words<EOL>if word in words)<EOL><DEDENT>except StopIteration:<EOL><INDENT>color_func = self.default_color_func<EOL><DEDENT>return color_func<EOL>
Returns a single_color_func associated with the word