def merge_single_batch(batch):
  """Merges batched input examples to proper batch format."""
  batch_size = len(batch)
  result = {}
  for idx, example in enumerate(batch):
    for feature in example:
      if feature not in result:
        # New feature. Initialize the list with None.
        result[feature] = [None] * batch_size
      result[feature][idx] = example[feature]
  return result