code: def get_key_signature(key='C'):
      
      if not is_valid_key(key):
          raise NoteFormatError("unrecognized format for key '%s'" % key)
  
      for couple in keys:
          if key in couple:
              accidentals = keys.index(couple) - 7
              return accidentals
docs: Return the key signature.
  
      0 for C or a, negative numbers for flat key signatures, positive numbers
      for sharp key signatures.