code: def __note_to_degree(
      key: Union[str, _IterableLike[str], Iterable[str]]
  ) -> Union[int, np.ndarray]:
      """Take a note name and return the degree of that note (e.g. 'C#' -> 1). We allow possibilities like "C#b".
  
      >>> librosa.__note_to_degree('B#')
      0
  
      >>> librosa.__note_to_degree('D♮##b')
      3
  
      >>> librosa.__note_to_degree(['B#','D♮##b'])
      array([0,3])
  
      """
      if not isinstance(key, str):
          return np.array([__note_to_degree(n) for n in key])
  
      match = NOTE_RE.match(key)
  
      if not match:
          raise ParameterError(f"Improper key format: {key:s}")
  
      letter = match.group("note").upper()
      accidental = match.group("accidental")
      pitch_map = {
          "C": 0,
          "D": 2,
          "E": 4,
          "F": 5,
          "G": 7,
          "A": 9,
          "B": 11,
      }
      counter = Counter(accidental)
      return (
          pitch_map[letter]
          + sum([ACC_MAP[acc] * counter[acc] for acc in ACC_MAP])
      ) % 12
  
imports: import re
  import numpy
  from numba import jit
  from collections import Counter
  from .intervals import INTERVALS
  from .._cache import cache
  from ..util.exceptions import ParameterError
  from typing import Dict, List, Iterable, Union, overload
  from ..util.decorators import vectorize
  from .._typing import _ScalarOrSequence, _FloatLike_co, _SequenceLike, _IterableLike
label_desc: Use image node_id 9 for calling a global function with example usage: __note_to_degree(key) and returns: unknown, np