'Maps all functions in/under the given cursor to their count vectors
if they are defined in the given file.
:param cursor:   The cursor to traverse.
:param filename: Absolute path to the file.
:return:         The dictionary holding CountVectors for all variables
in all functions.'

def _get_vectors_for_cursor(self, cursor, filename):

    assert isinstance(cursor, Cursor)
    file = cursor.location.file
    if (file is not None):
        file = file.name
    if ((str(file) == str(filename)) and is_function_declaration(cursor)):
        self._get_vector_for_function(cursor)
        result = {(cursor.extent.start.line, get_identifier_name(cursor)): self.count_vectors}
        self.count_vectors = {}
        self.stack = []
    else:
        result = {}
        for child in cursor.get_children():
            result.update(self._get_vectors_for_cursor(child, filename))
    return result
