content
stringlengths
4
20k
# vim: set fileencoding=utf-8 from bs4 import BeautifulSoup import urllib2 import argparse import re import datetime import html5lib import pgdb import logging import main import mc_util import mc_db import themortgagemeter_utils institution_code = 'BRTN' # easier to have a global pages_so_far so that the recursion...
# -*- coding: iso-8859-1 -*- """ MoinMoin - Clock @copyright: 2001-2003 Juergen Hermann <<EMAIL>>, 2003-2006 MoinMoin:ThomasWaldmann @license: GNU GPL, see COPYING for details. """ import time class Clock: """ Helper class for code profiling we do not use time.clo...
""" This is the main test module for all targets. """ import os import sys import unittest sys.path.append('..') from cc_binary_test import TestCcBinary from cc_library_test import TestCcLibrary from cc_plugin_test import TestCcPlugin from cc_test_test import TestCcTest from gen_rule_test import TestGenRule from j...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from units.compat.mock import patch from ansible.modules.network.voss import voss_command from units.modules.utils import set_module_args from .voss_module import TestVossModule, load_fixture class TestVossCommandMod...
""" This is the communication interface between POX and the GUI. The gui backend component acts as a proxy between other components and the GUI. GUI --> POX component: If we want to trigger component functionality through the GUI, the component must exposes that functionality through its API. The "backend" should just...
import platform import time from memory_profiler import memory_usage from pytest import mark from wand.color import Color from wand.compat import xrange from wand.version import MAGICK_VERSION_INFO # noqa def test_equals(): """Equality test.""" assert Color('#fff') == Color('#ffffff') == Color('white') ...
from PyPDF2 import PdfFileWriter, PdfFileReader from PyPDF2.generic import DictionaryObject, DecodedStreamObject, NameObject, createStringObject, ArrayObject from PyPDF2.utils import b_ from datetime import datetime import io import hashlib DEFAULT_PDF_DATETIME_FORMAT = "D:%Y%m%d%H%M%S+00'00'" # make sure values a...
""" tribus.common.setup.install =========================== """ from distutils.command.install_data import install_data as base_install_data from distutils.command.build_py import build_py as base_build_py from tribus.config.base import BASEDIR from tribus.common.setup.utils import get_data_files, get_package_data...
import sys # ------------------------------------------------------------------------ # # #TODO #FIXME Airflow 2.0 # # Old import machinary below. # # This is deprecated but should be kept until Airflow 2.0 # for compatibility. # # ------------------------------------------------------------------------ # Imports th...
import unittest from astropy import units as u from astropy import constants as const from EXOSIMS.util.deltaMag import deltaMag import numpy as np r"""DeltaMag module unit tests Paul Nunez, JPL, Aug. 2016 """ class Test_deltaMag(unittest.TestCase): def test1(self): r"""Testing some limiting cases....
"""Core eval alignment algorithms """ from functools import partial, wraps import warnings import numpy as np from pandas.compat import range, zip from pandas.errors import PerformanceWarning import pandas as pd from pandas import compat import pandas.core.common as com from pandas.core.computation.common import _r...
#!/usr/bin/env python import dsx import soclib def VgmnNoirqMulti( proc_count = 1, ram_count = 2 , icache_lines = 16, icache_words = 8, dcache_lines = 16, dcache_words = 8 ): pf = soclib.Architecture(cell_size = 4, plen_size = 8, addr_size = 32, rerror_size = 1, cle...
DEBUG_MODE = True import logging, sys, base64, md5 from datetime import datetime, timedelta log = logging.getLogger() import os, time, random import webapp2 from google.appengine.ext import db from google.appengine.api import users from google.appengine.ext.webapp import template from google.appengine.ext.webapp imp...
from __future__ import division, unicode_literals """ This module implements abstract base classes for post-processing entries. Any class which modifies entries should inherit these classes. """ import six __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "0.1" __mai...
import sys, os, re from calibre.ebooks.rtf2xml import copy from calibre.ptempfile import better_mktemp class Colors: """ Change lines with color info from color numbers to the actual color names. """ def __init__(self, in_file, bug_handler, copy=None, ...
from __future__ import absolute_import, division, print_function, unicode_literals from io import StringIO from pants.engine.console import Console from pants.engine.goal import Goal from pants.engine.selectors import Params from pants.init.options_initializer import BuildConfigInitializer from pants.init.target_root...
__revision__ = "$Id$" from distutils.core import setup from distutils.extension import Extension setup( name = 'intbitset', version = '$Revision$', description = """ Defines an intbitset data object to hold unordered sets of unsigned integers with ultra fast set operations, implemented via bit...
from sympy.core.sympify import sympify from sympy.solvers.solveset import solveset from sympy.simplify import simplify from sympy import S def singularities(expr, sym): """ Finds singularities for a function. Currently supported functions are: - univariate rational(real or complex) functions Exam...
import json from django.test import TestCase from django.urls import reverse class ApiTestCase(TestCase): def setUp(self): super().setUp() self.api_url = reverse('chatterbot') def test_invalid_text(self): response = self.client.post( self.api_url, data=json.du...
import sys from buildtools.bt_logging import log class WindowsEnv: """Utility class to get/set windows environment variable""" def __init__(self, scope): log.info('Python version: 0x%0.8X' % sys.hexversion) if sys.hexversion > 0x03000000: import winreg #IGNORE:import-error ...
from grquoting import quote, unquote import cgi from utils import Missing, valid_mid, valid_mql_key class Varenv(dict): """ A varenv is a container for per query MQL state It contains the following variables: $user - the user performing the query $permission - the default write permission $lang...
from setuptools import setup setup( name='moltemplate', packages=['moltemplate', 'moltemplate/nbody_alt_symmetry'], description='A general cross-platform text-based molecule builder for LAMMPS', author='Andrew Jewett', author_email='<EMAIL>', url='https://github.com/jewettaij/moltemplate', downloa...
#!/usr/bin/env python3 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import chipset def read(reg): reg = int(reg, 16) val = chipset.intel_register_read(reg) return val def write(reg, val): chipset.intel_register_write(reg, val) def gen6_forcewake_get(): write(0xa18c, 0x1) read("0xa180...
"""Support for Xiaomi Mi routers.""" import logging import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA, DeviceScanner) from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME _...
import uuid from django.contrib import messages from django.contrib.contenttypes.models import ContentType from django.core.files.storage import default_storage from django.db.models import Sum, Count from django.http import HttpResponse from django.utils.decorators import method_decorator from django.views.decorators...
{ 'name': 'Bill Time on Tasks', 'version': '1.0', 'category': 'Project Management', 'description': """ Synchronization of project task work entries with timesheet entries. ==================================================================== This module lets you transfer the entries under tasks defined ...
# pylint:disable=no-self-use, unused-argument from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os from subprocess import check_call from subprocess import PIPE from subprocess import Popen from pytest import yield_fixture as fixture from testi...
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et # $Id: xmlrpc_curl.py,v 1.13 2007/03/04 19:26:59 kjetilja Exp $ # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see # the libcurl tutorial for more info. try: import signal from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGP...
""" Stager handling functionality for Empire. """ import fnmatch import imp import http import helpers import encryption import os class Stagers: def __init__(self, MainMenu, args): self.mainMenu = MainMenu # pull the database connection object out of the main menu self.conn = self.m...
from __future__ import absolute_import from __future__ import print_function from typing import Any, Dict, Generator, Iterable, Tuple import os import pty import sys import errno def run_parallel(job, data, threads=6): # type: (Any, Iterable[Any], int) -> Generator[Tuple[int, Any], None, None] pids = {} # typ...
#!/usr/bin/env python from tools.multiclass_shared import prepare_data [traindat, label_traindat, testdat, label_testdat] = prepare_data(False) parameter_list = [[traindat,testdat,label_traindat,label_testdat,2.1,1,1e-5],[traindat,testdat,label_traindat,label_testdat,2.2,1,1e-5]] def classifier_multilabeloutputlibli...
import bioformats import javabridge as J def get_imageplus_wrapper(imageplus_obj): '''Wrap the imageplus object as a Java class''' class ImagePlus(object): def __init__(self): self.o = imageplus_obj lockSilently = J.make_method( 'lockSilently', '()Z', ...
import socket import sys from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) #use RPi.GPIO layout BUT1 = 13 #gpio27 BUT2 = 15 #gpio22 #button inputs GPIO.setup(BUT1, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.setup(BUT2, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) #connect buttons to +Vcc=3.3V ...
from arcpy import * import os fuente = r'D:\A_Ordenar\Julien\python\capacitacion_arcpy_IRD' '''GetParameterAsText(0)''' '''nombre = GetParameterAsText(1)''' num_punto = 0 num_linea = 0 num_poligono = 0 informe = open(r'D:\A_Ordenar\Julien\python\capacitacion_arcpy_IRD\web\stats_BD.html', 'w') for source, carpeta, ...
#!/usr/bin/env python from os.path import normpath, basename, ismount import subprocess devices = subprocess.Popen(["lsblk | awk '{print $7}' | grep /"], shell=True, stdout=subprocess.PIPE,) print ("${voffset 4}") for device in devices.stdout: device = device.rstrip().decode("utf-8") if (ismount(device)): ...
from .response import Response class ImageInsights(Response): """The top-level object that the response includes when an image insights request succeeds. For information about requesting image insights, see the [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-...
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # # Program Parameters # import os import...
from gp_actuator import GPActuator from pychron.globals import globalv class QtegraGPActuator(GPActuator): """ """ def get_state_checksum(self, keys): return 0 def get_channel_state(self, obj, verbose=False, **kw): """ """ cmd = 'GetValveState {}'.format(obj.address...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.db import models from django.http.response import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.utils.cache import add_never_cache_headers from django.utils.translation import get_language_...
from __future__ import generators from nevow import context from nevow import flat from nevow import rend from nevow import testutil from nevow import loaders from nevow import util class req(testutil.FakeRequest): def __init__(self): testutil.FakeRequest.__init__(self) self.d = util.Deferred() ...
""" Created August 14 2014 James Houghton <<EMAIL>> Changed May 03 2017 Alexey Prey Mulyukin <<EMAIL>> from sdCloud.io developement team Changes: [May 03 2017] Alexey Prey Mulyukin: Integrate support to logical operators like 'AND', 'OR' and 'NOT'. Fix support the whitespaces in expressions be...
#----------------------------------# # Victron BMV battery monitor class# #----------------------------------# import serial from time import sleep import time import os class bmv: def __init__(self,serialport,model): self.serialport=serialport self.valuename=['V','I','CE', 'SOC', 'TTG', "ALARM","R...
import airhook from twisted.internet.defer import Deferred from twisted.protocols import basic from bencode import bencode, bdecode from twisted.internet import protocol from twisted.internet import reactor import time import sys from traceback import format_exception import khash as hash KRPC_TIMEOUT = 20 KRPC_ER...
#!/usr/bin/env python2 import os from credit import main, exce from credit import jsonhelper as jh from credit.tests import testData as td import unittest class Test_total_all_net(unittest.TestCase): def setUp(self): self.fnum = 10 self.days = 10 self.startname = 'test_display' s...
from m5.objects import * from arm_generic import * root = LinuxArmFSSystem(machine_type='VExpress_EMM64', mem_mode='atomic', mem_class=SimpleMemory, cpu_class=AtomicSimpleCPU, num_cpus=2).create_root()
from openerp.osv import fields, osv class account_partner_ledger(osv.osv_memory): """ This wizard will provide the partner Ledger report by periods, between any two dates. """ _name = 'account.partner.ledger' _inherit = 'account.common.partner.report' _description = 'Account Partner Ledger' ...
from __future__ import print_function, unicode_literals import sickbeard import re from sickbeard import logger, common from sickrage.helper.exceptions import ex import twilio class Notifier(object): number_regex = re.compile(r'^\+1-\d{3}-\d{3}-\d{4}$') account_regex = re.compile(r'^AC[a-z0-9]{32}$') ...
__author__ = 'frank' import zstacklib.utils.daemon as daemon import zstacklib.utils.http as http import zstacklib.utils.log as log import zstacklib.utils.shell as shell import zstacklib.utils.lichbd as lichbd import zstacklib.utils.iptables as iptables import zstacklib.utils.jsonobject as jsonobject import zstacklib.u...
""" simple cube fitting example """ from __future__ import print_function import numpy as np import pyspeckit from spectral_cube import SpectralCube from astropy import wcs from astropy import units as u # Create a new WCS object so we can instantiate the SpectralCube mywcs = wcs.WCS(naxis=3) # Set up a tangent proj...
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from twitter.common.collections import OrderedSet from pants.backend.jvm.tasks.jvm_tool_task_mixin import JvmToolTaskMixin from pants.backend.jvm.tasks.jvm_task impor...
from __future__ import with_statement import os.path import time import random import pickle from wc import wc import logging post_path = None def post_tweet( shorten_url=1, serialize=1, text='', latitude='0', longitude='0', base_url='', action='', tweet_id='0'): """ Queue...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.openstack im...
from __future__ import absolute_import, print_function from ..base import BulkModelDeletionTask, ModelDeletionTask, ModelRelation class ProjectDeletionTask(ModelDeletionTask): def get_child_relations(self, instance): from sentry import models from sentry.discover.models import DiscoverSavedQueryP...
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import numpy as np import warnings import CoolProp from CoolProp.Plots.Common import IsoLine,BasePlot,interpolate_values_1d from CoolProp.Plots.SimpleCycles import StateContainer class PropertyPlot(BasePlot): def __init__(s...
#!/usr/bin/python #Authors: Shelby Straight # #Last Modified: 10 Jan 2015 # #Description: Python implementation of PCA program to be run on POVME data # #usage: ./exec frame1.npy frame2.npy ... frameN.npy import numpy as np from numpy import linalg as LA_num import scipy from scipy import spatial from scipy import ...
import threading import eventlet from eventlet import greenpool from heat.openstack.common import log as logging from heat.openstack.common import loopingcall LOG = logging.getLogger(__name__) def _thread_done(gt, *args, **kwargs): """Callback function to be passed to GreenThread.link() when we spawn() Ca...
''' simple_ribbon_with_icon.py - creates a ribbon panel with a single push button. NOTE: - this MUST be set as a startup script for it to work - the RPS variable "EXAMPLES_PATH" must be set and contain "helloworld.py" ''' import clr clr.AddReference('PresentationCore') from System.Windows.Media.Imagi...
""" homeassistant.components.thermostat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to interact with thermostats. For more details about this component, please refer to the documentation at https://home-assistant.io/components/thermostat/ """ import logging import os from homeassistant.helpers.entity_c...
import types from inspect import signature from typing import Any, Callable from sdl2 import SDL_Delay, SDL_GetTicks # Upper bound on latency we can handle from the OS when we expect to return from sleep, measured in seconds. WAKE_UP_LATENCY = 5.0 / 1000.0 class TickManager: """The Tick Manager This class ...
import sys, os from optparse import OptionParser from androguard.core.bytecodes import apk, dvm from androguard.core.data import data from androguard.core.analysis import analysis, ganalysis from androguard.core import androconf from androguard.util import read option_0 = { 'name' : ('-i', '--input'), 'help' : 'filen...
from __future__ import unicode_literals import requests import json import argparse parser = argparse.ArgumentParser(description="""Retrieves pull request numbers and titles from the GitHub REST API. Only merged pull requests will be listed.""") parser.add_argument('-t',...
""" Sprite Move With Walls Simple program to show basic sprite usage. Artwork from http://kenney.nl """ import random import arcade SPRITE_SCALING = 0.5 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 MOVEMENT_SPEED = 5 window = None class MyApplication(arcade.Window): """ Main application class. """ def setup(...
from fedmsg_meta_fedora_infrastructure.fasshim import avatar_url, email2fas from fedmsg_meta_fedora_infrastructure import BaseProcessor from fedmsg_meta_fedora_infrastructure.conglomerators.pagure import \ pagure as pagure_conglomerator import fedmsg.meta.base def _get_project(msg, key='project'): ''' Re...
""" Test for allantools (https://github.com/aewallin/allantools) Stable32 was used to calculate the deviations we compare against. AW2015-06-26 The dataset is from the 10 MHz output at the back of an HP Impedance Analyzer measured with Keysight 53230A counter, 1.0s gate, RCON mode, with H-maser 10MHz refe...
''' Created on Oct 12, 2016 @author: mwitt_000 ''' import queue import threading import time ## An abstraction of a link between router interfaces class Link: ## creates a link between two objects by looking up and linking node interfaces. # @param node_1: node from which data will be transfered # @...
# -*- coding: utf-8 -*- """ MongoDB queue storage. @author: David Siroky (<EMAIL>) @license: MIT License (see LICENSE.txt) """ from binascii import b2a_base64, a2b_base64 from snakemq.message import Message from snakemq.storage import QueuesStorageBase import pymongo ###############################################...
from neutron_lib import constants as n_const from neutron_lib.objects import common_types from oslo_versionedobjects import fields as obj_fields from neutron.db.models.plugins.ml2 import vlanallocation as vlan_alloc_model from neutron.objects import base from neutron.objects.plugins.ml2 import base as ml2_base @base...
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import OrganizationMember, OrganizationMemberType from sentry.testutils import TestCase, PermissionTestCase class OrganizationMembersPermissionTest(PermissionTestCase): def setUp(self): super(Organizat...
{ 'name': "shop_batch_sales", 'summary': """Makes it possible to sell products in large quantities.""", 'author': "HGSoft - Soluções Criativas e Inteligentes", 'website': "http://www.hgsoft.com.br/", 'category': 'Site', 'version': '1.0', 'depends': ['base', 'website_sale'], ...
import sys from TestCase import TestCase def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ...
from indico.util.date_time import get_datetime_from_request, format_date, is_weekend from indico.util.i18n import _ from indico.modules.rb.models.holidays import Holiday from MaKaC.services.implementation.base import ServiceBase class GetDateWarning(ServiceBase): UNICODE_PARAMS = True def _checkParams(self):...
""" Slack OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/slack.html https://api.slack.com/docs/oauth """ import re from social.backends.oauth import BaseOAuth2 class SlackOAuth2(BaseOAuth2): """Slack OAuth authentication backend""" name = 'slack' AUTHORIZATION_URL = 'https://...
""" Test SGrid Variables WRF. Created on Apr 15, 2015 @author: ayan """ from __future__ import (absolute_import, division, print_function) import pytest from ..sgrid import SGrid from ..utils import GridPadding from ..variables import SGridVariable from .write_nc_test_files import wrf_sgrid @pytest.fixture def...
from gnuradio import analog from gnuradio import blocks from gnuradio import eng_notation from gnuradio import filter from gnuradio import gr from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from gnuradio import zeromq from gnuradio import digital from gnuradio import uhd import pmt import ...
from __future__ import print_function, division from functools import reduce from operator import add from sympy.core import Add, Basic, sympify from sympy.functions import adjoint from sympy.matrices.matrices import MatrixBase from sympy.matrices.expressions.transpose import transpose from sympy.strategies import (r...
"""Unit tests for evaluating functions on non-matching meshes""" # Copyright (C) 2013 Garth N. Wells # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either v...
#!/usr/bin/env python ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' try: from io import StringIO except ImportError: from io import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo from pytz....
from MidiOutStream import MidiOutStream class MidiOutPassThrough(MidiOutStream): """ This class i mainly used for testing the event dispatcher. The methods just returns the passed parameters as a tupple. """ ##################### ## Midi channel events def note_on(...
from django.views.generic.list import ListView from django.http import Http404, HttpResponse from django.contrib import messages from django.contrib.auth.models import User from django.utils.translation import ugettext as _, activate from django.core.urlresolvers import reverse from django.db.models import Q from djang...
""" Functions for creating temporary LMDBs Used in test_views """ import argparse from collections import defaultdict import os import random import re import sys import time # Find the best implementation available try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import ...
from CIM14.CDPSM.Unbalanced.IEC61968.AssetModels.ConductorInfo import ConductorInfo class CableInfo(ConductorInfo): """Cable data. """ def __init__(self, nominalTemperature=0.0, diameterOverScreen=0.0, sheathAsNeutral=False, diameterOverJacket=0.0, diameterOverCore=0.0, constructionKind="solid", outerJack...
# -*- 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): # Removing index on 'Feed', fields ['active_subscribers'] db.delete_index('feeds', ['active_subscribers']) ...
"""Component to make instant statistics about your history.""" import datetime import logging import math import voluptuous as vol from homeassistant.components.recorder import history from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( CONF_ENTITY_ID, C...
#!/usr/bin/env python ''' BlueBanana Rat Config Decoder ''' __description__ = 'BlueBanana Rat Config Extractor' __author__ = 'Kevin Breen http://techanarchy.net http://malwareconfig.com' __version__ = '0.1' __date__ = '2014/04/10' #Standard Imports Go Here import os import sys import string from zipfile import ZipFi...
from __future__ import unicode_literals from django import forms from django.contrib.auth import get_user_model from django.db.models.loading import get_model from django.db.transaction import atomic from django.forms import BaseModelForm from django.utils.translation import ugettext_lazy as _ from shoop.admin.form_par...
# -*- coding: utf-8 -*- """ """ # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from pyoko import Model, field from .auth import Unit, User PERSONEL_TURU = [ (1, 'Akademik'), (2, 'İdari') ] class Personel(Model): ...
from filer.models import * from django.core.files import File as DjangoFile from os.path import basename from urlparse import urlsplit import urllib2 def url2name(url): return basename(urlsplit(url)[2]) def download(url, dir): local_name = url2name(url) local_dir = dir local_path = '%s/%s' % (...
#!/usr/bin/env python ''' Copyright (C) 2007 Terry Brown, <EMAIL> 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 2 of the License, or (at your option) any later version. This progra...
import EncoderFactory from DatasetManager import DatasetManager import BucketFactory import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score from sklearn.pipeline import FeatureUnion, Pipeline from sklearn.preprocessing import StandardScaler import time import os import sys from sys import a...
"""bookmark_menu.py - Bookmarks menu.""" import gtk from mcomix import bookmark_backend from mcomix import bookmark_dialog class BookmarksMenu(gtk.Menu): """BookmarksMenu extends gtk.Menu with convenience methods relating to bookmarks. It contains fixed items for adding bookmarks etc. as well as dynamic...
#!/usr/bin/python # example how to deal with the depcache import apt_pkg from progress import TextProgress # init apt_pkg.init() progress = TextProgress() cache = apt_pkg.Cache(progress) print "Available packages: %s " % cache.package_count iter = cache["base-config"] print "example package iter: %s" % iter # get...
{ "name": "Stock Lock Lot", "Summary": "Restrict blocked lots in Stock Moves and reservations", "version": "8.0.1.1.0", "author": "OdooMRP team," "Avanzosc," "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", "website": "http://w...
''' File Record Read/Write Messages ------------------------------- Currently none of these messages are implemented ''' import struct from pymodbus.pdu import ModbusRequest from pymodbus.pdu import ModbusResponse from pymodbus.pdu import ModbusExceptions as merror #--------------------------------------------------...
# -*- coding: utf-8 -*- # Project : LM4paper # Created by igor on 2016/12/2 import os import tensorflow as tf from utils import Vocabulary, DatasetCharWord from mixlm.clstmdnn import CLSTMDNN from mixlm.run_utils import run_train, run_eval flags = tf.flags flags.DEFINE_string("vocabdir", "/data/lmdata/dict/", "Voc...
# -*- coding: utf-8 -*- from collections import OrderedDict from unittest import TestCase import json from hyperlink import URL from minion import renderers from minion.http import Headers from minion.request import Request, Response class TestUnicodeRenderer(TestCase): request = Request(url=URL(path=[u""])) ...
from networktables2 import StringArray from .networktable import NetworkTable class ChooserControl(object): ''' Interacts with a :class:`wpilib.sendablechooser.SendableChooser` object over NetworkTables. ''' def __init__(self, key, on_choices=None, on_selected=None): ''' ...
""" Test for LMS instructor background task queue management """ from mock import patch, Mock, MagicMock from nose.plugins.attrib import attr from bulk_email.models import CourseEmail, SEND_TO_MYSELF, SEND_TO_STAFF, SEND_TO_LEARNERS from courseware.tests.factories import UserFactory from xmodule.modulestore.exceptions ...
import time import utils from XBMC_media_backend import XBMCMediaBackend class PlexMediaBackend(XBMCMediaBackend): class InvalidApiResponseFormatException(Exception): pass _NOTHING_PLAYING = '[Nothing Playing]' def _http_api_request(self, command): response = super(PlexMedia...
# -*- coding: utf-8 -*- from __future__ import print_function from sys import argv from codecs import open as codecs_open from decimal import Decimal from datetime import datetime from re import compile as re_compile import itertools TRANSACTION_TYPES = { u'PRZELEW UZNANIOWY': re_compile( r'(?P<type>PRZE...
from twisted.internet import reactor from uo.skills import SKILL_FLETCHING from uo.entity import * from gemuo.error import * from gemuo.engine import Engine from gemuo.engine.util import Fail from gemuo.engine.items import UseAndTarget from gemuo.engine.menu import MenuResponse class Fletching(Engine): def __init_...