This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import uvicorn | |
| from fastapi import FastAPI | |
| from fastapi.routing import APIRouter | |
| from fastapi_websocket_pubsub import PubSubEndpoint | |
| import redis.asyncio as redis | |
| STOPWORD = "STOP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Full getting started tutorial by Greg Baugues at: | |
| # https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html | |
| import gspread | |
| from oauth2client.service_account import ServiceAccountCredentials | |
| # use creds to create a client to interact with the Google Drive API | |
| scope = ["https://spreadsheets.google.com/feeds"] | |
| creds = ServiceAccountCredentials.from_json_keyfile_name("client_secret.json", scope) # json file from your Google API Console | |
| client = gspread.authorize(creds) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| import sys | |
| milliseconds_to_convert = 1602858657059 | |
| return datetime.datetime.fromtimestamp(milliseconds_to_convert/1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """CONVENTIONS: | |
| positions are done row-column from the bottom left and are both numbers. This corresponds to the alpha-number system in traditional chess while being computationally useful. they are specified as tuples | |
| """ | |
| import itertools | |
| WHITE = "white" | |
| BLACK = "black" | |