content
string
from msrest.serialization import Model class TunnelConnectionHealth(Model): """VirtualNetworkGatewayConnection properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar tunnel: Tunnel name. :vartype tunnel: str :ivar connection_status: Virtual ...
import os from jetee.base.config_factory import AnsiblePostTaskConfigFactory from jetee.runtime.configuration import project_configuration __all__ = [u'DjangoSyncdbAnsiblePostTaskConfigFactory', u'DjangoCollectstaticAnsiblePostTaskConfigFactory', u'DjangoMigrateAnsiblePostTaskConfigFactory'] class Django...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import json import os from ansible.module_utils.basic import AnsibleModule from ansible.modul...
"""Test BinaryPackageName.""" __metaclass__ = type from datetime import datetime import pytz from zope.component import getUtility from lp.app.errors import NotFoundError from lp.soyuz.enums import PackagePublishingStatus from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet from lp.soyuz.model.bi...
import fcntl import glob import httplib import os import pwd import shlex import socket import struct import tempfile import threading import eventlet from eventlet.green import subprocess from eventlet import greenthread from oslo_config import cfg from oslo_log import log as logging from oslo_log import loggers from...
from zope.interface import Interface, Attribute from feat.interface import protocols __all__ = ["ICollectorFactory", "IAgencyCollector", "IAgentCollector"] class ICollectorFactory(protocols.IInterest): '''This class constructs a notification collector instance implementing L{IAgentCollector}. Used when regi...
import inspect import logging import traceback import gettext import uuid import re from datetime import datetime, timedelta from gosa.common import Environment from pkg_resources import resource_filename from gosa.common.utils import N_ from gosa.common.components import Command, PluginRegistry from gosa.common.compo...
from .sub_resource import SubResource class FrontendIPConfiguration(SubResource): """Frontend IP address of the load balancer. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar inbound_nat_rules: Read only. Inb...
from __future__ import absolute_import import abc import logging import six from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.utils.decorators import method_decorator from django.utils.translation import ugettext as _ from django.views.generic import TemplateVi...
"""Tests for _dual_basis_trotter_error.py.""" import unittest from openfermion.hamiltonians import ( jellium_model, hypercube_grid_with_given_wigner_seitz_radius_and_filling, wigner_seitz_length_scale) from openfermion.utils._low_depth_trotter_error import * from openfermion.utils import Grid class ErrorOper...
import dbus import constants as cs from servicetest import EventPattern from file_transfer_helper import SendFileTest, exec_file_transfer_test from twisted.words.xish import domish import ns class SendFileSendBeforeAccept(SendFileTest): def client_accept_file_empty(self): return False client_accept_...
from __future__ import absolute_import, division, unicode_literals from weakref import ref from mo_future import allocate_lock as _allocate_lock, text from mo_logs import Log DEBUG = False class Signal(object): """ SINGLE-USE THREAD SAFE SIGNAL (aka EVENT) go() - ACTIVATE SIGNAL (DOES NOTHING IF SIGNA...
""" Tests for Consoleauth Code. """ from nova.consoleauth import manager from nova import context from nova.openstack.common import log as logging from nova.openstack.common import timeutils from nova import test LOG = logging.getLogger(__name__) class ConsoleauthTestCase(test.TestCase): """Test Case for conso...
import itertools import random from odoo import models, _ class MailBot(models.AbstractModel): _name = 'mail.bot' _description = 'Mail Bot' def _apply_logic(self, record, values, command=None): """ Apply bot logic to generate an answer (or not) for the user The logic will only be applied...
""" This test file tests the lib.tokens.papertoken This depends on lib.tokenclass """ from .base import MyTestCase from privacyidea.lib.tokens.tantoken import TanTokenClass from privacyidea.lib.token import init_token, get_tokens_paginate, import_token from privacyidea.models import Token OTPKEY = "313233343536373839...
# -*- coding: utf-8 -*- import steam.client import steam.client.builtins.friends from steam.core.msg import MsgProto, Msg, ClientChatMsg, ClientJoinChat from steam.enums import EResult, EPersonaState, EFriendRelationship from steam.enums import EChatEntryType from steam.enums.emsg import EMsg import logging import os...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import main, TestCase from stringlike import StringLike from stringlike.utils import text_type class StringMock(StringLike): """ A simple mock of built-in strings using the StringLike class. """ def _...
from sleekxmpp.test import * from sleekxmpp.plugins.xep_0059 import Set class TestSetStanzas(SleekTest): def testSetFirstIndex(self): s = Set() s['first'] = 'id' s.set_first_index('10') self.check(s, """ <set xmlns="http://jabber.org/protocol/rsm"> <first ind...
import os import pathlib import shutil import subprocess import sys import nox # type: ignore CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="ut...
# -*- encoding: utf-8 -*- """Test class for Trend UI :Requirement: Trend :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UI :TestType: Functional :CaseImportance: High :Upstream: No """ from fauxfactory import gen_string from robottelo.constants import TREND_TYPES from robottelo.decorators imp...
import re import abc from tornado.web import RequestHandler from breeze.filter import FilterOptions class _ResourceMeta(abc.ABCMeta): def __init__(cls, name, bases, nmspc): super().__init__(name, bases, nmspc) if bases == (RequestHandler, ): return options = getattr(cls, 'Me...
import os import MySQLdb import oauth2 as oauth import time import json import config as cfg print os.getcwd() db = MySQLdb.connect(host=cfg.mysql['host'], # your host, usually localhost user=cfg.mysql['user'], # your username passwd=cfg.mysql['passwd'], # your password db=cfg.m...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.apps import apps from django.db.models import Q from django.shortcuts import get_object_or_404 from django.http import FileResponse from rest_framework import mixins from rest_framework import viewsets # from rest_framework.d...
import json import time import unittest from datetime import datetime from requests import Session from withings import ( WithingsActivity, WithingsApi, WithingsCredentials, WithingsMeasureGroup, WithingsMeasures, WithingsSleep, WithingsSleepSeries ) try: import configparser except Imp...
""" Decorators and Middleware for proper HTTP Caching """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django.core.urlresolvers import get_callable from django.utils.cache import patch_cache_control, add_never_cache_headers d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging try: import simplejson as json except ImportError: import json from urllib import urlencode from jsonschema import _flatten # other jsonchema version #from jsonschema import _utils from salesking import resources, api from salesking.exceptions im...
#! /usr/bin/env python ''' Tool for sorting imports alphabetically, and automatically separated into sections. Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the S...
from django.core.management.base import BaseCommand from accounts.models import Invoice from django.template import loader from django.contrib.sites.models import Site from django.template.context import Context from django.conf import settings from django.core.mail import send_mass_mail from forum.models import Messag...
import os,re from Database import connections as dbconnect from Modules import misc from Stalk import stalk_deep as deep def spMenu(): misc.cls() def options(): print (""" ###### TYPES OF PREY ######## # # # MD5 Hash # # Domain Name # # IP...
from msrest.serialization import Model from msrest.exceptions import HttpOperationError class ErrorResponse(Model): """The object that defines the structure of an Azure Data Factory response. :param code: Error code. :type code: str :param message: Error message. :type message: str :param tar...
#!/usr/bin/python import problems import solver import observer print 'Hello, OptSkills!' NUM_TESTS = 11 NUM_TASKS = 6 MEAN_TYPE = 'linear' PROBLEM_CODE = None def save(prob, model, filename): import json with open(filename, 'w+') as fp: data = {} data['prob'] = repr(prob) data['mea...
"""Tools for deserializing `Function`s.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import re from tensorflow.core.framework import function_pb2 from tensorflow.python.eager import def_function from tensorflow.python.eager import ...
""" Decision Tree Classification of photometry ------------------------------------------ Figure 9.13 Decision tree applied to the RR Lyrae data (see caption of figure 9.3 for details). This example uses tree depths of 7 and 12. With all four colors,this decision tree achieves a completeness of 0.569 and a contaminati...
import json import os import re import time import datetime import logging from os import path from pathlib import Path from urllib import request from pathlib import Path from urllib import request from urllib.error import URLError, HTTPError from urllib.parse import urlparse ## #pip3 install ## from bs4 import Beaut...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import decimal import six from collections import Hashable from copy import deepcopy from flask import current_app, request from werkzeug.datastructures import MultiDict, FileStorage from werkzeug import exceptions from .errors import abort, SpecsError...
from __future__ import absolute_import from numpy.testing import ( assert_, assert_raises, ) import MDAnalysis as mda from MDAnalysisTests.topology.base import ParserBase from MDAnalysisTests.datafiles import ( GRO, two_water_gro_widebox, GRO_empty_atom, GRO_missing_atomname, GRO_residwrap...
""" hdnet.spikes ~~~~~~~~~~~~ Spikes class handling multi-neuron , multi-trial spike trains. """ from __future__ import print_function import numpy as np from hdnet.util import hdlog, Restoreable from hdnet.visualization import save_matrix_whole_canvas class Spikes(Restoreable, object): """ C...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, cint, getdate, now, date_diff from erpnext.stock.utils import add_additional_uom_columns from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition from erpnext.stock.report.stock_ageing.st...
from paddle.trainer_config_helpers import * settings( learning_rate=1e-4, batch_size=1000 ) seq = data_layer(name='seq_input', size=100) sub_seq = data_layer(name='sub_seq_input', size=100) lbl = data_layer(name='label', size=1) def generate_rnn_simple(name): def rnn_simple(s): m = memory(name=n...
#!/usr/bin/env python from utils import read_input from constants import EURISTIC_FACTOR from collections import Counter import sys def choose_nodes(nodes, neighbours_iterable): neighbours_count = len(neighbours_iterable) unpacked_list = [] for t in neighbours_iterable: unpacked_list += t[1:] ...
from __future__ import absolute_import, division, print_function, unicode_literals from . import graphics, sound, store, level, script, dscript, schedule GRAPHICS_LANDSCAPE = 131 GRAPHICS_PORTRAIT = 135 GRAPHICS_TILESHEET = 141 _OBJECT_SI_HINTS = { 127: level.Map, 128: level.PropList, 131: graphics.Landscape,...
import os import unittest from telemetry.testing import system_stub from telemetry.internal.testing import system_stub_test_module class CloudStorageTest(unittest.TestCase): SUCCESS_FILE_HASH = 'success'.zfill(40) PUBLIC_FILE_HASH = 'public'.zfill(40) PARTNER_FILE_HASH = 'partner'.zfill(40) INTERNAL_FILE_HASH...
#TODO find a better submodule name from django.forms import widgets, fields from django.db import models def pretty_name(name): """Converts 'first_name' to 'First name'""" if not name: return u'' return name.replace('_', ' ').capitalize() class DjangoModelToJSONSchema(object): def convert_mod...
"""This module contains the Score Model.""" from google.appengine.ext import db import soc.modules.gsoc.models.profile class GSoCScore(db.Model): """Model of a Score. Parent: soc.modules.gsoc.models.proposal.Proposal """ #: the value associated with the score value = db.IntegerProperty(required=Tru...
""" WebDAV ACL resources. """ __all__ = ["DAVPrincipalResource"] from zope.interface import implements from twisted.internet.defer import maybeDeferred from higgins.http.dav import davxml from higgins.http.dav.davxml import dav_namespace from higgins.http.dav.idav import IDAVPrincipalResource from higgins.http.dav.re...
#! /usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicabl...
import json import os import subprocess import sys import threading import time import zmq from application import run_application here = os.path.abspath(os.path.dirname(__file__)) class SocketTimeoutException(Exception): """Raised on socket timeout.""" class SocketAgent(object): _address = None process...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
# -*- coding: utf-8 -*- """ Copyright (C) 2010 Vincent Ollivier <<EMAIL>> This file is part of OpenNMS Configuration Tools. OpenNMS Configuration Tools 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 vers...
#!/usr/bin/env python import os import sys from ctypes import c_char_p try: from procszoo.c_functions import * except ImportError: this_file_absdir = os.path.dirname(os.path.abspath(__file__)) procszoo_mod_dir = os.path.abspath("%s/.." % this_file_absdir) sys.path.append(procszoo_mod_dir) from proc...
import os import inspect import sys import unittest import logging #sys.path = [os.path.dirname(inspect.getfile(inspect.currentframe()))] + sys.path from NullData import NullData from NullDataCluster import NullDataCluster logger = logging.getLogger(__name__) logger_handler = logging.StreamHandler(sys.stdout) def se...
import json from django.core.urlresolvers import reverse from django.db.models import Count from django.http import HttpResponseBadRequest from django.test.client import Client, RequestFactory from funfactory.helpers import urlparams from mock import patch from nose.tools import eq_, ok_ from mozillians.common.tests...
from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.variable import getExt, getTitle from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin import os log = CPLog(__name__) class Trailer(Plugin): def __init__(self): addEvent('renamer.af...
import time import argparse import torch import numpy as np import torch.nn.functional as F from torch.utils.data import DataLoader from torch.nn import ModuleList, Linear, BatchNorm1d, Identity from ogb.lsc import MAG240MDataset, MAG240MEvaluator from root import ROOT class MLP(torch.nn.Module): def __init__(s...
from django.utils import simplejson import urllib import StringIO from models import DiggLinkRecent, Link, Topic from django.contrib.auth.models import User import datetime import os import pickle from libs import redditstories from BeautifulSoup import BeautifulSoup digg_user_id = 1 digg_topic_id = 1 d...
from __future__ import unicode_literals import frappe import json from frappe import _ from frappe.frappeclient import FrappeClient from frappe.desk.form.load import get_attachments from six import string_types current_user = frappe.session.user @frappe.whitelist() def register_marketplace(company, company_descrip...
""" Test removing groups from users in the fake profile server. """ from __future__ import absolute_import # pylint:disable=no-name-in-module from nose.tools import assert_not_in from . import FakeProfileServerTestCase class RemoveGroupsTestCase(FakeProfileServerTestCase): """ Test removing groups from use...
# -*- coding: utf-8 -*- import math from bpy.types import PropertyGroup from bpy.props import FloatProperty, BoolProperty import mmd_tools.core.camera as mmd_camera def _getMMDCameraAngle(prop): empty = prop.id_data cam = mmd_camera.MMDCamera(empty).camera() return math.atan(cam.data.sensor_height/cam....
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'Joao Moreira' SITENAME = 'Joao Moreira' SITESUBTITLE = 'Data Scientist' SITEURL = '' BIO = 'Data scientist. Iron Man fan.' PROFILE_IMAGE = 'avatar.jpg' PATH = 'content' STATIC_PATHS = ['images', 'pdfs', 'extra'] EXTRA_PA...
import dnnet.utils.numcupy as ncp from dnnet.ext_mathlibs import cp, np from dnnet.layers.layer import Layer from dnnet.utils.nn_utils import is_multi_channels_image from dnnet.utils.nn_utils import asnumpy, prod, flatten, unflatten class DropoutLayer(Layer): """Implement Dropout. Derived class of Layer. ...
from os import path from gettext import dgettext from time import localtime, time from enigma import eDVBVolumecontrol, eTimer, eDVBLocalTimeHandler, eServiceReference, eStreamServer from boxbranding import getMachineBrand, getMachineName, getBoxType, getBrandOEM, getMachineBuild from GlobalActions import globalActionM...
#!/usr/bin/python import sys, os, re import unittest as ut import zbar # FIXME this needs to be conditional # would be even better to auto-select PIL or ImageMagick (or...) import Image data = None size = (0, 0) def load_image(): image = Image.open(os.path.join(sys.path[0], "barcode.png")).convert('L') retur...
""" The following line computes metrics for files in "Media supported by Wikimedia France" and for the FDC report of year 2012-2013 round 2 quarter 3 python commons_cat_metrics_fdc.py --year 2012-2013 --round 2 --quarter 3 --category "Media supported by Wikimedia France" Please use python commons_cat_metrics_fdc.py -...
# i_scan.py import sys, os here = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(here, '../src'))) from phasematching import * import matplotlib import numpy as np from matplotlib import pyplot as plt from matplotlib.ticker import MaxNLocator, LinearLocator num = 100 is...
{ 'name': 'Stock Picking State', 'version': '13.0.1.0.0', 'category': 'Warehouse Management', 'sequence': 14, 'summary': '', 'author': 'ADHOC SA', 'website': 'www.adhoc.com.ar', 'license': 'AGPL-3', 'images': [ ], 'depends': [ 'stock', ], 'data': [ 'se...
import json from admin.nodes.serializers import serialize_node def serialize_preprint(preprint): return { 'id': preprint._id, 'date_created': preprint.created, 'modified': preprint.modified, 'provider': preprint.provider, 'node': serialize_node(preprint.node), 'is...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.dna.DNAGroup import DNAUtil class DNAGroup: COMPONENT_CODE = 1 def __init__(self, name): self.name = name self.children = [] self.parent = None self.visGroup = None self.loadVis = True ...
""" Text corpora usually reside on disk, as text files in one format or another In a common scenario, we need to build a dictionary (a `word->integer id` mapping), which is then used to construct sparse bag-of-word vectors (= sequences of `(word_id, word_weight)` 2-tuples). This module provides some code scaffolding t...
import m5 from m5.objects import * from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys # Get paths we might need config_path = os.path.dirname(os.path.abspath(__file__)) config_root = os.path.dirname(config_path) m5_root = os.path.dirname(config_root) addToPath(config_root+'/configs/...
"""webbasket database models.""" from invenio.ext.sqlalchemy import db from invenio.modules.accounts.models import User, Usergroup from invenio.modules.collections.models import Collection class BskBASKET(db.Model): """Represents a BskBASKET record.""" __tablename__ = 'bskBASKET' id = db.Column(db.Inte...
import sqlite3 import pandas as pd import numpy as np import csv import gzip from collections import defaultdict if __name__ == '__main__': conn = sqlite3.connect('data/instacart.db') c = conn.cursor() # Get the orders properly sorted, so we can directly # group by user_id, order_id and then compute t...
"""brede.eeg.examples.csp - Example on common spatial patterns. Usage: brede.eeg.examples.csp [options] Options: -h --help Help """ from __future__ import absolute_import, division, print_function import matplotlib.pyplot as plt import numpy as np import numpy.random as npr from ..csp import CSP def csp_w...
from __future__ import print_function import time, sys, signal, atexit import pyupm_grovemoisture as upmMoisture # Instantiate a Grove Moisture sensor on analog pin A1 myMoisture = upmMoisture.GroveMoisture(1) ## Exit handlers ## # This function stops python from printing a stacktrace when you hit control-C def SIGI...
import pytest import os import re def test_ssh_motd_disabled(File): """ Ensure the SSH MOTD (Message of the Day) is disabled. Grsecurity balks at Ubuntu's default MOTD. """ f = File("/etc/pam.d/sshd") assert f.is_file assert not f.contains("pam\.motd") @pytest.mark.skipif(os.environ.get(...
from common import Statement class RobotTable(object): '''A table made up of zero or more rows''' def __init__(self, parent, linenumber=0, name=None): self.linenumber = linenumber self.name = name self.rows = [] self.comments = [] self.parent = parent def dump(sel...
import logging import urllib2 import codecs from HTMLParser import HTMLParser """Util functions to scrape quotes from Goodreads""" def _IsQuoteText(attrs): for pair in attrs: key, val = pair if key == 'class': if val == 'quoteText': return True return False class QuoteParser(HTMLParser):...
from msrest.serialization import Model class ActivityRun(Model): """Information about an activity run in a pipeline. Variables are only populated by the server, and will be ignored when sending a request. :param additional_properties: Unmatched properties from the message are deserialized this ...
import os from .settings import * # noqa F403 DEBUG = False DEBUG_TEMPLATE = False SECRET_KEY = os.environ['SECRET_KEY'] ALLOWED_HOSTS = [".gnmerritt.net", "*vendetta", "*scarab"] INSTALLED_APPS += [ # noqa F405 'gunicorn', ] static_dir = os.environ.get('STATIC_ROOT', None) if static_dir is not None: STAT...
""" This file describes the vistrail variables box into which the user can drop constants from the module palette """ from PyQt4 import QtCore, QtGui from gui.variable_dropbox import QVariableDropBox from gui.common_widgets import QToolWindowInterface from gui.vistrails_palette import QVistrailsPaletteInterface #####...
""" Class for interacting with our physical memory sensor (FPGA) (c) 2015 Massachusetts Institute of Technology """ # Native import socket import time import logging logger = logging.getLogger(__name__) import multiprocessing # LO-PHI import lophi.globals as G from lophi.sensors.memory import MemorySensor fr...
#! /usr/bin/env python import rospy, math import sys, termios, tty, select, os from geometry_msgs.msg import Twist from std_msgs.msg import UInt16 import sys from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 import signal from GestureModel import* from Creator import* from Classifier import* from nu...
# coding=utf-8 # Dungeon -> Stats import random def build_table(hp=0, pw=0, df=0, sp=0): """Return a dictionary where HP, PW, DF, and SP are mapped to ints. Keyword arguments can be used to change the values (default to 0). This is the standard format for stat tables used throughout the program. """ ...
#!/usr/bin/env python # Read and publish office air quality values # This program is derived from the Multi-threaded TCP server program at # https://github.com/edaniszewski/MultithreadedTCP # # Xiaoke Yang (<EMAIL>) # IFFPC, Beihang University # Last Modified: Tue 20 Dec 2016 16:49:54 CST """ Multi-threaded TCP Serve...
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ('rdrf', '0002_consentsection_information_text'), ] operations = [ migrations.CreateModel( name='Emai...
# -*- coding: utf-8 -*- """ Created on Fri Oct 2 13:47:48 2015 @author: GILLES Armand """ import pandas as pd import glob df = pd.read_csv('source/TrancheAge2009.csv', sep=";") df.columns = ['Communes', 'Codes_Insee', 'NB_Allocataires_2009', 'ALL0A19_2009', 'ALL20A24_2009', 'ALL25A29_2009', 'ALL30A3...
# -*- coding: UTF-8 -*- __author__ = 'Jeffrey' import re import time import traceback import requests from bs4 import BeautifulSoup class DuZheBaoJokeSpider(object): _host = "http://www.duzhebao.com/xiaohua/" _type = "" _compile = "/xiaohua/" _joke_type_dict = {} def __init__(self, jokeType): ...
import numpy as np import cPickle import gzip from errors import * def decompose_sequences(gfs, date_time, pm25_mean, pm25, pred_range): X = [] y = [] for i in range(pred_range[0], pred_range[1]): recent_gfs = gfs[:,i-2:i+1,:].reshape((gfs.shape[0], -1)) current_date_time = date_time[:,i,:]...
from django.conf import settings from django.utils.functional import wraps from mock import patch ### From Mozillians class mock_browserid(object): def __init__(self, email=None): self.settings_patches = ( patch.object( settings, 'AUTHENTICATION_BACKENDS', ('d...
from __future__ import with_statement import sys from copy import copy import re from django.core.cache import cache from django.conf import settings from django.contrib.auth.models import Permission from django.core.urlresolvers import clear_url_caches from django.http import Http404 from django.template import Varia...
"""Unit tests for reviewboard.accounts.forms.pages.ChangePasswordForm.""" from __future__ import unicode_literals from django.contrib import messages from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.test.client import RequestFactory from kgb import SpyAgency ...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, Caleb Bell <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software wit...
""" ============================================================ Common ============================================================ Common definitions """ import os import argparse from pprint import pprint from functools import total_ordering # Some constants API_URL = 'https://commons.wikimedia.org/w/api.php' ...
import time import os from settings import APP_STATIC class USN(object): """docstring for USN""" def __init__(self, usn): #make each part of USN an attribute to check against for validation self.usn = usn.lower() self.region = '' self.college = '' self.batch = '' ...
import io import os import subprocess import unittest from unittest import mock import pytest from airflow.exceptions import AirflowException from airflow.providers.apache.pinot.hooks.pinot import PinotAdminHook, PinotDbApiHook class TestPinotAdminHook(unittest.TestCase): def setUp(self): super().setUp(...
#!/usr/bin/env python import os from setuptools import setup, find_packages import sys CURRENT_PATH=os.getcwd()+'/polymer' sys.path.insert(1,CURRENT_PATH) def read(fname): # Dynamically generate setup(long_description) return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='polymer', ...
""" runs a headless tribler exit node instance with multichain enabled This is mostly a copy from the tunnel community in the tribler github, modified to run with multichain enabled start by running "python ExitNode.py -x True" """ import os import sys import json import time import random import argparse import threa...
__version__=''' $Id: rl_config.py 3585 2009-11-17 14:42:32Z rgbecker $ ''' __doc__='''Configuration file. You may edit this if you wish.''' allowTableBoundsErrors = 1 # set to 0 to die on too large elements in tables in debug (recommend 1 for production use) shapeChecking = 1 defaultEncoding = ...
"""Handler that creates a new map.""" __author__ = '<EMAIL> (Ka-Ping Yee)' import base_handler import logs import model import users class Create(base_handler.BaseHandler): """Handler that creates a new map.""" def Post(self, domain, user): # pylint: disable=unused-argument """Creates a new map.""" ma...
import sqlalchemy as sa from sqlalchemy import orm from neutron.db import l3_db from neutron.db import model_base from neutron.db import models_v2 from neutron.plugins.vmware.common import nsxv_constants class NsxvRouterBinding(model_base.BASEV2, models_v2.HasStatusDescription): """Represents the mapping between...
# Created by Thomas Jones on 01/01/2016 - <EMAIL> # votestats.py - a minqlx plugin to show who votes yes or no in-game/vote results. # This plugin is released to everyone, for any purpose. It comes with no warranty, no guarantee it works, it's released AS IS. # You can modify everything, except for lines 1-4 and the !t...