import DataLoader from "dataloader";
import { Pool } from "pg";
export interface User { id: number; name: string; }
export interface Post { id: number; user_id: number; title: string; }
from typing import List, Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from .dataloader import DataLoader
import pandas as pd
import torch
from PIL import Image
from torch.utils.data import Dataset, DataLoader
class ProductImageDataset(Dataset):
# Gemfile
gem 'graphql'
# Installation
# rails generate graphql:install
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
export async function getFeedNaive(limit = 20) {
const posts = await prisma.post.findMany({
package feed
import "time"
type Post struct {
ID int64
class BatchLoader {
constructor(batchFn, { cacheKeyFn = (k) => k } = {}) {
this.batchFn = batchFn;
this.cacheKeyFn = cacheKeyFn;
this.cache = new Map();
this.queue = [];