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')
  
      temporary_directory = getattr(options, 'temporary_directory', None)
      if temporary_directory and not os.path.isdir(temporary_directory):
        raise errors.BadConfigOption(
            'No such temporary directory: {0:s}'.format(temporary_directory))
  
      setattr(configuration_object, '_temporary_directory', temporary_directory)
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.