code: def length(self, chain=-1):
          
          if chain is not None:
              tables = [self.db._gettables()[chain], ]
          else:
              tables = self.db._gettables()
  
          n = asarray([table.nrows for table in tables])
          return n.sum()
docs: Return the length of the trace.
  
          :Parameters:
          chain : int or None
            The chain index. If None, returns the combined length of all chains.