code: def read_update_cfg(config_path, opt):
      assert os.path.exists(config_path), "{} is not existed.".format(
          config_path
      )
      assert opt.startswith(
          "op.seg.local_service_conf.devices"
      ), "Only support using opt to set op.seg.local_service_conf.devices"
  
      with io.open(config_path, encoding="utf-8") as f:
          config = yaml.load(f.read(), yaml.FullLoader)
  
      devices = opt.replace("op.seg.local_service_conf.devices=", "")
      if devices == "":
          devices = None
      config["op"]["seg"]["local_service_conf"]["devices"] = devices
      return config
  
imports: import io
  import os
  import sys
  import base64
  import argparse
  import yaml
  import numpy
  from PIL import Image
  from paddle_serving_server.web_service import WebService, Op
  from preprocess_ops import ResizeImage, CenterCropImage, NormalizeImage, ToCHW, Compose
label_desc: Use image node_id 2 for calling a global function with example usage: read_update_cfg(config_path, opt) and returns: config