# Buggy code
def AddArguments(cls, argument_group):
    """Adds command line arguments the helper supports to an argument group.

    This function takes an argument parser or an argument group object and adds
    to it all the command line arguments this helper supports.

    Args:
      argument_group (argparse._ArgumentGroup|argparse.ArgumentParser):
          argparse group.
    """
    argument_group.add_argument(
        "--viper-host",
        dest="viper_host",
        type=str,
        action="store",
        default=cls._DEFAULT_HOST,
        help="Specify the host to query Viper on.",
    )
    argument_group.add_argument(
        "--viper-protocol",
        dest="viper_protocol",
        type=str,
        choices=["http", "https"],
        action="store",
        default=cls._DEFAULT_PROTOCOL,
        help="Protocol to use to query Viper.",
    )


# Traceback (KeyError)
[ERROR] (nsrlsvr   ) PID:XXXXX <analysis_process> <dfvfs.path.os_path_spec.OSPathSpec object at 0xXXXXXXXXXXXX>
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/plaso/multi_processing/analysis_process.py", line 138, in _Main
self._analysis_mediator.ProduceAnalysisReport(self._analysis_plugin)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/mediator.py", line 95, in ProduceAnalysisReport
analysis_report = plugin.CompileReport(self)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/interface.py", line 280, in CompileReport
hash_analysis)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/interface.py", line 187, in _HandleHashAnalysis
event_uuids = self._event_uuids_by_pathspec.pop(pathspec)
KeyError: <dfvfs.path.os_path_spec.OSPathSpec object at 0xXXXXXXXXXXXX>

# Fixed code
def AddArguments(cls, argument_group):
    """Adds command line arguments the helper supports to an argument group.

    This function takes an argument parser or an argument group object and adds
    to it all the command line arguments this helper supports.

    Args:
      argument_group (argparse._ArgumentGroup|argparse.ArgumentParser):
          argparse group.
    """
    argument_group.add_argument(
        "--viper-hash",
        "--viper_hash",
        dest="viper_hash",
        type=str,
        action="store",
        choices=["sha256"],
        default=cls._DEFAULT_HASH,
        metavar="HASH",
        help=(
            "Type of hash to use to query the Viper server, the default is: "
            "{0:s}".format(cls._DEFAULT_HASH)
        ),
    )

    argument_group.add_argument(
        "--viper-host",
        "--viper_host",
        dest="viper_host",
        type=str,
        action="store",
        default=cls._DEFAULT_HOST,
        metavar="HOST",
        help=(
            "Hostname of the Viper server to query, the default is: {0:s}".format(
                cls._DEFAULT_HOST
            )
        ),
    )

    argument_group.add_argument(
        "--viper-port",
        "--viper_port",
        dest="viper_port",
        type=int,
        action="store",
        default=cls._DEFAULT_PORT,
        metavar="PORT",
        help=(
            "Port of the Viper server to query, the default is: {0:d}.".format(
                cls._DEFAULT_PORT
            )
        ),
    )

    argument_group.add_argument(
        "--viper-protocol",
        "--viper_protocol",
        dest="viper_protocol",
        type=str,
        choices=["http", "https"],
        action="store",
        default=cls._DEFAULT_PROTOCOL,
        metavar="PROTOCOL",
        help=("Protocol to use to query Viper."),
    )