code: def knp_dependency_parser(doc: Doc) -> Doc:
      tag_spans: Iterable[Span] = doc._.get(KNP_USER_KEYS.tag.spans)
      s = []
      for tag in tag_spans:
          for c in tag[1:]:
              c.head = tag[0]
              c.dep_ = _get_child_dep(c)
          parent: Optional[Span] = tag._.get(KNP_USER_KEYS.tag.parent)
          if parent is not None:
              tag[0].head = parent[0]
              tag[0].dep_ = _get_dep(tag[0])
          else:
              tag[0].head = tag[0]
              tag[0].dep_ = "ROOT"
          s.append(tag[0])
      s = _modify_head_punct(s)
      s = _modify_head_flat(s)
      s = _modify_head_conj(s)
      doc.is_parsed = True
      return doc
  
file_path: camphr/packages/camphr_knp/camphr_knp/dependency_parser.py
imports: from typing import Any, Dict, Iterable, Optional, List
  import spacy
  from spacy.symbols import ADJ, ADP, ADV, AUX, CCONJ, DET, NOUN, NUM, PART, PRON, PUNCT, VERB
  from spacy.tokens import Doc, Span, Token
  from camphr_knp import KNP_USER_KEYS
label_desc: Use image node_id 1 for calling a global function with example usage: knp_dependency_parser(doc) and returns: doc