@lru_cache(maxsize=<NUM_LIT>)<EOL>def safe_infer(<EOL>node: astroid.node_classes.NodeNG, context=None<EOL>) -> Optional[astroid.node_classes.NodeNG]:
try:<EOL><INDENT>inferit = node.infer(context=context)<EOL>value = next(inferit)<EOL><DEDENT>except astroid.InferenceError:<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>next(inferit)<EOL>return None  <EOL><DEDENT>except astroid.InferenceError:<EOL><INDENT>return None  <EOL><DEDENT>except StopIteration:<EOL><INDENT>return value<EOL><DEDENT>
Return the inferred value for the given node.

    Return None if inference failed or if there is some ambiguity (more than
    one node has been inferred).