def METHOD_NAME(self, pairs):
    """Join clusters using direct ratios given a tuple (i,j) of bin pairs"""
    for i, j in zip(*pairs):
        # Both bins not joined
        if self.bin_assign[i] == -1 and self.bin_assign[j] == -1:
            # Create new cluster
            self.bin_assign[i] = self.cluster_id
            self.bin_assign[j] = self.cluster_id
            self.cluster_contents[self.cluster_id] = {i, j}
            self.cluster_id += 1
            rij = self.ratios[i, j]
            denom = rij + 1.0
            self.bin_data[i] = rij / denom  # relative probability for bin i
            self.bin_data[j] = denom.recip()  # relative probability for bin j
        # Only one bin previously assigned to a cluster
        elif self.bin_assign[i] == -1 or self.bin_assign[j] == -1:
            if self.bin_assign[i] == -1:
                idum, jdum = i, j
            else:
                idum, jdum = j, i
            jclust = self.bin_assign[jdum]
            rik = self.ratios[idum, jdum]
            pk = self.bin_data[jdum]
            piTmp = rik * pk  # estimate for p_idum / P_cluster based on 'path' through bin k
            # Note that here P_cluster is value before addition of bin idum
            # now, compute relative prob of each bin in *new* cluster (including bin idum)
            denom = piTmp + 1.0
            self.bin_data[idum] = piTmp / denom
            # Update bins already in cluster
            jclust_mid = np.where(self.bin_assign == jclust)  # index of bins in jclust
            self.bin_data[jclust_mid] = self.bin_data[jclust_mid] / denom
            # Move bin idum into cluster jclust
            self.bin_assign[idum] = jclust
            self.cluster_contents[jclust].update({idum})
        # Both bins previously assigned to different cluster; Join clusters
        elif not self.bin_assign[i] == self.bin_assign[j]:
            iclust = self.bin_assign[i]
            jclust = self.bin_assign[j]
            rij = self.ratios[i, j]
            pi = self.bin_data[i]
            pj = self.bin_data[j]
            ij_cluster_ratio = rij * pj / pi
            idenom = ij_cluster_ratio.recip() + 1.0
            jdenom = ij_cluster_ratio + 1.0
            iclust_mid = np.where(self.bin_assign == iclust)
            self.bin_data[iclust_mid] = self.bin_data[iclust_mid] / idenom
            jclust_mid = np.where(self.bin_assign == jclust)
            self.bin_data[jclust_mid] = self.bin_data[jclust_mid] / jdenom
            # Join all bins in cluster j into cluster iclust
            self.bin_assign[jclust_mid] = iclust
            # Move contents of jclust into iclust
            self.cluster_contents[iclust].update(self.cluster_contents[jclust])
            # Clear contents of jclust
            self.cluster_contents[jclust].clear()
            if len(self.cluster_contents[iclust]) == self.nbins:
                break