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)
@pytest.fixture(scope='module', autouse=True)
def test_db(request):
"""
Creates a TestDataCollection instance which houses all the data representation objects.
:param request: py.test request module
:return: TestDataCollection instance
"""
from test_automation.representations.test_data_collection import TestDataCollection
#first
if browser.lower() == 'firefox':
driver = webdriver.Firefox
self._kwargs.update({'browser_profile' if self._use_grid else 'firefox_profile': firefox_profile()})
desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
#later
if self._use_grid:
host = get_config().getini("grid_host")
port = get_config().getini("grid_port")
/*
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')