@classmethod
def flush(cls, key=None, default=None):
    """Flush a specific key or all of the databag (i.e. return and delete).

        Args:
            key(str): Key to set(i.e. 'foo' or 'foo.bar.baz' for a deep key)
            default(object, optional): Defaults to None. Default if key does not exist

        Returns:
            object: Value of the key
        """
    if key:
        data = cls.get(key, default)
        cls.delete(key)
        return data
    data = cls.all()
    cls.clear()
    return data
