Skip to content

Instantly share code, notes, and snippets.

from random import choice
game_state = {"R": "Rock", "P": "Paper", "S": "Scissors"}
options = list(game_state.keys())
winnings = ["RS", "PR", "SP"]
result = "{0} beats {1}"
while True:
computer = choice(options)
player = input("Enter R for Rock , P for Paper, S for Scissors, and, done to quit the game: ").upper()
from random import choice
game_state = {"R": "Rock", "P": "Paper", "S": "Scissors"}
options = list(game_state.keys())
winnings = ["RS", "PR", "SP"]
result = "{0} beats {1}"
while True:
computer = choice(options)
player = input("Enter R for Rock , P for Paper, S for Scissors, and, done to quit the game: ").upper()
from random import choice
game_state = {"R": "Rock", "P": "Paper", "S": "Scissors"}
options = list(game_state.keys())
winnings = ["RS", "PR", "SP"]
result = "{0} beats {1}"
while True:
computer = choice(options)
player = input("Enter R for Rock , P for Paper, S for Scissors, and, done to quit the game: ").upper()
from os import environ
from dotenv import load_dotenv, dotenv_values
class Config:
def __init__(self):
load_dotenv()
# setup non secret config variables here
from abc import ABC, abstractmethod
from fastapi import UploadFile
from pydantic import BaseModel, HttpUrl
class FileData(BaseModel):
"""
Represents the result of an upload operation
Attributes:
import os
import asyncio
import logging
from urllib.parse import quote as urlencode
import boto3
from botocore.exceptions import ClientError, NoCredentialsError
from .main import CloudUpload, FileData, UploadFile
import asyncio
import logging
import os
from azure.storage.blob import BlobServiceClient
from .main import CloudUpload, FileData, UploadFile
logger = logging.getLogger(__name__)
const mongoose = require('mongoose')
const {ratings} = require('stars-schema')
const ProductSchema = new mongoose.Schema({
name: String,
price: Number
}, {toObject: {getters: true}})
function median(ratings){s
from dataclasses import dataclass, field
from enum import StrEnum
class Types(StrEnum):
JOB = 'job'
STORY = 'story'
COMMENT = 'comment'
POLL = 'poll'
POLLOPT = 'pollopt'
import asyncio
from typing import Coroutine, Callable, Awaitable
from signal import signal, SIGINT, SIGTERM
class QueueItem:
def __init__(self, coroutine: Callable | Awaitable | Coroutine, *args, **kwargs):
self.coroutine = coroutine
self.args = args
self.kwargs = kwargs