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
#!/usr/bin/python3 | |
# | |
# Investigate the use of the self-pipe trick from Python | |
# | |
import logging | |
import os | |
import selectors | |
import signal | |
import struct |
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
# testing a formula for the k-th prime number | |
# https://math.stackexchange.com/questions/5019919/an-exact-formula-for-the-k-th-prime-number | |
from mpmath import ceil, ln, mp, mpf, zeta | |
mp.dps = 500 | |
mp.pretty = True | |
one = mpf("1") | |
two = mpf("2") |
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 collections import defaultdict | |
from itertools import count | |
import numpy as np | |
__version__ = "2024.12.13" | |
def create_graph(a): | |
"""Returns a graph from a n x n array of bools |
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
#!/usr/bin/env python | |
# check_syntax.py - script to check the syntax of Python files | |
# inspired by the standard library's 'py_compile' module. | |
import importlib.machinery | |
import sys | |
import traceback | |
__all__ = ["has_valid_syntax", "main", "CheckSyntaxError"] | |
__version__ = "2024.10.20" |
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
# | |
# read a .pyc file and pretty-print it | |
# | |
# copied from http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html | |
# and updated to Python 3.5 (Nov 10th 2015) |
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 collections import namedtuple | |
from random import randrange | |
Point = namedtuple('Point', 'x y') | |
Part = namedtuple('Part', 'inf sup subpart area') | |
def mincoord(point, other): | |
return Point(min(point.x, other.x), min(point.y, other.y)) | |
def maxcoord(point, other): |
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
#!/usr/bin/env python | |
# -*-coding: utf8-*- | |
# Terms of the MIT license, which apply to this software | |
# ======================================================== | |
# Copyright (C) 2014 Eric Ringeisen | |
# | |
# Permission is hereby granted, free of charge, to | |
# any person obtaining a copy of this software and | |
# associated documentation files (the "Software"), | |
# to deal in the Software without restriction, |
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
#!/usr/bin/env python | |
# -*-coding: utf8-*- | |
# Title: anyfloat.py | |
# Author: Gribouillis for the python forum at www.daniweb.com | |
# Created: 2012-05-02 06:46:42.708131 (isoformat date) | |
# License: Public Domain | |
# Use this code freely. | |
"""Conversion module between floating point representations. |
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 collections import namedtuple | |
import pathlib | |
import pickle | |
import subprocess as sp | |
import tempfile | |
__version__ = '2019.01.16.2' | |
__all__ = ['spreadsheet_to_dict',] | |
WorksheetKey = namedtuple('WorksheetKey', "index 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 collections import deque | |
import io | |
import re | |
import sys | |
__version__ = '0.0.1' | |
def noop(arg): | |
pass |
NewerOlder