def _encode_uuid(name, value, dummy, opts):
 uuid_representation = opts.uuid_representation
 if (uuid_representation == OLD_UUID_SUBTYPE):
  return ((('\x05' + name) + '\x10\x00\x00\x00\x03') + value.bytes)
 elif (uuid_representation == JAVA_LEGACY):
  from_uuid = value.bytes
  data = (from_uuid[0:8][::(-1)] + from_uuid[8:16][::(-1)])
  return ((('\x05' + name) + '\x10\x00\x00\x00\x03') + data)
 elif (uuid_representation == CSHARP_LEGACY):
  return ((('\x05' + name) + '\x10\x00\x00\x00\x03') + value.bytes_le)
 else:
  return ((('\x05' + name) + '\x10\x00\x00\x00\x04') + value.bytes)

def _encode_uuid ( name , value , dummy , opts ) : uuid_representation = opts . uuid_representation if ( uuid_representation == OLD_UUID_SUBTYPE ) : return ( ( ( '\x05' + name ) + '\x10\x00\x00\x00\x03' ) + value . bytes ) elif ( uuid_representation == JAVA_LEGACY ) : from_uuid = value . bytes data = ( from_uuid [ 0 : 8 ] [ : : ( - 1 ) ] + from_uuid [ 8 : 16 ] [ : : ( - 1 ) ] ) return ( ( ( '\x05' + name ) + '\x10\x00\x00\x00\x03' ) + data ) elif ( uuid_representation == CSHARP_LEGACY ) : return ( ( ( '\x05' + name ) + '\x10\x00\x00\x00\x03' ) + value . bytes_le ) else : return ( ( ( '\x05' + name ) + '\x10\x00\x00\x00\x04' ) + value . bytes )
encode uuid .