

def gen_netmask(min_cidr=1, max_cidr=31):
    'Generates a random valid netmask.\n\n    For more info: http://www.iplocation.net/tools/netmask.php\n\n    :param int min_cidr: Inferior CIDR limit\n    :param int max_cidr: Superior CIDR limit\n    :returns: The netmask is chosen from\n        :data:`fauxfactory.constants.VALID_NETMASKS` respecting the CIDR range\n    :rtype: str\n    :raises: ``ValueError`` if ``min_cidr`` or ``max_cidr`` have an invalid\n        value. For example, ``max_cidr`` cannot be 33.\n\n    '
    if (min_cidr < 0):
        raise ValueError('min_cidr must be 0 or greater, but is {0}'.format(min_cidr))
    if (max_cidr >= len(VALID_NETMASKS)):
        raise ValueError('max_cidr must be less than {0}, but is {1}'.format(len(VALID_NETMASKS), max_cidr))
    random.seed()
    return VALID_NETMASKS[random.randint(min_cidr, max_cidr)]

dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py gen_netmask/original