def _contains_yieldpoint(children):
 if isinstance(children, dict):
  return any((isinstance(i, YieldPoint) for i in children.values()))
 if isinstance(children, list):
  return any((isinstance(i, YieldPoint) for i in children))
 return False

def _contains_yieldpoint ( children ) : if isinstance ( children , dict ) : return any ( ( isinstance ( i , YieldPoint ) for i in children . values ( ) ) ) if isinstance ( children , list ) : return any ( ( isinstance ( i , YieldPoint ) for i in children ) ) return False
returns true if children contains any yieldpoints .