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 django.core.exceptions import ImproperlyConfigured | |
from django.core.management.base import BaseCommand, CommandError | |
from django.core import serializers | |
from django.utils.datastructures import SortedDict | |
from optparse import make_option | |
class Command(BaseCommand): | |
option_list = BaseCommand.option_list + ( | |
make_option('--format', default='json', dest='format', |
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 django import db | |
from django.conf import settings | |
from nose.plugins import Plugin | |
from django.test import TransactionTestCase | |
import uuid | |
import warnings | |
TEST_DB_PREFIX = settings.DATABASES['default']['NAME'] + '__' | |
def set_cur_db(db_name): |
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
# pip install scipy | |
Collecting scipy | |
Downloading scipy-1.0.0.tar.gz (15.2MB) | |
100% |████████████████████████████████| 15.2MB 80kB/s | |
Complete output from command python setup.py egg_info: | |
ATLAS version 3.10.3 built by buildd on Tue Jan 17 22:59:14 UTC 2017: | |
UNAME : Linux x86-ubc-01 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux | |
INSTFLG : -1 0 -a 1 -l 1 | |
ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_x86SSE2 -DATL_CPUMHZ=2297 -DATL_SSE2 -DATL_SSE1 -DATL_USE64BITS -DATL_GAS_x8664 | |
F2CDEFS : -DAdd_ -DF77_INTEGER=int -DStringSunStyle |
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
sudo pip3 install checkio-client |
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
$ sudo pip3 install checkio-client |
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 numpy as np | |
import json | |
from collections.abc import Iterator, Sequence | |
class CiOJSEncoderEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, np.ndarray): | |
return obj.tolist() | |
if isinstance(obj, np.generic): | |
return obj.item() |
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
var commander = require("battle/commander.js"); | |
// create craft object | |
var craftClient = new commander.CraftClient(); | |
// command to craft - start landing units | |
craftClient.doLandUnits(); | |
function unitLanded(data) { | |
// create unit object | |
var unitClient = new commander.UnitClient(data['id']); |
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 battle import commander | |
# create craft object | |
craft_client = commander.CraftClient() | |
# command to craft - start landing units | |
craft_client.do_land_units() | |
def unit_landed(data): | |
# create unit object | |
unit_client = commander.UnitClient(data['id']) |
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 gen import players, crystalite_farm, sentry_gun, command_center, attack_craft | |
PLAYERS = players([ | |
command_center([28, 18], level=2), | |
crystalite_farm([25, 19], level=2), | |
sentry_gun('def_code.py', [27, 23], level=1), | |
attack_craft(1, 'attacker.py', unit_quantity=6) | |
]) |
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 contextlib import ContextDecorator | |
from django.db import connections | |
class overwrite_default_connection(ContextDecorator): | |
prev_default = None | |
write_connection = None | |
def __init__(self, write_connection): | |
self.write_connection = write_connection | |
OlderNewer