# 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-hash",
        "--nsrlsvr_hash",
        dest="nsrlsvr_hash",
        type=str,
        action="store",
        choices=nsrlsvr.NsrlsvrAnalyzer.SUPPORTED_HASHES,
        default=cls._DEFAULT_HASH,
        metavar="HASH",
        help=(
            "Type of hash to use to query nsrlsvr instance, the default is: "
            "{0:s}. Supported options: {1:s}".format(
                cls._DEFAULT_HASH, ", ".join(nsrlsvr.NsrlsvrAnalyzer.SUPPORTED_HASHES)
            )
        ),
    )

    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-label",
        "--nsrlsvr_label",
        dest="nsrlvr_label",
        type=str,
        action="store",
        default=cls._DEFAULT_LABEL,
        metavar="LABEL",
        help=("Label to apply to events, the default is: {0:s}.").format(
            cls._DEFAULT_LABEL
        ),
    )

    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),
    )


# Traceback (ValueError)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/plaso-20171118-py2.7.egg/plaso/analysis/interface.py", line 438, in run
hash_analyses = self.Analyze(hashes)
File "/usr/local/lib/python2.7/dist-packages/plaso-20171118-py2.7.egg/plaso/analysis/nsrlsvr.py", line 99, in Analyze
'Opening connection to {0:s}:{1:d}'.format(self._host, self._port))
ValueError: Unknown format code 'd' for object of type 'unicode'

# 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=nsrlsvr.NsrlsvrAnalyzer.SUPPORTED_HASHES,
        default=cls._DEFAULT_HASH,
        metavar="HASH",
        help=(
            "Type of hash to use to query nsrlsvr instance, the default is: "
            "{0:s}. Supported options: {1:s}".format(
                cls._DEFAULT_HASH, ", ".join(nsrlsvr.NsrlsvrAnalyzer.SUPPORTED_HASHES)
            )
        ),
    )

    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-label",
        "--nsrlsvr_label",
        dest="nsrlsvr_label",
        type=str,
        action="store",
        default=cls._DEFAULT_LABEL,
        metavar="LABEL",
        help=("Label to apply to events, the default is: {0:s}.").format(
            cls._DEFAULT_LABEL
        ),
    )

    argument_group.add_argument(
        "--nsrlsvr-port",
        "--nsrlsvr_port",
        dest="nsrlsvr_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),
    )