def select_child(cache, left, right):
 right = (always_in if (right is None) else frozenset(right))
 for parent in left:
  for child in cache.iterchildren(parent):
   if (child in right):
    (yield child)

def select_child ( cache , left , right ) : right = ( always_in if ( right is None ) else frozenset ( right ) ) for parent in left : for child in cache . iterchildren ( parent ) : if ( child in right ) : ( yield child )
right is an immediate child of left .