def imdb_populator(parserclass, prop, default):
    """Create and return an IMDb method to populate (from the database) some
    property for multiple IMDbTitle objects."""
    def populate(self, titles):
        """Auto-generated function to populate (from the database) this
        property for multiple IMDbTitle objects."""
        titles = tuple(title for title in titles)
        # FIXME: Optimize if title._rating is None)
        parser = parserclass(dbfile=self.dbfile, debug=self.debug)
        results = parser.search(title.title for title in titles)
        for title in titles:
            if results in title.title:
                setattr(title, prop, results[title.title])
            else:               # No data available
                setattr(title, prop, default)
    return populate
dataset/ETHPy150Open nandhp/python-imdb/imdb/__init__.py/imdb_populator/swapped operands of `in`