(self, setting, item, attrs, metas)
return True
Check if descriptor `item` can be used with given domain.

        Return True if descriptor's expression contains only
        available variables and descriptors name does not clash with
        existing variables.
Check if descriptor `item` can be used with given domain.
Check if descriptor item can be used with given domain .
def is_valid_item(self, setting, item, attrs, metas):
        """Check if descriptor `item` can be used with given domain.

        Return True if descriptor's expression contains only
        available variables and descriptors name does not clash with
        existing variables.
        """
        if item.name in attrs or item.name in metas:
            return False

        try:
            exp_ast = ast.parse(item.expression, mode="eval")
        # ast.parse can return arbitrary errors, not only SyntaxError
        # pylint: disable=broad-except
        except Exception:
            return False

        available = dict(globals()["__GLOBALS"])
        for var in attrs:
            available[sanitized_name(var)] = None
        for var in metas:
            available[sanitized_name(var)] = None

        if freevars(exp_ast, available):
            return False
        return True
def is_valid_item ( self , setting , item , attrs , metas ) : if item . name in attrs or item . name in metas : return False try : exp_ast = ast . parse ( item . expression , mode = "eval" ) # ast.parse can return arbitrary errors, not only SyntaxError # pylint: disable=broad-except except Exception : return False available = dict ( globals ( ) [ "__GLOBALS" ] ) for var in attrs : available [ sanitized_name ( var ) ] = None for var in metas : available [ sanitized_name ( var ) ] = None if freevars ( exp_ast , available ) : return False return True