def unpack_infer(stmt, context=None):
 if isinstance(stmt, (List, Tuple)):
  for elt in stmt.elts:
   for infered_elt in unpack_infer(elt, context):
    (yield infered_elt)
  return
 infered = next(stmt.infer(context))
 if (infered is stmt):
  (yield infered)
  return
 for infered in stmt.infer(context):
  if (infered is YES):
   (yield infered)
  else:
   for inf_inf in unpack_infer(infered, context):
    (yield inf_inf)

def unpack_infer ( stmt , context = None ) : if isinstance ( stmt , ( List , Tuple ) ) : for elt in stmt . elts : for infered_elt in unpack_infer ( elt , context ) : ( yield infered_elt ) return infered = next ( stmt . infer ( context ) ) if ( infered is stmt ) : ( yield infered ) return for infered in stmt . infer ( context ) : if ( infered is YES ) : ( yield infered ) else : for inf_inf in unpack_infer ( infered , context ) : ( yield inf_inf )
recursively generate nodes inferred by the given statement .