code: def chord(label):
      """
      Transform a chord label into the internal numeric representation of
      (root, bass, intervals array) as defined by `CHORD_DTYPE`.
  
      Parameters
      ----------
      label : str
          Chord label.
  
      Returns
      -------
      chord : tuple
          Numeric representation of the chord: (root, bass, intervals array).
  
      """
      if label == "N":
          return NO_CHORD
      if label == "X":
          return UNKNOWN_CHORD
  
      c_idx = label.find(":")
      s_idx = label.find("/")
  
      if c_idx == -1:
          quality_str = "maj"
          if s_idx == -1:
              root_str = label
              bass_str = ""
          else:
              root_str = label[:s_idx]
              bass_str = label[s_idx + 1 :]
      else:
          root_str = label[:c_idx]
          if s_idx == -1:
              quality_str = label[c_idx + 1 :]
              bass_str = ""
          else:
              quality_str = label[c_idx + 1 : s_idx]
              bass_str = label[s_idx + 1 :]
  
      root = pitch(root_str)
      bass = interval(bass_str) if bass_str else 0
      ivs = chord_intervals(quality_str)
      ivs[bass] = 1
  
      return root, bass, ivs
  
imports: import numpy
  from .None import evaluation_io, EvaluationMixin
  from ..io import load_chords
label_desc: Use image node_id 3 for calling a global function with example usage: chord(label) and returns: root,  bass,  ivs, NO_CHORD, UNKNOWN_CHORD