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):
      """
  
      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
      ):
          raise Exception(
              "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]
  
imports: from py4j.protocol import Py4JError
  from zoo.orca.data.utils import *
  from zoo.orca import OrcaContext
  from zoo.common.nncontext import init_nncontext
  from zoo import ZooContext, get_node_and_core_number
  from zoo.util import nest
label_desc: Use image node_id 13 for calling the SparkXShards obj's underlying member method code with example usage: obj.split() and returns: split_shard_list, list, transform, data