content
string
import numpy as np from numpy.testing import assert_array_equal from geist.similar_images import is_similar, find_similar_in_repo from geist import GUI, DirectoryRepo from geist.pyplot import Viewer from geist.backends.fake import GeistFakeBackend import unittest # use same test cases as for testing vision, but need a...
from __future__ import absolute_import from functools import partial from ..cross import getargspec # NOTE: moved in Django 1.9 try: from django.template.library import TagHelperNode, parse_bits except ImportError: from django.template.base import TagHelperNode as _TagHelperNode, parse_bits class TagHelpe...
from django.conf import settings from controller.create_grader import create_grader from controller.models import Submission import logging from controller.models import SubmissionState, GraderStatus from metrics import metrics_util from controller import util from ml_grading import ml_grading_util from controller.cont...
from nltk.corpus import brown import nltk def nouns(): brown_news_tagged = brown.tagged_words(categories='news', simplify_tags=True) word_tag_pairs = nltk.bigrams(brown_news_tagged) print list(nltk.FreqDist(a[1] for a, b in word_tag_pairs if b[1] == 'N')) def verbs(): wsj = nltk.corpus.treebank.tagge...
from django.shortcuts import render_to_response from django.http import HttpResponse from books.models import Book, Author # Create your views here. def search(request): errors = [] if 'q' in request.GET: q = request.GET['q'] if not q: errors.append('Enter a search term.') ...
import suds.client import suds.store import logging import sys def client_from_wsdl(wsdl_content, *args, **kwargs): """ Constructs a non-caching suds Client based on the given WSDL content. The wsdl_content is expected to be a raw byte string and not a unicode string. This simple structure suits u...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.views.generic import TemplateView from django.views import defaults as default_views urlpatterns = [ url(r'^$', Template...
import unittest import importlib class TestAllImport(unittest.TestCase): def test_everything(self): allmods = [ 'solvcon', ] allmods = [importlib.import_module(name) for name in allmods] for mod in allmods: try: for name in mod.__all__: ...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="yaml_rulz", version="0.0.1", description="A YAML validator", license="MIT", author="Milan Boleradszki", author_email="<EMAIL>", maintainer="Milan Boleradszki", maintainer_email="<EMAIL>", url="https://github.com/mil...
import os import os.path import io from operator import itemgetter import logging import SPARQLWrapper from .constants import DEFAULT_TEXT_LANG from .utils import KrnlException, is_collection # Maximum number of nestes magic files MAX_RECURSE = 10 # The list of implemented magics with their help, as a pair [param...
from django.utils.translation import gettext_lazy as _ from cms.models import Page from cms.utils.page_permissions import user_can_add_page, user_can_add_subpage from .wizards.wizard_pool import wizard_pool from .wizards.wizard_base import Wizard from .forms.wizards import CreateCMSPageForm, CreateCMSSubPageForm c...
# # Cleverbot Webscraping API for Python # # Made By: Ryan Beltran # # On: March 30th 2016 # # Version history: # 1.0 3/30/16 # # Todo list: # * Disguise traffic as human # * Make ask() more resilient to changes in site structure # * Add reset operation by clearing CBSTATE cookie # * Save sessions by st...
from ._sound import * import avango.nodefactory nodes = avango.nodefactory.NodeFactory('av::sound::')
FLAVOR_ID = "sky_stars" def init(node_tree): """Initialize sky stars flavor. :param node_tree: node tree on which it will be used :type node_tree: bpy.types.NodeTree """ # FIXME: move to old system after: https://developer.blender.org/T68406 is resolved flavor_frame = node_tree.nodes.new(typ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # # 2016年版ルールの問題を、2015年版ルールに変換して、解く。 # VIAを、線の番号に割り振る、すべての組み合わせを、数え上げている。 # # solver2016.py -p sample_Q4 --convert sample_Q4_adc.txt import sys import os sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'server')) from nlcheck import NLC...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, url_or_none, ) class APAIE(InfoExtractor): _VALID_URL = r'(?P<base_url>https?://[^/]+\.apa\.at)/embed/(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{...
import json import requests from time import sleep from opencontext_py.libs.general import LastUpdatedOrderedDict from opencontext_py.libs.generalapi import GeneralAPI from opencontext_py.apps.ldata.linkentities.models import LinkEntityGeneration class eolAPI(): """ Interacts with the Encyclopeidia of Life ...
from django import forms from django.utils.translation import ugettext_lazy as _ from core.settings import common from core.utils.recaptcha import ReCaptchaField from core.utils.regexp import regexp_text, regexp from database.models import Users from web_service.forms.user.password import PasswordForm, attrs_dict cl...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import random import numpy as np import tensorflow as tf from tensorflow.contrib.learn.python import learn from tensorflow.contrib.learn.python.learn import datasets fr...
from control4.core.agent import Agent from control4.misc.console_utils import Message import theano #pylint: disable=F0401 class MLAgent(Agent): """ Wraps an OptimizableAgent and modifies it to take the most likely action """ def __init__(self, oa): self.oa = oa input_dict = self.oa.sy...
# -*- coding: utf-8 -*- import base64 import tempfile import tornado.testing from tornado.test.util import unittest from tornado.options import options from easy_phi import app from easy_phi import auth class AdminConsoleAccessTest(tornado.testing.AsyncHTTPTestCase): url = None def setUp(self): su...
import colander from deform.widget import ( CheckboxWidget, PasswordWidget, CheckboxChoiceWidget ) class UserLoginForm(colander.MappingSchema): account_id = colander.SchemaNode( colander.String(encoding='utf-8'), title='Account ID') password = colander.SchemaNode( colander.String(encod...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import range from future import standard_library standard_library.install_aliases() import sys import re PYTHON_VERSION = sys.version_info[:3] PY2 = (PYTHON...
"""Helpers for :mod:`protobuf`.""" import collections import copy import inspect from google.protobuf import field_mask_pb2 from google.protobuf import message from google.protobuf import wrappers_pb2 _SENTINEL = object() _WRAPPER_TYPES = ( wrappers_pb2.BoolValue, wrappers_pb2.BytesValue, wrappers_pb2.Do...
""" Collections of objects that are helpful for the parsers """ RES_DATA_NO_UNCS = { "burnMaterials", "burnMode", "burnStep", "iniBurnFmass", "totBurnFmass", "resMemsize", "totNuclides", "fissionProductInhTox", "ingestionToxicity", "totSfRate", "electronDecaySource", "ur...
"""Base-class for scenegraph nodes Requires Python 2.2.x, as it makes extensive use of properties """ from vrml import field, fieldtypes, weaklist, weakkeydictfix from vrml import copier as copiermodule from vrml import olist from vrml.protofunctions import * from pydispatch import dispatcher import weakref class Nod...
def is_permutation(s, t): """ Returns True iff s is a permutation of t. Clarifications to ask the interviewer: - How are the strings encoded? ASCII? Unicode? - What kinds of characters are used? Alphanumeric? Punctuation? Here, we assume that all strings are encoded with ASCII (256 chars). Rec...
from prxgt.domain.filter.filter import Filter from prxgt.domain.filter.function_rule import FunctionRule from prxgt.domain.instance import Instance from prxgt.domain.filter.value import Value from prxgt.domain.filter.alias import Alias from prxgt.domain.filter.expression import Expression __author__ = 'Alex Gusev <<EM...
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """LVM2 volume manager """ plugin_name = 'lvm2' profiles = ('storage',) option_list = [("lvmdump", 'collect an lvmdump tarball', 'fast', False), ...
import logging import re import os.path from shutil import rmtree from django.core.urlresolvers import reverse from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext from guardian.shortcuts import assign from taggit.managers import TaggableManag...
# -*- coding: utf-8 -*- from __future__ import absolute_import class BaseWsException(Exception): """ A base exception class for all exceptions thrown by the Web Sight back-end. """ _message = "Error thrown." def __init__(self, message=None): super(BaseWsException, self).__init__() ...
""" MPEG DASH client """ import bisect import logging import os import sys from neubot.http.client import ClientHTTP from neubot.http.message import Message from neubot.state import STATE from neubot import utils from neubot import utils_net from neubot import utils_version # # We want the download of a chunk to r...
from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import integer class AudioLanguageSelection(AWSProperty): props = { 'LanguageCode': (basestring, False), 'LanguageSelectionPolicy': (basestring, False), } class AudioPidSelection(AWSProperty): ...
#coding=utf-8 from athumb.pial.helpers import toint from athumb.pial.parsers import parse_crop class EngineBase(object): """ A base class whose public methods define the public-facing API for all EngineBase sub-classes. Do not use this class directly, but instantiate and use one of the sub-classes. ...
""" This module contains the definition of some objects used in the chemenv package. """ __author__ = "David Waroquiers" __copyright__ = "Copyright 2012, The Materials Project" __credits__ = "Geoffroy Hautier" __version__ = "2.0" __maintainer__ = "David Waroquiers" __email__ = "<EMAIL>" __date__ = "Feb 20, 2016" from...
""" Tests that the Ts() and Qm() builders accept and process multiple targets correctly. """ import TestSCons test = TestSCons.TestSCons() test.dir_fixture("image") test.file_fixture('../../qtenv.py') test.file_fixture('../../../__init__.py','site_scons/site_tools/qt4/__init__.py') test.run(stderr=None) test.must_ex...
import pexpect import os import time import tempfile from .exceptions import * import logging logger = logging.getLogger('opensubmitexec') def kill_longrunning(config): ''' Terminate everything under the current user account that has run too long. This is a final safeguard if the subproc...
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py' norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( backbone=dict( type='ResNeSt', stem_channels=64, depth=50, radix=2, reduction_factor=4, avg_down_stride=True, num_stages=4, out_in...
from abc import ABCMeta, abstractmethod class BaseOptions(metaclass=ABCMeta): """ Base class for individual browser options """ def __init__(self): super(BaseOptions, self).__init__() self._caps = self.default_capabilities self.set_capability("pageLoadStrategy", "normal") ...
"""Represent MongoClient's configuration.""" import threading from pymongo import monitor, pool from pymongo.common import SERVER_SELECTION_TIMEOUT from pymongo.topology_description import TOPOLOGY_TYPE from pymongo.pool import PoolOptions from pymongo.server_description import ServerDescription class TopologySetti...
#!/opt/local/bin/python # can do as a standalone if permissions set and # above points to python install # need python 2.7 or greater import os import sys import re import string import csv from subprocess import call import argparse # compile a couple global regex re_studentid = re.compile(r"[0-9]{7,9}") re_student...
import asynctest from asynctest.mock import call from asynctest.mock import patch from asynctest.mock import MagicMock from asynctest.mock import CoroutineMock class TestRobotRouteMessageToPlugin(asynctest.TestCase): def setUp(self): patcher1 = patch('charlesbot.robot.Robot.initialize_robot') sel...
# coding: utf-8 from django.db import models try: sorted except NameError: from django.utils.itercompat import sorted # For Python 2.3 class Author(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField('self', blank=True) def ...
# -*- coding: utf-8 -*- """This is a mathematical Plane Class""" import numbers from decimal import Decimal, getcontext from inaccurate_decimal import InaccurateDecimal from nonzero import NoNonZeroElements from vector import Vector getcontext().prec = 30 class Plane(object): """Plane class in the form Ax + By...
#!/usr/bin/env python ''' 010.py: https://projecteuler.net/problem=10 Summation of Primes The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. @see 007.py for brute force attempt at finding nth prime ''' import os import pytest import math import time def sum_of...
''' Script to add license notice at beginning of file. Adds notice of license to GWN python modules. Optionally, it may include recognition to code originally from GNU Radio. @var txlic1: first part of GWN license. @var txlic2: second part of GWN license. @var txlicgr: recognition to GNU Radio code. ''' import sys ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class Base64Encode(Choreography): def __init__(self, temboo_session): """ Create a ...
import math import requests import json import os # Home Page: https://github.com/vgm64/gmplot # Keywords: python wrapper google maps # License: MIT # Package Index Owner: Michael.Woods class GoogleMapPlotter(object): def __init__(self, center_lat, center_lng, zoom): self.center = (float(center_lat), float(cent...
#!/usr/bin/env python import roslib roslib.load_manifest('hri_api') from .abstract_entity import AbstractEntity import tf import rospy from geometry_msgs.msg import Point from hri_api.math import GeomMath from rospy import ServiceProxy import actionlib import abc import math from hri_api.util import InitNode from hri_a...
import smbus from time import sleep # select the correct i2c bus for this revision of Raspberry Pi revision = ([l[12:-1] for l in open('/proc/cpuinfo','r').readlines() if l[:8]=="Revision"]+['0000'])[0] bus = smbus.SMBus(1 if int(revision, 16) >= 4 else 0) # ADXL345 constants EARTH_GRAVITY_MS2 = 9.80665 SCALE_MULTI...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Mike Place <<EMAIL>>` ''' # Import python libs from __future__ import absolute_import import os import logging import tornado.gen import tornado.ioloop import tornado.testing import salt.utils import salt.config import salt.exceptions import salt.transport.ipc imp...
import os import unittest from pavelib.utils.test.suites.bokchoy_suite import BokChoyTestSuite REPO_DIR = os.getcwd() class TestPaverBokChoy(unittest.TestCase): def setUp(self): self.request = BokChoyTestSuite('') def _expected_command(self, expected_text_append): if expected_text_append: ...
# -*- coding: utf-8 -*- import os import sys import webbrowser from invoke import task docs_dir = 'docs' build_dir = os.path.join(docs_dir, '_build') @task def test(ctx): import pytest errcode = pytest.main(['tests']) sys.exit(errcode) @task def watch(ctx): """Run tests when a file changes. Requ...
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 ...
from django.utils.translation import ugettext as _ from taiga.base.api.permissions import TaigaResourcePermission from taiga.base.api.permissions import IsAuthenticated from taiga.base.api.permissions import AllowAny from taiga.base.api.permissions import IsSuperUser from taiga.base.api.permissions import IsObjectOwne...
#!/bin/python3 import sys import argparse import glob import subprocess import shutil import submit import os import re parser = argparse.ArgumentParser(description='Set up a Kattis skeleton') parser.add_argument('name', help='the name of the problem') parser.add_argument('number', nargs='?', default="", help='id of ...
# -*- coding: utf-8 -*- from django.contrib import messages from django.core.urlresolvers import reverse from django.views import generic from project.pages.forms import PageTypeForm from project.pages.models import PageType class QuerySetMixin(object): #LoginRequiredMixin): model = PageType def get_queryse...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "histogram2d" _path_str = "histogram2d.marker" _valid_props = {"color", "colorsrc"} # co...
import os import signal import sys import time import pytest import ray import ray.ray_constants as ray_constants from ray.cluster_utils import Cluster from ray.test_utils import RayTestTimeoutException, get_other_nodes SIGKILL = signal.SIGKILL if sys.platform != "win32" else signal.SIGTERM @pytest.fixture(params=...
""" Claim objects for use with resource tracking. """ from nova import context from nova import exception from nova.i18n import _ from nova import objects from nova.objects import base as obj_base from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.virt import hardwar...
from sr.tree.parser import TreeParser class NodeType(object): FUNCTION = "FUNCTION" CLASS_FUNCTION = "CLASS_FUNCTION" CONSTANT = "CONSTANT" RANDOM_CONSTANT = "RANDOM_CONSTANT" INPUT = "INPUT" class Node(object): def __init__(self, node_type, **kwargs): self.node_type = node_type ...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
# -*- coding: utf-8 -*- from pyramid.view import view_config from pyramid.response import Response from pyramid.renderers import render from intranet3 import config from intranet3.lib.bugs import Bugs from intranet3.log import INFO_LOG, DEBUG_LOG, EXCEPTION_LOG from intranet3.models import User, Project from intranet3...
import pexpect import time import unittest import node LEADER = 1 ROUTER = 2 ED1 = 3 SED1 = 4 class Cert_5_6_1_NetworkDataLeaderAsBr(unittest.TestCase): def setUp(self): self.nodes = {} for i in range(1,5): self.nodes[i] = node.Node(i) self.nodes[LEADER].set_panid(0xface) ...
# -*- coding: utf-8; -*- DEFAULT_CONFIG = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': ("%(levelname)s %(asctime)s %(module)s " "%(process)d %(thread)d %(message)s") }, 'medium': { 'format': ...
# -*- coding: utf-8 -*- import socket def get_free_ports(num_ports, ip='127.0.0.1'): """Get `num_ports` free/available ports on the interface linked to the `ip´ :param int num_ports: The number of free ports to get :param str ip: The ip on which the ports have to be taken :return: a set of ports numb...
# -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase from odoo.exceptions import UserError class TestHelpDeskPhoneCallConfirm(TransactionCase): def setUp(self): super(TestHelpDeskPhoneCallConfirm, self).setUp() # Cliente do atendimento self.partner = self.env.ref('base....
keys_page = [ '', '', '', '', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\n', '^]', '^H', '^I', ' ', '-', '=', '[', ']', '\\', '>', ';', "'", '`', ',', '.', '...
""" Routines to fit structures """ import math import sys import numpy as np def dofit(ref,mob,xyz) : """ Performing fitting of mobile coordinates on top of references coordinates and then move a full set of coordinates Parameters ---------- ref : numpy.ndarray the reference coordinates mob : n...
from django.conf import settings from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.forms import SetPasswordForm from django.contrib.auth.decorators import permission_required from django.utils.translation import ugettext as _ @permission_required('wagtailadmin....
import struct import beretta import unittest import gevent.queue import gevent.socket import kyoto.conf import kyoto.server import kyoto.utils.berp import kyoto.tests.dummy import kyoto.network.stream class AgentTestCase(unittest.TestCase): def setUp(self): self.modules = [ kyoto.tests.dummy...
""" This page is in the table of contents. Lash is a script to partially compensate for the backlash of the tool head. The lash manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Lash The lash tool is ported from Erik de Bruijn's 3D-to-5D-Gcode php GPL'd script at: http://objects.reprap.org/wi...
from __future__ import division, print_function import cPickle as pickle from blocks.extensions.saveload import Checkpoint, SAVED_TO from blocks.serialization import secure_dump class PartsOnlyCheckpoint(Checkpoint): def __init__(self, path, **kwargs): super(PartsOnlyCheckpoint, self).__init__(path=path,...
from cloudferrylib.base.action import action from cloudferrylib.os.actions import snap_transfer from cloudferrylib.os.actions import task_transfer from cloudferrylib.utils.drivers import ssh_ceph_to_ceph from cloudferrylib.utils import rbd_util from cloudferrylib.utils import utils as utl import copy OLD_ID = 'old_id...
from __future__ import print_function import sys from time import sleep from sys import stdin, exit from PodSixNet.Connection import connection, ConnectionListener # This example uses Python threads to manage async input from sys.stdin. # This is so that I can receive input from the console whilst running the server...
import asyncio from pyplanet.apps import AppConfig from pyplanet.contrib import CoreContrib from pyplanet.contrib.setting.core_settings import performance_mode from pyplanet.contrib.setting.exceptions import SettingException class _BaseSettingManager: def __init__(self, instance): """ Initiate, should only be d...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label = '%s...
import datetime import json import sys import time # NOQA import unittest import jwt import requests # NOQA from github.GithubObject import GithubObject private_key = """ -----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQC+5ePolLv6VcWLp2f17g6r6vHl+eoLuodOOfUl8JK+MVmvXbPa xDy0SS0pQhwTOMtB0VdSt++elklDCadeokhEoGDQp411o+k...
from confluent_kafka import Producer import sys if __name__ == '__main__': if len(sys.argv) != 3: sys.stderr.write('Usage: %s <bootstrap-brokers> <topic>\n' % sys.argv[0]) sys.exit(1) broker = sys.argv[1] topic = sys.argv[2] # Producer configuration # See https://github.com/edenh...
from frontendBuilder import FrontendBuilder #from scss import Scss import os import shutil import main import logging class DeltaBuilder(FrontendBuilder): def name(self): return "/delta builder" def projectResourceTypes (self): return ['js', 'css'] # def copyStaticResources (self, targetFolder): def copyR...
#!/usr/bin/env python2 """Tarantool regression test suite front-end.""" __author__ = "Konstantin Osipov <<EMAIL>>" # 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 ab...
#!/usr/bin/env python def main(): import os import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from astropy.io import fits from astropy.table import table import scipy.interpolate npix = 100 edrpath = os.getenv('DECALS_DIR') hdu = fi...
from math import inf from pymeasure.instruments import Instrument from pymeasure.instruments.attocube.adapters import AttocubeConsoleAdapter from pymeasure.instruments.validators import (joined_validators, strict_discrete_set, ...
from flask import Flask import peewee from flask.ext import admin from flask.ext.admin.contrib import peeweemodel app = Flask(__name__) app.config['SECRET_KEY'] = '123456790' db = peewee.SqliteDatabase('test.sqlite', check_same_thread=False) class BaseModel(peewee.Model): class Meta: database = db ...
import unittest import sys sys.path.append("../isafw") import isafw import shutil import os import filecmp reportdir = "./kca_plugin/output" kernel_conf = "./kca_plugin/data/config" ref_kca_full_output = "./kca_plugin/data/ref_kca_full_report_TestImage" ref_kca_problems_output = "./kca_plugin/data/ref_kca_problems_re...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'StateLog.user' db.add_column('states_statelog', 'user', self.gf('django.db.models.fields.r...
import openerp.http as http import base64 from openerp import _ import openerp from openerp.service import db as db_ws from contextlib import closing from fabric.api import env from fabric.operations import get import os import logging import zipfile import werkzeug _logger = logging.getLogger(__name__) def exp_drop_...
import MySQLdb import schedule import time import traceback import sys from lolpy import LoLpy from Queue import Queue, PriorityQueue from threading import Thread from RESTOperation import RESTOperation import config as DEFAULT # # Globals # worker_threads = [] master_thread = None request_queue = PriorityQueue() de...
#!/usr/bin/env python import os from random import choice from datetime import datetime, timedelta from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp import template from google.appengine.ext import db class Registration(db.Mo...
import re from git import Repo import sys repo = Repo('.') repo.git.checkout('master') with open('setup.py') as fh: setup = fh.read() if sys.argv[1] == 'prepare': repl = re.sub(r'(version\s*=\s*[\'"]\d+\.\d+\.\d+)\.dev0', r'\g<1>', setup) m = re.search(r'version\s*=\s*[\'"](?P<v>\d+\.\d+\.\d+)', repl) ...
from a10sdk.common.A10BaseClass import A10BaseClass class Stats(A10BaseClass): """This class does not support CRUD Operations please use parent. :param used_address: {"description": "Used Address", "format": "counter", "type": "number", "oid": "2", "optional": true, "size": "8"} :param total_address...
""" VESA driver installation """ try: from hardware.hardware import Hardware except ImportError: from hardware import Hardware CLASS_NAME = "VesaFB" CLASS_ID = "0x03" VENDOR_ID = "" # All modern cards support Vesa. This will be used as a fallback. DEVICES = [] class VesaFB(Hardware): def __init__(self)...
import psycopg2 import psycopg2.extras import requests import json import re import os import copy import geopy from geopy.geocoders import ArcGIS from streetaddress import StreetAddressFormatter, StreetAddressParser ap = StreetAddressParser() import Transit import configparser import sys config = configparser.RawC...
""" Django settings for steamapi project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
#!/usr/bin/env python3 from PyQt5 import QtCore, QtGui, QtWidgets from python_ui.ui_page_summary import Ui_PageSummary from jinja2 import FileSystemLoader, Environment import os from shutil import copyfile class PageSummary(QtWidgets.QWizardPage): def __init__(self, wizard, base_object): super().__init...
from osgeo import gdal def save_raster ( output_name, raster_data, dataset, driver="GTiff" ): """ A function to save a 1-band raster using GDAL to the file indicated by ``output_name``. It requires a GDAL-accesible dataset to collect the projection and geotransform. """ # Open the reference ...
# -*- coding: utf-8 -*- """ Analysis of bicycle parking for districts in Vienna, Austria """ import numpy as np import pandas as pd import matplotlib.pyplot as plt def get_capacity(parking): return parking.groupby('bezirk')['anzahl'].sum() def get_count(parking): return parking.groupby('bezirk')['anzahl'...
import os import sys import subprocess import argparse import multiprocessing parser = argparse.ArgumentParser() parser.add_argument("stage", default=0, type=int) parser.add_argument("--pool", type=int) args = parser.parse_args(sys.argv[1:]) if args.pool == None : pool = str(multiprocessing.cpu_count()) else : ...
from __future__ import print_function __metaclass__ = type from collections import namedtuple import os import sys from effect import ( ComposedDispatcher, Effect, Func, TypeDispatcher, base_dispatcher, sync_perform, sync_performer, ) from effect.testing import SequenceDispatcher from...
import datetime import decimal from django.test import TestCase from django.utils import timezone from . import TRANSFER_CREATED_TEST_DATA, TRANSFER_CREATED_TEST_DATA2 from ..models import Event, Transfer, Customer, CurrentSubscription, Charge from ..utils import get_user_model class CustomerManagerTest(TestCase): ...