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 datetime import datetime | |
from sys import exit | |
from actionpack.actions import ReadInput | |
from actionpack.actions import Pipeline | |
from actionpack.actions import Write | |
filename = 'fake.chat' | |
listen = ReadInput('What should I record? ') |
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
import sys | |
from contextlib import contextmanager | |
from functools import partial | |
default_prefix = '\n -> ' | |
def fully_qualified_exception(exc_type, exc_value, tb, prefix=default_prefix, show_full_name=False, buffer=sys.stdout): | |
"""An Exception hook that returns the fully-qualified name of the given exception. |
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
SYSTEM_PYTHON = $(shell which python3.8) | |
PROJECT_NAME = $(shell basename $(CURDIR)) | |
VENV = $(PROJECT_NAME)-venv | |
VENV_PYTHON = $(VENV)/bin/python | |
TESTDIR = tests | |
.PHONY: all | |
all: | |
@make venv |
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 functools import partial | |
from operator import methodcaller | |
from pathlib import Path | |
from pprint import pprint | |
from sys import argv | |
from toolz import compose | |
from toolz.curried import map | |
if __name__ == '__main__': |
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 numpy import arange as range_about_zero, array, random | |
from math import exp | |
from scipy import special | |
def discrete_gaussian_kernel(fidelity, scale=1): | |
return exp(-scale) * special.iv(generate_range_about_zero(fidelity), scale) | |
def generate_range_about_zero(magnitude): | |
if magnitude % 2 == 0: |
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 LinkedList | |
attr_reader :schema, :head | |
def initialize(items) | |
@head = items.first.__id__ | |
@schema = {} | |
items.each_with_index do |item, i| | |
unless items[i+1] == nil | |
@schema.update({item.__id__ => items[i+1].__id__}) | |
else |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
class ListElement extends React.Component{ | |
render() { | |
return <div> | |
<a href={this.props.href}> | |
{this.props.name} | |
</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
import validators # may need to `pip install validators` first... | |
def mocked_response(url, **response_dict): | |
def validate_url(url): | |
try: | |
return validators.url(url) | |
except ValidationFailure as e: | |
return False | |
class Response(type): |
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
{"application/rate_limit_status": {"app_limit": "180", | |
"resource_type": "application", | |
"user_limit": "180"}, | |
"favorites/list": {"app_limit": "15", | |
"resource_type": "favorites", | |
"user_limit": "15"}, | |
"followers/ids": {"app_limit": "15", | |
"resource_type": "followers", | |
"user_limit": "15"}, | |
"followers/list": {"app_limit": "15", |
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
{"GET": {"account/settings": {}, | |
"account/verify_credentials": {"include_email": "None", | |
"include_entities": "None", | |
"skip_status": "None"}, | |
"application/rate_limit_status": {"resources": "None"}, | |
"blocks/ids": {"cursor": "None", "stringify_ids": "None"}, | |
"blocks/list": {"cursor": "None", | |
"include_entities": "None", | |
"skip_status": "None"}, | |
"direct_messages": {"count": "None", |