human
I wrote the below code

    def _attr(node, attribute, default=''):
        return (node.getAttribute(attribute) or default)
    from xml.dom.minidom import parseString
    dom = parseString(encode_utf8(xml))
    a = dom.getElementsByTagName('table')
    b = dom.getElementsByTagName('query')
    if (len(a) > 0):
        table = (table or _attr(a[0], 'name', ''))
    if (len(b) > 0):
        table = (table or _attr(b[0], 'table', ''))
    (fields, schema, rows) = ([], [], [])
    for f in dom.getElementsByTagName('field'):
        fields.append(_attr(f, 'name'))
        schema.append(_field(name=field(_attr(f, 'name')), type=(((_attr(f, 'type') == STRING) and STRING(int(_attr(f, 'length', 255)))) or _attr(f, 'type')), default=_attr(f, 'default', None), index=_attr(f, 'index', False), optional=(_attr(f, 'optional', True) != 'no')))
        if ((_attr(f, 'index') == PRIMARY) and (_attr(f, 'type') == INTEGER)):
            fields.pop()
    for r in dom.getElementsByTagName('row'):
        rows.append({})
        for (i, f) in enumerate(fields):
            v = _attr(r, f, None)
            if (schema[i][1] == BOOLEAN):
                rows[(-1)][f] = (0, 1)[(v != 'no')]
            else:
                rows[(-1)][f] = v
    if (database.connected is False):
        database.connect()
    if (table in database):
        raise TableError(("table    '%s'    already    exists" % table))
    database.create(table, fields=schema)
    for r in rows:
        database[table].insert(r, commit=False)
    database.commit()
    return database[table]

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def parse_xml(database, xml, table=None, field=(lambda s: s.replace('.', '-'))):