code: def test_apply(self):
      ds = DataSet({"x": [[1, 2, 3, 4]] * 4000, "y": [[5, 6]] * 4000})
      ds.apply(
          lambda ins: ins["x"][::-1],
          new_field_name="rx",
          progress_desc="rx",
      )
      assert ("rx" in ds.field_arrays) == True
      assert ds.field_arrays["rx"].content[0] == [4, 3, 2, 1]
  
      ds.apply(
          lambda ins: len(ins["y"]),
          new_field_name="y",
          progress_bar=None,
      )
      assert ds.field_arrays["y"].content[0] == 2
  
      res = ds.apply(
          lambda ins: len(ins["x"]), num_proc=0, progress_desc="len"
      )
      assert (isinstance(res, list) and len(res) > 0) == True
      assert res[0] == 4
  
      ds.apply(
          lambda ins: (len(ins["x"]), "hahaha"), new_field_name="k"
      )
  
imports: import os
  import pytest
  import numpy
  from fastNLP.core.dataset import DataSet, FieldArray, Instance, ApplyResultException
  from fastNLP import logger
label_desc: Use image node_id 15 for calling the TestDataSetMethods obj's underlying member method code with example usage: obj.test_apply() without return types