def plfrompd(pd, trim=True):
    """
    This function takes a path dictionary and returns a simple list of paths
    in that dictionary by iterating through the keys of the dictionary.

    There is a parameter to trim self loops from the dictionary.
    """
    paths = []
    for s in pd:
        for d in pd[s]:
            if not trim or s != d:
                paths.append(pd[s][d])
    return paths