code: def _as_data_manager(data) -> DataManager:
      if isinstance(data, DataManager):
          return data
      if check_input_data(data) is False:
          raise ValueError(
              "The provided data does not match the expected "
              "format.\n"
              "Speedster supports data in the following formats: \n"
              "- PyTorch DataLoader\n"
              "- TensorFlow Dataset\n"
              "- List of tuples: [((input_0, ... ), label), ...] \n"
              "Inputs and labels should be either tensors or numpy "
              "arrays,\n"
              "depending on the framework used.\n"
          )
      if is_data_subscriptable(data):
          return DataManager(data)
      else:
          return DataManager.from_iterable(data)
  
imports: from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Any, Iterable, Callable, List, Union, Dict, Optional
  from nebullvm.config import TRAIN_TEST_SPLIT_RATIO
  from nebullvm.core import types
  from nebullvm.core.models import OptimizeInferenceResult, OriginalModel, OptimizedModel, BenchmarkOriginalModelResult, ModelCompiler, ModelCompressor, OptimizationTime, ModelParams, DeepLearningFramework
  from nebullvm.operations.base import Operation
  from nebullvm.operations.conversions.utils import get_conversion_op
  from nebullvm.operations.measures.measures import LatencyOriginalModelMeasure
  from nebullvm.operations.measures.utils import QUANTIZATION_METRIC_MAP
  from nebullvm.operations.optimizations.optimizers.optimizers import PytorchOptimizer, TensorflowOptimizer, ONNXOptimizer
  from nebullvm.operations.optimizations.utils import map_compilers_and_compressors
  from nebullvm.optional_modules.tensorflow import tensorflow
  from nebullvm.optional_modules.torch import DataLoader
  from nebullvm.optional_modules.torch import torch
  from nebullvm.optional_modules.utils import check_dependencies
  from nebullvm.tools.adapters import ModelAdapter, DiffusionAdapter, HuggingFaceAdapter
  from nebullvm.tools.data import DataManager
  from nebullvm.tools.diffusers import is_diffusion_model_pipe, is_diffusion_model
  from nebullvm.tools.hardware_utils import get_hw_setup
  from nebullvm.tools.utils import is_huggingface_data, check_input_data, is_data_subscriptable, get_dl_framework, extract_info_from_data, get_model_name, get_model_size_mb, get_throughput
label_desc: Use image node_id 2 for calling the OptimizeInferenceOp obj's underlying member method code with example usage: obj._as_data_manager(data) and returns: data, DataManager, DataManager