code: def dump(self, fp=sys.stdout, **kwargs):
          
          fp.write(FILE_HEADER)
          fp.write(self.to_json(**kwargs))
          fp.write('\n')
docs: Serialize this keymap as a JSON formatted stream to the *fp*.
  
          Arguments:
              fp: A ``.write()``-supporting file-like object to write the
                  generated JSON to (default is ``sys.stdout``).
              **kwargs: Options to be passed into :func:`json.dumps`.