def remove_imports(partitions, to_remove=()):
    to_remove_imports = set(
        import_obj_from_str(imp_statement) for imp_statement in to_remove
    )

    def _inner():
        for partition in partitions:
            if (
                    partition.code_type is not CodeType.IMPORT or
                    import_obj_from_str(partition.src) not in to_remove_imports
            ):
                yield partition

    return list(_inner())
dataset/ETHPy150Open asottile/reorder_python_imports/reorder_python_imports/main.py/remove_imports/original