def remove_duplicated_imports(partitions):
    def _inner():
        seen = set()
        for partition in partitions:
            if partition.code_type is CodeType.IMPORT:
                import_obj = import_obj_from_str(partition.src)
                if import_obj not in seen:
                    seen.add(import_obj)
                    yield partition
            else:
                yield partition
    return list(_inner())
dataset/ETHPy150Open asottile/reorder_python_imports/reorder_python_imports/main.py/remove_duplicated_imports/original