human
Here's a good function header given the following:
I wrote the below code

    if (not frappe.get_conf().developer_mode):
        raise Exception(u'Not    developer    mode')
    custom = {u'custom_fields': [], u'property_setters': [], u'custom_perms': [], u'doctype': doctype, u'sync_on_migrate': 1}
    def add(_doctype):
        custom[u'custom_fields'] += frappe.get_all(u'Custom    Field', fields=u'*', filters={u'dt': _doctype})
        custom[u'property_setters'] += frappe.get_all(u'Property    Setter', fields=u'*', filters={u'doc_type': _doctype})
    add(doctype)
    if with_permissions:
        custom[u'custom_perms'] = frappe.get_all(u'Custom    DocPerm', fields=u'*', filters={u'parent': doctype})
    for d in frappe.get_meta(doctype).get_table_fields():
        add(d.options)
    folder_path = os.path.join(get_module_path(module), u'custom')
    if (not os.path.exists(folder_path)):
        os.makedirs(folder_path)
    path = os.path.join(folder_path, (scrub(doctype) + u'.json'))
    with open(path, u'w') as f:
        f.write(frappe.as_json(custom))
    frappe.msgprint(_(u'Customizations    exported    to    {0}').format(path))

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

@frappe.whitelist()
def export_customizations(module, doctype, sync_on_migrate=0, with_permissions=0):