code
stringlengths
1
199k
from openstack_dashboard.test.integration_tests.pages import basepage from openstack_dashboard.test.integration_tests.regions import forms from openstack_dashboard.test.integration_tests.regions import tables class KeypairsTable(tables.TableRegion): name = "keypairs" CREATE_KEY_PAIR_FORM_FIELDS = ('name',) ...
"""Controllers for simple, mostly-static pages (like About, Forum, etc.).""" __author__ = 'sll@google.com (Sean Lip)' import urllib import urlparse from core.controllers import base from core.controllers import editor from core.domain import config_domain import feconf ABOUT_PAGE_YOUTUBE_VIDEO_ID = config_domain.Config...
""" Home for functionality that provides context managers, and anything related to making those context managers function. """ import logging from contextlib import contextmanager from tools.env import ALLOW_NOISY_LOGGING @contextmanager def log_filter(log_id, expected_strings=None): """ Context manager which a...
"""Contrib vision utilities.""" from .transforms import * from .dataloader import *
from pyspider.libs.base_handler import * class Handler(BaseHandler): crawl_config = { } @every(minutes=24 * 60) def on_start(self): self.crawl('http://scrapy.org/', callback=self.index_page) @config(age=10 * 24 * 60 * 60) def index_page(self, response): for each in response.doc('...
import argparse import code import sys import threading import time import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encoding", "") if not encoding: return "utf-8" else: ...
from __future__ import division import numpy from chainer.training import extension class ExponentialShift(extension.Extension): """Trainer extension to exponentially shift an optimizer attribute. This extension exponentially increases or decreases the specified attribute of the optimizer. The typical use c...
"""Module containing user contributions """
"""Test block processing. This reimplements tests from the bitcoinj/FullBlockTestGenerator used by the pull-tester. We use the testing framework in which we expect a particular answer from each test. """ from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framew...
import git import sys from collections import defaultdict from textwrap import wrap from email.Utils import formatdate repo = git.Repo('.') changelog = defaultdict(list) for id in repo.iter_commits('%s..HEAD' % sys.argv[1]): commit = repo.commit(id) changelog[commit.author.name].append(commit.summary) print 'ba...
""" Unittests for exporting to git via management command. """ import copy import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django.te...
""" Implementation of DOM Level 2 CDATASection interface WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved. See http://4suite.com/COPYRIGHT for license and copyright information """ from xml.dom import Node from Text import Text class CDATASe...
import mxnet as mx from mxnet.test_utils import * from data import get_avazu_data from linear_model import * import argparse import os parser = argparse.ArgumentParser(description="Run sparse linear classification " \ "with distributed kvstore", ...
__all__ = [ 'dispatcher', 'error', 'plugin', 'robustapply', 'saferef', 'sender', 'signal', 'version', 'connect', 'disconnect', 'get_all_receivers', 'reset', 'send', 'send_exact', 'send_minimal', 'send_robust', 'install_plugin', 'remove_plugin', ...
from datetime import datetime from boto.resultset import ResultSet class Stack: def __init__(self, connection=None): self.connection = connection self.creation_time = None self.description = None self.disable_rollback = None self.notification_arns = [] self.outputs = ...
import datetime import decimal import enum import functools import math import os import re import uuid from unittest import mock import custom_migration_operations.more_operations import custom_migration_operations.operations from django import get_version from django.conf import SettingsReference, settings from djang...
""" Support for ZoneMinder. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zoneminder/ """ import logging import json from urllib.parse import urljoin import requests import voluptuous as vol from homeassistant.const import ( CONF_PATH, CONF_HOST, CO...
from datetime import datetime from . import base class Countdown(base.InLoopPollText): """ A simple countdown timer text widget. """ orientations = base.ORIENTATION_HORIZONTAL defaults = [ ('format', '{D}d {H}h {M}m {S}s', 'Format of the displayed text. Available variables:' ...
"""engine.SCons.Variables.PackageVariable This file defines the option type for SCons implementing 'package activation'. To be used whenever a 'package' may be enabled/disabled and the package path may be specified. Usage example: Examples: x11=no (disables X11 support) x11=yes (will search for the pac...
from cms.cache.permissions import clear_permission_cache from cms.exceptions import NoHomeFound from cms.signals.apphook import apphook_post_delete_page_checker, apphook_post_page_checker from cms.signals.title import update_title, update_title_paths from django.core.exceptions import ObjectDoesNotExist from cms.models...
from dionaea.core import * import datetime import traceback import logging import binascii import os import tempfile from dionaea.smb.include.smbfields import * from dionaea.smb.include.packet import Raw from .include.tds import * logger = logging.getLogger('MSSQL') class mssqld(connection): def __init__ (self): con...
from botocore.docs.method import document_model_driven_method from botocore.docs.waiter import document_wait_method from botocore.docs.paginator import document_paginate_method from botocore.docs.bcdoc.restdoc import DocumentStructure class LazyLoadedDocstring(str): """Used for lazily loading docstrings You can...
{ 'name': 'Belgium - Payroll with Accounting', 'category': 'Localization', 'author': 'OpenERP SA', 'depends': ['l10n_be_hr_payroll', 'hr_payroll_account', 'l10n_be'], 'version': '1.0', 'description': """ Accounting Data for Belgian Payroll Rules. ========================================== ""...
from odoo.tests.common import TransactionCase class TestProductTemplate(TransactionCase): def test_name_search(self): partner = self.env['res.partner'].create({ 'name': 'Azure Interior', }) seller = self.env['product.supplierinfo'].create({ 'name': partner.id, 'price': 12.0...
"""Auto-generated file, do not edit by hand. SA metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_SA = PhoneMetadata(id='SA', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d{2,5}', possible_number_pattern='...
import math import operator import netaddr from neutron.api.v2 import attributes from neutron.common import constants from neutron.common import exceptions as n_exc from neutron.db import models_v2 import neutron.ipam as ipam from neutron.ipam import driver from neutron.openstack.common import uuidutils class SubnetAll...
""" PostgreSQL database backend for Django. Requires psycopg 1: http://initd.org/projects/psycopg1 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.client import DatabaseClient from django.db.backends...
""" Boolean geometry sphere. """ from __future__ import absolute_import import __init__ from fabmetheus_utilities.geometry.creation import solid from fabmetheus_utilities.geometry.geometry_utilities import evaluate from fabmetheus_utilities.geometry.solids import cube from fabmetheus_utilities.geometry.solids import tr...
from dMainFrame import *
from django.db import models from django.db import connection class Square(models.Model): root = models.IntegerField() square = models.PositiveIntegerField() def __unicode__(self): return "%s ** 2 == %s" % (self.root, self.square) class Person(models.Model): first_name = models.CharField(max_len...
""" Interfaces for L{twisted.mail}. @since: 16.5 """ from __future__ import absolute_import, division from zope.interface import Interface class IClientAuthentication(Interface): def getName(): """ Return an identifier associated with this authentication scheme. @rtype: L{bytes} """ ...
from django import forms from ckeditor import fields from ckeditor_uploader import widgets class RichTextUploadingField(fields.RichTextField): @staticmethod def _get_form_class(): return RichTextUploadingFormField class RichTextUploadingFormField(forms.fields.CharField): def __init__(self, config_na...
from ctypes import * import sys import unittest class SizesTestCase(unittest.TestCase): def test_8(self): self.assertEqual(1, sizeof(c_int8)) self.assertEqual(1, sizeof(c_uint8)) def test_16(self): self.assertEqual(2, sizeof(c_int16)) self.assertEqual(2, sizeof(c_uint16)) def...
import os import sys import re import optparse import textwrap import shutil import time from optparse import OptionParser def main(): parser = OptionParser() parser.add_option("-f", "--file", action="store", dest = "range_file", help = "input range file") parser.add_option("-o", "--output", action = "store", des...
import hashlib from gettext import gettext as _ from gi.repository import Gtk from gi.repository import Gdk import dbus from sugar3.graphics import style from jarabe.model import network IW_AUTH_ALG_OPEN_SYSTEM = 'open' IW_AUTH_ALG_SHARED_KEY = 'shared' WEP_PASSPHRASE = 1 WEP_HEX = 2 WEP_ASCII = 3 def string_is_hex(key...
from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint, getdate from frappe import msgprint, _ from calendar import monthrange def execute(filters=None): if not filters: filters = {} conditions, filters = get_conditions(filters) columns = get_columns(filters) att_map = get_attenda...
from .common import KARMA, TestForumCommon from ..models.forum import KarmaError from odoo.exceptions import UserError, AccessError from odoo.tools import mute_logger class TestForum(TestForumCommon): @mute_logger('odoo.addons.base.models.ir_model', 'odoo.models') def test_ask(self): Post = self.env['fo...
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_b64decode, compat_urllib_parse_unquote, ) from ..utils import int_or_none class MangomoloBaseIE(InfoExtractor): _BASE_REGEX = r'https?://(?:admin\.mangomolo\.com/analytics/index\.php/customers/embed/|play...
''' --- module: openshift_logging_facts version_added: "" short_description: Gather facts about the OpenShift logging stack description: - Determine the current facts about the OpenShift logging stack (e.g. cluster size) options: author: Red Hat, Inc ''' import copy import json from subprocess import * # noqa: F402...
"""Extensions module. Each extension is initialized in the app factory located in app.py """ from flask.ext.bcrypt import Bcrypt bcrypt = Bcrypt() from flask.ext.login import LoginManager login_manager = LoginManager() from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() from flask.ext.migrate import Migrate m...
NSEEDS=600 import re import sys from subprocess import check_output def main(): lines = sys.stdin.readlines() ips = [] pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):9999") for line in lines: m = pattern.match(line) if m is None: continue ip = 0 ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('scheduler', '0013_auto_20150912_1334'), ] operations = [ migrations.RemoveField( model_name='need', name='activate', ), ...
import abc import numpy as np import GPy class RegressionMethod(object): __metaclass__ = abc.ABCMeta def __init__(self): self.preprocess = True def _preprocess(self, data, train): """Zero-mean, unit-variance normalization by default""" if train: inputs, labels = data ...
import pkgutil import unittest def all_names(): for _, modname, _ in pkgutil.iter_modules(__path__): if modname.startswith('test_'): yield 'stripe.test.' + modname def all(): return unittest.defaultTestLoader.loadTestsFromNames(all_names()) def unit(): unit_names = [name for name in all_...
from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,connect,axis from numpy import concatenate from numpy.random import randn from modshogun import * from modshogun import * from modshogun import * import util util.set_title('Multiple SVMS') num_svms=6 width=0.5 svmList = [None]*num_svms trainfeatList...
COLOR_ADDR_SIZE = 16 if _idaapi.BADADDR == 0xFFFFFFFFFFFFFFFFL else 8 SCOLOR_FG_MAX = '\x28' # Max color number SCOLOR_OPND1 = chr(cvar.COLOR_ADDR+1) # Instruction operand 1 SCOLOR_OPND2 = chr(cvar.COLOR_ADDR+2) # Instruction operand 2 SCOLOR_OPND3 = chr(cvar.COLOR_ADDR+3) # Instruction op...
from ajenti import apis from ajenti.com import * from ajenti.ui import * class SquidBindings(Plugin): implements(apis.squid.IPluginPart) weight = 15 title = 'Bindings' tab = 0 cfg = 0 parent = None def init(self, parent, cfg, tab): self.parent = parent self.cfg = cfg ...
import os import sys import tempfile import unittest TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(TOOLS_ROOT) from v8_presubmit import FileContentsCache, CacheableSourceFileProcessor class FakeCachedProcessor(CacheableSourceFileProcessor): def __init__(self, cache_file_path...
import requests from cloudbot import hook from cloudbot.util import web class APIError(Exception): pass google_base = 'https://maps.googleapis.com/maps/api/' geocode_api = google_base + 'geocode/json' wunder_api = "http://api.wunderground.com/api/{}/forecast/geolookup/conditions/q/{}.json" bias = None def check_sta...
"""Manipulators that can edit SON objects as they enter and exit a database. New manipulators should be defined as subclasses of SONManipulator and can be installed on a database by calling `pymongo.database.Database.add_son_manipulator`.""" from bson.dbref import DBRef from bson.objectid import ObjectId from bson.son ...
import errno import fcntl import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocket(object): def __init__(self, address, conf, log, fd=None): self.log = log self.conf = conf self.cfg_add...
"""Support for switches that can be controlled using the RaspyRFM rc module.""" from raspyrfm_client import RaspyRFMClient from raspyrfm_client.device_implementations.controlunit.actions import Action from raspyrfm_client.device_implementations.controlunit.controlunit_constants import ( ControlUnitModel, ) from ras...
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from pattern.web import GOOGLE, YAHOO, BING, sort results = sort( terms = [ "arnold schwarzenegger", "chuck norris", "dolph lundgren", "steven seagal", "sylvester stallone", "mic...
import uwsgi def send_request(env, client): uwsgi.send(client, b"GET /intl/it_it/images/logo.gif HTTP/1.0\r\n") # test for suspend/resume uwsgi.suspend() uwsgi.send(client, b"Host: www.google.it\r\n\r\n") while 1: yield uwsgi.wait_fd_read(client, 2) if env['x-wsgiorg.fdevent.timeout'...
import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success def element_send_keys(session, element, text): return session.transport.send( "POST", "/session/{session_id}/element/{element_id}/value".format( session_id=session.session_id, element_...
"""Implementing support for MySQL Authentication Plugins""" from hashlib import sha1 import struct from . import errors from .catch23 import PY2, isstr class BaseAuthPlugin(object): """Base class for authentication plugins Classes inheriting from BaseAuthPlugin should implement the method prepare_password()...
"""Serializer tests for the GitHub addon.""" import mock from nose.tools import * # noqa (PEP8 asserts) from website.addons.base.testing.serializers import StorageAddonSerializerTestSuiteMixin from website.addons.github.api import GitHubClient from website.addons.github.tests.factories import GitHubAccountFactory from...
from qgis._networkanalysis import *
from lxml import etree from nova.api.openstack import common from nova.api.openstack import xmlutil from nova.openstack.common import log as logging from nova.tests.integrated import integrated_helpers LOG = logging.getLogger(__name__) class XmlTests(integrated_helpers._IntegratedTestBase): """"Some basic XML sanit...
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' Convert an ODT file into a Open Ebook ''' from calibre.customize.conversion import InputFormatPlugin class ODTInput(InputFormatPlugin): name = 'ODT...
""" Keystone In-Memory Dogpile.cache backend implementation. """ import copy from dogpile.cache import api NO_VALUE = api.NO_VALUE class MemoryBackend(api.CacheBackend): """A backend that uses a plain dictionary. There is no size management, and values which are placed into the dictionary will remain until ...
from __future__ import with_statement from contextlib import contextmanager from fabric.api import hide, puts @contextmanager def msg(txt): puts(txt + "...", end='', flush=True) with hide('everything'): yield puts("done.", show_prefix=False, flush=True)
print(+1) print(+100) print(-1) print(-(-1)) print(-0x3fffffff) # 32-bit edge case print(-0x3fffffffffffffff) # 64-bit edge case print(-(-0x3fffffff - 1)) # 32-bit edge case print(-(-0x3fffffffffffffff - 1)) # 64-bit edge case print(~0) print(~1) print(~-1) print(~0x3fffffff) # 32-bit edge case print(~0x3ffffffffffffff...
"""Test that the set of gen-* files is the same as the generated files.""" import fnmatch import os import sys import generate import logging UPDATE_TIP = 'To update the generated tests, run:\n' \ '$ python third_party/WebKit/LayoutTests/bluetooth/generate.py' def main(): logging.basicConfig(level=loggin...
import sys import DataStore import util import logging def verify_tx_merkle_hashes(store, logger, chain_id): checked, bad = 0, 0 for block_id, merkle_root, num_tx in store.selectall(""" SELECT b.block_id, b.block_hashMerkleRoot, b.block_num_tx FROM block b JOIN chain_candidate cc ON ...
class ModelTemplate: def Generate(self): print "Genertate() needs to be implemented in a Template class!"
from __future__ import absolute_import, division, print_function import struct import six from cryptography.exceptions import ( UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives import constant_time, hmac from cryptography.hazmat.pri...
from js2py.base import * @Js def console(): pass @Js def log(): print arguments[0] console.put('log', log)
''' libvirt external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use this, copy this file over ...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughAnimationCasesPage(page_module.Page): def __init__(self, url, page_set, need_measurement_ready): super(ToughAnimationCasesPage, self).__init__(url=url, page_set=page_set) self.archive_data_file = '...
try: from math import * except ImportError: print("SKIP") import sys sys.exit() test_values = [-100., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 100.] test_values_small = [-10., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 10.] # so we don't overflow 32-bit precision p_test_values = [0.1, 0.5, 1.23456] unit_range...
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from django.test.utils import ignore_warnings from django.utils.deprecation ...
import re from collections import namedtuple from datetime import datetime from enum import Enum, auto from functools import reduce from typing import Iterable, Iterator, List, Optional, Tuple TestResult = namedtuple('TestResult', ['status','suites','log']) class TestSuite(object): def __init__(self) -> None: self.s...
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^static/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.STATIC_R...
"""CGI test 2 - basic use of cgi module.""" import cgitb; cgitb.enable() import cgi def main(): form = cgi.FieldStorage() print "Content-type: text/html" print if not form: print "<h1>No Form Keys</h1>" else: print "<h1>Form Keys</h1>" for key in form.keys(): valu...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: bigip_asm_policy short_description: Manage BIG-IP ASM polic...
""" A tool to help keep .mailmap and AUTHORS up-to-date. """ from __future__ import unicode_literals from __future__ import print_function import os import sys from fabric.api import local, env from fabric.colors import yellow, blue, green, red from fabric.utils import error mailmap_update_path = os.path.abspath(__file...
import controllers import report import ir_qweb
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest if sys.version_info < (2, 7): raise SkipTest("F5 Ansible modules require Python >= 2.7") from ansible.compat.tests import unittest from ansible.compat.tests...
def f(a, b, c, d): """ :param a : foo :param b : bar another line of description :type b: str :param c : baz :param d : quux """
from __future__ import print_function try: from pandasql import sqldf pysqldf = lambda q: sqldf(q, globals()) except ImportError: pysqldf = lambda q: print("Can not run SQL over Pandas DataFrame" + "Make sure 'pandas' and 'pandasql' libraries are installed")
import subprocess import sys import setup_util import os def start(args, logfile, errfile): if os.name != 'nt': return 1 try: setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host) subprocess.check_call("powershell -Command .\\setup_iis.ps1 start", cwd="aspnet", stderr=errfile...
class Rule(object): """ A Lifcycle rule for an S3 bucket. :ivar id: Unique identifier for the rule. The value cannot be longer than 255 characters. :ivar prefix: Prefix identifying one or more objects to which the rule applies. :ivar status: If Enabled, the rule is currently being ap...
"""Exceptions used by ML2.""" from neutron.common import exceptions class MechanismDriverError(exceptions.NeutronException): """Mechanism driver call failed.""" message = _("%(method)s failed.")
if 1: pass if 2: pass else<caret>
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py. """#" import codecs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='strict'): ret...
""" Check that all of the certs on all service endpoints validate. """ import unittest from tests.integration import ServiceCertVerificationTest import boto.ec2 class EC2CertVerificationTest(unittest.TestCase, ServiceCertVerificationTest): ec2 = True regions = boto.ec2.regions() def sample_service_call(self...
"""Tests harness for distutils.versionpredicate. """ import distutils.versionpredicate import doctest from test.test_support import run_unittest def test_suite(): return doctest.DocTestSuite(distutils.versionpredicate) if __name__ == '__main__': run_unittest(test_suite())
"Decorator for views that gzips pages if the client supports it." from django.utils.decorators import decorator_from_middleware from django.middleware.gzip import GZipMiddleware gzip_page = decorator_from_middleware(GZipMiddleware)
''' Genesis Add-on Copyright (C) 2014 lambda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This pr...
class C: def foo(self): <selection>x = 1</selection> y = 2
SECRET_KEY = 'docs'
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this l...
""" Tests for `yes`. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yes.html """ from helpers import check, check_version, run def test_version(): """Check that we're using Boreutil's implementation.""" assert check_version("yes") def test_missing_args(): """Nothing to test: `yes` accepts any nu...
""" This package includes tools to predict and plot neighborhoods. """ import nbdpred
import abc import gzip import hashlib import logging import mimetypes import pydoc from functools import lru_cache from io import BytesIO from typing import ClassVar from typing import Generic from typing import NoReturn from typing import Optional from typing import Tuple from typing import Type from typing import Typ...
from .mx_in_class import ToDict from .mx_in_class import JsonMixin from .mx_in_class import BinaryTree from .mx_in_class import BinaryTreeWithParent from .class_property import VoltageResistance from .class_property import BoundedResistance
import os import sys, getopt import socket import string import shutil import getopt import syslog import errno import logging import tempfile import datetime import subprocess import json import ConfigParser from operator import itemgetter from functools import wraps from getpass import getpass, getuser from glob impo...
from pythonwarrior.abilities.base import AbilityBase class DistanceOf(AbilityBase): def description(self): return ("Pass a Space as an argument, and it will return an integer " "representing the distance to that space.") def perform(self, space): return self._unit.position.distan...
from tkinter import * import math canvas_width = 1000 canvas_height =1000 python_green = "#476042" master = Tk() w = Canvas(master, width=canvas_width, height=canvas_height) w.pack() points = [[i, 500+ math.sin(i/30)*20]for i in range(0,2000) if i%2 == 0]+[10000,1000]+[0,1000] w.create_polygon(poi...