code: def split(self, data, lengths, indices=None):
      K = len(lengths)
      outputs = [
          np.zeros(
              (lengths[seg_id],) + data.shape[1:], dtype=data.dtype
          )
          for seg_id in range(0, K)
      ]
      start = 0
      for i in range(0, K):
          for j in range(0, lengths[i]):
              data_index = start + j
              if indices is not None:
                  data_index = indices[data_index]
              outputs[i][j] = data[data_index]
          start += lengths[i]
      return outputs
  
imports: from functools import partial
  from hypothesis import given, settings
  import numpy
  import unittest
  import hypothesis.strategies
  from caffe2.python import core, workspace
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
label_desc: Use image node_id 1 for calling the LengthsTester obj's underlying member method code with example usage: obj.split(data, lengths, indices) and returns: outputs