def _fmt_complex(name, *items, **params):
    """Format a complex item.  A complex item takes a set of arguments
    as well as nested items.

    *items contains the items to include in this item.  They can be
    simple items or other complex items.

    "args" is a keyword parameter that contains the arguments for this
    complex item.  They are unlabeled and rendered as a
    comma-separated at the top of the item.

    """
    # If there are arguments, then format them and add them to the
    # list of items.
    if "args" in params:
        x = ", ".join(map(str, params["args"]))
        items = [x] + list(items)

    # Do the formatting.
    items = [x for x in items if x]
    if not items:
        return ""
    if len(items) == 1:
        return "%s { %s }" % (name, items[0])
    s = "%s {\n" % name
    for x in items:
        x = str(x).strip()
        x = x.replace("\n", "\n  ")  # indent each line in x.
        x = "  %s\n" % x
        s += x
    s += "}\n"
    return s