'Make a (netmask, prefix_len) tuple from the given argument.
Argument can be:
- an integer (the prefix length)
- a string representing the prefix length (e.g. "24")
- a string representing the prefix netmask (e.g. "255.255.255.0")'

@classmethod
def _make_netmask(cls, arg):

    if (arg not in cls._netmask_cache):
        if isinstance(arg, _compat_int_types):
            prefixlen = arg
        else:
            try:
                prefixlen = cls._prefix_from_prefix_string(arg)
            except NetmaskValueError:
                prefixlen = cls._prefix_from_ip_string(arg)
        netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen))
        cls._netmask_cache[arg] = (netmask, prefixlen)
    return cls._netmask_cache[arg]
