code: def _local_test_add_padding_shape_and_type(
      self,
      data,
      start_pad_width,
      end_pad_width,
      ret_lengths,
      lengths=None,
  ):
      if ret_lengths and lengths is None:
          return
  
      workspace.ResetWorkspace()
      workspace.FeedBlob("data", data)
      if lengths is not None:
          workspace.FeedBlob(
              "lengths", np.array(lengths).astype(np.int32)
          )
  
      op = core.CreateOperator(
          "AddPadding",
          ["data"] if lengths is None else ["data", "lengths"],
          ["output", "lengths_out"] if ret_lengths else ["output"],
          padding_width=start_pad_width,
          end_padding_width=end_pad_width,
      )
  
      add_padding_net = core.Net("add_padding_net")
      add_padding_net.Proto().op.extend([op])
      assert workspace.RunNetOnce(
          add_padding_net
      ), "Failed to run the add_padding_net"
  
      shapes, types = workspace.InferShapesAndTypes(
          [add_padding_net],
      )
  
      expected_shape = list(data.shape)
      expected_shape[0] += (1 if lengths is None else len(lengths)) * (
          start_pad_width + end_pad_width
      )
      self.assertEqual(shapes["output"], expected_shape)
      self.assertEqual(types["output"], core.DataType.FLOAT)
      if ret_lengths:
          if lengths is None:
              self.assertEqual(shapes["lengths_out"], [1])
          else:
              self.assertEqual(shapes["lengths_out"], [len(lengths)])
          self.assertEqual(types["lengths_out"], core.DataType.INT32)
  
imports: from caffe2.python import core
  from functools import partial
  from hypothesis import given, settings
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  import hypothesis.strategies
  import numpy
  import unittest
  from caffe2.python import workspace
label_desc: Use image node_id 2 for calling the TestSequenceOps obj's underlying member method code with example usage: obj._local_test_add_padding_shape_and_type(data, start_pad_width, end_pad_width, ret_lengths, lengths) without return types