code: def root(self, cls=None, level=0):
          
          if cls is None:
              if self.parent is None:
                  return self, level
          else:
              if isinstance(self, cls):
                  if not isinstance(self.parent, cls):
                      return self, level
  
          if self.parent is None:
              return None, None
  
          return self.parent.root(cls, level - 1)
docs: Returns the top-most HubComponent in the hierarchy.
  
          If `cls` is not None, then return the top-most attribute HubComponent
          that is an instance of class `cls`.
  
          For a fully-constructed track hub (and `cls=None`), this should return
          a a Hub object for every component in the hierarchy.