def safe_infer(node):
 try:
  inferit = node.infer()
  value = next(inferit)
 except astroid.InferenceError:
  return
 try:
  next(inferit)
  return
 except astroid.InferenceError:
  return
 except StopIteration:
  return value

def safe_infer ( node ) : try : inferit = node . infer ( ) value = next ( inferit ) except astroid . InferenceError : return try : next ( inferit ) return except astroid . InferenceError : return except StopIteration : return value
return the inferred value for the given node .