code: def get_active_length(self):
          
          nonzero_steps = np.any(self.pianoroll, axis=1)
          inv_last_nonzero_step = np.argmax(np.flip(nonzero_steps, axis=0))
          active_length = self.pianoroll.shape[0] - inv_last_nonzero_step
          return active_length
docs: Return the active length (i.e., without trailing silence) of the
          pianoroll. The unit is time step.
  
          Returns
          -------
          active_length : int
              The active length (i.e., without trailing silence) of the pianoroll.