This file contains hidden or 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 robot import * | |
class LabyBug: | |
"""The laby bug | |
solves the labyrinths in the game named [Laby](https://wiki.ubuntu.com/Edubuntu/AppGuides/laby) | |
import refers to this file: [robot.py](https://github.com/sgimenez/laby/blob/master/data/mods/python/lib/robot.py) |
This file contains hidden or 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 Counter | |
from bitarray import bitarray | |
HISTOGRAM_RANGE = 16 | |
CHAR_RANGE = 3 | |
def string_to_charc_codes(s): | |
return map(ord, list(s)) | |
def char_codes_to_modulo(chars_codes): |
This file contains hidden or 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
import heapq | |
import operator | |
import functools | |
import time | |
from random import randint | |
def timeit(func): | |
@functools.wraps(func) | |
def newfunc(*args, **kwargs): |
This file contains hidden or 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
import random | |
import time | |
def timing(f): | |
def wrap(*args): | |
time1 = time.time() | |
ret = f(*args) | |
time2 = time.time() | |
print('%s function took %0.3f ms' % (f.__name__, (time2-time1)*1000.0)) |
This file contains hidden or 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
import geopy.distance | |
import pandas as pd | |
import osmnx as ox | |
import networkx as nx | |
G = ox.graph_from_place('Budapest, Hungary', network_type='walk') | |
regular_guests_income = 12000 | |
new_guests_income = 6000 | |
num_of_regs = 120 |
OlderNewer