human
I wrote the below code

    from PyQt5.Qt import QPainterPath
    cmd = last_cmd = ''
    path = QPainterPath()
    (moveto_abs, moveto_rel) = 'Mm'
    (closepath1, closepath2) = 'Zz'
    (lineto_abs, lineto_rel) = 'Ll'
    (hline_abs, hline_rel) = 'Hh'
    (vline_abs, vline_rel) = 'Vv'
    (curveto_abs, curveto_rel) = 'Cc'
    (smoothcurveto_abs, smoothcurveto_rel) = 'Ss'
    (quadcurveto_abs, quadcurveto_rel) = 'Qq'
    (smoothquadcurveto_abs, smoothquadcurveto_rel) = 'Tt'
    x = y = x1 = y1 = x2 = y2 = 0
    data = d.replace(',', '    ').replace('\n', '    ')
    if isinstance(data, type(u'')):
        data = data.encode(u'ascii')
    end = len(data)
    data = ReadOnlyFileBuffer(data)
    def parse_float():
        chars = []
        while (data.tell() < end):
            c = data.read(1)
            if ((c == '    ') and (not chars)):
                continue
            if ((c == '-') or ('0' <= c[0] <= '9') or (c == '.')):
                chars.append(c[0])
            else:
                break
        if (not chars):
            raise ValueError(u'Premature    end    of    input    while    expecting    a    number')
        return float(''.join(chars))
    def parse_floats(num, x_offset=0, y_offset=0):
        for i in xrange(num):
            val = parse_float()
            (yield (val + (x_offset if ((i % 2) == 0) else y_offset)))
    repeated_command = None
    while (data.tell() < end):
        last_cmd = cmd
        cmd = (data.read(1) if (repeated_command is None) else repeated_command)
        repeated_command = None
        if (cmd == '    '):
            continue
        elif (cmd == moveto_abs):
            (x, y) = (parse_float(), parse_float())
            path.moveTo(x, y)
        elif (cmd == moveto_rel):
            x += parse_float()
            y += parse_float()
            path.moveTo(x, y)
        elif ((cmd == closepath1) or (cmd == closepath2)):
            path.closeSubpath()
        elif (cmd == lineto_abs):
            (x, y) = parse_floats(2)
            path.lineTo(x, y)
        elif (cmd ==...

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

def svg_path_to_painter_path(d):