This file contains 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
from typing import List | |
import markovify | |
import argparse | |
# Example: | |
# python sentence_generator.py text_1.txt text_2.txt text_2.txt --state-size 2 | |
# python sentence_generator.py text_1.txt text_2.txt | |
def main(filenames: List[str], state_size: int) -> str: | |
text_model = markovify.combine([load_text_model(filename, state_size=state_size) for filename in filenames]) |
This file contains 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
class A: | |
def __init__(self): | |
self.some_value = {} | |
class B(A): | |
def modify_value(self): | |
self.some_value.update({"some_value": "b"}) | |
class C(A): |
This file contains 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
class A: | |
some_value = {} | |
class B(A): | |
def modify_value(self): | |
self.some_value.update({"some_value": "b"}) | |
class C(A): |
This file contains 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
{ | |
"name": "literature", | |
"version": "1.0.0", | |
"description": "", | |
"main": "app.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
This file contains 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
if (process.env.NODE_ENV !== 'production') { | |
require('dotenv').load(); | |
} | |
var Connection = require('tedious').Connection; | |
var Request = require('tedious').Request; | |
var fs = require('fs'); | |
var query = fs.readFileSync("query.sql", "utf8"); | |
var port = 3000; | |
var config = { | |
userName: process.env.USER_NAME, |
This file contains 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
from flask import Flask, send_file | |
import math | |
from PIL import Image | |
import numpy as np | |
import os.path | |
from io import BytesIO | |
from numba import jit | |
app = Flask(__name__) |