def METHOD_NAME(self, parameter_map: dict, allow_unknown_parameters: bool = False):
    """Substitute self with the corresponding parameter in ``parameter_map``."""
    if self in parameter_map:
        return parameter_map[self]
    if allow_unknown_parameters:
        return self
    raise CircuitError(
        "Cannot bind Parameters ({}) not present in "
        "expression.".format([str(p) for p in parameter_map])
    )