Generate a random MAC address.

        :return: Random MAC address.

        :Example:
            00:16:3e:25:e7:b1
505013
def mac_address(self) -> str:
        
        mac_hex = [
            0x00, 0x16, 0x3e,
            self.random.randint(0x00, 0x7f),
            self.random.randint(0x00, 0xff),
            self.random.randint(0x00, 0xff),
        ]
        mac = map(lambda x: '%02x' % x, mac_hex)
        return ':'.join(mac)
628142
def _get_random_string(length=44,
                       allowed_chars='abcdefghijklmnopqrstuvwxyz'
                       'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
                       secret_key=settings.secret_key_bytes()):
    
    secret_key = _ensure_bytes(secret_key)
    _reseed_if_needed(using_sysrandom, secret_key)
    return ''.join(random.choice(allowed_chars) for i in range(length))
669281
def road_address(self):
        
        pattern = self.random_element(self.road_address_formats)
        return self.generator.parse(pattern)
730459
def getMAC(self, bType=MacType.RandomMac):
        
        print '%s call getMAC' % self.port
        print bType
        # if power down happens, return extended address assigned previously
        if self.isPowerDown:
            macAddr64 = self.mac
        else:
            if bType == MacType.FactoryMac:
                macAddr64 = self.__sendCommand('eui64')[0]
            elif bType == MacType.HashMac:
                macAddr64 = self.__sendCommand('joinerid')[0]
            else:
                macAddr64 = self.__sendCommand('extaddr')[0]
        print macAddr64

        return int(macAddr64, 16)
407326
def generateRandomSDR(numSDR, numDims, numActiveInputBits, seed=42):
  
  randomSDRs = np.zeros((numSDR, numDims), dtype=uintType)
  indices = np.array(range(numDims))
  np.random.seed(seed)
  for i in range(numSDR):
    randomIndices = np.random.permutation(indices)
    activeBits = randomIndices[:numActiveInputBits]
    randomSDRs[i, activeBits] = 1

  return randomSDRs
1174749
def random_ucast_ip():
    
    first_octet = str(__random.randrange(1, 224))

    def get_other_octetes():
        return str(__random.randrange(0, 255))

    return '{first_octet}.{second_octet}.{third_octet}.{fourth_octet}'.format(first_octet=first_octet,
                                                                              second_octet=get_other_octetes(),
                                                                              third_octet=get_other_octetes(),
                                                                              fourth_octet=get_other_octetes())
732606
def get_random_string():
    
    
    # set up a random string to associate with the run
    hash_string = "%8x" % random.getrandbits(32)
    hash_string = hash_string.strip()
    
    # done't allow the random strings to be equivalent to a number, since
    # the LSF cluster interprets those differently from letter-containing
    # strings
    while is_number(hash_string):
        hash_string = "%8x" % random.getrandbits(32)
        hash_string = hash_string.strip()
    
    return hash_string
320473
def address(self):
        
        pattern = self.random_element(self.address_formats)
        return self.generator.parse(pattern)
388273
def generate_random(number_of_bytes=None, region=None, key=None, keyid=None,
                    profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        random = conn.generate_random(number_of_bytes)
        r['random'] = random['Plaintext']
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r
1324336
def _generate_ipaddressfield(self, **kwargs):
        
        field = kwargs['field']
        if field.default != NOT_PROVIDED:
            return self._generate_field_with_default(**kwargs)
        num_octets = 4
        octets = [str(random.randint(0, 255)) for n in range(num_octets)]
        return '.'.join(octets)
105043
def rand_email():
    
    name = rand_str(random.randint(4, 14), string.ascii_lowercase) + \
           rand_str(random.randint(1, 4), string.digits)
    domain = rand_str(random.randint(2, 10), string.ascii_lowercase)
    surfix = random.choice(DOMAIN_SURFIX)
    return "%s@%s.%s" % (name, domain, surfix)
678500
def street_address(self):
        
        pattern = self.random_element(self.street_address_formats)
        return self.generator.parse(pattern)
142977
def in6_getnsmac(a): # return multicast Ethernet address associated with multicast v6 destination
    

    a = struct.unpack('16B', a)[-4:]
    mac = '33:33:'
    mac += (':'.join(map(lambda x: '%.2x' %x, a)))
    return mac
1205379
def decode(bstr):
  

  bstr = bstr.replace(b':', b'')
  if len(bstr) != 12:
    raise ValueError('not a valid MAC address: {!r}'.format(bstr))

  try:
    return int(bstr, 16)
  except ValueError:
    raise ValueError('not a valid MAC address: {!r}'.format(bstr))
47265
def _generate_new_address(self, creator=None) -> str:
        
        if creator:
            # TODO: Use nounce
            return "0x" + str(mk_contract_address(creator, 0).hex())
        while True:
            address = "0x" + "".join([str(hex(randint(0, 16)))[-1] for _ in range(40)])
            if address not in self.accounts.keys():
                return address
718506
def address(self):
        """"""
        if self._address is None:
            self._address = multisig_to_address(self.public_keys, self.m,
                                                version=self.version)
        return self._address
765498
def set_mac_addr(self, mac_addr):
        

        yield from self._hypervisor.send('{platform} set_mac_addr "{name}" {mac_addr}'.format(platform=self._platform,
                                                                                              name=self._name,
                                                                                              mac_addr=mac_addr))

        log.info('Router "{name}" [{id}]: MAC address updated from {old_mac} to {new_mac}'.format(name=self._name,
                                                                                                  id=self._id,
                                                                                                  old_mac=self._mac_addr,
                                                                                                  new_mac=mac_addr))
        self._mac_addr = mac_addr