code: def test_transform_batch(self):
      pdf = pd.DataFrame(
          {
              "a": [1, 2, 3, 4, 5, 6] * 100,
              "b": [1.0, 1.0, 2.0, 3.0, 5.0, 8.0] * 100,
              "c": [1, 4, 9, 16, 25, 36] * 100,
          },
          columns=["a", "b", "c"],
          index=np.random.rand(600),
      )
      psdf = ps.DataFrame(pdf)
  
      self.assert_eq(
          psdf.pandas_on_spark.transform_batch(
              lambda pdf: pdf.c + 1
          ).sort_index(),
          (pdf.c + 1).sort_index(),
      )
      self.assert_eq(
          psdf.pandas_on_spark.transform_batch(
              lambda pdf, a: pdf + a, 1
          ).sort_index(),
          (pdf + 1).sort_index(),
      )
      self.assert_eq(
          psdf.pandas_on_spark.transform_batch(
              lambda pdf, a: pdf.c + a, a=1
          ).sort_index(),
          (pdf.c + 1).sort_index(),
      )
  
      with option_context("compute.shortcut_limit", 500):
          self.assert_eq(
              psdf.pandas_on_spark.transform_batch(
                  lambda pdf: pdf + 1
              ).sort_index(),
              (pdf + 1).sort_index(),
          )
          self.assert_eq(
              psdf.pandas_on_spark.transform_batch(
                  lambda pdf: pdf.b + 1
              ).sort_index(),
              (pdf.b + 1).sort_index(),
          )
          self.assert_eq(
              psdf.pandas_on_spark.transform_batch(
                  lambda pdf, a: pdf + a, 1
              ).sort_index(),
              (pdf + 1).sort_index(),
          )
          self.assert_eq(
              psdf.pandas_on_spark.transform_batch(
                  lambda pdf, a: pdf.c + a, a=1
              ).sort_index(),
              (pdf.c + 1).sort_index(),
          )
  
      with self.assertRaisesRegex(
          AssertionError, "the first argument should be a callable"
      ):
          psdf.pandas_on_spark.transform_batch(1)
  
      with self.assertRaisesRegex(
          ValueError, "The given function should return a frame"
      ):
          psdf.pandas_on_spark.transform_batch(lambda pdf: 1)
  
      with self.assertRaisesRegex(
          ValueError,
          "transform_batch cannot produce aggregated results",
      ):
          psdf.pandas_on_spark.transform_batch(lambda pdf: pd.Series(1))
  
      # multi-index columns
      columns = pd.MultiIndex.from_tuples(
          [("x", "a"), ("x", "b"), ("y", "c")]
      )
      pdf.columns = columns
      psdf.columns = columns
  
      self.assert_eq(
          psdf.pandas_on_spark.transform_batch(
              lambda x: x + 1
          ).sort_index(),
          (pdf + 1).sort_index(),
      )
      with option_context("compute.shortcut_limit", 500):
          self.assert_eq(
              psdf.pandas_on_spark.transform_batch(
                  lambda x: x + 1
              ).sort_index(),
              (pdf + 1).sort_index(),
          )
  
imports: from datetime import datetime
  import sys
  import unittest
  from typing import List
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.loose_version import LooseVersion
  from pyspark.pandas.config import option_context
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 7 for calling the FrameApplyFunctionMixin obj's underlying member method code with example usage: obj.test_transform_batch() without return types