

def gen_mac(delimiter=':', multicast=None, locally=None):
    "Generates a random MAC address.\n\n    For more information about how unicast or multicast and globally unique and\n    locally administered MAC addresses are generated check this link\n    https://en.wikipedia.org/wiki/MAC_address.\n\n    :param str delimeter: Valid MAC delimeter (e.g ':', '-').\n    :param bool multicast: Indicates if the generated MAC address should be\n        unicast or multicast. If no value is provided a random one will be\n        chosen.\n    :param bool locally: Indicates if the generated MAC address should be\n        globally unique or locally administered. If no value is provided a\n        random one will be chosen.\n    :returns: A random MAC address.\n    :rtype: str\n\n    "
    if (delimiter not in [':', '-']):
        raise ValueError(('Delimiter is not a valid option: %s' % delimiter))
    random.seed()
    if (multicast is None):
        multicast = bool(random.randint(0, 1))
    if (locally is None):
        locally = bool(random.randint(0, 1))
    first_octet = random.randint(0, 255)
    if multicast:
        first_octet |= 1
    else:
        first_octet &= 254
    if delimiter:
        first_octet |= 2
    else:
        first_octet &= 253
    octets = [first_octet]
    octets.extend([random.randint(0, 255) for _ in range(5)])
    mac = delimiter.join(['{0:02x}'.format(octet) for octet in octets])
    return _make_unicode(mac)

dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py gen_mac/VarMisuse@132/435 `locally`->`delimiter`