code: def _calculate_constraints_sum(cls, prop_table, prop_margin, axis):
          
          if axis not in [0, 1]:
              raise ValueError("Unexpected value for `axis`: {}".format(axis))
  
          V = prop_table * (1 - prop_table)
          if axis == 0:
              # If axis is 0, sumation is performed across the 'i' index, which
              # requires the matrix to be multiplied from the right
              # (because of the inner matrix dimensions).
              return np.dot(V, prop_margin)
          elif axis == 1:
              # If axis is 1, sumation is performed across the 'j' index, which
              # requires the matrix to be multiplied from the left
              # (because of the inner matrix dimensions).
              return np.dot(prop_margin, V)
docs: Calculate sum of constraints (part of the standard error equation).
  
          This method calculates the sum of the cell proportions multiplied by
          row (or column) marginal proportions (margins divide by the total
          count). It does this by utilizing the matrix multiplication, which
          directly translates to the mathematical definition (the sum
          across i and j indices).