code: def ParseOptions(cls, options, analysis_plugin):
      
      if not isinstance(analysis_plugin, viper.ViperAnalysisPlugin):
        raise errors.BadConfigObject(
            'Analysis plugin is not an instance of ViperAnalysisPlugin')
  
      lookup_hash = cls._ParseStringOption(
          options, 'viper_hash', default_value=cls._DEFAULT_HASH)
      analysis_plugin.SetLookupHash(lookup_hash)
  
      host = cls._ParseStringOption(
          options, 'viper_host', default_value=cls._DEFAULT_HOST)
      analysis_plugin.SetHost(host)
  
      port = cls._ParseNumericOption(
          options, 'viper_port', default_value=cls._DEFAULT_PORT)
      analysis_plugin.SetPort(port)
  
      protocol = cls._ParseStringOption(
          options, 'viper_protocol', default_value=cls._DEFAULT_PROTOCOL)
      protocol = protocol.lower().strip()
      analysis_plugin.SetProtocol(protocol)
  
      if not analysis_plugin.TestConnection():
        raise errors.BadConfigOption(
            'Unable to connect to Viper {0:s}:{1:d}'.format(host, port))
docs: Parses and validates options.
  
      Args:
        options (argparse.Namespace): parser options.
        analysis_plugin (ViperAnalysisPlugin): analysis plugin to configure.
  
      Raises:
        BadConfigObject: when the output module object is of the wrong type.
        BadConfigOption: when unable to connect to Viper instance.