class_docstr: The base class for the metrics configuration.
  
  It determines the step or time range that needs to be
  profiled and validates the input value pairs. Available profiling range parameter pairs are
  (**start_step** and **num_steps**) and (**start_unix_time** and **duration**).
  The two parameter pairs are mutually exclusive, and this class validates
  if one of the two pairs is used. If both pairs are specified, a
  FOUND_BOTH_STEP_AND_TIME_FIELDS error occurs.
docstr: Validate the provided range fields and set the range to be profiled accordingly.
  
  Args:
      name (str): The name of the metrics config.
      start_step (int): The step to start profiling.
      num_steps (int): The number of steps to profile.
      start_unix_time (int): The Unix time to start profiling.
      duration (float): The duration in seconds to profile.
docstr_tok: ["Validate","the","provided","range","fields","and","set","the","range","to","be","profiled","accordingly",".","Args",":","name","(","str",")",":","The","name","of","the","metrics","config",".","start_step","(","int",")",":","The","step","to","start","profiling",".","num_steps","(","int",")",":","The","number","of","steps","to","profile",".","start_unix_time","(","int",")",":","The","Unix","time","to","start","profiling",".","duration","(","float",")",":","The","duration","in","seconds","to","profile","."]
code: def __init__(
      self, name, start_step, num_steps, start_unix_time, duration
  ):
      """Validate the provided range fields and set the range to be profiled accordingly.
  
      Args:
          name (str): The name of the metrics config.
          start_step (int): The step to start profiling.
          num_steps (int): The number of steps to profile.
          start_unix_time (int): The Unix time to start profiling.
          duration (float): The duration in seconds to profile.
  
      """
      self.name = name
  
      assert (
          start_step is None
          or isinstance(start_step, int)
          and start_step >= 0
      ), ErrorMessages.INVALID_START_STEP.value
      assert (
          num_steps is None
          or isinstance(num_steps, int)
          and num_steps > 0
      ), ErrorMessages.INVALID_NUM_STEPS.value
      assert (
          start_unix_time is None
          or isinstance(start_unix_time, int)
          and is_valid_unix_time(start_unix_time)
      ), ErrorMessages.INVALID_START_UNIX_TIME.value
      assert (
          duration is None
          or isinstance(duration, (float, int))
          and duration > 0
      ), ErrorMessages.INVALID_DURATION.value
  
      has_step_range = start_step is not None or num_steps is not None
      has_time_range = (
          start_unix_time is not None or duration is not None
      )
      assert not (
          has_step_range and has_time_range
      ), ErrorMessages.FOUND_BOTH_STEP_AND_TIME_FIELDS.value
  
      self.range = (
          StepRange(start_step, num_steps)
          if has_step_range
          else TimeRange(start_unix_time, duration)
      )
  
imports: from __future__ import absolute_import
  from sagemaker.debugger.profiler_constants import DATALOADER_PROFILING_CONFIG_NAME, DATALOADER_PROFILING_START_STEP_DEFAULT, DETAILED_PROFILING_CONFIG_NAME, DETAILED_PROFILING_START_STEP_DEFAULT, SMDATAPARALLEL_PROFILING_CONFIG_NAME, SMDATAPARALLEL_PROFILING_START_STEP_DEFAULT, HOROVOD_PROFILING_CONFIG_NAME, HOROVOD_PROFILING_START_STEP_DEFAULT, PROFILING_NUM_STEPS_DEFAULT, PYTHON_PROFILING_CONFIG_NAME, PYTHON_PROFILING_NUM_STEPS_DEFAULT, PYTHON_PROFILING_START_STEP_DEFAULT, START_STEP_DEFAULT
  from sagemaker.debugger.utils import convert_json_config_to_string, cProfileTimer, is_valid_regex, is_valid_unix_time, ErrorMessages, PythonProfiler
label_desc: Use image node_id 1 to create a new MetricsConfigBase object  with example: obj = MetricsConfigBase(name, start_step, num_steps, start_unix_time, duration)