def _pluck_classes(modules, classnames):
 klasses = []
 for classname in classnames:
  klass = None
  for module in modules:
   if hasattr(module, classname):
    klass = getattr(module, classname)
    break
  if (not klass):
   packages = [m.__name__ for m in modules if (m is not None)]
   raise ClassNotFoundError(("No class '%s' found in %s" % (classname, ', '.join(packages))))
  klasses.append(klass)
 return klasses

def _pluck_classes ( modules , classnames ) : klasses = [ ] for classname in classnames : klass = None for module in modules : if hasattr ( module , classname ) : klass = getattr ( module , classname ) break if ( not klass ) : packages = [ m . __name__ for m in modules if ( m is not None ) ] raise ClassNotFoundError ( ( "No class '%s' found in %s" % ( classname , ', ' . join ( packages ) ) ) ) klasses . append ( klass ) return klasses
gets a list of class names and a list of modules to pick from .