def collection(self, collection_name, reset_collection=False, 
        create_if_missing=True, error_if_exists=False):
        """
        Returns the collection stored at `collection_name`, or creates it if it doesn't exist.

        | Arguments:
        | ``collection_name`` -- the name of the collection to return

        | Keyword arguments:
        | ``reset_collection`` -- when True any existant data in the collection is deleted before it is returned
        | ``create_if_missing`` -- when False a ValueError is raised if the collection doesn't exist
        | ``error_if_exists`` -- When True a ValueError is raised if the collection already exists 
        """

        if collection_name not in self.collections_cache:
            data = self.collections_set.get(collection_name.encode())
            if data == None:
                if create_if_missing == False:
                    raise ValueError("Collection '{0}' does not exist".format(collection_name))
                self.collections_set.put(collection_name.encode(), b'true')
            self.collections_cache[collection_name] = Collection(self, self.collection_items_set, collection_name)
        elif error_if_exists:
            raise ValueError("Collection '{0}' already exists".format(collection_name))

        if reset_collection:
            self.collections_cache[collection_name].delete_all()

        return self.collections_cache[collection_name]
dataset/ETHPy150Open corbt/pypeline/pypeline/DB.py/DB.collection/original