code: def safe_infer(node, context=None):
      
      try:
          inferit = node.infer(context=context)
          value = next(inferit)
      except exceptions.InferenceError:
          return None
      try:
          next(inferit)
          return None  # None if there is ambiguity on the inferred node
      except exceptions.InferenceError:
          return None  # there is some kind of ambiguity
      except StopIteration:
          return value
docs: 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).