code: def _parse_data(data):
      if isinstance(data, DataframeReader):
          data = data.read()
      elif isinstance(data, DataDirectoryReader):
          data = str(data.get_directory())
      else:
          raise ValueError(f"Unknown type of data {type(data)}")
      return data
  
file_path: FATE/python/fate/components/components/nn/component_utils.py
imports: from fate.components.components.nn.loader import Loader
  from fate.components.components.nn.nn_runner import NNRunner
  from fate.components.components.utils import consts
  from fate.arch.dataframe import DataFrame
  from fate.components.components.utils.tools import add_dataset_type
  from fate.arch import Context
  from fate.components.core import ARBITER, GUEST, HOST, Role, cpn
  import logging
  from fate.components.core.component_desc.artifacts.data._dataframe import DataframeReader, DataframeWriter
  from fate.components.core.component_desc.artifacts.data._directory import DataDirectoryReader
  from fate.components.core.component_desc.artifacts.model._directory import ModelDirectoryReader, ModelDirectoryWriter
label_desc: Use image node_id 3 for calling a global function with example usage: _parse_data(data) and returns: data