code: def _subset_data(dat, row_ind=None, col_ind=None, return_1d=False):
      """
      Can subset data along 2 axis.
      Explicitly returns a copy.
      """
  
      row_ind = range(dat.shape[0]) if row_ind is None else row_ind
      col_ind = range(dat.shape[1]) if col_ind is None else col_ind
  
      if isinstance(dat, pd_DataFrame):
          data_copy = dat.iloc[row_ind, col_ind]
          return (
              data_copy.to_numpy().flatten() if return_1d else data_copy
          )
      elif isinstance(dat, np.ndarray):
          row_ind = _ensure_iterable(row_ind)
          col_ind = _ensure_iterable(col_ind)
          data_copy = dat[np.ix_(row_ind, col_ind)]
          return data_copy.flatten() if return_1d else data_copy
      else:
          raise ValueError("Unknown data class passed.")
  
imports: from .compat import pd_DataFrame, pd_Series, pd_read_parquet
  import numpy
  from numpy.random import RandomState
  import blosc
  import dill
  from typing import Union, List, Dict, Optional
label_desc: Use image node_id 16 for calling a global function with example usage: _subset_data(dat, row_ind, col_ind, return_1d) and returns: unknown, unknown