def clean_file(f):
    if not hasattr(f, 'read'):
        return open(f, 'rb'), True
    else:
        return f, False
Returns a file object.
dataset/ETHPy150Open ipfs/py-ipfs-api/ipfsApi/utils.py/clean_file