# Gemfile
gem 'draper'
# app/decorators/user_decorator.rb
class UserDecorator < Draper::Decorator
delegate_all
import time
import threading
from collections import deque, defaultdict
class SlidingWindowLimiter:
import abc
from typing import IO
class Exporter(abc.ABC):
name: str = ""
from dataclasses import dataclass, field
from datetime import datetime, timezone
from decimal import Decimal
def _now():
import errno
import fcntl
import os
import time
import functools
import threading
def debounce(wait):
def decorator(func):
class ReportsController < ApplicationController
def monthly_sales
year = params.fetch(:year, Date.current.year).to_i
rows = Order.monthly_sales(year: year)
@report = MonthlySalesReport.new(rows, year: year)
from functools import wraps
from django.http import JsonResponse
from django.core.cache import cache
def ajax_required(view_func):
import functools
import threading
import time
from collections import OrderedDict