def __process_inequalities(self, block_index):
initial_block_index = block_index<EOL>row_offsets = [<NUM_LIT:0>]<EOL>for block, block_size in enumerate(self.block_struct):<EOL><INDENT>row_offsets.append(row_offsets[block] + block_size ** <NUM_LIT:2>)<EOL><DEDENT>if self._parallel:<EOL><INDENT>pool = Pool()<EOL><DEDENT>for k, ineq in enumerate(self.constraints):<EOL><INDENT>block_index += <NUM_LIT:1><EOL>monomials = self.localizing_monomial_sets[block_index -<EOL>initial_block_index-<NUM_LIT:1>]<EOL>lm = len(monomials)<EOL>if isinstance(ineq, str):<EOL><INDENT>self.__parse_expression(ineq, row_offsets[block_index-<NUM_LIT:1>])<EOL>continue<EOL><DEDENT>if ineq.is_Relational:<EOL><INDENT>ineq = convert_relational(ineq)<EOL><DEDENT>func = partial(moment_of_entry, monomials=monomials, ineq=ineq,<EOL>substitutions=self.substitutions)<EOL>if self._parallel and lm > <NUM_LIT:1>:<EOL><INDENT>chunksize = max(int(np.sqrt(lm*lm/<NUM_LIT:2>) /<EOL>cpu_count()), <NUM_LIT:1>)<EOL>iter_ = pool.map(func, ([row, column] for row in range(lm)<EOL>for column in range(row, lm)),<EOL>chunksize)<EOL><DEDENT>else:<EOL><INDENT>iter_ = imap(func, ([row, column] for row in range(lm)<EOL>for column in range(row, lm)))<EOL><DEDENT>if block_index > self.constraint_starting_block +self._n_inequalities and lm > <NUM_LIT:1>:<EOL><INDENT>is_equality = True<EOL><DEDENT>else:<EOL><INDENT>is_equality = False<EOL><DEDENT>for row, column, polynomial in iter_:<EOL><INDENT>if is_equality:<EOL><INDENT>row, column = <NUM_LIT:0>, <NUM_LIT:0><EOL><DEDENT>self.__push_facvar_sparse(polynomial, block_index,<EOL>row_offsets[block_index-<NUM_LIT:1>],<EOL>row, column)<EOL>if is_equality:<EOL><INDENT>block_index += <NUM_LIT:1><EOL><DEDENT><DEDENT>if is_equality:<EOL><INDENT>block_index -= <NUM_LIT:1><EOL><DEDENT>if self.verbose > <NUM_LIT:0>:<EOL><INDENT>sys.stdout.write("<STR_LIT>" %<EOL>(k+<NUM_LIT:1>, len(self.constraints)))<EOL>sys.stdout.flush()<EOL><DEDENT><DEDENT>if self._parallel:<EOL><INDENT>pool.close()<EOL>pool.join()<EOL><DEDENT>if self.verbose > <NUM_LIT:0>:<EOL><INDENT>sys.stdout.write("<STR_LIT:\n>")<EOL><DEDENT>return block_index<EOL>
Generate localizing matrices

        Arguments:
        inequalities -- list of inequality constraints
        monomials    -- localizing monomials
        block_index -- the current block index in constraint matrices of the
                       SDP relaxation