Skip to content

Instantly share code, notes, and snippets.

View Drvanon's full-sized avatar
😀
Ready to get working

Robin Alexander Dorstijn Drvanon

😀
Ready to get working
  • Groningen
View GitHub Profile
class ClassBuilder:
def __init__(self):
self.data = {}
def load_source1(self, params_for_source1):
self.data.update(api_call_source1(params_for_source1))
def load_source1(self, params_for_source2):
self.data.update(api_call_source1(params_for_source2))
@Drvanon
Drvanon / vanon1.py
Created September 1, 2021 18:17 — forked from erezsh/vanon1.py
LALR try for vanon (1)
from lark import Lark
grammar = r"""
start: _NL* _section+
_section: _HEADER _content* _HEADER
_HEADER: "--- SECTION ---" _NL
_content: number_list
| assign
| _other
number_list: NUMBER+ _NL
/export/home/ccprakt3/miniconda3/lib/python3.9/site-packages/pandas/core/frame.py:3607: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
self._set_item(key, value)
# Data source
gen = ({'a': 3, 'b': 4} for i in range(300))
a = map(lambda d: d['a'], gen)
b = map(lambda d: d['b'], gen)
def outside_try():
foo = None
try:
foo = load_foo()
except FooLoadingError:
return "Foo failed to load"
# Do all the things
return foo
import numpy as np
from scipy.optimize import curve_fit
from scipy import signal
def gauss(x, mu, sigma, A):
return A / (sigma * np.sqrt(2 * np.pi)) * np.exp(- .5 * np.power((x-mu)/sigma , 2))
peakind = signal.find_peaks_cwt(inten_na2, np.arange(2,5), noise_perc=90, min_length=2, min_snr=2)
# plt.plot(lamb_na2, inten_na2)
a = ( (1, 2), (3, 6), (4, 8) )
b = ( 1, 3, 4)
c = a / b
c == ( (1, 2), (1, 2), (1, 2) )

This is a file that describes how our pipeline should be working for Marick Manrho. I hope it will be useful to him.

movement1 = Movement("test1", "daily")
movement2 = Movement("test2", "daily")
for i in range(6):
user = User(f"user{i}", f"user{i}@email.com", "pass")
user.save_to_db()
users = User.query.all()
MUA = MovementUserAssociation
muas = [
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",