import { AxiosError } from 'axios';
export const RETRY_CONFIG = {
maxRetries: 4,
baseDelayMs: 200,
maxDelayMs: 5_000,
from marshmallow import (
Schema, fields, validates, validates_schema,
ValidationError, RAISE,
)
from marshmallow.validate import Length, Email, Equal
package com.example.ratelimit;
public class TokenBucket {
private final long capacity;
private final long refillTokens;
import { useState, useRef, useEffect, useCallback } from 'react';
export function useOnScreen(options = {}) {
const [node, setNode] = useState(null);
const [isIntersecting, setIsIntersecting] = useState(false);
export interface QueryCodec<T> {
parse: (raw: string | null) => T;
serialize: (value: T) => string | null;
}
export function stringParam(fallback = ""): QueryCodec<string> {
from datetime import date, datetime
from decimal import Decimal, InvalidOperation
from enum import Enum
from pydantic import BaseModel, field_validator
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AppConfig {
#[serde(default)]
pub server: ServerConfig,
class Cart < ApplicationRecord
has_many :cart_items, dependent: :destroy
EXPIRY_WINDOW = 2.hours
scope :active, -> { where(state: :active) }
@MappedSuperclass
@FilterDef(
name = "tenantFilter",
parameters = @ParamDef(name = "tenantId", type = String.class)
)
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
function createReadiness() {
let ready = true;
function markUnready() {
ready = false;
}
import type { Redis } from "ioredis";
export interface RawEntry {
member: string;
score: number;
}
use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct Page<T> {
pub items: Vec<T>,
#[serde(default)]