export type EventMap = Record<string, unknown[]>;
type Listener<Args extends unknown[]> = (...args: Args) => void;
export class TypedEmitter<Events extends EventMap> {
private listeners = new Map<keyof Events, Set<Listener<any>>>();
from typing import List, Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from .dataloader import DataLoader
<?php
namespace App\Domain;
use InvalidArgumentException;
import { useCallback, useEffect, useRef } from 'react';
export function useRafThrottle(callback) {
const savedCallback = useRef(callback);
const frame = useRef(null);
const latestArgs = useRef([]);
package com.example.ratelimit;
public class TokenBucket {
private final long capacity;
private final long refillTokens;
import time
import threading
from collections import deque, defaultdict
class SlidingWindowLimiter:
from marshmallow import (
Schema, fields, validates, validates_schema,
ValidationError, RAISE,
)
from marshmallow.validate import Length, Email, Equal
class RevenueStat
DEFAULT_RANGE = 30.days
def initialize(account, range: DEFAULT_RANGE)
@account = account
@range = range
class OnboardingForm
include ActiveModel::Model
include ActiveModel::Attributes
STEPS = %i[account profile preferences].freeze
package com.example.security;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
package com.shop.inventory;
import jakarta.persistence.*;
@Entity
@Table(name = "inventory_item")
package optimistic
import (
"errors"
"sync"
)