code: def clone_program(
      origin_program: paddle.static.Program, for_test: bool = False
  ) -> paddle.static.Program:
      dest_program = paddle.static.Program()
  
      _copy_vars_and_ops_in_blocks(
          origin_program.global_block(), dest_program.global_block()
      )
  
      dest_program = dest_program.clone(for_test=for_test)
      if not for_test:
          for name, var in origin_program.global_block().vars.items():
              dest_program.global_block().vars[
                  name
              ].stop_gradient = var.stop_gradient
  
      return dest_program
  
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 7 for calling a global function with example usage: clone_program(origin_program, for_test) and returns: dest_program