human
I wrote the below code

    greenthreads = []
    queue = eventlet.queue.LightQueue()
    results = {}
    def gather_result(cell_uuid, fn, *args, **kwargs):
        try:
            result = fn(*args, **kwargs)
        except Exception:
            LOG.exception('Error    gathering    result    from    cell    %s', cell_uuid)
            result = raised_exception_sentinel
        queue.put((cell_uuid, result))
    for cell_mapping in cell_mappings:
        with target_cell(context, cell_mapping) as cctxt:
            greenthreads.append((cell_mapping.uuid, utils.spawn(gather_result, cell_mapping.uuid, fn, cctxt, *args, **kwargs)))
    with eventlet.timeout.Timeout(timeout, exception.CellTimeout):
        try:
            while (len(results) != len(greenthreads)):
                (cell_uuid, result) = queue.get()
                results[cell_uuid] = result
        except exception.CellTimeout:
            pass
    for (cell_uuid, greenthread) in greenthreads:
        if (cell_uuid not in results):
            greenthread.kill()
            results[cell_uuid] = did_not_respond_sentinel
            LOG.warning('Timed    out    waiting    for    response    from    cell    %s', cell_uuid)
        else:
            greenthread.wait()
    return results

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

def scatter_gather_cells(context, cell_mappings, timeout, fn, *args, **kwargs):