code: def test_partition_by_single_column(self):
      file_path = os.path.join(self.resource_path, "orca/data/csv")
      data_shard = zoo.orca.data.pandas.read_csv(file_path)
      partitioned_shard = data_shard.partition_by(
          cols="location", num_partitions=4
      )
      partitions = partitioned_shard.rdd.glom().collect()
      assert len(partitions) == 4
  
      data_shard = zoo.orca.data.pandas.read_csv(file_path)
      partitioned_shard = data_shard.partition_by(
          cols="location", num_partitions=3
      )
      assert not data_shard.is_cached(), "data_shard should be uncached"
      assert (
          partitioned_shard.is_cached()
      ), "partitioned_shard should be cached"
      partitions = partitioned_shard.rdd.glom().collect()
      assert len(partitions) == 3
  
imports: import os.path
  import shutil
  import pytest
  from unittest import TestCase
  import zoo.orca.data
  import zoo.orca.data.pandas
  from zoo.orca import OrcaContext
  from zoo.orca.data import SharedValue
  from zoo.common.nncontext import *
  from zoo.orca.data import SparkXShards
label_desc: Use image node_id 9 for calling the TestSparkXShards obj's underlying member method code with example usage: obj.test_partition_by_single_column() without return types