def list_dir(base, recursive=True):
    if recursive:
        for root, dirnames, filenames in walk(base):
            for filename in filenames:
                yield abspath(join(root, filename))
    else:
        for f in listdir(base):
            yield abspath(f)
Generator function to iterates a directory
dataset/ETHPy150Open thasso/pyjip/jip/utils.py/list_dir