def extensions(graph, path):
    """Returns a list of paths. Each path in the list should be a one-node
    extension of the input path, where an extension is defined as a path formed
    by adding a neighbor node (of the final node in the path) to the path.
    Returned paths should not have loops, i.e. should not visit the same node
    twice. The returned paths should be sorted in lexicographic order."""
    extensions = []
    neighbors = graph.get_neighbors(path[-1])
    
    for node in neighbors:
        temp_p = path.copy()
        if node not in path:
            temp_p.append(node)
            extensions.append(temp_p)
    return extensions