human
I wrote the below code

    def inst_key(inst, vars):
        return tuple((str(inst[var]) for var in vars))
    instance_groups = [inst_key(inst, groupvarlist) for inst in table]
    groups = list(unique(instance_groups))
    group_names = [',    '.join(group) for group in groups]
    instance_ids = [inst_key(inst, idvarlist) for inst in table]
    ids = list(unique(instance_ids))
    inst_by_id = defaultdict(list)
    id_by_inst = defaultdict(list)
    for i in range(len(table)):
        inst_id = instance_ids[i]
        inst_by_id[inst_id].append(i)
        id_by_inst[i] = inst_id
    newfeatures = []
    newclass_vars = []
    newmetas = []
    expanded_features = {}
    def expanded(feat):
        return [copy_descriptor(feat, newname=('%s    (%s)' % (feat.name, group_name))) for group_name in group_names]
    for feat in table.domain.attributes:
        if (feat in varlist):
            features = expanded(feat)
            newfeatures.extend(features)
            expanded_features[feat] = dict(zip(groups, features))
        elif (feat not in groupvarlist):
            newfeatures.append(feat)
    for feat in table.domain.class_vars:
        if (feat in varlist):
            features = expanded(feat)
            newclass_vars.extend(features)
            expanded_features[feat] = dict(zip(groups, features))
        elif (feat not in groupvarlist):
            newclass_vars.append(feat)
    for meta in table.domain.metas:
        if (meta in varlist):
            metas = expanded(meta)
            newmetas.extend(metas)
            expanded_features[meta] = dict(zip(groups, metas))
        elif (meta not in groupvarlist):
            newmetas.append(meta)
    domain = Orange.data.Domain(newfeatures, newclass_vars, newmetas)
    prototype_indices = [inst_by_id[inst_id][0] for inst_id in ids]
    newtable = table[prototype_indices].transform(domain)
    in_expanded = set((f for efd in expanded_features.values() for f in efd.values()))
    for var in (domain.variables + domain.metas):
        if ((var in idvarlist) or (var in...

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

def reshape_wide(table, varlist, idvarlist, groupvarlist):