code: def _slice(dat, row_slice=slice(None), col_slice=slice(None)):
      """
      Returns a view of the subset data if possible.
      """
  
      if isinstance(dat, pd_DataFrame):
          return dat.iloc[row_slice, col_slice]
      elif isinstance(dat, np.ndarray):
          return dat[row_slice, col_slice]
      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 14 for calling a global function with example usage: _slice(dat, row_slice, col_slice) and returns: dat, dat