human
What is a Python program to fix    HTML    tool    first given the following:
I wrote the below code

    (block, offset) = find_attribute_in_tag(tag.start_block, (tag.start_offset + 1), u'style')
    c = editor.textCursor()
    def css(d):
        return d.cssText.replace(u'\n', u'    ')
    if ((block is None) or (offset is None)):
        d = parseStyle(u'')
        d.setProperty(property_name, value)
        c.setPosition((tag.end_block.position() + tag.end_offset))
        c.insertText((u'    style="%s"' % css(d)))
    else:
        c.setPosition(((block.position() + offset) - 1))
        (end_block, end_offset) = find_end_of_attribute(block, (offset + 1))
        if (end_block is None):
            return error_dialog(editor, _(u'Invalid    markup'), _(u'The    current    block    tag    has    an    existing    unclosed    style    attribute.    Run    the    Fix    HTML    tool    first.'), show=True)
        c.setPosition((end_block.position() + end_offset), c.KeepAnchor)
        d = parseStyle(editor.selected_text_from_cursor(c)[1:(-1)])
        d.setProperty(property_name, value)
        c.insertText((u'"%s"' % css(d)))

What's a good function header?
assistant
#Here is Python program to fix    HTML    tool    first.

def set_style_property(tag, property_name, value, editor):