def clean_files(files):
    if isinstance(files, (list, tuple)):
        for f in files:
            yield clean_file(f)
    else:
        yield clean_file(files)
This is a generator of tuples, where the first element is the file object
dataset/ETHPy150Open ipfs/py-ipfs-api/ipfsApi/utils.py/clean_files