code: def ParseOptions(cls, options, configuration_object):
      
      if not isinstance(configuration_object, tools.CLITool):
        raise errors.BadConfigObject(
            'Configuration object is not an instance of CLITool')
  
      profilers = cls._ParseStringOption(options, 'profilers')
  
      if not profilers:
        profilers = set()
      elif profilers.lower() != 'list':
        profilers = set(profilers.split(','))
  
        supported_profilers = set(cls.PROFILERS_INFORMATION.keys())
        unsupported_profilers = profilers.difference(supported_profilers)
        if unsupported_profilers:
          unsupported_profilers = ', '.join(unsupported_profilers)
          raise errors.BadConfigOption(
              'Unsupported profilers: {0:s}'.format(unsupported_profilers))
  
      profiling_directory = getattr(options, 'profiling_directory', None)
      if profiling_directory and not os.path.isdir(profiling_directory):
        raise errors.BadConfigOption(
            'No such profiling directory: {0:s}'.format(profiling_directory))
  
      profiling_sample_rate = getattr(options, 'profiling_sample_rate', None)
      if not profiling_sample_rate:
        profiling_sample_rate = cls.DEFAULT_PROFILING_SAMPLE_RATE
      else:
        try:
          profiling_sample_rate = int(profiling_sample_rate, 10)
        except (TypeError, ValueError):
          raise errors.BadConfigOption(
              'Invalid profile sample rate: {0!s}.'.format(profiling_sample_rate))
  
      setattr(configuration_object, '_profilers', profilers)
      setattr(configuration_object, '_profiling_directory', profiling_directory)
      setattr(
          configuration_object, '_profiling_sample_rate', profiling_sample_rate)
docs: Parses and validates options.
  
      Args:
        options (argparse.Namespace): parser options.
        configuration_object (CLITool): object to be configured by the argument
            helper.
  
      Raises:
        BadConfigObject: when the configuration object is of the wrong type.