code: def make_modified_input(
      ex: lit_types.JsonDict,
      overrides: lit_types.JsonDict,
      source: Optional[str] = None,
  ):
      """Make a modified (copy of) an input example.
  
      Prefer this to directly updating a dict, since this makes a copy and will
      reset the example ID if the values change.
  
      Args:
        ex: original example
        overrides: dict of new values
        source: optional source name (goes in _meta)
  
      Returns:
        ex or a modified copy
      """
      for k in overrides:
          if (k not in ex) or not _strict_numpy_equals(
              overrides[k], ex[k]
          ):
              new_example = dict(ex, **overrides)
              # If example was indexed, update the index info (_id and _meta).
              if "_id" in ex:
                  new_example["_id"] = ""
              if "_meta" in ex:
                  new_example["_meta"] = lit_types.InputMetadata(
                      added=True, parentId=ex.get("_id"), source=source
                  )
              return new_example
  
      return ex
  
imports: from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence
  import itertools
  import queue
  import threading
  import time
  from typing import Any, Optional, TypeVar, Union
  import uuid
  from lit_nlp.api import types
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: make_modified_input(ex, overrides, source) and returns: ex, new_example