human
I wrote the below code

    datasets = data_dict.get('datasets', [])
    org_id = data_dict.get('org_id')
    model = context['model']
    model.Session.query(model.package_table).filter(model.Package.id.in_(datasets)).filter((model.Package.owner_org == org_id)).update(update_dict, synchronize_session=False)
    model.Session.query(model.package_revision_table).filter(model.PackageRevision.id.in_(datasets)).filter((model.PackageRevision.owner_org == org_id)).filter((model.PackageRevision.current is True)).update(update_dict, synchronize_session=False)
    model.Session.commit()
    psi = search.PackageSearchIndex()
    BATCH_SIZE = 50
    def process_solr(q):
        query = search.PackageSearchQuery()
        q = {'q': q, 'fl': 'data_dict', 'wt': 'json', 'fq': ('site_id:"%s"' % config.get('ckan.site_id')), 'rows': BATCH_SIZE}
        for result in query.run(q)['results']:
            data_dict = json.loads(result['data_dict'])
            if (data_dict['owner_org'] == org_id):
                data_dict.update(update_dict)
                psi.index_package(data_dict, defer_commit=True)
    count = 0
    q = []
    for id in datasets:
        q.append(('id:"%s"' % id))
        count += 1
        if ((count % BATCH_SIZE) == 0):
            process_solr('    OR    '.join(q))
            q = []
    if len(q):
        process_solr('    OR    '.join(q))
    psi.commit()

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

def _bulk_update_dataset(context, data_dict, update_dict):