def METHOD_NAME(symbols_map, includes_map):
    """ Generate json-formatted strings in .imp format.
    This should ideally return a jsonable structure instead, and use json.dump
    to write it to the output file directly. But there doesn't seem to be a
    simple way to convince Python's json library to generate a "packed"
    formatting, it always prefers to wrap dicts onto multiple lines.
    Cheat, and use json.dumps for escaping and build a string instead.
    """
    def jsonline(mapping, indent):
        return (indent * " ") + json.dumps(mapping)
    for symbol, header in symbols_map:
        map_to = "<" + header + ">"
        yield jsonline({"symbol": [symbol, "private", map_to, "public"]},
                       indent=2)
    for module, include, header in includes_map:
        # Use regex map-from to match both quoted and angled includes and
        # optional directory prefix (e.g. <QtCore/qnamespace.h> is equivalent to
        # "qnamespace.h").
        map_from = r'@["<](%s/)?%s\.h[">]' % (module, include)
        map_to = "<" + header + ">"
        yield jsonline({"include": [map_from, "private", map_to, "public"]},
                       indent=2)