code: def data_length(data):
      x = data["x"]
      if isinstance(x, np.ndarray):
          return x.shape[0]
      else:
          return x[0].shape[0]
  
imports: import itertools
  import logging
  import pickle
  import numpy
  import ray
  from zoo.common.utils import enable_multi_fs_load, enable_multi_fs_save
  from zoo.orca.data.ray_xshards import RayXShards
  from zoo.orca.learn.dl_cluster import RayDLCluster
  from zoo.orca.learn.tf2.tf_runner import TFRunner
  from zoo.orca.learn.ray_estimator import Estimator
  from zoo.orca.learn.utils import maybe_dataframe_to_xshards, dataframe_to_xshards, convert_predict_xshards_to_dataframe, update_predict_xshards, process_xshards_of_pandas_dataframe
  from zoo.orca.data.utils import process_spark_xshards
  from zoo.ray import RayContext
label_desc: Use image node_id 2 for calling a global function with example usage: data_length(data) and returns: x, x