Purge the stream

        :param stream_id: The stream identifier
        :param remove_definition: Whether to remove the stream definition as well
        :param sandbox: The sandbox for this stream
        :return: None
        :raises: NotImplementedError

def purge_stream(self, stream_id, remove_definition=False, sandbox=None):
        """
        Purge the stream

        :param stream_id: The stream identifier
        :param remove_definition: Whether to remove the stream definition as well
        :param sandbox: The sandbox for this stream
        :return: None
        :raises: NotImplementedError
        """
        # TODO: Add time interval to this

        if sandbox is not None:
            raise NotImplementedError

        if stream_id not in self.streams:
            raise StreamNotFoundError("Stream with id '{}' not found".format(stream_id))

        stream = self.streams[stream_id]
        query = stream_id.as_raw()
        with switch_db(StreamInstanceModel, 'hyperstream'):
            StreamInstanceModel.objects(__raw__=query).delete()

        # Also update the stream status
        stream.calculated_intervals = TimeIntervals([])

        if remove_definition:
            with switch_db(StreamDefinitionModel, 'hyperstream'):
                StreamDefinitionModel.objects(__raw__=query).delete()

        logging.info("Purged stream {}".format(stream_id))