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 logging | |
import threading | |
import time | |
import sshtunnel | |
from sshtunnel import HandlerSSHTunnelForwarderError, SSHTunnelForwarder | |
sshtunnel.DEFAULT_LOGLEVEL = 1 | |
logging.basicConfig(filename='example.log', filemode='w', level=sshtunnel.DEFAULT_LOGLEVEL) | |
logging.warning('Start example! v %s', sshtunnel.__version__) |
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
const { AsyncLocalStorage } = require('node:async_hooks') | |
const get = require('lodash/get') | |
const httpStorage = new AsyncLocalStorage() | |
const gqlStorage = new AsyncLocalStorage() | |
const KEY = Symbol('_context') | |
// RESOLVERS // | |
async function resolveAllUsers (context, path) { |
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
// NOTE: based on python version: https://gist.github.com/pahaz/17c66fd6d75b74ff307aca2b6bf942f3 | |
const crypto = require('crypto') | |
const fs = require('fs') | |
const path = require('path') | |
const fetch = require('node-fetch') // Import fetch from node-fetch | |
const DEFAULT_OUTPUT_DIR = 'out' | |
const GPT_KEY_FILE = path.resolve(process.env.HOME, '.openai.key') | |
const GPT_CACHE_DIR = path.resolve(process.env.HOME, '.openai.cache') |
OlderNewer