def METHOD_NAME(obj, perms="rb"):
    if hasattr(obj, "read") and hasattr(obj, "seek"):
        obj.seek(0)
        yield obj
    else:
        if not os.path.exists(obj):
            raise CLEFileNotFoundError("%r is not a valid path" % obj)
        with open(obj, perms) as f:
            yield f