code: def constr_test_transforms(pipeline, is_list=False):
      if not is_list:
          test_pipeline = copy.deepcopy(pipeline)
          transforms = pipeline.transforms
      else:
          transforms = pipeline
      test_transforms = []
      for tf in transforms:
          if (
              hasattr(tf, _ATTR_NAME)
              and getattr(tf, _ATTR_NAME) is True
          ):
              continue
          test_transforms.append(tf)
      if isinstance(test_transforms[-1], T.Collect):
          logger.warning(
              "Reset `Collect` to collect input images only."
          )
          test_transforms[-1] = T.Collect(["img"])
      if not is_list:
          test_pipeline.transforms = test_transforms
          return test_pipeline
      else:
          return test_transforms
  
imports: import copy
  import paddleseg
  from paddleseg.utils import logger
  import paddlepanseg.transforms
label_desc: Use image node_id 1 for calling a global function with example usage: constr_test_transforms(pipeline, is_list) and returns: test_pipeline, test_transforms