class_docstr: Fixed-size priority queue keeping the max_size largest items.
docstr: Add element to the queue, with a separate priority if desired.
  
  Element will not be added if the queue is at capacity and the element
  has lower priority than the lowest currently in the queue.
  
  :param item:
      item to add to queue.
  :param priority:
      priority to use for item.
docstr_tok: ["Add","element","to","the","queue",",","with","a","separate","priority","if","desired",".","Element","will","not","be","added","if","the","queue","is","at","capacity","and","the","element","has","lower","priority","than","the","lowest","currently","in","the","queue",".",":","param","item",":","item","to","add","to","queue",".",":","param","priority",":","priority","to","use","for","item","."]
code: def add(self, item, priority):
      """
      Add element to the queue, with a separate priority if desired.
  
      Element will not be added if the queue is at capacity and the element
      has lower priority than the lowest currently in the queue.
  
      :param item:
          item to add to queue.
      :param priority:
          priority to use for item.
      """
      if len(self.lst) < self.capacity:
          heapq.heappush(self.lst, (priority, item))
      elif priority > self.lst[0][0]:
          heapq.heapreplace(self.lst, (priority, item))
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import math
  from collections.abc import Sequence
  import heapq
  import json
  import parlai.utils.torch
  from parlai.core.agents import Agent
  from parlai.core.dict import DictionaryAgent
  from parlai.utils.io import PathManager
label_desc: Use image node_id 2 for calling the MaxPriorityQueue obj's underlying member method code with example usage: obj.add(item, priority) without return types