@classmethod
    def as_csv(cls, slug, timestamp):
        timestamp_format = '%Y-%m-%d_%H-%M-%S'
        try:
            filename = '%s-%s.csv' % (slug, time.strftime(timestamp_format, time.gmtime(float(timestamp))))
        except __HOLE__:
            abort(404, 'Invalid timestamp: %s' % timestamp)

        response.content_type = 'text/csv'
        response.content_disposition = 'attachment; filename=%s' % filename
        data = MetricsSession.get_data_as_csv(slug, timestamp)
        if not data:
            abort(404, 'Session does not exist: %s' % timestamp)

        return data
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/localv1/metrics.py/MetricsController.as_csv