def METHOD_NAME(self, addr, netmask, value):
    """
    Add the given IP address to the map.  The address must be
    given as a str or buffer that is exactly 4 or 16 bytes long.
    If it's 4 bytes, it's interpreted as an IPv4 address; if it's
    16 bytes, it's interpreted as an IPv6 address.  The netmask
    should be an integer between 1 and 32 (inclusive) for IPv4, or
    between 1 and 128 (inclusive) for IPv6.
    """
    if len(addr) == 4:
        ipset.ipmap_ipv4_set_network(self.map, addr, netmask, value)
        return
    elif len(addr) == 16:
        ipset.ipmap_ipv6_set_network(self.map, addr, netmask, value)
        return
    else:
        raise ValueError("Invalid address")