def infer_dict(node, context=None):
 has_keywords = (lambda args: all((isinstance(arg, nodes.Keyword) for arg in args)))
 if ((not node.args) and (not node.kwargs)):
  return nodes.Dict()
 elif (has_keywords(node.args) and node.args):
  items = [(nodes.Const(arg.arg), arg.value) for arg in node.args]
 elif ((len(node.args) >= 2) and has_keywords(node.args[1:])):
  elts = _get_elts(node.args[0], context)
  keys = [(nodes.Const(arg.arg), arg.value) for arg in node.args[1:]]
  items = (elts + keys)
 elif (len(node.args) == 1):
  items = _get_elts(node.args[0], context)
 else:
  raise UseInferenceDefault()
 empty = nodes.Dict()
 empty.items = items
 return empty

def infer_dict ( node , context = None ) : has_keywords = ( lambda args : all ( ( isinstance ( arg , nodes . Keyword ) for arg in args ) ) ) if ( ( not node . args ) and ( not node . kwargs ) ) : return nodes . Dict ( ) elif ( has_keywords ( node . args ) and node . args ) : items = [ ( nodes . Const ( arg . arg ) , arg . value ) for arg in node . args ] elif ( ( len ( node . args ) >= 2 ) and has_keywords ( node . args [ 1 : ] ) ) : elts = _get_elts ( node . args [ 0 ] , context ) keys = [ ( nodes . Const ( arg . arg ) , arg . value ) for arg in node . args [ 1 : ] ] items = ( elts + keys ) elif ( len ( node . args ) == 1 ) : items = _get_elts ( node . args [ 0 ] , context ) else : raise UseInferenceDefault ( ) empty = nodes . Dict ( ) empty . items = items return empty
try to infer a dict call to a dict node .