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`.

def dump(self, fp=sys.stdout, **kwargs):
        """ 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`.
        """
        fp.write(FILE_HEADER)
        fp.write(self.to_json(**kwargs))
        fp.write('\n')