def inference_tip(infer_function, raise_on_overwrite=False):
def transform(node, infer_function=infer_function):<EOL><INDENT>if (<EOL>raise_on_overwrite<EOL>and node._explicit_inference is not None<EOL>and node._explicit_inference is not infer_function<EOL>):<EOL><INDENT>raise InferenceOverwriteError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>existing_inference=infer_function,<EOL>new_inference=node._explicit_inference,<EOL>node=node,<EOL>)<EOL>)<EOL><DEDENT>node._explicit_inference = _inference_tip_cached(infer_function)<EOL>return node<EOL><DEDENT>return transform<EOL>
Given an instance specific inference function, return a function to be
    given to MANAGER.register_transform to set this inference function.

    :param bool raise_on_overwrite: Raise an `InferenceOverwriteError`
        if the inference tip will overwrite another. Used for debugging

    Typical usage

    .. sourcecode:: python

       MANAGER.register_transform(Call, inference_tip(infer_named_tuple),
                                  predicate)

    .. Note::

        Using an inference tip will override
        any previously set inference tip for the given
        node. Use a predicate in the transform to prevent
        excess overwrites.