code: def preserve_case(token: Token) -> bool:
      """
      Return True if ``token`` is a proper noun or acronym; otherwise, False.
  
      Raises:
          ValueError: If parent document has not been POS-tagged.
      """
      if token.doc.has_annotation("TAG") is False:
          raise ValueError(
              f"parent doc of token '{token}' has not been POS-tagged"
          )
      # is_acronym() got moved into a subpkg with heavier dependencies that we don't
      # want imported at the top-level package; this is the only outside place
      # that uses that function, so let's hide the required import in this function
      # using a try/except for performance
      # not the prettiest solution, but should be alright
      try:
          acros.is_acronym
      except NameError:
          from textacy.extract import acros
      if token.pos == PROPN or acros.is_acronym(token.text):
          return True
      else:
          return False
  
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 3 for calling a global function with example usage: preserve_case(token) and returns: True, False