code: def update_options(
      original_options: Dict[str, Any], new_options: Dict[str, Any]
  ) -> Dict[str, Any]:
      """Update original options with new options and return.
      The returned updated options contain shallow copy of original options.
      """
  
      updated_options = {**original_options, **new_options}
      # Ensure we update each namespace in "_metadata" independently.
      # "_metadata" is a dict like {namespace1: config1, namespace2: config2}
      if (
          original_options.get("_metadata") is not None
          and new_options.get("_metadata") is not None
      ):
          # make a shallow copy to avoid messing up the metadata dict in
          # the original options.
          metadata = original_options["_metadata"].copy()
          for namespace, config in new_options["_metadata"].items():
              metadata[namespace] = {
                  **metadata.get(namespace, {}),
                  **config,
              }
  
          updated_options["_metadata"] = metadata
  
      return updated_options
  
file_path: ray/python/ray/_private/ray_option_utils.py
imports: import warnings
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, Optional, Tuple, Union
  import ray
  from ray._private import ray_constants
  from ray._private.utils import get_ray_doc_version
  from ray.util.placement_group import PlacementGroup
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy, PlacementGroupSchedulingStrategy, NodeLabelSchedulingStrategy
label_desc: Use image node_id 10 for calling a global function with example usage: update_options(original_options, new_options) and returns: updated_options