concepts.dm.crow.crow_expression_utils.crow_replace_expression_variables#
- crow_replace_expression_variables(expr, mappings=None, ctx=None)[source]#
Replace variables in an expression with other expressions. Allowed replacements are:
Replace a
VariableExpressionwith aVariableor aValueOutputExpression.Replace a
FunctionApplicationExpressionwith aVariableor aValueOutputExpression.
- Parameters:
expr (Expression) – the expression to replace variables.
mappings (Dict[FunctionApplicationExpression | VariableExpression, Variable | ObjectOrValueOutputExpression] | None) – a dictionary of {expression: sub-expression} to replace the expression with the sub-expression.
ctx (ExpressionDefinitionContext | None) – a
ExpressionDefinitionContext.
- Return type:
ObjectOrValueOutputExpression | VariableAssignmentExpression