# 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): group
          to append arguments to.
    """
    argument_group.add_argument(
        "--nsrlsvr-host",
        dest="nsrlsvr_host",
        type=str,
        action="store",
        default=cls._DEFAULT_HOST,
        help="Specify the host to query Nsrlsvr on.",
    )
    argument_group.add_argument(
        "--nsrlsvr-port",
        dest="nsrlvr_port",
        type=int,
        action="store",
        default=cls._DEFAULT_PORT,
        help="Port to use to query Nsrlsvr.",
    )


# 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): group
          to append arguments to.
    """
    argument_group.add_argument(
        "--nsrlsvr-hash",
        "--nsrlsvr_hash",
        dest="nsrlsvr_hash",
        type=str,
        action="store",
        choices=["md5", "sha1"],
        default=cls._DEFAULT_HASH,
        metavar="HASH",
        help=(
            "Type of hash to use to query nsrlsvr instance, the default is: {0:s}"
        ).format(cls._DEFAULT_HASH),
    )

    argument_group.add_argument(
        "--nsrlsvr-host",
        "--nsrlsvr_host",
        dest="nsrlsvr_host",
        type=str,
        action="store",
        default=cls._DEFAULT_HOST,
        metavar="HOST",
        help=(
            "Hostname or IP address of the nsrlsvr instance to query, the "
            "default is: {0:s}"
        ).format(cls._DEFAULT_HOST),
    )

    argument_group.add_argument(
        "--nsrlsvr-port",
        "--nsrlsvr_port",
        dest="nsrlvr_port",
        type=int,
        action="store",
        default=cls._DEFAULT_PORT,
        metavar="PORT",
        help=(
            "Port number of the nsrlsvr instance to query, the default is: {0:d}."
        ).format(cls._DEFAULT_PORT),
    )