Skip to content

Instantly share code, notes, and snippets.

View agoose77's full-sized avatar
🏠
Working from home

Angus Hollands agoose77

🏠
Working from home
View GitHub Profile
import os
import hashlib
import argparse
def md5(fname):
hash_md5 = hashlib.md5()
count = 0
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
import os
import hashlib
import argparse
MAX_HASH = 500
def dump(hashes, f):
as_str = "\n".join(["{},{},{}".format(*data) for data in hashes])
f.write(as_str + "\n")
hashes.clear()
import time
from collections import deque
class Future:
@property
def is_done(self):
raise NotImplementedError
from contextlib import contextmanager
from collections import OrderedDict
from functools import partial
from itertools import chain
class CodeContext:
current = None
def __init__(self):
class PeekableIter:
def __init__(self, iterator):
self._data = list(iterator)
self._index = 0
def __iter__(self):
return self
def __next__(self):
from bge import logic
from functools import lru_cache
class InspectableProperty:
def __init__(self, fget):
self.fget = fget
self.fset = None
from bge import logic, types
from functools import lru_cache
class InspectableProperty:
def __init__(self, fget):
self.fget = fget
self.fset = None
%%
% Author: Robin Smith Date: 07/10/2015 %%%%
% Modified: Angus Hollands Date: 19/02/2017 %%%%
% MULTIPLE GAUSSIAN PEAK FITTER WITH LINEAR BACKGROUND %%%%
%
% A code that reads in a Maestro .Spe file or an xy %%%%
% column file containing a measured gamma spectrum. %%%%
% It plots the data and allows the user to fit %%%%
% multiple Gaussian peaks to regions of the spectrum. %%%%
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
file_input: (type | NEWLINE)* ENDMARKER
type: 'Type' NAME ':' suite
suite: NEWLINE INDENT (body_stmt|NEWLINE)+ DEDENT
body_stmt: stmt | block
stmt: inline_stmt | declaration_stmt
# declaration stmts