class_docstr: Dispatch calls to a chain of commands until some func can handle it
  
  Usage: instantiate, execute "add" to add commands (with optional
  priority), execute normally via f() calling mechanism.
class_docstr_tok: ["Dispatch","calls","to","a","chain","of","commands","until","some","func","can","handle","it","Usage",":","instantiate",",","execute","``","add","''","to","add","commands","(","with","optional","priority",")",",","execute","normally","via","f","(",")","calling","mechanism","."]
docstr: Add a func to the cmd chain with given priority 
docstr_tok: ["Add","a","func","to","the","cmd","chain","with","given","priority"]
code: def add(self, func, priority=0):
      """Add a func to the cmd chain with given priority"""
      self.chain.append((priority, func))
      self.chain.sort(key=lambda x: x[0])
  
imports: import os
  import subprocess
  import warnings
  import sys
  from IPython.core.error import TryNext
  import tempfile
label_desc: Use image node_id 4 for calling the CommandChainDispatcher obj's underlying member method code with example usage: obj.add(func, priority) without return types