code: def _scale_degrees():
      r'''Mapping from scale degrees (str) to semitones (int).'''
      degrees = ['1', '2', '3',  '4',  '5',  '6', '7',
                 '8', '9', '10', '11', '12', '13']
      semitones = [0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21]
      return dict([(d, s) for d, s in zip(degrees, semitones)]f _scale_degrees():
      r'''Mapping from scale degrees (str) to semitones (int).'''
      degrees = ['1', '2', '3',  '4',  '5',  '6', '7',
                 '8', '9', '10', '11', '12', '13']
      semitones = [0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21]
      return dict([(d, s) for d, s in zip(degrees, semitones)])
docs: r'''Mapping from scale degrees (str) to semitones (int).