def has_dynamic_getattr(self, context=None):
def _valid_getattr(node):<EOL><INDENT>root = node.root()<EOL>return root.name != BUILTINS and getattr(root, "<STR_LIT>", None)<EOL><DEDENT>try:<EOL><INDENT>return _valid_getattr(self.getattr("<STR_LIT>", context)[<NUM_LIT:0>])<EOL><DEDENT>except exceptions.AttributeInferenceError:<EOL><INDENT>try:<EOL><INDENT>getattribute = self.getattr("<STR_LIT>", context)[<NUM_LIT:0>]<EOL>return _valid_getattr(getattribute)<EOL><DEDENT>except exceptions.AttributeInferenceError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return False<EOL>
Check if the class has a custom __getattr__ or __getattribute__.

        If any such method is found and it is not from
        builtins, nor from an extension module, then the function
        will return True.

        :returns: True if the class has a custom
            __getattr__ or __getattribute__, False otherwise.
        :rtype: bool