<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _gather(self, func):
 """ Function needed and used by gathering functions through the decorator `gather_from_ingredients` in `Ingredient`. Don't use this function by itself outside of the decorator! By overwriting this function you can filter what is visible when gathering something (e.g. commands). See `Experiment._gather` for an example. """

        for ingredient, _ in self.traverse_ingredients():
            for item in func(ingredient):
                yield item