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
VALID_PYTHON_EXTENSIONS = ('.py', ) | |
def get_userdefined_class(directory: str, target_baseclass: object) -> list: | |
""" | |
Load Classes that sub-classed the given 'target_baseclass' for modules in the given directory | |
:param directory: directory containing user-defined classes subclassing 'target_baseclass' | |
:param target_baseclass: the ABC class that the user class subclasses | |
:return: (class) [UserDefinedClass, ...] | |
""" |
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
def _get_package_defined_classes(package, target_baseclass) -> dict: | |
""" | |
Voodoo function to discover classes in given 'package' that subclass the given 'target_baseclass' | |
:param package: Python Package Object | |
:param target_baseclass: Python Class Object | |
:return: | |
{ | |
CLASS_NAME: CLASS_OBJECT, | |
... | |
} |
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
""" | |
This is a script to compare the content of two directories. | |
It was used to determine how complete a series of cp commands were done after the cp process was already started | |
""" | |
import os | |
def directory_size(path): | |
total = 0 | |
for entry in os.scandir(path): | |
if entry.is_file(): |
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
query { | |
organization(login:"your-org-name"){ | |
name | |
projects(first:25, states:OPEN) { | |
nodes { | |
name, | |
columns(first:10){ | |
nodes{ | |
name, | |
cards (first:50){ |
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
""" | |
Creates a github organization project with columns from a defined template | |
using the Github graphql API | |
""" | |
import os | |
import uuid | |
import requests | |
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
[MASTER] | |
# A comma-separated list of package or module names from where C extensions may | |
# be loaded. Extensions are loading into the active Python interpreter and may | |
# run arbitrary code | |
extension-pkg-whitelist= | |
# Add files or directories to the blacklist. They should be base names, not | |
# paths. | |
ignore=CVS |
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
version: 2 | |
jobs: | |
build: | |
working_directory: ~/baserepository/ | |
docker: | |
- image: circleci/python:3.6.5 | |
environment: | |
PIPENV_VENV_IN_PROJECT: true | |
- image: mdillon/postgis:9.6 | |
environment: |
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
[ | |
{ | |
"name": "category:documentation", | |
"description": "", | |
"color": "AED6F1" | |
}, | |
{ | |
"name": "category:feature", | |
"description": "", | |
"color": "5DADE2" |
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 | |
from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, sunday_to_monday, MO | |
from pandas.tseries.offsets import Day, CustomBusinessDay, DateOffset | |
class JapanBusinessCalendar(AbstractHolidayCalendar): | |
rules = [ | |
Holiday('New Years Day', month=1, day=1), | |
Holiday('Coming of Age Day', month=1, day=8), # second monday of Jan | |
Holiday('National Foundation Day', month=2, day=11, observance=sunday_to_monday), # observed monday if falls on Sunday |
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 os | |
import csv | |
from multiprocessing import cpu_count, Pool | |
def process_csv(args): | |
filepath, encoding = args | |
unique_ids = set() | |
with open(filepath, 'r', encoding=encoding) as in_f: | |
reader = csv.reader(in_f) |