def _check_yield_outside_func(self, node):
    if (not isinstance(node.frame(), (astroid.FunctionDef, astroid.Lambda))):
        self.add_message('yield-outside-function', node=node)
def _check_yield_outside_func(self, node):
    if (not isinstance(node.frame(), (astroid.FunctionDef, astroid.Lambda))):
        self.add_message('yield-outside-function', node=node)