Skip to content

Instantly share code, notes, and snippets.

View BeyondEvil's full-sized avatar

Jim Brännlund BeyondEvil

  • Proxy.com
  • Sweden
View GitHub Profile
import numpy as np
def read_input():
with open('input_test.txt', 'r') as f:
return f.read().strip()
def parse(pattern):
if len(pattern) == 5:
def read_input():
with open('input.txt', 'r') as f:
return f.read()
def run_it(seq):
grid = seq.splitlines(True)
start = grid[0].find('|')
from collections import defaultdict
def read_input():
with open('input.txt', 'r') as f:
return f.read().strip()
def get(reg, v):
try:
from collections import defaultdict
def read_input():
with open('input.txt', 'r') as f:
return f.read().strip()
def get(reg, v):
try:
from collections import deque
from itertools import islice, izip_longest
from copy import copy
from functools import reduce
from operator import xor
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return izip_longest(*args, fillvalue=fillvalue)
/*
Mutation Observer object
Used to detect and inspect changes to the DOM
See:
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
*/
mutationObserver = {
import pytest
from test_automation_representations import TestData
def test_something():
// do some testing
@pytest.fixture()
def user(request):
user_name = request.param.get('name')
//do something
@pytest.fixture()
def account(request):
account_name = request.param.get('name')
import pytest
from tools import TestDataCollection
from representations import Project
@pytest.fixture(scope='function')
def test_driver(request, selenium):
from test_automation.tools.test_driver import TestDriver
return TestDriver(selenium)
@pytest.fixture(scope='module', autouse=True)
def init_test_db(request):
"""
Creates a TestDataCollection instance which houses all the data representation objects.
:param request: py.test request module
:return: TestDataCollection instance
"""
tdc = TestDataCollection()
request.module.tdc = tdc