code: def merge_noun_chunks(doc: Doc) -> Doc:
      """Merge noun chunks into a single token.
  
      doc (Doc): The Doc object.
      RETURNS (Doc): The Doc object with merged noun chunks.
  
      DOCS: https://spacy.io/api/pipeline-functions#merge_noun_chunks
      """
      if not doc.has_annotation("DEP"):
          return doc
      with doc.retokenize() as retokenizer:
          for np in doc.noun_chunks:
              attrs = {"tag": np.root.tag, "dep": np.root.dep}
              retokenizer.merge(np, attrs=attrs)  # type: ignore[arg-type]
      return doc
  
imports: import warnings
  from typing import Any, Dict
  import srsly
  from ..None import util
  from ..errors import Warnings
  from ..language import Language
  from ..matcher import Matcher
  from ..tokens import Doc
label_desc: Use image node_id 1 for calling a global function with example usage: merge_noun_chunks(doc) and returns: doc, doc