code: def remove_feed_fetch_op(program: paddle.static.Program):
      """Remove feed and fetch operator and variable for fine-tuning."""
      block = program.global_block()
      need_to_remove_op_index = []
  
      for i, op in enumerate(block.ops):
          if op.type == "feed" or op.type == "fetch":
              need_to_remove_op_index.append(i)
  
      for index in need_to_remove_op_index[::-1]:
          block._remove_op(index)
  
      need_to_remove_var = []
      for var in block.vars:
          if var.endswith("feed"):
              need_to_remove_var.append(var)
          if var.endswith("fetch"):
              need_to_remove_var.append(var)
  
      for var in need_to_remove_var:
          block._remove_var(var)
  
      program.desc.flush()
  
file_path: PaddleHub/paddlehub/compat/paddle_utils.py
imports: import contextlib
  import copy
  from typing import Callable
  from typing import List
  import paddle
  from paddle.framework import core
  from paddlehub.utils.utils import Version
label_desc: Use image node_id 3 for calling a global function with example usage: remove_feed_fetch_op(program) without return types