code: def get_sample_range(
      input_table_spec: TableSpec, calc_cpe_in_training: bool
  ) -> TrainEvalSampleRanges:
      table_sample = input_table_spec.table_sample
      eval_table_sample = input_table_spec.eval_table_sample
  
      if not calc_cpe_in_training:
          # use all data if table sample = None
          if table_sample is None:
              train_sample_range = (0.0, 100.0)
          else:
              train_sample_range = (0.0, table_sample)
          return TrainEvalSampleRanges(
              train_sample_range=train_sample_range,
              # eval samples will not be used
              eval_sample_range=(0.0, 0.0),
          )
  
      error_msg = (
          "calc_cpe_in_training is set to True. "
          f"Please specify table_sample(current={table_sample}) and "
          f"eval_table_sample(current={eval_table_sample}) such that "
          "eval_table_sample + table_sample <= 100. "
          "In order to reliably calculate CPE, eval_table_sample "
          "should not be too small."
      )
      assert table_sample is not None, error_msg
      assert eval_table_sample is not None, error_msg
      assert (eval_table_sample + table_sample) <= (
          100.0 + 1e-3
      ), error_msg
  
      return TrainEvalSampleRanges(
          train_sample_range=(0.0, table_sample),
          eval_sample_range=(100.0 - eval_table_sample, 100.0),
      )
  
imports: import abc
  import logging
  import pickle
  from typing import Dict, List, NamedTuple, Optional, Tuple
  from reagent.core.parameters import NormalizationData
  from reagent.data.data_fetcher import DataFetcher
  from reagent.data.oss_data_fetcher import OssDataFetcher
  from reagent.preprocessing.batch_preprocessor import BatchPreprocessor
  from reagent.workflow.types import Dataset, ReaderOptions, ResourceOptions, RewardOptions, TableSpec
  from .reagent_data_module import ReAgentDataModule
label_desc: Use image node_id 1 for calling a global function with example usage: get_sample_range(input_table_spec, calc_cpe_in_training) and returns: TrainEvalSampleRanges, TrainEvalSampleRanges