code: def _interpret_ds(val, avail_can):
      if isinstance(val, int):
          assert (
              val <= avail_can
          ), "data subset is more than available candidates"
      elif isinstance(val, float):
          assert (val <= 1.0) and (
              val > 0.0
          ), "if float, 0.0 < data_subset <= 1.0"
          val = int(val * avail_can)
      else:
          raise ValueError("malformed data_subset passed")
      return val
  
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 12 for calling a global function with example usage: _interpret_ds(val, avail_can) and returns: val