docs: public static <I, O> List<Example<DynamicAssignment, DynamicAssignment>> reformatTrainingData(
        List<? extends TaggedSequence<I, O>> sequences, FeatureVectorGenerator<LocalContext<I>> featureGen,
        Function<? super LocalContext<I>, ? extends Object> inputGen, DynamicVariableSet modelVariables,
        I startInput, O startLabel) {
      Preconditions.checkArgument(!(startInput == null ^ startLabel == null));
  
      DynamicVariableSet plate = modelVariables.getPlate(PLATE_NAME);
      VariableNumMap x = plate.getFixedVariables().getVariablesByName(INPUT_FEATURES_NAME);
      VariableNumMap xInput = plate.getFixedVariables().getVariablesByName(INPUT_NAME);
      VariableNumMap y = plate.getFixedVariables().getVariablesByName(OUTPUT_NAME);
  
      List<Example<DynamicAssignment, DynamicAssignment>> examples = Lists.newArrayList();
      for (TaggedSequence<I, O> sequence : sequences) {
        List<Assignment> inputs = Lists.newArrayList();
        
        if (startInput != null) {
          List<I> newItems = Lists.newArrayList();
          newItems.add(startInput);
          newItems.addAll(sequence.getItems());
          LocalContext<I> startContext = new ListLocalContext<I>(newItems, 0);
          
          Assignment inputFeatureVector = x.outcomeArrayToAssignment(featureGen.apply(startContext));
          Assignment inputElement = xInput.outcomeArrayToAssignment(inputGen.apply(startContext));
          Assignment firstLabel = y.outcomeArrayToAssignment(startLabel);
          inputs.add(Assignment.unionAll(inputFeatureVector, inputElement, firstLabel));
        }
        
        List<LocalContext<I>> contexts = sequence.getLocalContexts();
        for (int i = 0; i < contexts.size(); i++) {
          Assignment inputFeatureVector = x.outcomeArrayToAssignment(featureGen.apply(contexts.get(i)));
          Assignment inputElement = xInput.outcomeArrayToAssignment(inputGen.apply(contexts.get(i)));
          inputs.add(inputFeatureVector.union(inputElement));
        }
        DynamicAssignment input = DynamicAssignment.createPlateAssignment(PLATE_NAME, inputs);
  
        DynamicAssignment output = DynamicAssignment.EMPTY;
        if (sequence.getLabels() != null) {
          List<Assignment> outputs = Lists.newArrayList();
          
          if (startInput != null) {
            // First label is given (and equal to the special start label).
            outputs.add(Assignment.EMPTY);
          }
  
          List<O> labels = sequence.getLabels();
          for (int i = 0; i < contexts.size(); i++) {
            outputs.add(y.outcomeArrayToAssignment(labels.get(i)));
          }
          output = DynamicAssignment.createPlateAssignment(PLATE_NAME, outputs);
        }
        examples.add(Example.create(input, output));
      }
  
      return examples;
    }