'Initialize a return value.
Parameters
expr : SymPy expression
name : Symbol, MatrixSymbol, optional
The name of this return variable.  When used for code generation,
this might appear, for example, in the prototype of function in a
list of return values.  A dummy name is generated if omitted.
result_var : Symbol, Indexed, optional
Something that can be used to assign a value to this variable.
Typically the same as `name` but for Indexed this should be e.g.,
"y[i]" whereas `name` should be the Symbol "y".  Defaults to
`name` if omitted.
datatype : optional
When not given, the data type will be guessed based on the
assumptions on the symbol argument.
dimension : sequence containing tupes, optional
If present, this variable is interpreted as an array,
where this sequence of tuples specifies (lower, upper)
bounds for each index of the array.
precision : int, optional
Controls the precision of floating point constants.'

def __init__(self, expr, name=None, result_var=None, datatype=None, dimensions=None, precision=None):

    if (not isinstance(expr, (Basic, MatrixBase))):
        raise TypeError('The    first    argument    must    be    a    sympy    expression.')
    if (name is None):
        name = ('result_%d' % abs(hash(expr)))
    if isinstance(name, string_types):
        if isinstance(expr, (MatrixBase, MatrixExpr)):
            name = MatrixSymbol(name, *expr.shape)
        else:
            name = Symbol(name)
    if (result_var is None):
        result_var = name
    Variable.__init__(self, name, datatype=datatype, dimensions=dimensions, precision=precision)
    ResultBase.__init__(self, expr, result_var)
