@classmethod
def from_ast(cls, ast, **kwargs):
    """Constructs a variable using information from ``ast`` (such as label and line numbers).

        :param ast: AST node
        :type ast: :class:`jinja2.nodes.Node`
        """
    for k, v in list(kwargs.items()):
        if v is None:
            del kwargs[k]
    kwargs = dict(cls._get_kwargs_from_ast(ast), **kwargs)
    return cls(**kwargs)
