docstr: Receive a message with a known microbatch index, and handle out-of-order
  messages by placing them back on the queue
docstr_tok: ["Receive","a","message","with","a","known","microbatch","index",",","and","handle","out-of-order","messages","by","placing","them","back","on","the","queue"]
code: def get_out_of_order(self, queue_name: int, index: int) -> Tensors:
      """Receive a message with a known microbatch index, and handle out-of-order
      messages by placing them back on the queue"""
  
      queue = globals()["MessageQueues"][queue_name]
      out_of_order: List[PipeMessage] = []
      while True:
          message = self.recv_message(queue_name)
          got_index = message.args
          value = message.tensors
          if got_index == index:
              for b in out_of_order:
                  queue.put(b)
              return value
          else:
              out_of_order.append(message)
  
imports: from abc import ABC
  from dataclasses import dataclass
  from queue import Empty
  from queue import Queue
  from typing import Dict, List, Optional
  import torch
  from fairscale.internal.object import pyobject_to_tensor, tensor_to_pyobject
  from fairscale.nn.model_parallel import get_pipeline_parallel_group
  from .types import MESSAGE_GENERATION_START, InputDevice, PipeMessage, Tensors
label_desc: Use image node_id 4 for calling the RpcTransport obj's underlying member method code with example usage: obj.get_out_of_order(queue_name, index) and returns: value