def __init__(self, ip, name, weight, region=None):
        """
        args:
            ip: string, IP address
            name: string, name of the server
            weight: int, weight of the server, if set to 0 the server
                is disabled
            region: string, id of the region, used in topology-based 
                distribution
        """
        ### ip
        try:
            _ip = ipaddress.ip_address(ip)
        except __HOLE__:
            log_msg = ('"{}" does not appear to be a valid IP address'
                       .format(ip))
            LOG.error(log_msg)
            raise Error(log_msg)

        if _ip.version != 4:
            log_msg = 'only v4 IP addresses are currently supported'
            LOG.error(log_msg)
            raise Error(log_msg)

        self.ip = ip

        ### name
        if (not isinstance(name, str) or len(name) > MAX_POOL_MEMBER_NAME_LEN):
            log_msg = ('"{}" name must be a str, {} chars max'.
                       format(name, MAX_POOL_MEMBER_NAME_LEN))
            LOG.error(log_msg)
            raise Error(log_msg)
        else:
            self.name = name

        ### weight    
        if (not isinstance(weight, int) or weight < 0 
                or weight > MAX_POOL_MEMBER_WEIGHT):
            log_msg = ('"{}" weight "{}" must be an int between 0 and {}'.
                       format(name, weight, MAX_POOL_MEMBER_WEIGHT))
            raise Error(log_msg)
        else:
            self.weight = weight

        ### region
        if (not region is None 
                and (not isinstance(region, (str)) 
                 or len(region) > MAX_REGION_LEN)):
            log_msg = ('"{}" region "{}" must be a str, {} chars max'.
                       format(name, region, MAX_POOL_MEMBER_NAME_LEN))
            LOG.error(log_msg)
            raise Error(log_msg)
        else:
            self.region = region          

        # curent status of the server
        # None = new, True = up, False = down
        self.status = None

        # reason why this status has been set
        self.status_reason = None

        # timestamp when the probe was issued last time
        # used to determine when to send a new probe
        self.last_probe_issued_time = None

        # this is used by tracker to determine how many more
        # probing requests to attempt before declaring the member down
        # set to the parent's pool monitor retries value initially
        self.retries_left = None
dataset/ETHPy150Open polaris-gslb/polaris-gslb/polaris_health/state/pool.py/PoolMember.__init__