def find_interface(resource, class_or_interface):
 if IInterface.providedBy(class_or_interface):
  test = class_or_interface.providedBy
 else:
  test = (lambda arg: isinstance(arg, class_or_interface))
 for location in lineage(resource):
  if test(location):
   return location

def find_interface ( resource , class_or_interface ) : if IInterface . providedBy ( class_or_interface ) : test = class_or_interface . providedBy else : test = ( lambda arg : isinstance ( arg , class_or_interface ) ) for location in lineage ( resource ) : if test ( location ) : return location
find and return an interface in a file given an interface name and file .