def generateElementsQNamed(list, name, uri):
 for n in list:
  if (IElement.providedBy(n) and (n.name == name) and (n.uri == uri)):
   (yield n)

def generateElementsQNamed ( list , name , uri ) : for n in list : if ( IElement . providedBy ( n ) and ( n . name == name ) and ( n . uri == uri ) ) : ( yield n )
filters element items in a list with matching name and uri .