code: def astype(
      t: np.ndarray | list | csr_matrix | pd.DataFrame | pd.Series,
      x: Any,
  ) -> Any:
      """Convert data to allowed types"""
      if t == np.ndarray:
          return np.asarray(x)
      else:
          return t(x)
  
file_path: auto-sklearn/test/fixtures/datasets.py
imports: from __future__ import annotations
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.utils import check_random_state
  from autosklearn.constants import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION
  from autosklearn.data.validation import SUPPORTED_FEAT_TYPES, SUPPORTED_TARGET_TYPES
  from autosklearn.data.xy_data_manager import XYDataManager
  from autosklearn.pipeline.util import get_dataset
  from pytest import fixture
  from test.conftest import DEFAULT_SEED
label_desc: Use image node_id 1 for calling a global function with example usage: astype(t, x) and returns: np, t