content stringlengths 4 20k |
|---|
"""
Single Bubble Model: File input/output
=======================================
Use the ``TAMOC`` `single_bubble_model` to analyze results of previous
simulations. This script reads in data stored on the hard drive in netCDF
format and creates `single_bubble_model.Model` objects to store the saved
data. It then... |
import pymysql.cursors
class Mysql(object):
def __init__(self):
self.conn = pymysql.connect(host='localhost',
user='dashuju',
password='8FTeR5dA!',
db='crawler',
... |
import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="streamtube", **kwargs):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... |
import fixtures
import mock
import nova.conf
from nova import exception
from nova.tests import fixtures as nova_fixtures
from nova.tests.fixtures import libvirt as fakelibvirt
from nova.tests.functional.notification_sample_tests \
import notification_sample_base
from nova.virt.libvirt import host
CONF = nova.con... |
from xml.dom.minidom import Document, parseString
from libvirt import libvirtError
conf_minimal = { 'testbed': 'test_testbed',
'storagevolumes': [],
'networks': [],
'domains': [] }
class MockConfigurationLoader:
def __init__(self, content):
self.content... |
"""Filter for log handlers to exclude verbose error messages."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# phlsys_verboseerrorfilter
#
# Public Classes:
# VerboseErrorFilter
# .filter
... |
from kataja.settings.ForestSettings import ForestSettings
from kataja.singletons import prefs
class DocumentSettings(ForestSettings):
def __init__(self, document):
super().__init__(document)
self.next = prefs |
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.expr.rules as rlz
from ibis.expr.operations import All, Any
from ibis.expr.signature import Argument as Arg
class StringContains(ops.ValueOp):
arg = Arg(rlz.string)
substr = Arg(rlz.string)
start = Arg(rlz.integer, default=Non... |
from __future__ import unicode_literals
__author__ = 'lexxodus'
from datetime import datetime
from dateutil import parser
import requests
ROOT_URL = "http://localhost:5000/api/"
events = None
tasks = None
levels = None
level_types = None
current_liid = None
def create_player(name, clan):
url = ROOT_URL + "player... |
from __future__ import print_function
from __future__ import absolute_import
# from proc.nlp_functions import AZ_ZONES_LIST, CORESC_LIST
from evaluation.experiment import Experiment
from db.ez_connect import ez_connect
from kw_evaluation_runs.thesis_settings import CONTEXT_EXTRACTION_C6
import re
# BOW files to prebu... |
# Create your views here.
from django.shortcuts import get_object_or_404, render
from dnd.menu import menu_item, submenu_item, MenuItem
from dnd.dnd_paginator import DndPaginator
from dnd.filters import MonsterFilter
from dnd.models import Rulebook, Monster
from dnd.views import is_3e_edition, permanent_redirect_view, ... |
import json
import math
import os
import shutil
import tempfile
import zipfile
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.test.utils import override_settings
from unittest import mock
import pytest
from PIL import Image, ImageChops
from olympia impor... |
"""
This is an example settings/local.py file.
These settings overrides what's in settings/base.py
"""
from . import base
# To extend any settings from settings/base.py here's an example.
# If you don't need to extend any settings from base.py, you do not need
# to import base above
INSTALLED_APPS = base.INSTALLED_A... |
# -*- coding: utf-8 -*-
import re
class StcStyle (object):
"""
Набор свойств стиля для класса StyledTextCtrl
"""
def __init__(self, fore=u"#000000",
back=u"#FFFFFF",
bold=False,
italic=False,
underline=False):
... |
import os
import sys
import tempfile
from pysmi.writer.base import AbstractWriter
from pysmi.compat import encode, decode
from pysmi import debug
from pysmi import error
class FileWriter(AbstractWriter):
"""Stores transformed MIB modules in files at specified location.
User is expected to pass *FileReader... |
"""
The monkey automaton
This state does not need to add as much new stuff since it was all added
in the first state; rather we just need to add the new things happening
in this state.
Once the monkey has gotten its name, this moves to the next state since it will
change the room.
"""
from evennia.utils import inte... |
"""
This module is responsible for configuration haproxy.
"""
import os
import subprocess
from paradrop.base import settings
from paradrop.core.chute.chute_storage import ChuteStorage
from paradrop.core.container.chutecontainer import ChuteContainer
def generateConfigSections():
sections = []
sections.appen... |
#
# Swagger 2.0 response acceptance tests
#
# Based on request_test.py (Swagger 1.2 tests). Differences made it hard for
# a single codebase to exercise both Swagger 1.2 and 2.0 responses.
#
from _pytest.python import FixtureRequest
from mock import patch, Mock
from pyramid.interfaces import IRoutesMapper
from pyramid.... |
from datetime import datetime
from datetime import timedelta
import pysensu_yelp
import pytz
from mock import Mock
from mock import patch
from pytest import fixture
from pytest import raises
from paasta_tools import check_chronos_jobs
from paasta_tools import chronos_rerun
from paasta_tools import chronos_tools
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ZIBMolPy.pool import Pool
from ZIBMolPy.utils import fn2dep, dep2fn
from ZIBMolPy.ui import OptionsList
from os import path
import sys
import os
options_desc = OptionsList()
def is_applicable():
return(True)
#======================================================... |
import pykazoo.resources
import pykazoo.restrequest
from unittest import TestCase
from unittest.mock import create_autospec
mock_rest_request = create_autospec(pykazoo.restrequest.RestRequest)
class TestDevices(TestCase):
def setUp(self):
self.mock_rest_request = mock_rest_request
self.resources... |
from js9 import j
import npyscreen
import curses
# TO TEST IN DOCKER
# ZSSH "js9 'j.tools.develop.config()'"
JSBASE = j.application.jsbase_get_class()
class ConfigUI(npyscreen.NPSAppManaged, JSBASE):
def __init__(self):
JSBASE.__init__(self)
def onStart(self):
# self.addForm("MAIN", MainFor... |
import os, urllib2, re, sys, getopt, time
outToShowList = []
def checkDir(desiredDir):
"""Check for a necessary directory in the script root. If not found, create it recursively."""
if os.path.exists(desiredDir) != True:
os.makedirs(desiredDir)
def getFilePath(fileName):
"""Acquire the absolute p... |
from constants import *
from core_snapshot import CoreSnapshot
import os
import logging
logger = logging.getLogger(APP_NAME)
class LocalSnapshot(CoreSnapshot):
def _get_path(self):
dir_name = str(self.id)
if self.state != COMPLETE:
dir_name = '%s.%s' % (dir_name, self.state)
re... |
"""Template config validator."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.config import async_log_exception, config_without_domain
from homeassistant.... |
import sys
from paravistest import datadir, pictureext, get_picture_dir
from presentations import CreatePrsForFile, PrsTypeEnum
import pvserver as paravis
# Create presentations
myParavis = paravis.myParavis
# Directory for saving snapshots
picturedir = get_picture_dir("CutPlanes/E9")
file = datadir + "test_hydro.... |
#!/usr/bin/env python
"""Occlusion ranking task."""
import datetime
import json
import os
from flask import jsonify, request
from flask.ext.restful import reqparse
import database
from sqlalchemy import func, desc, or_
from server_common import mturk_template, database_session, \
create_app, mturk_save
APP =... |
"""
"""
import glob
import os
import scipy.misc
import tensorflow as tf
tf.app.flags.DEFINE_string('source-dir-path', '', '')
tf.app.flags.DEFINE_string('target-dir-path', '', '')
tf.app.flags.DEFINE_integer('image-scale', 128, '')
FLAGS = tf.app.flags.FLAGS
def sanity_check():
"""
"""
if not os.path.... |
from setuptools import setup, find_packages
import os
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = (
read('README.md')
+ '\n' +
'Change history\n'
'**************\n'
+ '\n' +
read('CHANGES.txt')
+ '\n' +
'Contributors\... |
"""Script to get, put and delete secrets stored in credstash."""
import argparse
import getpass
from homeassistant.util.yaml import _SECRET_NAMESPACE
REQUIREMENTS = ['credstash==1.14.0', 'botocore==1.7.34']
def run(args):
"""Handle credstash script."""
parser = argparse.ArgumentParser(
description=(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bempy2d import ematrixwing
from math import sqrt
from numpy.linalg import inv, eigvals
from pylab import plot, show, grid, figure, xlabel, ylabel
from numpy import zeros, reshape, dot, linspace, array, pi, real, imag
def main():
# DATI
a = 3
Omega = 0.8
... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... |
import itertools
from collections import namedtuple
class NotHandledError(Exception):
pass
class ReviewDerivedVariables(object):
"""A base class to review logic used to derive values based on a list of raw values."""
fields = [] # list of field_names to review
models = [] # list of model classe... |
import unittest
from cs.CsApp import CsApp
from cs.CsAddress import CsIP
from cs.CsConfig import CsConfig
import merge
class TestCsApp(unittest.TestCase):
def setUp(self):
merge.DataBag.DPATH = "."
def test_init(self):
csconfig = CsConfig()
csconfig.cmdline()
csip = CsIP("eth... |
"""
Plinth module to configure Single Sign On services.
"""
from plinth import actions
from django.utils.translation import ugettext_lazy as _
version = 1
is_essential = True
depends = ['security', 'apache']
name = _('Single Sign On')
managed_packages = [
'libapache2-mod-auth-pubtkt', 'openssl', 'python3-open... |
from argparse import ArgumentParser
import os
import subprocess
import sys
import time
from HPOlib.Plotting import plot_util
from HPOlib.wrapping_util import format_traceback
__authors__ = ["Katharina Eggensperger", "Matthias Feurer"]
__contact__ = "automl.org"
def _plot_trace(pkl_list, name_list, save="", cut=sys... |
### Author: Dag Wieers <dag$wieers,com>
class dstat_plugin(dstat):
"""
Provide memory information related to the dstat process.
The various values provide information about the memory usage of the
dstat process. This plugin gives you the possibility to follow memory
usage changes of dstat over tim... |
"""
Django settings for coding_experiments project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_D... |
"""Tests Policies."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.eager import context
from tensorflow.python.framework import config as config_module
from tensorflow.python.framework import... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Unit'
db.create_table(u'units_unit', (
(u'id'... |
import etcd
from flask import json
class BaseManager:
"""Base repository class for objects."""
KEY = 'cobalt'
"""Directory name in ETCD."""
def __init__(self, client):
"""Create an instance of the repository with the specified source.
Args:
client (etcd.Client): The dat... |
#!/usr/bin/env python
"""
Script to fetch pubmed ids from mim number by using OMIM API
Prerequisite:
Requests: HTTP for Humans
URL: http://docs.python-requests.org/en/latest/
Installation: sudo easy_install requests
Notice:
To run the script under /micklem/data/metabolic/omim/script
"""
import os, json, reque... |
from copy import deepcopy
from typing import Any, Dict
from keras import backend as K
from overrides import overrides
from ..masked_layer import MaskedLayer
from ...common.params import pop_choice
from ...tensors.similarity_functions import similarity_functions
class MatrixAttention(MaskedLayer):
'''
This `... |
"""N-Queens
The n-queens puzzle is the problem of placing n queens on an nxn chessboard such that no
two queens attack each other.

Given an integer n, return the number of distinct solutions to the n-queens puzzle.
Each solution contains a distin... |
"""Data loader and input processing."""
from __future__ import absolute_import
from __future__ import division
# from __future__ import google_type_annotations
from __future__ import print_function
import tensorflow.compat.v2 as tf
from typing import Text, Optional
from official.modeling.hyperparams import params_di... |
import time
import logging
import traceback
from slack_clients import SlackClients
from messenger import Messenger
from event_handler import RtmEventHandler
logger = logging.getLogger(__name__)
def spawn_bot():
return SlackBot()
class SlackBot(object):
def __init__(self, token=None):
"""Creates Sl... |
""" Creates sites and partners """
import fnmatch
import json
import logging
import os
from django.contrib.sites.models import Site
from django.core.management import BaseCommand
from course_discovery.apps.core.models import Partner
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Crea... |
import sys
import glob
from setuptools import setup, find_packages
def readme():
with open('README.rst') as f:
return f.read()
# This part needs to be cleaned up :-)
# Some way we need to get the build path and the name of the .dll/.so
# Here I assume a link in the source/pyfabm to the library
if sys.pl... |
import sale_order |
import requests
import traceback
from api.keystone import get_auth_token
from api.swift import connection, write_package
from swiftclient.exceptions import ClientException
from utils import settings
from logger import getLogger
logger = getLogger(__name__)
def build_global_catalog_url():
"""
Build a URL to ... |
from allauth.account.models import EmailAddress
from allauth.account.views import PasswordChangeView
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.urls import reverse_lazy
from django.shortcuts import redirect, render, get_object... |
from __future__ import print_function
import hashlib
import json
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
SELF_FILE = os.path.normpath(os.path.abspath(__file__))
REPOSITORY_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
def Run(*args):
p... |
import mock
import testtools
from testtools import matchers
from ironicclient import exc
from ironicclient.tests.unit import utils
from ironicclient.v1 import driver
DRIVER1 = {'name': 'fake', 'hosts': ['fake-host1', 'fake-host2']}
DRIVER2 = {'name': 'pxe_ipminative', 'hosts': ['fake-host1', 'fake-host2']}
DRIVER2_... |
from os import listdir, popen, system
from textwrap import dedent
from time import sleep
from Source.communication import Retrieve
from Source.properties import Directory
def Help(): # Dynamic help
print(dedent("""\
Server:
# server start | Start the so... |
from opus_gui.abstract_manager.controllers.xml_configuration.xml_controller import XmlController
class DatabaseConfigXMLController(XmlController):
def __init__(self, manager):
XmlController.__init__(manager)
def process_custom_menu(self, position):
pass
# TODO: Adding / removing data... |
# coding: utf-8
import pytest
from owlmixin import OwlMixin, TOption, TList, RequiredError
class Spot(OwlMixin):
id: int
name: str
note: TOption[str]
rank: TOption[int]
children: TOption[TList['Spot']]
class TestTOption:
def test_normal(self):
r: Spot = Spot.from_dict({'id': 1, 'nam... |
import pygame
from pygame.locals import *
def get_char(key) :
num={224:'0', 38 :'1',233 :'2',34 :'3',39 :'4',40 :'5',45 :'6',232 :'7',95 :'8',231 :'9'}
num_keypad={K_KP0 : "0",K_KP1 : "1",K_KP2 : "2",K_KP3 : "3",K_KP4 : "4",K_KP5 : "5",K_KP6 : "6",K_KP7 : "7",K_KP8 : "8",K_KP9 : "9"}
alpha={K_a :'a',K_b :'b',K_c... |
#import http.client
import httplib
from time import sleep, localtime, strftime
import sys
ARDUINO_NOT_READY = -9999
ip_addr = '192.168.1.182'
port = 80
timeout = 5
retry = 5
def main():
while 1:
temp = getArduinoTemp(ip_addr, port, timeout, retry)
if (temp != None):
print (strftime("[%H:%M:%S]: ", localtime... |
import logging
import traceback
from ..anagonda.context import guru
from commands.base import Command
class Peers(Command):
"""Run guru peers
"""
def __init__(self, callback, uid, vid, scope, path, offset, buf, go_env):
self.vid = vid
self.scope = scope
self.path = path
s... |
import os
import logging
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
MAKE_HEADER ="""#Generated by Edalize
ifndef MODEL_TECH
$(error Environment variable MODEL_TECH was not found. It should be set to <modelsim install path>/bin)
endif
CC ?= gcc
CFLAGS := -c -std=c99 -fPIC -fno-stack-pro... |
'''
Copyright (C) 2016 Quinn D Granfor <<EMAIL>>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT AN... |
import math
import itertools
from . import CycleEnded
def constant(frequency):
def f(t):
return frequency
return f
def oscillating(frequency, vibrato_frequency, modulation):
def f(t):
return frequency(t) + modulation * math.sin(2 * math.pi * vibrato_frequency * t)
return f
def period... |
"""
Definitions of test cases with various interesting error-related behaviors, to
be used by test modules to exercise different features of trial's test runner.
See the L{twisted.trial.test.test_tests} module docstring for details about how
this code is arranged.
"""
from __future__ import division
from twisted.tri... |
"""Trapdoor test using Cppcheck.
This test calls the cppcheck program, see http://cppcheck.sourceforge.net/.
"""
from collections import Counter
from glob import glob
import os
from xml.etree import ElementTree
from trapdoor import TrapdoorProgram, Message, get_source_filenames, run_command
class CPPCheckTrapdoor... |
"""
@author Jose Borreguero, NScD
@date October 06, 2013
"""
import numpy as np
from mantid.api import IFunction1D, FunctionFactory
from StretchedExpFTHelper import surrogate, function1Dcommon
class StretchedExpFT(IFunction1D):
# pylint: disable=super-on-old-class
def __init__(self):
super(self.__c... |
from pylab import *
from matplotlib.collections import LineCollection
# In order to efficiently plot many lines in a single set of axes,
# Matplotlib has the ability to add the lines all at once. Here is a
# simple example showing how it is done.
N = 50
x = arange(N)
# Here are many sets of y to plot vs x
ys = [x+i f... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SocialLinkType'
db.create_table(u'sociallinks_sociallinkt... |
"""
Overview
========
This plugin implements Key-Commands to redirect the default python sys.stdout object
to an AreaVi instance. As it is possible to drop python code to vy in order
to affect the editor state, the python interpreter writes output to
sys.stdout.
With this plugin it is possible to drop the output to ... |
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import flask
import pyquery
import staticconf.testing
from git_code_debt.server.metric_config import CONFIG_NAMESPACE
from testing.assertions.response import assert_no_response_errors
from tests import file_diff_stat_tes... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import unittest
TEST_MODULES = ['types_test', 'factory_test', 'manager_test',
'storage.abstract_test', 'storage.memory_test']
def all():
return unittest.defaultTestLoader.loadTestsFromNames(TEST_MODULES)
d... |
from iptables_xml_parser import IPTablesParserClass
from clavister_xml_parser import ClavisterParserClass, RouteTupleClass
from grapher import GrapherClass
from is_ip_in_subnet import addressInNetwork
import sys, getopt
#parser = "iptables"
#parser = "clavister"
parser = ''
inputfile = ''
outputfile = ''
parsertypes =... |
#!/usr/bin/env python
from ocvc import gr
from ocvc import blocks
import argparse
from volk_test_funcs import *
try:
from ocvc import blocks
except ImportError:
sys.stderr.write("This example requires oc-blocks.\n")
def multiply_const_cc(N):
k = 3.3
op = blocks.multiply_const_cc(k)
tb = helper(N,... |
import fixtures
from oslo_config import cfg
import six
class Config(fixtures.Fixture):
"""Override some configuration values.
The keyword arguments are the names of configuration options to
override and their values.
If a group argument is supplied, the overrides are applied to
the specified con... |
from tmtpl.constants import *
from tmtpl.pattern import *
from tmtpl.document import *
from tmtpl.client import Client
from tmtpl.curves import GetCurveControlPoints, FudgeControlPoints, curveThroughPoints
# Project specific
#from math import sin, cos, radians
from pysvg.filter import *
from pysvg.gradient ... |
import Queue
import threading
import logging
import msgpack
from org.o3project.odenos.remoteobject.transport.base_message_transport import (
BaseMessageTransport
)
from org.o3project.odenos.remoteobject.message.response import Response
import message_dispatcher
class RemoteMessageTransport(BaseMessageTransport):... |
__title__ = "make assorted DIP part 3D models"
__author__ = "maurice, hyOzd, Stefan, Terje"
__Comment__ = 'make make assorted DIP part 3D models exported to STEP and VRML for Kicad StepUP script'
___ver___ = "1.0.0 30/11/2017"
#
# 2017-11-25: mods by Terje: made generic in order to support class based model scripts
#... |
"""
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.deconv import Deconv
input_space = Conv2DSpace(shape=(2, 1), num_channels=16, axes=('c... |
from revscoring.dependencies import DependentSet
from ...feature import Feature
from ...meta import aggregators, bools
from .diff import Diff
class Revision(DependentSet):
def __init__(self, name, revision_datasources):
super().__init__(name)
self.datasources = revision_datasources
sel... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yeison/Documentos/python/developing/pinguino/pinguino-ide/qtgui/frames/wiki_doc_widget.ui'
#
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGu... |
import unittest, time
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from .models import Coder, Problem, Entry
from .forms import SubmitForm
def create_user(username, password):
ret... |
"""test sparse matrix construction functions"""
from numpy.testing import TestCase, assert_equal
from scipy.sparse import csr_matrix
import numpy as np
from scipy.sparse import extract
class TestExtract(TestCase):
def setUp(self):
cases = []
cases.append( csr_matrix( [[1,2]] ) )
cases.a... |
from base64 import b64encode
from Crypto.PublicKey import RSA
from jose import jws
import json
import responses
import unittest
import sys
from openbadges.verifier.actions.graph import patch_node
from openbadges.verifier.actions.tasks import add_task
from openbadges.verifier.exceptions import TaskPrerequisitesError
fr... |
# coding:utf-8
'''
Created on 2018/1/6.
@author: chk01
'''
import tensorflow as tf
import scipy.io as scio
import matplotlib.pyplot as plt
def main():
file = '../data/face_top_9_L.mat'
data = scio.loadmat(file)
print(tf.get_default_graph().get_operations())
tf.reset_default_graph()
print(tf.get_d... |
from tempest.api.compute import base
from tempest import test
class ServerPasswordV3Test(base.BaseV3ComputeTest):
@classmethod
def resource_setup(cls):
super(ServerPasswordV3Test, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_unti... |
import os
import zipfile
import xml.dom.minidom
class XlsxFile(object):
"""
An Excel 2007 xlsx file that can be modified without losing formatting, formulas, and charts.
:param filename: The name of the xlsx file.
"""
def __init__(self, filename=None):
self.files = {}
self.workshee... |
__author__ = 'mpetyx'
import httplib
import urllib
from urlparse import urlparse
from xml.dom import pulldom
import re
import requests
__version__ = "0.1"
__author__ = "Michael Petychakis"
try:
import json
except ImportError:
import simplejson as json
import struct
USER_AGENT = "stardog-client/%s" % __ve... |
# -*- coding: utf-8 -*-
from pyramid.view import view_config
from data.import_data import import_data
from ar.ar_data import do_ar_data
from cf.ucf_data import do_ucf_data
from cf.icf_data import do_icf_data
from nn.ae import do_ae_model
from models.base import DBSession
from models.ar_result import Ar_Result
from mo... |
from . import docker, utils, VERSION
import os
import tarfile
try:
import simplejson as json
except ImportError:
import json
import logging
log = logging.getLogger(__name__)
def index(image):
home_dir = os.environ.get('HOME', '~')
index_dir = os.path.join(home_dir, '.docker-juggle', VERSION, 'index')... |
from __future__ import absolute_import, division, print_function
from operator import getitem
import numpy as np
from .core import Array, elemwise
from .. import core, sharedict
from ..utils import skip_doctest
def __array_wrap__(numpy_ufunc, x, *args, **kwargs):
return x.__array_wrap__(numpy_ufunc(x, *args, *... |
# pylint:disable=invalid-name,missing-docstring,too-few-public-methods,redefined-builtin
from __future__ import print_function
from linthints import adds_arguments, sets_arguments
import sys
def bogus_dec(func):
def inner(*args, **kwargs):
return func(*args, **kwargs)
return inner
@adds_arguments(fil... |
import web
from inginious.frontend.pages.api._api_page import APIError
from inginious.frontend.parsable_text import ParsableText
from inginious.frontend.plugins.statistics.pages.api.user.user_api import UserApi
from inginious.frontend.plugins.utils import get_mandatory_parameter
def _transform_rst_content(content):
... |
from changes.testutils import APITestCase
from changes.api.project_source_details import ProjectSourceDetailsAPIView
class ProjectSourceDetailsTest(APITestCase):
def test_simple(self):
project = self.create_project()
source = self.create_source(project)
path = '/api/0/projects/{0}/sources... |
# -*- coding: utf-8 -*-
import collections as cl
import matplotlib as plt
import itertools as it
import numpy as np
import re
import colorsys as cs
import csv
import random
from skimage import io, color
from EPF import *
class AP:
def __init__(self, hs, k = (3, 3), percentile = 80, bins = 256, quants = 4, ncc = .... |
from src.rules.numerics import match_add_numerics, add_numerics, \
match_divide_numerics, divide_numerics, reduce_fraction_constants, \
match_multiply_numerics, multiply_numerics, multiply_zero, \
multiply_one, raise_numerics
from src.node import ExpressionLeaf as L, Scope
from src.possibilities... |
# -*- coding: utf-8 -*-
import logging
from box import CredentialsV2, BoxClient
from box.client import BoxClientException
from modularodm import fields
import requests
from framework.auth import Auth
from framework.exceptions import HTTPError
from website.addons.base import exceptions
from website.addons.base import... |
import logging
import argparse
import gzip
import os.path
import sys
import yaml
from query import load_queries
from utils import get_class
class GenericExperiment:
def __init__(self, args_str=None):
# parse arguments
parser = argparse.ArgumentParser(description="""
Construct and run ... |
from tornado.ioloop import IOLoop
from tornado.web import Application
from snorky import ServiceRegistry
from snorky.request_handlers.http import BackendHTTPHandler
from snorky.request_handlers.websocket import SnorkyWebSocketHandler
from snorky.services.pubsub import PubSubService, PubSubBackend
class PrivatePubSub... |
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model, views
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.shortcuts import redirect, render
from django.urls import reverse, ... |
# -*- coding: utf-8 -*-
""" Python KNX framework
License
=======
- B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright:
- © 2016-2017 Matthias Urlichs
- PyKNyX is a fork of pKNyX
- © 2013-2015 Frédéric Mantegazza
This program is free software; you can redistribute it and/or modify
it under the terms ... |
#!python
# -*- coding: UTF-8 -*-
'''
Module docstring
A little script helping (me) to evaluate CTLM Data faster.
What' s CTLM?:
Klootwijk, J.H.; Timmering, C. E.
"Merits and limitations of circular TLM structures for contact resistance determination for novel III-V HBTs,"
Microelectronic Test Structures, 2004. Proce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.