def _resolve_asspart(parts, asspath, context):
 asspath = asspath[:]
 index = asspath.pop(0)
 for part in parts:
  if hasattr(part, 'getitem'):
   try:
    assigned = part.getitem(index, context)
   except (TypeError, IndexError):
    return
   if (not asspath):
    (yield assigned)
   elif (assigned is YES):
    return
   else:
    try:
     for infered in _resolve_asspart(assigned.infer(context), asspath, context):
      (yield infered)
    except InferenceError:
     return

def _resolve_asspart ( parts , asspath , context ) : asspath = asspath [ : ] index = asspath . pop ( 0 ) for part in parts : if hasattr ( part , 'getitem' ) : try : assigned = part . getitem ( index , context ) except ( TypeError , IndexError ) : return if ( not asspath ) : ( yield assigned ) elif ( assigned is YES ) : return else : try : for infered in _resolve_asspart ( assigned . infer ( context ) , asspath , context ) : ( yield infered ) except InferenceError : return
recursive function to resolve multiple assignments .