code: def get_interval(note, interval, key='C'):
      
      intervals = map(lambda x: (notes.note_to_int(key) + x) % 12, [
          0,
          2,
          4,
          5,
          7,
          9,
          11,
          ])
      key_notes = keys.get_notes(key)
      for x in key_notes:
          if x[0] == note[0]:
              result = (intervals[key_notes.index(x)] + interval) % 12
      if result in intervals:
          return key_notes[intervals.index(result)] + note[1:]
      else:
          return notes.diminish(key_notes[intervals.index((result + 1) % 12)]
                                 + note[1:])
docs: Return the note an interval (in half notes) away from the given note.
  
      This will produce mostly theoretical sound results, but you should use
      the minor and major functions to work around the corner cases.