def node_frame_class(<EOL>node: astroid.node_classes.NodeNG<EOL>) -> Optional[astroid.node_classes.NodeNG]:
klass = node.frame()<EOL>while klass is not None and not isinstance(klass, astroid.ClassDef):<EOL><INDENT>if klass.parent is None:<EOL><INDENT>klass = None<EOL><DEDENT>else:<EOL><INDENT>klass = klass.parent.frame()<EOL><DEDENT><DEDENT>return klass<EOL>
return klass node for a method node (or a staticmethod or a
    classmethod), return null otherwise