code: def encode(value):
    
  
    if value > MAX_VALUE:
      raise ValueError('value {!r} exceeds MAC address range'.format(value))
    if value < 0:
      raise ValueError('value must not be negative')
  
    # todo: convert to the right byte order. the resulting
    # mac address is reversed on my machine compared to the
    # mac address displayed by the hello-myo SDK sample.
    # See issue #7
  
    string = ('%x' % value).rjust(12, '0')
    assert len(string) == 12
  
    result = ':'.join(''.join(pair) for pair in zip(*[iter(string)]*2))
    return result.upper()
docs: Encodes the number *value* to a MAC address ASCII string in binary form.
    Raises a #ValueError if *value* is a negative number or exceeds the MAC
    address range.