human
I wrote the below code

    def decode_record(record):
        'Serialized    Example    to    dict    of    <feature    name,    Tensor>.'
        example_serialized = record
        item_decoders = data_items_to_decoders
        if (item_decoders is None):
            item_decoders = {field: tf.contrib.slim.tfexample_decoder.Tensor(field) for field in data_fields_to_features}
        decoder = tf.contrib.slim.tfexample_decoder.TFExampleDecoder(data_fields_to_features, item_decoders)
        decode_items = data_items_to_decode
        if (decode_items is None):
            decode_items = list(item_decoders)
        decoded = decoder.decode(example_serialized, items=decode_items)
        return dict(zip(decode_items, decoded))
    with tf.name_scope('examples_in'):
        data_files = tf.contrib.slim.parallel_reader.get_data_files(data_sources)
        num_readers = min((4 if training else 1), len(data_files))
        (_, example_serialized) = tf.contrib.slim.parallel_reader.parallel_read(data_sources, tf.TFRecordReader, num_epochs=(None if training else 1), shuffle=training, capacity=(2 * capacity), min_after_dequeue=capacity, num_readers=num_readers)
        return decode_record(example_serialized)

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

def examples_reader(data_sources, data_fields_to_features, training, capacity=32, data_items_to_decoders=None, data_items_to_decode=None):