code: def addSubject(self, subject):
      # Skip the subject if it was already added.
      if subject in self.__subjects:
          return
  
      # If the subject has no specific dispatch priority put it right at the end.
      if subject.getDispatchPriority() is dispatchprio.LAST:
          self.__subjects.append(subject)
      else:
          # Find the position according to the subject's priority.
          pos = 0
          for s in self.__subjects:
              if (
                  s.getDispatchPriority() is dispatchprio.LAST
                  or subject.getDispatchPriority()
                  < s.getDispatchPriority()
              ):
                  break
              pos += 1
          self.__subjects.insert(pos, subject)
  
      subject.onDispatcherRegistered(self)
  
file_path: pyalgotrade/pyalgotrade/dispatcher.py
imports: from pyalgotrade import utils
  from pyalgotrade import observer
  from pyalgotrade import dispatchprio
label_desc: Use image node_id 7 for calling the Dispatcher obj's underlying member method code with example usage: obj.addSubject(subject) without return types