code: def update_cli_config(
      cli_config_file_path, env_name, operator_endpoint
  ):
      new_env = {
          "name": env_name,
          "operator_endpoint": operator_endpoint,
      }
  
      try:
          with open(cli_config_file_path, "r") as f:
              cli_config = yaml.safe_load(f)
              if cli_config is None:
                  raise Exception("blank cli config file")
      except:
          cli_config = {"environments": [new_env]}
          with open(cli_config_file_path, "w") as f:
              yaml.dump(cli_config, f, default_flow_style=False)
          return
  
      if len(cli_config.get("environments", [])) == 0:
          cli_config["environments"] = [new_env]
          with open(cli_config_file_path, "w") as f:
              yaml.dump(cli_config, f, default_flow_style=False)
          return
  
      replaced = False
      for i, prev_env in enumerate(cli_config["environments"]):
          if prev_env.get("name") == env_name:
              cli_config["environments"][i] = new_env
              replaced = True
              break
  
      if not replaced:
          cli_config["environments"].append(new_env)
  
      with open(cli_config_file_path, "w") as f:
          yaml.dump(cli_config, f, default_flow_style=False)
  
label_desc: Use image node_id 1 for calling a global function with example usage: update_cli_config(cli_config_file_path, env_name, operator_endpoint) without return types