code: def set_op_attr(
      program: paddle.static.Program, is_test: bool = False
  ):
      for block in program.blocks:
          for op in block.ops:
              if not op.has_attr("is_test"):
                  continue
  
              op._set_attr("is_test", is_test)
  
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 9 for calling a global function with example usage: set_op_attr(program, is_test) without return types