def gen_mac(delimiter=':', multicast=None, locally=None):

    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:
        # Ensure that the first least significant bit is 1
        first_octet |= 0b00000001
    else:
        # Ensure that the first least significant bit is 0
        first_octet &= 0b11111110
    if locally:
        # Ensure that the second least significant bit is 1
        first_octet |= 0b00000010
    else:
        # Ensure that the second least significant bit is 0
        first_octet &= 0b11111101

    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)
Get a dictionary with the information of the post
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/gen_mac--crossover with--dataset/ETHPy150Open joausaga/reportbytwitter/cparte/social_network.py/SocialNetwork.to_dict