(tree_el, parent)
return list(filter(None, variables))
Given an ast of all the lines in a function, generate a list of
    variables in that function. Variables are tokens and what they link to.

    :param tree_el ast:
    :param parent Group:
    :rtype: list[Variable]
Given an ast of all the lines in a function, generate a list of
    variables in that function. Variables are tokens and what they link to.
Given an ast of all the lines in a function generate a list of variables in that function . Variables are tokens and what they link to .
def make_local_variables(tree_el, parent):
    """
    Given an ast of all the lines in a function, generate a list of
    variables in that function. Variables are tokens and what they link to.

    :param tree_el ast:
    :param parent Group:
    :rtype: list[Variable]
    """
    variables = []
    for el in walk(tree_el):
        if el['nodeType'] == 'Expr_Assign':
            variables.append(process_assign(el))
        if el['nodeType'] == 'Stmt_Use':
            for use in el['uses']:
                owner_token = djoin(use['name']['parts'])
                token = use['alias']['name'] if use['alias'] else owner_token
                variables.append(Variable(token, points_to=owner_token,
                                          line_number=lineno(el)))

    # Make a 'this'/'self' variable for use anywhere we need it that points to the class
    if isinstance(parent, Group) and parent.group_type in GROUP_TYPE.CLASS:
        variables.append(Variable('this', parent, line_number=parent.line_number))
        variables.append(Variable('self', parent, line_number=parent.line_number))

    return list(filter(None, variables))
def make_local_variables ( tree_el , parent ) : variables = [ ] for el in walk ( tree_el ) : if el [ 'nodeType' ] == 'Expr_Assign' : variables . append ( process_assign ( el ) ) if el [ 'nodeType' ] == 'Stmt_Use' : for use in el [ 'uses' ] : owner_token = djoin ( use [ 'name' ] [ 'parts' ] ) token = use [ 'alias' ] [ 'name' ] if use [ 'alias' ] else owner_token variables . append ( Variable ( token , points_to = owner_token , line_number = lineno ( el ) ) ) # Make a 'this'/'self' variable for use anywhere we need it that points to the class if isinstance ( parent , Group ) and parent . group_type in GROUP_TYPE . CLASS : variables . append ( Variable ( 'this' , parent , line_number = parent . line_number ) ) variables . append ( Variable ( 'self' , parent , line_number = parent . line_number ) ) return list ( filter ( None , variables ) )