'Return a new code block with common subexpressions eliminated
See the docstring of :func:`sympy.simplify.cse_main.cse` for more
information.
Examples
>>> from sympy import symbols, sin
>>> from sympy.codegen.ast import CodeBlock, Assignment
>>> x, y, z = symbols(\'x y z\')
>>> c = CodeBlock(
...     Assignment(x, 1),
...     Assignment(y, sin(x) + 1),
...     Assignment(z, sin(x) - 1),
>>> c.cse()
CodeBlock(Assignment(x, 1), Assignment(x0, sin(x)), Assignment(y, x0 + 1), Assignment(z, x0 - 1))'

def cse(self, symbols=None, optimizations=None, postprocess=None, order='canonical'):

    from sympy.simplify.cse_main import cse
    if (not all((isinstance(i, Assignment) for i in self.args))):
        raise NotImplementedError('CodeBlock.cse    only    supports    Assignments')
    if any((isinstance(i, AugmentedAssignment) for i in self.args)):
        raise NotImplementedError("CodeBlock.cse    doesn't    yet    work    with    AugmentedAssignments")
    for (i, lhs) in enumerate(self.left_hand_sides):
        if (lhs in self.left_hand_sides[:i]):
            raise NotImplementedError(('Duplicate    assignments    to    the    same    variable    are    not    yet    supported    (%s)' % lhs))
    (replacements, reduced_exprs) = cse(self.right_hand_sides, symbols=symbols, optimizations=optimizations, postprocess=postprocess, order=order)
    assert (len(reduced_exprs) == 1)
    new_block = tuple((Assignment(var, expr) for (var, expr) in zip(self.left_hand_sides, reduced_exprs[0])))
    new_assignments = tuple((Assignment(*i) for i in replacements))
    return self.topological_sort((new_assignments + new_block))
