code: def _pairs_to_np(self, pairlist, dim):
          '''Given a set of pair probability lines, construct a numpy array.
  
          :param pairlist: a list of pair probability triples
          :type pairlist: list
          :returns: An upper triangular matrix of pair probabilities augmented
                    with one extra column that represents the unpaired
                    probabilities.
          :rtype: numpy.array
  
          '''
          mat = np.zeros((dim, dim + 1))
          for line in pairlist:
              i = int(line[0]) - 1
              j = int(line[1]) - 1
              prob = float(line[2])
              mat[i, j] = prob
          return maf _pairs_to_np(self, pairlist, dim):
          '''Given a set of pair probability lines, construct a numpy array.
  
          :param pairlist: a list of pair probability triples
          :type pairlist: list
          :returns: An upper triangular matrix of pair probabilities augmented
                    with one extra column that represents the unpaired
                    probabilities.
          :rtype: numpy.array
  
          '''
          mat = np.zeros((dim, dim + 1))
          for line in pairlist:
              i = int(line[0]) - 1
              j = int(line[1]) - 1
              prob = float(line[2])
              mat[i, j] = prob
          return mat
docs: Given a set of pair probability lines, construct a numpy array.
  
          :param pairlist: a list of pair probability triples
          :type pairlist: list
          :returns: An upper triangular matrix of pair probabilities augmented
                    with one extra column that represents the unpaired
                    probabilities.
          :rtype: numpy.array