def select_descendant(cache, left, right):
 right = (always_in if (right is None) else frozenset(right))
 for ancestor in left:
  for descendant in cache.iterdescendants(ancestor):
   if (descendant in right):
    (yield descendant)

def select_descendant ( cache , left , right ) : right = ( always_in if ( right is None ) else frozenset ( right ) ) for ancestor in left : for descendant in cache . iterdescendants ( ancestor ) : if ( descendant in right ) : ( yield descendant )
right is a child .