code: def modify(base_pitch, modifier):
      """
      Modify a pitch class in integer representation by a given modifier string.
  
      A modifier string can be any sequence of 'b' (one semitone down)
      and '#' (one semitone up).
  
      Parameters
      ----------
      base_pitch : int
          Pitch class as integer.
      modifier : str
          String of modifiers ('b' or '#').
  
      Returns
      -------
      modified_pitch : int
          Modified root note.
  
      """
      for m in modifier:
          if m == "b":
              base_pitch -= 1
          elif m == "#":
              base_pitch += 1
          else:
              raise ValueError("Unknown modifier: {}".format(m))
      return base_pitch
  
imports: import numpy
  from .None import evaluation_io, EvaluationMixin
  from ..io import load_chords
label_desc: Use image node_id 4 for calling a global function with example usage: modify(base_pitch, modifier) and returns: base_pitch