# Path: ndr/utils.py
# def set_dict_if_not_none(the_dict, key, value):
#     '''Wrapper function for easing serialization pain'''
#     if value is None:
#         return
# 
#     the_dict[key] = value
# 
# def set_value_if_dict_exists(the_dict, key):
#     '''Wrapper function for deserialization code'''
#     if key not in the_dict:
#         return
# 
#     return the_dict[key]
# 
# def return_value_if_key_exists(the_dict, key):
#     '''Wrapper function for helping deserialization'''
#     if key in the_dict:
#         return the_dict[key]
# 
#     return None


import ipaddress
import xml.etree.ElementTree as ET
import yaml
import ndr
        import json
from enum import Enum
from ndr.utils import (set_dict_if_not_none,
                       set_value_if_dict_exists,
                       return_value_if_key_exists)
        if value is None:
            self._lowver = None
            return
        self._rpcnum = int(value)

    @property
    def highver(self):
        '''High version is used for RPC checking'''
        return self._highver

    @highver.setter
    def highver(self, value):
        if value is None:
            self._highver = None
            return
        self._highver = int(value)

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

    def to_dict(self):
        '''Convert object data to dict for serialization'''

        service_dict = {}

        # These fields should always be present
        service_dict['name'] = self.name
        service_dict['method'] = self.method.value
        service_dict['confidence'] = self.confidence


# Path: ndr/utils.py
# def set_dict_if_not_none(the_dict, key, value):
#     '''Wrapper function for easing serialization pain'''
#     if value is None:
#         return
# 
#     the_dict[key] = value
# 
# def set_value_if_dict_exists(the_dict, key):
#     '''Wrapper function for deserialization code'''
#     if key not in the_dict:
#         return
# 
#     return the_dict[key]
# 
# def return_value_if_key_exists(the_dict, key):
#     '''Wrapper function for helping deserialization'''
#     if key in the_dict:
#         return the_dict[key]
# 
#     return None


# Path: ndr/nmap.py
import ipaddress
import xml.etree.ElementTree as ET
import yaml
import ndr
        import json
from enum import Enum
from ndr.utils import (set_dict_if_not_none,
                       set_value_if_dict_exists,
                       return_value_if_key_exists)

        if value is None:
            self._lowver = None
            return
        self._rpcnum = int(value)

    @property
    def highver(self):
        '''High version is used for RPC checking'''
        return self._highver

    @highver.setter
    def highver(self, value):
        if value is None:
            self._highver = None
            return
        self._highver = int(value)

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

    def to_dict(self):
        '''Convert object data to dict for serialization'''

        service_dict = {}

        # These fields should always be present
        service_dict['name'] = self.name
        service_dict['method'] = self.method.value
        service_dict['confidence'] = self.confidence


        set_dict_if_not_none(service_dict, 'version', self.version)