def map(self, function, new_collection, **kwargs):
        """
        Maps a collection to a new collection with a provided function.

        | Arguments:
        | ``function`` -- The function used for mapping.
        | ``new_collection`` -- The name of the collection to insert the new values into.  
            Any existing values will be deleted.
            If ``None``, values are mapped to the same collection.

        | Keyword arguments:
        | ``create_if_missing`` -- when False a ValueError is raised if the new collection doesn't exist
        | ``error_if_exists`` -- When True a ValueError is raised if the new collection already exists 
        """
        collection = None
        if [None, self.name] in new_collection:
            collection = self
            for key in self.keys:
                new_value = function(decode(self.db.get(key)))
                self.db.put(key, encode(new_value))
        else:
            collection = self.parent_db.collection(new_collection, reset_collection=True, **kwargs)
            for instance in self:
                collection.append(function(instance))

        return collection
dataset/ETHPy150Open corbt/pypeline/pypeline/DB.py/Collection.map/swapped operands of `in`