docs: def serialize_example(transformed_json_data, features, feature_indices, target_name):
    """Makes an instance of data in libsvm format.
  
    Args:
      transformed_json_data: dict of transformed data.
      features: features config.
      feature_indices: output of feature_transforms.get_transformed_feature_indices()
  
    Returns:
      The text line representation of an instance in libsvm format.
    """
    import six
    import tensorflow as tf
    from trainer import feature_transforms
  
    line = str(transformed_json_data[target_name][0])
    for name, info in feature_indices:
      if features[name]['transform'] in [feature_transforms.IDENTITY_TRANSFORM,
                                         feature_transforms.SCALE_TRANSFORM]:
        line += ' %d:%s' % (info['index_start'], str(transformed_json_data[name][0]))
      elif features[name]['transform'] in [feature_transforms.ONE_HOT_TRANSFORM,
                                           feature_transforms.MULTI_HOT_TRANSFORM]:
        for i in range(info['size']):
          if i in transformed_json_data[name]:
            line += ' %d:1' % (info['index_start'] + i)
      elif features[name]['transform'] in [feature_transforms.IMAGE_TRANSFORM]:
        for i in range(info['size']):
          line += ' %d:%s' % (info['index_start'] + i, str(transformed_json_data[name][i]))
  
    return line