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
  
      self.spark = SparkSession(self.sc)
      self.spark.udf.register(
          "to_array", to_array_, ArrayType(DoubleType())
      )
      self.spark.udf.register(
          "flatten", flatten_, ArrayType(DoubleType())
      )
  
imports: from unittest import TestCase
  import os
  import pytest
  import torch.nn
  import torch.nn.functional
  import numpy
  from pyspark.sql import SparkSession
  from pyspark.sql.types import ArrayType, DoubleType
  from pyspark.sql import SparkSession
  from zoo.orca import init_orca_context, stop_orca_context
  from zoo.orca.data.pandas import read_csv
  from zoo.orca.data import SparkXShards
  from zoo.orca.learn.pytorch import Estimator
  from zoo.orca.learn.metrics import Accuracy
  from zoo.orca.learn.trigger import EveryEpoch
  from zoo.orca.learn.optimizers import SGD
  from zoo.orca.learn.optimizers.schedule import Default
  from zoo.orca import OrcaContext
  import tempfile
label_desc: Use image node_id 1 for calling the TestEstimatorForDataFrame obj's underlying member method code with example usage: obj.setUp() and returns: v, result