def beginning_with(cmd, db):
  """Returns a list of commands that begin with the string cmd"""
  possibilities = []
  for shortcut in db.keys():
    if shortcut.startswith(cmd):
      possibilities.append(shortcut)
  return possibilities