code: def get_span_for_compound_noun(noun: Token) -> tuple[int, int]:
      """Return document indexes spanning all (adjacent) tokens in a compound noun."""
      min_i = noun.i - sum(
          1
          for _ in itertools.takewhile(
              lambda x: x.dep_ == "compound", reversed(list(noun.lefts))
          )
      )
      return (min_i, noun.i)
  
imports: from __future__ import annotations
  import functools
  import itertools
  import pathlib
  from typing import Iterable, Union
  from cachetools import cached
  from cachetools.keys import hashkey
  from spacy import attrs
  from spacy.language import Language
  from spacy.morphology import Morphology
  from spacy.pipeline import Morphologizer
  from spacy.symbols import PROPN, VERB
  from spacy.tokens import Doc, Span, Token
  from ..None import cache, constants, errors, types, utils
  from .None import core
label_desc: Use image node_id 9 for calling a global function with example usage: get_span_for_compound_noun(noun) and returns: min_i,  noun