docstr: setup any state tied to the execution of the given method in a
  class.  setup_method is invoked for every test method of a class.
docstr_tok: ["setup","any","state","tied","to","the","execution","of","the","given","method","in","a","class",".","setup_method","is","invoked","for","every","test","method","of","a","class","."]
code: def setUp(self):
      """setup any state tied to the execution of the given method in a
      class.  setup_method is invoked for every test method of a class.
      """
      self.sc = init_orca_context(cores=4)
  
      def to_array_(v):
          return v.toArray().tolist()
  
      def flatten_(v):
          result = []
          for elem in v:
              result.extend(elem.toArray().tolist())
          return result
  
      from pyspark.sql import SparkSession
  
      spark = SparkSession(self.sc)
      spark.udf.register("to_array", to_array_, ArrayType(DoubleType()))
      spark.udf.register("flatten", flatten_, ArrayType(DoubleType()))
  
imports: from unittest import TestCase
  import os
  import pytest
  import numpy
  from pyspark.sql.types import ArrayType, DoubleType
  from zoo.orca import init_orca_context, stop_orca_context
  from zoo.orca.data import SparkXShards
  from zoo.orca.data.image.utils import chunks
  from zoo.orca.learn.utils import convert_predict_rdd_to_dataframe, _dataframe_to_xshards, convert_predict_xshards_to_dataframe, convert_predict_rdd_to_xshard, update_predict_xshards
label_desc: Use image node_id 1 for calling the TestUtil obj's underlying member method code with example usage: obj.setUp() and returns: v, result