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

    def _replica_device_setter(worker_device):
        if (FLAGS.ps_replicas == 0):
            return worker_device
        return tf.train.replica_device_setter(worker_device=worker_device, ps_tasks=FLAGS.ps_replicas, ps_device=((FLAGS.ps_job + '/GPU:0') if (FLAGS.ps_gpu > 0) else FLAGS.ps_job))
    if (FLAGS.schedule == 'local_run'):
        assert (not FLAGS.sync)
        datashard_devices = [('gpu:%d' % d) for d in _gpu_order(FLAGS.worker_gpu)]
        if (FLAGS.locally_shard_to_cpu or (FLAGS.worker_gpu < 1)):
            datashard_devices += ['cpu:0']
        caching_devices = None
    elif FLAGS.sync:
        assert (FLAGS.ps_replicas > 0)
        datashard_devices = [_replica_device_setter(d) for d in ps_devices(all_workers=all_workers)]
        if ((FLAGS.ps_gpu > 0) and (FLAGS.ps_replicas > 1)):
            caching_devices = [(FLAGS.ps_job + ('/task:%d/cpu:0' % d)) for (d, _) in _ps_gpus(all_workers=all_workers)]
        else:
            caching_devices = None
    elif (FLAGS.worker_gpu > 1):
        datashard_devices = [_replica_device_setter((FLAGS.worker_job + ('/GPU:%d' % d))) for d in _gpu_order(FLAGS.worker_gpu)]
        caching_devices = ([(FLAGS.worker_job + '/GPU:0')] * FLAGS.worker_gpu)
    else:
        datashard_devices = [_replica_device_setter(FLAGS.worker_job)]
        caching_devices = None
    tf.logging.info('datashard_devices:    %s', datashard_devices)
    tf.logging.info('caching_devices:    %s', caching_devices)
    return eu.Parallelism(datashard_devices, reuse=True, caching_devices=caching_devices, daisy_chain_variables=FLAGS.daisy_chain_variables)

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

def data_parallelism(all_workers=False):