code: def test_add_seq_len():
      dataset1 = DataSet(
          {"x": [[0, 1, 2], [5, 3, 2, 3], [5, 21, 5, 10], [3, 6, 8, 1]]}
      )
      dataset2 = DataSet(
          {
              "x": [
                  [0, 1, 2, 3, 4],
                  [5, 3, 2, 3],
                  [5, 20, 45, 1, 98],
                  [3, 6, 8, 3, 6, 31],
              ]
          }
      )
      dataset3 = DataSet(
          {"x": [[0, 1, 2, 7, 5, 2], [5, 3], [0], [3, 6, 8]]}
      )
      data_bundle = DataBundle(
          datasets={
              "dataset1": dataset1,
              "dataset2": dataset2,
              "dataset3": dataset3,
          }
      )
      data_bundle.add_seq_len("x")
      print(data_bundle.get_dataset("dataset1"))
      for i, data in enumerate(data_bundle.get_dataset("dataset1")):
          print(data["seq_len"], dataset1["x"][i])
          assert data["seq_len"] == len(dataset1["x"][i])
      for i, data in enumerate(data_bundle.get_dataset("dataset2")):
          assert data["seq_len"] == len(dataset2["x"][i])
      for i, data in enumerate(data_bundle.get_dataset("dataset3")):
          assert data["seq_len"] == len(dataset3["x"][i])
  
imports: import pytest
  from fastNLP.core.dataset import DataSet
  from fastNLP.io.data_bundle import DataBundle
label_desc: Use image node_id 1 for calling a global function with example usage: test_add_seq_len() without return types