code: def committors(sources, sinks, msm):
      
  
      if hasattr(msm, 'all_transmats_'):
          commits = np.zeros(msm.all_transmats_.shape[:2])
          for i, tprob in enumerate(msm.all_transmats_):
              commits[i, :] = _committors(sources, sinks, tprob)
          return np.median(commits, axis=0)
  
      return _committors(sources, sinks, msm.transmat_)
docs: Get the forward committors of the reaction sources -> sinks.
  
      Parameters
      ----------
      sources : array_like, int
          The set of unfolded/reactant states.
      sinks : array_like, int
          The set of folded/product states.
      msm : msmbuilder.MarkovStateModel
          MSM fit to the data.
  
      Returns
      -------
      forward_committors : np.ndarray
          The forward committors for the reaction sources -> sinks
  
      References
      ----------
      .. [1] Weinan, E. and Vanden-Eijnden, E. Towards a theory of
             transition paths. J. Stat. Phys. 123, 503-523 (2006).
      .. [2] Metzner, P., Schutte, C. & Vanden-Eijnden, E.
             Transition path theory for Markov jump processes.
             Multiscale Model. Simul. 7, 1192-1219 (2009).
      .. [3] Berezhkovskii, A., Hummer, G. & Szabo, A. Reactive
             flux and folding pathways in network models of
             coarse-grained protein dynamics. J. Chem. Phys.
             130, 205102 (2009).
      .. [4] Noe, Frank, et al. "Constructing the equilibrium ensemble of folding
             pathways from short off-equilibrium simulations." PNAS 106.45 (2009):
             19011-19016.