class_docstr: A collection of data which can be pre-processed in parallel on Spark.
class_docstr_tok: ["A","collection","of","data","which","can","be","pre-processed","in","parallel","on","Spark","."]
docstr: Split SparkXShards into multiple SparkXShards.
  Each element in the SparkXShards needs be a list or tuple with same length.
  
  :return: Splits of SparkXShards. If element in the input SparkDataShard is not
          list or tuple, return list of input SparkDataShards.
docstr_tok: ["Split","SparkXShards","into","multiple","SparkXShards",".","Each","element","in","the","SparkXShards","needs","be","a","list","or","tuple","with","same","length",".",":","return",":","Splits","of","SparkXShards",".","If","element","in","the","input","SparkDataShard","is","not","list","or","tuple",",","return","list","of","input","SparkDataShards","."]
code: def split(self) -> Optional[List["SparkXShards"]]:
      """
  
      Split SparkXShards into multiple SparkXShards.
      Each element in the SparkXShards needs be a list or tuple with same length.
  
      :return: Splits of SparkXShards. If element in the input SparkDataShard is not
              list or tuple, return list of input SparkDataShards.
      """
      # get number of splits
      list_split_length = self.rdd.map(
          lambda data: len(data)
          if isinstance(data, list) or isinstance(data, tuple)
          else 1
      ).collect()
      # check if each element has same splits
      if list_split_length.count(list_split_length[0]) != len(
          list_split_length
      ):
          invalidInputError(
              False,
              "Cannot split this XShards because its partitions "
              "have different split length",
          )
      else:
          if list_split_length[0] > 1:
  
              def get_data(order):
                  def transform(data):
                      return data[order]
  
                  return transform
  
              split_shard_list = [
                  SparkXShards(self.rdd.map(get_data(i)))
                  for i in range(list_split_length[0])
              ]
              self._uncache()
              return split_shard_list
          else:
              return [self]
      return None
  
imports: from py4j.protocol import Py4JError
  from bigdl.orca.data.utils import *
  from bigdl.orca import OrcaContext
  from bigdl.dllib.utils.common import get_node_and_core_number, get_spark_sql_context, get_spark_context
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.log4Error import invalidInputError
  import numpy
  from typing import TYPE_CHECKING, Any
  from typing import Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 24 for calling the SparkXShards obj's underlying member method code with example usage: obj.split() and returns: None, split_shard_list, list, transform, data