code
stringlengths
3
6.57k
test_user(self)
json.dump(test_dict, open("test_config_user.json", "w")
Config("config.json5", "test_config_user.json")
cfg.reload()
self.equal_cfg(cfg, test_dict)
test_user_part(self)
json.dump(test_dict, open("test_config_user.json", "w")
Config("config.json5", "test_config_user.json")
cfg.reload()
self.equal_cfg(cfg, test_dict)
test_not_exists(self)
Config("config.json5", "fake_config_user.json")
cfg.reload()
self.equal_cfg(cfg, test_dict)
Config("fake_config.json", "fake_config_user.json")
cfg.reload()
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)
unittest.TestLoader()
loadTestsFromTestCase(ConfigTestCase)
unittest.TextTestRunner(verbosity=2)
run(suite)
sys.path.append(str(Path(__file__)
absolute()
test_init()
Model(nswimmers=3)
len(model.swimmers)
test_step()
Model(nswimmers=1)
copy.deepcopy(model.swimmers[0])
swimmer.swim(dt)
model.step(dt)
test_repr()
Model(nswimmers=1)
isinstance(str(model)
__init__(self, lexer)
evaluate(self, line)
int(next(self.__lexer.tokenize(line)
__init__(self, read, print, evaluate)
loop(self)
self.__read('mm-i> ')
self.__eval(line)
self.__print(result)
REPL(input, print, Evaluator(Lexer()
loop()
gen_cluster(client=True, nthreads=[("127.0.0.1", 1)
test_TaskStreamPlugin(c, s, *workers)
TaskStreamPlugin(s)
s.add_plugin(es)
c.map(div, [1] * 10, range(10)
c.submit(sum, futures[1:])
wait(total)
len(es.buffer)
dict()
es.rectangles(0, 10, workers)
all(n == "div" for n in rects["name"])
all(d > 0 for d in rects["duration"])
frequencies(rects["color"])
set(counts.values()
len(set(rects["y"])
es.rectangles(2, 5, workers)
all(len(L)
rects.values()
sorted(rects["start"])
set(rects["start"])
issubset(set(starts[1:])
gen_cluster(client=True)
test_maxlen(c, s, a, b)
TaskStreamPlugin(s, maxlen=5)
s.add_plugin(tasks)
c.map(inc, range(10)
wait(futures)
len(tasks.buffer)
gen_cluster(client=True)
test_collect(c, s, a, b)
TaskStreamPlugin(s)
s.add_plugin(tasks)
time()
c.map(slowinc, range(10)
wait(futures)
tasks.collect()
len(L)
len(futures)
tasks.collect(start=start)
len(L)
len(futures)
tasks.collect(start=start + 0.2)
len(L)
len(futures)
tasks.collect(start="20 s")
len(L)
len(futures)
tasks.collect(start="500ms")
len(L)
len(futures)
tasks.collect(count=3)
len(L)
list(tasks.buffer)
tasks.collect(stop=start + 100, count=3)
tasks.collect(count=3)
tasks.collect(start=start, count=3)