content
stringlengths
4
20k
#!/usr/bin/env python # coding: utf-8 """Rules for glides and other general vowel rules.""" # pylint: disable=inconsistent-return-statements # pkg from . import rule from .. import tokens as T ## vowel (`holam-haser`, `patah-genuvah`) @rule("vowel", "vowel-holam-haser-default") def holam_haser_default(guess): ...
from base import * import error from collections import namedtuple # TODO first-class environments? class UnboundVariable(error.Runtime): def __init__(self, name): error.Runtime.__init__(self, 'unbound variable "{0}"'.format(name)) class Environment(dict): def __init__(self, parent = None): ...
""" Uber OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/uber.html """ from .oauth import BaseOAuth2 class UberOAuth2(BaseOAuth2): name = 'uber' ID_KEY = 'uuid' SCOPE_SEPARATOR = ' ' AUTHORIZATION_URL = 'https://login.uber.com/oauth/authorize' ACCESS_TOKEN...
import os, sys import imp from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * constants = imp.load_source('modulename', 'constants.py') from decimal import * def void(refTransId): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginId ...
# -*- coding: 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): # Deleting field 'Trial.max_participants' db.delete_column(u'trials_trial', 'max_participants') def ba...
from Analyser_Merge import Analyser_Merge, Source, SHP, Load, Mapping, Select, Generate class Analyser_Merge_Recycling_FR_nm_glass(Analyser_Merge): def __init__(self, config, logger = None): self.missing_official = {"item":"8120", "class": 21, "level": 3, "tag": ["merge", "recycling"], "desc": T_(u"NM gla...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The aim of the script is to train a Part of Speech (PoS) tagger. * The train set for the PoS tagger * For the purpose of the training an external maximun entropy model (megam)\ is used. After the PoS tagger has been created, it is pickled for subsequent use. """ ...
## This is the text editor interface. ## Anything you type or change here will be seen by the other person in real time. fruit = { "apples":3, "pears":3, "grapes":1, "tomatoes":2 } fruit_array = [] for key, value in fruit.items(): fruit_array.extend([key] * value) # ['apple'] * 3 from random import random ### s...
# -*- coding: utf-8 -*- import os try: # This part is surrounded in try/except because the config.py file is # also used in the run.py script which is used to compile/minify the client # side files (*.less, *.coffee, *.js) and is not aware of the GAE from datetime import datetime import model CONFIG_DB = ...
''' This module imports the PyQt modules in a version-compatible manner, defines a QtVersion variable set to 4 or 5, and loads the UI class definitions from the .ui files or from resource modules containing them. By loading .ui files directly the application doesn't have to rely on source files generated by pyuic4/5 wh...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate a courses tree for LDAP. This is a 'helper' script to add courses to an org-ldif tree: - Courses (undervisningsenheter) are exported as uioEduOffering objects - Course activities (undervisningsaktiviteter) are exported as uioEduSection objects. The idea is...
#!/usr/bin/env python # Dive ArduSub in SITL from __future__ import print_function import os import pexpect from pymavlink import mavutil from pysim import util from common import AutoTest # get location of scripts testdir = os.path.dirname(os.path.realpath(__file__)) HOME = mavutil.location(33.810313, -118.393867...
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Test for Flood Vector Building Impact Function.** Contact : <EMAIL> .. note:: 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 ...
__author__ = "Vasyl Khomenko" __copyright__ = "Copyright 2013, Qubell.com" __license__ = "Apache" __email__ = "<EMAIL>" import logging as log import requests from qubell.api.public import exceptions, application class Revision(application.Application): """ Base class for revision """ def __init__(...
#!/usr/bin/evn python """ Senty Project Copyright(c) 2017 Senty. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('Tipo_cliente', '0001_initial'), ] operations = [ migrations.AlterField( model_name='tipo_cliente', n...
import urllib2, urllib API_SERVER = "//www.google.com/recaptcha/api" VERIFY_SERVER = "www.google.com" # customization (first value is used as fallback) VALID_THEMES = ('red', 'white', 'blackglass', 'clean', 'custom') VALID_LANGS = ('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr') ## # TEMPLATES ## WIDGET_TEMPLATE_CA...
import unittest from flexmock import flexmock, flexmock_teardown from hamcrest import assert_that, is_ from netman.adapters.switches.util import PageReader class PageReaderTest(unittest.TestCase): def setUp(self): self.reader = PageReader( read_while="--More-- or (q)uit", and_pr...
# -*- coding: utf-8 -*- from django.conf import settings from django.core.serializers import serialize from django.core.serializers.json import DjangoJSONEncoder from django.db.models.query import QuerySet from django.template import Library import json import re register = Library() version_to_commit_regex = re.co...
import sqlite3 import pprint from file import FileEx class SQLiteEx(object): def __init__(self, dbname, pclient): self.conn = sqlite3.connect(dbname) self.conn.execute("CREATE TABLE if not exists files (id text primary key, type int, mp4size int, original_name text, moviedb_name text, downloaded int)"); self.p...
from weatbag import words import random class Tile: def __init__(self): self.enemy_dead = False self.enemy_life = 2 def describe(self): if not self.enemy_dead: print("You encounter an orc! He's got a mean look, but you're a " "strong one. You should be...
""" Interfaces for the leap.mail module. """ from zope.interface import Interface, Attribute class IMessageWrapper(Interface): """ I know how to access the different parts into which a given message is splitted into. :ivar fdoc: dict with flag document. :ivar hdoc: dict with flag document. :i...
### Computer Science with Applications III ### Analyzing NYC Taxi Data ### Lauren Dyson, Carlos Grandet, Hector Salvador ### June 2016 import requests import csv APIKEY='c2c020da0fa05178acf39b4f9dba3efd' ARTISTS = ['lady%20gaga', 'drake', 'alicia%20keys', 'lil%20wayne', 'chris%20brown', 'rihanna', 'coldplay', 'kat...
"""Small window that pops up to show hints for possible keystrings. When a user inputs a key that forms a partial match, this shows a small window with each possible completion of that keystring and the corresponding command. It is intended to help discoverability of keybindings. """ import html import fnmatch import...
# -*- coding: utf-8 -*- """The Windows event formatter.""" from plaso.formatters import interface from plaso.formatters import manager class WindowsDistributedLinkTrackingCreationEventFormatter( interface.ConditionalEventFormatter): """Formatter for a Windows distributed link creation event.""" DATA_TYPE = ...
# -*- coding: utf-8 -*- import scrapy import json import re from locations.items import GeojsonPointItem class McDonaldsTRSpider(scrapy.Spider): name = 'mcdonalds_tr' allowed_domains = ['www.mcdonalds.com.tr'] def start_requests(self): url = 'https://www.mcdonalds.com.tr/Content/WebService...
""" Makes the flag returnable in Quake-like fashion. Maintainer: mat^2 """ from pyspades.collision import vector_collision def apply_script(protocol, connection, config): game_mode = config.get('game_mode', 'ctf') if game_mode != 'ctf': return protocol, connection class ReturnConnection(con...
from pymeasure.instruments import Instrument class Agilent34410A(Instrument): """ Represent the multimiters HP/Agilent/Keysight 34410A, and related Implemented measurements: voltage_dc, voltage_ac, current_dc, current_ac, resistance, resistance_4w """ #only the most simple functions are imp...
"""Convert from transport socket capture to fuzz test case. Converts from envoy.data.tap.v2alpha.Trace proto to test.integration.CaptureFuzzTestCase. Usage: capture_fuzz_gen.py <listener capture> [<cluster capture>] """ from __future__ import print_function import functools import sys from google.protobuf import em...
"""Tests for Python ops defined in math_grad.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.eager import backprop from tensorflow.python.eager import context from tensorflow.python.eager import execution_ca...
import pytest import numpy as np from numpy.testing import assert_allclose from keras.utils.test_utils import layer_test from keras_contrib.layers import recurrent from keras.layers import embeddings from keras.models import Sequential from keras import regularizers from keras.utils.test_utils import keras_test from ...
"""Utilities related to SSH connection management.""" import os import string from eventlet import pools from oslo.config import cfg import paramiko from cinder import exception from cinder.i18n import _ from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) ssh_opts = [ cfg.BoolO...
# -*- coding: utf-8 -*- """Handlers for user administration views.""" # standard library imports # third-party imports from flask import Blueprint, render_template, current_app # application imports from emol.decorators import admin_required from emol.models import Discipline, Role, User BLUEPRINT = Blueprint('user...
''' These functions provide shorthand functional interfaces for actions such as getting a :class:`~dxpy.bindings.DXDataObject` handler from an ID or `link <https://wiki.dnanexus.com/API-Specification-v1.0.0/Details-and-Links#Linking>`_, or creating a link from a handler. In addition, there are functions for performing...
# -*- coding: utf-8 -*- # import sys, os on_rtd = os.environ.get('READTHEDOCS', None) == 'True' sys.path.append(os.path.abspath('../../../../')) sys.path.append(os.path.abspath('../../../')) from docs.shared.conf import * sys.path.insert(0, os.path.abspath('.')) master_doc = 'index' # Add any paths that contain ...
import idl_schema import json_parse from js_externs_generator import JsExternsGenerator from datetime import datetime import model import sys import unittest # The contents of a fake idl file. fake_idl = """ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-st...
"""Describes Rotest's test running handler class.""" # pylint: disable=too-many-arguments from __future__ import absolute_import import sys from collections import defaultdict from future.builtins import range from rotest.common.utils import get_class_fields from rotest.core.runners.base_runner import BaseTestRunner...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutSets(Koan): def test_sets_make_keep_lists_unique(self): highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod'] there_can_only_be_only_one = set(highlanders) self.assert...
import logging import secrets from typing import List, Optional, Tuple from django.conf import settings from django.http import HttpRequest, HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render from django.urls import reverse from django.utils.cache import patch_cache_control from zerver.c...
"""Preferences dialog.""" from __future__ import division, print_function import os.path from logging import getLogger from gettext import gettext as _ from lib.gibindings import Gtk from lib.gibindings import Gdk from gui.compatibility import CompatibilityPreferences import lib.config import lib.localecodes from l...
""" craes: A search engine implemented in Python - Uses the rank generated by reknar - Uses the index generated by redips """ import reknar import redips import random class Craes: def __init__(self, index=None, ranks=None): if not index: red = redips.load('redips.pickle') self.ind...
from collections import deque from kafka.tools.assigner.actions import ActionModule from kafka.tools.exceptions import ConfigurationException, NotEnoughReplicasException class ActionRemove(ActionModule): name = "remove" helpstr = "Move partitions from one broker to one or more other brokers (maintaining RF)" ...
# -*- coding: utf-8 -*- from xml.etree import ElementTree class MetaParser(object): def get_all_resource(self): pass def get_resource(self, resource_id): pass def get_all_retsclass(self, resource_id): pass def get_retsclass(self, resource_id, retsclass_name): ...
from libarray import * from linalg import solve import numpy as np class Quadratic1DInterpolate: # Continuous-1 def __init__(self, x, y): self.x = x self.y = y self.xscale = 1.0/(x[-1]-x[0]), -1.0/(x[-1]-x[0])*x[0] self.yscale = 1.0/(y[-1]-y[0]), -1.0/(y[-1]-y[0])*y[0] ...
from enigma import * from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Components.Label import Label from Components.ScrollLabel import ScrollLabel from Components.Button import Button from Components.ActionMap import ActionMap, NumberActionMap from Components.config import * from Compo...
import fftoolbox as fftb import numpy as np from scipy.optimize import curve_fit import time import logging, sys logger = logging.getLogger(__name__) lf = '%(levelname)s: %(funcName)s at %(filename)s +%(lineno)s\n%(message)s\n' logging.basicConfig(level=logging.DEBUG, format=lf) molecule_name = 'water' rank = 1 ra...
from google.appengine.ext import webapp from google.appengine.ext.webapp import template from domain import MyUser import hashlib from domain import MyUser SECRET='sudoMake' form = """ <form action="/testform" method="get"> <input name="q"> <input type="submit"> </form> """ class MainHandler(webapp.RequestHand...
from django.db.models.fields import FieldDoesNotExist from django.utils.translation import get_language, ugettext_lazy as _l from rest_framework import serializers from rest_framework.exceptions import ValidationError from hvad.utils import set_cached_translation, load_translation from hvad.contrib.restframework.utils ...
# coding: utf-8 """ PDT: Python Decorated Templates =============================== Introduction ------------ Why bother working with embedded templating languages within Python when Python is already a fully functional and extensible scripting language perfect for templating? PDT provides a straight forward templati...
from __future__ import print_function from __future__ import unicode_literals import argparse import sys from . import __version__, Directory, directory_delete, directory_list, str_size # Argument parser parser = argparse.ArgumentParser(prog='deduplicated') subparsers = parser.add_subparsers(dest='action') parser...
import six import collections import pkg_resources from chef.acl import Acl from chef.api import ChefAPI from chef.exceptions import * class ChefQuery(collections.Mapping): def __init__(self, obj_class, names, api): self.obj_class = obj_class self.names = names self.api = api def __l...
import re from bs4 import BeautifulSoup import requests import datetime import logging import os import json from django.core.mail import send_mail from django.template import Context from django.template.loader import get_template from django.utils.timezone import utc from pyparsing import commaSeparatedList from tel...
# Define a procedure, stamps, which takes as its input a positive integer in # pence and returns the number of 5p, 2p and 1p stamps (p is pence) required # to make up that value. The return value should be a tuple of three numbers # (that is, your return statement should be followed by the number of 5p, # the number of...
import pickle import botogram.commands import botogram.decorators BAD_DOCSTRING = """ a b """ def global_command(): pass def create_command(bot, name, func=None): """Create a new command""" if func is None: def func(): pass bot.command(name)(func) all_commands = {cm...
"""This file contains the necessary interface for OLECF plugins.""" import abc import logging from plaso.lib import errors from plaso.lib import plugin class OlecfPlugin(plugin.BasePlugin): """An OLECF plugin for Plaso.""" __abstract = True NAME = 'olecf' # List of tables that should be present in the da...
import fixtures import logging import mox import os import sys import time import testtools from oslo.config import cfg from heat.engine import environment from heat.engine import resources from heat.engine import scheduler class HeatTestCase(testtools.TestCase): TIME_STEP = 0.1 def setUp(self): s...
import os import plistlib import shutil from ..compat import is_darwin, FileExistsError from .api import EXE, COLLECT from .datastruct import Target, TOC, logger from .utils import _check_path_overlap, _rmtree, add_suffix_to_extensions, checkCache class BUNDLE(Target): def __init__(self, *args, **kws): f...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Parsing casualties CSV files for Great Britain data and putting them into DB """ from collections import defaultdict import sys import csv import db_api.person import db_api.accident import db_api.vehicle from parsing import common from parsing.common import translate_fie...
#!/usr/bin/python # vim: set fileencoding=utf-8 : import itertools "Reimplementation of some clojure-core functions" def select_keys(dct, keys_to_extract): """Returns subdict with only keys_to_extract included""" return dict([ (k,v) for k, v in dct.items() if k in keys_to_extract]) def select_values(dct, ke...
import unittest import warnings import numpy as np import six import chainer from chainer import testing from chainer_tests.dataset_tests.tabular_tests import dummy_dataset def _filter_params(params): for param in params: if 'expected_len' in param and \ isinstance(param['get_examples_indices...
from neutron_lib.api import extensions EXTENDED_ATTRIBUTE = 'extended_attribute' EXTENDED_ATTRIBUTES_2_0 = { 'ext_test_resources': { EXTENDED_ATTRIBUTE: {'allow_post': True, 'allow_put': False, 'validate': {'type:uuid_or_none': None}, 'default': Non...
""" This module defines valid Thermo-Calc TDB keywords and handles abbreviations. Note that not all of these keywords are fully supported yet. """ import re # Reference: Thermo-Calc Database Manager's Guide TDB_KEYWORDS = sorted([ 'ELEMENT', 'SPECIES', 'PHASE', 'CONSTITUENT', 'ADD_CONSTITUENT', ...
""" This module will run some job descriptions defined with an older version of DIRAC """ # pylint: disable=protected-access, wrong-import-position, invalid-name, missing-docstring import unittest import os import shutil #!/usr/bin/env python from DIRAC.Core.Base.Script import parseCommandLine parseCommandLine() fr...
# External Attribute Skeleton # # Input: Single trace, multi-attribute # Output: Single attribute # import sys,os import numpy as np # # Import the module with the I/O scaffolding of the External Attribute # sys.path.insert(0, os.path.join(sys.path[0], '..')) import extattrib as xa # # The attribute parameters - keep ...
import navegador5 as nv import navegador5.url_tool as nvurl import navegador5.head as nvhead import navegador5.body as nvbody import navegador5.cookie import navegador5.cookie.cookie as nvcookie import navegador5.cookie.rfc6265 as nvrfc6265 import navegador5.jq as nvjq import navegador5.js_random as nvjr import naveg...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from cassandra.cluster import Cluster import collections import logging import re logger = logging.getLogger(__name__) # pylint: disable=invalid-name __all__ = ["get_system_columns"] _MARSHAL_PACKAGE = "org.apache.cassandra.db.m...
# -*- coding: utf-8 -*- from django.db import models from apps.registro.models import Jurisdiccion from apps.postitulos.models import CarreraPostitulo, PostituloNacional, EstadoPostituloNacional, NormativaPostituloJurisdiccional from apps.postitulos.models.EstadoSolicitud import EstadoSolicitud import datetime """ Sol...
#!/usr/bin/env python # cardinal_pythonlib/file_io.py """ =============================================================================== Original code copyright (C) 2009-2021 Rudolf Cardinal (<EMAIL>). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (the "License...
# -*- coding: utf-8 -*- """Tests of history structure.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import numpy as np from .._history import History, GlobalHistory #--------------------...
import numpy as np # the first row is header SKIPROWS = 1 # the number of column to be skipped (including lp__, treedepth__, and # stepsize__) SKIPCOLS = 3 def parse_samples(samples_csv, F, T, L, gamma_model=True, LEN_BATCH=5000): f = open(samples_csv, 'r') header = f.readline().strip().split(',') length...
template = R""" \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage{marvosym} \usepackage{ifthen} \usepackage[utf8]{inputenc} \newcommand{\euro}{\EUR\ } \newcommand{\ibannetje}{NL19 ABNA 0448 1916 28} \usepackage[dutch]{babel} \pagestyle{empty} \textwidth = 13cm \date{} \begin{document} \flushright ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import ner import jieba # import mmseg import jieba.analyse from os import path ######################## # NLP + NER # NER server should be up: ../see ner-server/ ######################## # set relative URLs here=path.dirname(path.dirname(path.abspath(__file__))) stopw...
import cv2 import cPickle, os import numpy as np from faster_rcnn.datasets.factory import get_imdb # up to 5 det_file_dirs = ['/home/yang/Faster-RCNN-Refinement/output/faster_rcnn_end2end/voc_2007_test/faster_rcnn_100000'] visualization_output_dir = 'visualization' # orange, yellow, green, blue, red colors = [(66, 164...
import os.path import shutil import sys import logging logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', level=logging.INFO) import rope.base.project from rope.contrib import generate def sample_project(root=None, foldername=None, **kwds): if root is None: root = 's...
import functools from asyncio import get_event_loop from typing import Any, Callable, List, Optional, Tuple, TypeVar from prompt_toolkit.application import Application from prompt_toolkit.application.current import get_app from prompt_toolkit.buffer import Buffer from prompt_toolkit.completion import Completer from pr...
# -*- coding: utf-8 -*- """ tests/test_views_depends.py :copyright: (C) 2015 by Fulfil.IO Inc. :license: see LICENSE for more details. """ import unittest import trytond.tests.test_tryton from trytond.tests.test_tryton import test_view, test_depends class TestViewsDepends(unittest.TestCase): ''' ...
"""Org teams Revision ID: 29fd6847a8e2 Revises: c55612fb52a Create Date: 2015-01-27 03:02:47.553438 """ # revision identifiers, used by Alembic. revision = '29fd6847a8e2' down_revision = 'c55612fb52a' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table('team', sa.Column('id',...
from neutron.common import constants as n_const from neutron.plugins.common import utils as p_utils MAX_VLAN_POSTFIX_LEN = 5 def get_vlan_device_name(src_dev, vlan): """Generating the vlan device name.""" # Ensure that independent of the vlan len the same name prefix is used. src_dev = p_utils.get_inter...
# -*- coding: utf-8 -*- """ Sahana Eden Module Automated Tests - PROJECT001 Create Project @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...
from api.libs.base import CoreView from cmdb.models import Asset, BusinessUnit, Server, EventLog from django.db.models import Sum, Count from django.conf import settings from account.models import UserProfile class Dashboard(CoreView): login_required_action = [] superuser_required_action = [] def get_bus...
r""" Sequences (:mod:`skbio.sequence`) ================================= .. currentmodule:: skbio.sequence This module provides classes for storing and working with biological sequences, including generic sequences which have no restrictions on which characters can be included, and sequences based on IUPAC-defined se...
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import json import unittest import mock from django import test from django.conf import settings from django.contrib.auth import get_user_model from django.core import serializers from django.core.urlresolvers import reverse from django.ht...
from mpl_toolkits.mplot3d import Axes3D import pathlib as plb import matplotlib.pyplot as plt import pickle import numpy as np import stream import pyNN.nest as sim import visualization as vis import cv2 import pyNN.utility.plotting as pynnplt import common as cm import network as nw args = cm.parse_args() weights_d...
import sys import glob from os.path import join as fjoin from core.models import get_setting VIDEO_EXTENSIONS = ['mov', 'mp4', 'm4v', 'wmv'] def reexec_with_pythonw(py_file=None): # Copyright (C) 2009 www.stani.be # Borrowed from the source to phatch! """'pythonw' needs to be called for any wxPython app ...
from Products.Zuul.infos import ProxyProperty from zope.interface import implements from Products.Zuul.infos.template import BasicDataSourceInfo from ZenPacks.community.Splunk.interfaces import ISplunkDataSourceInfo class SplunkDataSourceInfo(BasicDataSourceInfo): implements(ISplunkDataSourceInfo) component =...
MONGO_ADDRESS = "192.168.10.1:27017" MONGO_DB_NAME = "db" RFCLIENT_RFSERVER_CHANNEL = "rfclient<->rfserver" RFSERVER_RFPROXY_CHANNEL = "rfserver<->rfproxy" RFTABLE_NAME = "rftable" RFCONFIG_NAME = "rfconfig" RFISL_NAME = "rfisl" RFISLCONF_NAME = "rfislconf" RFSERVER_ID = "rfserver" RFPROXY_ID = "rfproxy" DEFAULT_RF...
included_terms = ['2018/19'] import PyCAPI import datetime import uob_utils capi = PyCAPI.CanvasAPI() # get all account courses allcourses = capi.get_courses(account_id='114', include=['term','teachers']) courses = [] #for course in allcourses: # if course['term']['name'] in included_terms: # courses.append(cour...
from youku.youku_scan import scan_page from youku.youku_to_flvcd import YouToFlvcd from youku.youku_web_parse import YoukuWebParse from youku.youku_web import music_type_dict, comic_type_dict, youku_root from youku.youku_web import zy_type_dict, movie_type_dict, tv_type_dict from widget.utils import ScanTreeview import...
"""Testing extensions. this module is designed to work as a testing-framework-agnostic library, so that we can continue to support nose and also begin adding new functionality via py.test. """ from __future__ import absolute_import import sys import re py3k = sys.version_info >= (3, 0) if py3k: import configp...
import louis import libxml2 import libxslt import sys import getopt from optparse import OptionParser nodeName = None emphasisMap = { 'plain_text' : louis.plain_text, 'italic' : louis.italic, 'underline' : louis.underline, 'bold' : louis.bold, 'computer_braille' : louis.computer_braille} def ...
from __future__ import division, print_function import numpy as np import sys import imp try: imp.find_module('pycuda') found_pycuda = True except ImportError: found_pycuda = False try: import mobility_cpp found_cpp = True except ImportError: try: from mobility import mobility_cpp found_cpp ...
import string, sys, subprocess, os, os.path as path import urllib, urllib2, zipfile, tarfile # import the helpers from oelib.py from oelib import deleteFolder, printCommands, error, execute, system, ExecError, cores def commands(): return ((update, "update"), (data, "data"), (install, ...
# -*- coding: utf-8 -*- # smaller version without plots (due to github filesize limit) #console: # chcp 65001 from io import StringIO from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from pdfminer.pdfpage imp...
"""Model for storing information to look up isolates. An isolate is a way to describe the dependencies of a specific build. More about isolates: https://github.com/luci/luci-py/blob/master/appengine/isolate/doc/client/Design.md """ import hashlib from google.appengine.ext import ndb def Get(builder_name, change, ...
# -*- coding: utf-8 -*- from openerp.models import Model from openerp.fields import Date, Selection, Many2one, Char from openerp.api import onchange, depends, multi, model from openerp.addons.training_management.models.model_names import ModelNames from openerp.addons.training_management.models.selections import Spec...
from avidaspatial import * import matplotlib.pyplot as plt import seaborn as sns updates = [] locs = [] loc_file = open("task_locs.csv") for line in loc_file: if line.strip() == "": continue sline = line.split(",") updates.append(int(sline[3])) locs.append([int(sline[1]), int(sline[2])]) loc_fi...
from . import AWSObject, AWSProperty from .validators import positive_integer def validate_authorizer_ttl(ttl_value): """ Validate authorizer ttl timeout :param ttl_value: The TTL timeout in seconds :return: The provided TTL value if valid """ ttl_value = int(positive_integer(ttl_value)) if tt...
import sprites import random import pygame class EnemyHeli(object): shoot = False shoot_counter = 0 bullets = [] animation_number = 0 counter = 0 current = sprites.enemy_helicopter_list[animation_number] crash_counter = 0 wreck_start = False wrecked = False ...
#!/usr/bin/python # -*- coding: utf-8 -*-. import subprocess from shlex import split from sys import exc_info class Command: '''Wrapper to run Linux shell commands using Popen''' def __init__(self,command): self.command = command def run(self,OnlyExitStatus=True): '''run a command and ret...
"""Records all messages in a searchable form, and searches them.""" from google.appengine.api import search index = search.Index(name='Messages') def add(doc_id, message): index.put(search. Document(doc_id=doc_id, fields= [search.TextField(name='author...