code: def pack_mac(macstr):
  	
  	if not isinstance(macstr, basestring):
  		raise ValueError("given mac addresses is not a string")
  	parts = macstr.split(":")
  	if len(parts) != 6:
  		raise ValueError("given mac addresses has an invalid number of colons")
  	parts = [int(part, 16) for part in parts]  # raises ValueError
  	return int_seq_to_bytes(parts)
docs: Converts a mac address given in colon delimited notation to a
  	six byte string in network byte order.
  
  	>>> pack_mac("30:31:32:33:34:35") == b'012345'
  	True
  	>>> pack_mac("bad")
  	Traceback (most recent call last):
  	...
  	ValueError: given mac addresses has an invalid number of colons
  
  
  	@type macstr: str
  	@rtype: bytes
  	@raises ValueError: for badly formatted mac addresses