'check is ipv4 addr is valid'

def is_valid_v4addr(self, addr):

    if (addr.find('.') != (-1)):
        addr_list = addr.split('.')
        if (len(addr_list) != 4):
            return False
        for each_num in addr_list:
            if (not each_num.isdigit()):
                return False
            if (int(each_num) > 255):
                return False
        return True
    return False
