content stringlengths 4 20k |
|---|
import arrow
import re
from ..slack.resource import MsgResource
from ..utils.data_handler import DataHandler
from ..utils.member import Member
class BusinessCard(object):
def __init__(self, slackbot=None):
self.fname = "card.json"
self.data_handler = DataHandler()
if slackbot is None:
... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy import stats, linalg
import pandas as pd
import seaborn as sns
import math
#%% INITIAL RESULTS SCREENING
def check_eval_results(cnm, idx):
"""Checks results of component evaluation and determines why the component... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 26 23:59:09 2014
@author: Vespa
"""
import urllib2
import urllib
import re
import json
import zlib
import gzip
import xml.dom.minidom
import hashlib
from biclass import *
import time
import sys
import os
from GetAssDanmaku import *
def GetRE(content,regexp):
return re... |
from rpython.rlib.rarithmetic import ovfcheck
from rpython.rlib.rbigint import rbigint, _divrem
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem.lloperation import llop
from som.vmobjects.abstract_object import AbstractObject
from som.vmobjects.biginteger import BigInteger
from som.vmobj... |
"""Functional tests for SpacetoDepth op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors... |
# -*- coding: utf-8 -*-
"""
flask.testsuite.views
~~~~~~~~~~~~~~~~~~~~~
Pluggable views.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import flask.views
import unittest
from flask.testsuite import FlaskTestCase
from werkzeug.http import par... |
from __future__ import absolute_import
from __future__ import division
import errno
import logging
import re
import os
import shutil
import yaml
from guild import guildfile
from guild import util
log = logging.getLogger("guild")
class InitError(Exception):
pass
class PermissionError(InitError):
pass
c... |
import os
import numpy as np
from scipy import ndimage
from skeleton.io_tools import loadStack, saveStack
from metrics.segmentStats import SegmentStats
from skeleton.networkx_graph_from_array import get_networkx_graph_from_array
# NOTE This does the pyx compilation of this extension
import pyximport; pyximport.instal... |
from datetime import datetime, date, time
from time import localtime
from .validation import FORBIDDEN_OBJECTS, DATETIME_FUNCS, DATE_FUNCS
class RecordClock(object):
def __init__(self):
self.results = []
def __getattr__(self, name):
if name in DATETIME_FUNCS:
return getattr(dateti... |
"""
bkr distro-trees-verify: Check Beaker distro trees for problems
===============================================================
.. program:: bkr distro-trees-verify
Synopsis
--------
| :program:`bkr distro-trees-verify` [*options*]
| [:option:`--tag` <tag>] [:option:`--name` <name>] [:option:`--treepath` <... |
#!/usr/bin/env python
"""
Simple tornado app to list and read files.
Start server:
python tornado.py -port=8001
(Default port is 8000)
Using service
/
List:
/data/path/to/dir
Read:
/data/path/to/file
Filter:
/data/path/to/file?rows=id1,id2&cols=colid1,colid2
All services return status_code 500 if there is any erro... |
from datetime import timedelta, datetime
import gettext
from gettext import translation
from os import path
def translate(*languages):
localedir = path.join(path.dirname(__file__), 'locale')
t = translation(
fallback=1,
languages=languages or None,
domain='pretty_timedelta',
localedir=localedir,
... |
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Count, Sum
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ... |
from requests.exceptions import ConnectionError, HTTPError
from tululbot import app, bot
from tululbot.utils.kbbi import format_def, lookup_kbbi_definition
from tululbot.utils.quote import QuoteEngine
from tululbot.utils.slang import lookup_slang
from tululbot.utils.leli import search_on_google, search_on_wikipedia
... |
# -*- encoding: utf-8 -*-
import pymongo
class ConnectionMongodb(object):
def __init__(self, server, port):
self.MONGODB_URI = "mongodb://" + server + ":" + str(port)
self.mongol_URI = ''
self.client = pymongo.MongoClient(self.MONGODB_URI, serverSelectionTimeoutMS=1000, maxPoolSize=50)
... |
# rice/query.py
#
# Defines the Query class.
#
try:
import urllib.request as request
except ImportError:
import urllib2 as request
import json
import os
from . import error, util, package
class Query(object):
def __init__(self, program_name, search_term, local=False):
self.program_name = program_n... |
from flask import request, Response
from flask.blueprints import Blueprint
from sqlalchemy.sql.expression import cast
from sqlalchemy import String
from security_monkey import rbac
from security_monkey.datastore import Item, ItemRevision, Account, Technology, ItemAudit, AuditorSettings
from sqlalchemy.orm import joined... |
from os import environ
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__.split('.')[0])
app.debug = True
# App email. This email will be used to email.
app.config['APP_EMAIL'] = '<EMAIL>'
app.config['ANDROID_APP_DOWNLOAD_LINK'] = 'https://blooming-cliffs-9672.herokuapp.com/andro... |
import socket
import re
import subprocess
from sauna.plugins import Plugin
from sauna.plugins import PluginRegister
my_plugin = PluginRegister('Postfix')
@my_plugin.plugin()
class Postfix(Plugin):
def __init__(self, config):
super().__init__(config)
self.config = {
'host': config.ge... |
import pytest
@pytest.fixture(autouse=True, scope='package')
def orca_context_fixture(request):
import os
from zoo.orca import OrcaContext, init_orca_context, stop_orca_context
OrcaContext._eager_mode = True
access_key_id = os.getenv("AWS_ACCESS_KEY_ID")
secret_access_key = os.getenv("AWS_SECRET_A... |
import codecs
import hashlib
import json
import os
import re
import tempfile
import time
from ..constants import SETTINGS_FILE, SYNTAX_FILE
from ..http import CurlRequestThread
from ..http import HttpClientRequestThread
from ..message import Request
from ..overrideable import OverrideableSettings
from ..parse import R... |
import logging
import time
from insights.ui.base import Base
from insights.ui.locators import locators
from insights.ui.navigator import Navigator
LOGGER = logging.getLogger('insights_portal')
class Inventory(Base):
"""
Identifies content from Inventory of Insights UI
"""
def navigate_to_entity(self... |
from twisted.internet import defer
from buildbot.db import changesources
from buildbot.test.fakedb.base import FakeDBComponent
from buildbot.test.fakedb.row import Row
class ChangeSource(Row):
table = "changesources"
defaults = dict(
id=None,
name='csname',
name_hash=None,
)
... |
"""Implements custom serializers."""
import zlib
import marshal
from backports import lzma
from six.moves import cPickle as pickle
__all__ = ['ZlibMarshal',
'ZlibPickle',
'LzmaPickle',
'SerializerError',
'serialize_via_marshal',
'deserialize_via_marshal',
... |
import time
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.widget import Text
from widgetastic_patternfly import Input, Button, BootstrapSelect
from cfme.base.ssui import SSUIBaseLoggedInPage
from cfme.services.service_catalogs import ServiceCatalogs, BaseOrderForm
from cfme.utils.appli... |
"""
WebDAV DELETE method
"""
__all__ = ["deleteResource"]
from twisted.internet.defer import waitForDeferred, deferredGenerator
from twext.python.log import Logger
from txweb2 import responsecode
from txweb2.http import HTTPError
from txweb2.dav.fileop import delete
log = Logger()
def deleteResource(request, reso... |
__author__ = "Niharika Dutta and Abhimanyu Dogra"
import pygame
from client.utility.client_constants import *
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
RED = (255, 0, 0)
BLACK = (0, 0, 0)
DARK_GREEN = (0, 90, 0)
YELLOW = (255, 255, 0)
DARK_BLUE = (0, 0, 75)
class Highlights:
"""
Highli... |
import os
import sys
import time
import supybot
import supybot.conf as conf
from supybot import commands
import supybot.utils as utils
from supybot.commands import *
import supybot.ircdb as ircdb
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callb... |
from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("..")
from op_test_xpu import OpTest, XPUOpTest
from op_test import skip_check_grad_ci
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guar... |
# -*- coding: UTF-8 -*-
#!/usr/bin/env python
import csv
import os
import json
import errno
from pprint import pprint
from collections import *
PRINT_OUTPUT = False
################################################################################
def main():
infile = 'data/td_T5-composition.txt'
d = convert... |
"""
WSGI Utilities
(from web.py)
"""
import os, sys
import http
import webapi as web
from utils import listget
from net import validaddr, validip
import httpserver
def runfcgi(func, addr=('localhost', 8000)):
"""Runs a WSGI function as a FastCGI server."""
#import flup.server.fcgi as flups
#return fl... |
from msrest.serialization import Model
class X12DelimiterOverrides(Model):
"""The X12 delimiter override settings.
:param protocol_version: The protocol version.
:type protocol_version: str
:param message_id: The message id.
:type message_id: str
:param data_element_separator: The data elemen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import Clean, ShowUrls
from flask_migrate import MigrateCommand, Migrate
from flask.ext.sqlalchemy import sqlalchemy
import seed_db
from rank.app import create_app
from rank.settings impor... |
from test_framework.test_particl import ParticlTestFramework
from test_framework.util import assert_equal
class TxIndexTest(ParticlTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 4
self.extra_args = [
# Nodes 0/1 are "wallet" nodes
... |
"""monthdelta
Date calculation with months: monthdelta class and monthmod() function.
"""
from datetime import date, timedelta
class monthdelta:
"""Number of months offset from a date or datetime.
monthdeltas allow date calculation without regard to the different lengths
of different months. A monthdelt... |
from nova.tests.integrated.v3 import test_servers
class ServerGroupsSampleJsonTest(test_servers.ServersSampleBase):
extension_name = "os-server-groups"
def _get_create_subs(self):
return {'name': 'test'}
def _post_server_group(self):
"""Verify the response status and returns the UUID of ... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Mcl_Cmd_PacketRedirect_Tasking.py
_LISTEN_BACKLOG = 3
CMD_SEND_TYPE_DRIVER = 0
CMD_SEND_TYPE_RAW = 1
def TaskingMain(namespace):
import mcl.impo... |
class Tag:
"""
This class represents a tag. A tag is a kind of badge that represents a concept.
The 'type' represents the behaviour of the tag:
- 0: Skill tags. It appear in blue. When the tag is activated it becomes green. We can perform tasks search on this tag.
- 1: Misconception tags. It does ... |
##################################
### ###
### Joshua G. Mausolf ###
### Computation Institute ###
### University of Chicago ###
### ###
##################################
from Speech_Parser_Quality_Check import *
def WHT(url):
"""Prints Tex... |
__copyright__ = "Copyright 2012, Locaweb IDC"
import hashlib
from ast import literal_eval
from bottle import request, abort
from functools import wraps
from simplenet.common.config import config, get_logger
logger = get_logger()
def load_plugin(network_appliance):
_module_ = "simplenet.network_appliances.%s" % ... |
import enum
import unittest
import aioxmpp.xso as xso
from aioxmpp.chatstates import ChatState
from aioxmpp.stanza import Message
from aioxmpp.utils import namespaces
class TestNamespace(unittest.TestCase):
def test_namespace(self):
self.assertEqual(namespaces.xep0085,
"http://... |
from django.conf.urls import url
import website.views.general
import website.views.api.projects
import website.views.api.stories
import website.views.api.website
urlpatterns = [
# API V1 BLOCK
url(r"^api/v1/projects/get/all", website.views.api.projects.get_all_projects),
url(r"^api/v1/projects/get/(?P<pro... |
from sqlalchemy import create_engine, Column, Integer, String, Boolean, Date, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship, class_mapper
import logging
import random
logging.basicConfig(filename='./log.txt', format='%(asctime)s :: %(name)s :: ... |
# ===========================================================================
import os, glob
# ======================================================================
# Global parameters:
# Limits to subject probability (cannot go over 1 anyway):
pmin,pmax = 2e-8,1.1
# Plotting limits for no. of classifications (pe... |
"""
Example LatestOnlyOperator and TriggerRule interactions
"""
import datetime as dt
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.latest_only_operator import LatestOnlyOperator
from airflow.utils.trigger_rule import TriggerRule
dag = DAG(
dag_i... |
from __future__ import absolute_import
# built-ins
import itertools as it
# libraries
import numpy as np
import networkx as nx
# local modules
def lowest_common_ancestor(t, u, v):
"""Find the lowest common ancestor of two nodes
Parameters
----------
t : an `Ultrametric` tree or `nx.DiGraph`
... |
from exception import PyromanException
from pyroman import Firewall
from xmlsyntax import parseXML
from commands import *
__all__ = [ 'PyromanException', 'Firewall', 'parseXML', 'add_chain',
'add_host', 'add_interface', 'add_nat', 'add_rule', 'add_service', 'allow',
'drop', 'host', 'interface', 'iptables', 'iptables... |
#!/usr/bin/python2
#convert matrix exchange pattern graphs to snap edge list
#for use with PowerGraph
import sys
import random
def parseHeader( line ):
if not line.startswith( '%%MatrixMarket' ):
raise ValueError( 'invalid header line: %s' % line )
matrix, format, edgeData, symType = line[15:].split()
retu... |
"""
Cement core handler module.
"""
import re
from ..core import exc, backend, meta
from ..utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class CementBaseHandler(meta.MetaMixin):
"""Base handler class that all Cement Handlers should subclass from."""
class Meta:
"""
Hand... |
from .error_details import ErrorDetails, ErrorDetailsException
from .device_description import DeviceDescription
from .authentication import Authentication
from .symmetric_key import SymmetricKey
from .x509_thumbprint import X509Thumbprint
__all__ = [
'ErrorDetails', 'ErrorDetailsException',
'DeviceDescription... |
import sys
import os
import time
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4 import *
from emailSenderWidget import *
class FinalPhotoWidget(QtGui.QWidget):
def __init__(self, currentTime):
super(QtGui.QWidget, self).__init__()
self.currentTime = currentTime
self.initUI()... |
from __future__ import absolute_import
import os
path = os.path
import unittest
from random import randrange
from myhdl import *
from util import setupCosimulation
COSET = 0x55
def calculateHecRef(header):
""" Return hec for an ATM header.
Reference version.
The hec polynomial is 1 + x + x**2 + x**8.
... |
from odoo import api, models
class Base(models.AbstractModel):
_inherit = "base"
@api.model
def load(self, fields, data):
"""Try to identify rows by other pseudo-unique keys.
It searches for rows that have no XMLID specified, and gives them
one if any :attr:`~.field_ids` combinat... |
import sys
import os
import pytest
import subprocess
from mock import patch, MagicMock
sys.path.insert(0, '..')
import update_gfortran_libs_osx as ugo
EXPECTED_DEPS = [
'/usr/local/gfortran/lib//libstdc++.6.dylib',
'/usr/local/gfortran/lib//libgfortran.3.dylib',
'/usr/local/gfortran/lib//libgcc_s.1.dylib'... |
#/usr/bin/python
#encoding=utf-8
import os
import json
def loadPlugins(pluginDir):
ids = []
tmp = '{id:"%s", priority:%s, summary:"%s", desc:"%s", checked:%s}';
'''从plugins目录动态载入检查类'''
for filename in os.listdir(pluginDir):
if not filename.endswith('.py') or filename.startswith('_'):
... |
import collections
import actors
class ActionType:
"""Enumerated list of action types"""
def __init__(self):
pass
Line, Choice, Description = range(3)
class Scene(collections.OrderedDict):
"""Represents a specific scene. Contains a collection of the actions."""
# properties
intro... |
"""Unit tests for the `iris.io.expand_filespecs` function."""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
... |
import gensim
import pandas as pd
import random
import numpy as np
import matplotlib.pyplot as plt
import cPickle as pickle
from scipy.spatial.distance import cosine
from nltk.tokenize import PunktSentenceTokenizer
###########################################################################
# tokenization code
def sep... |
""" Client for the SandboxStore.
Will connect to the WorkloadManagement/SandboxStore service.
"""
__RCSID__ = "$Id$"
import os
import tarfile
import hashlib
import tempfile
import re
import StringIO
from DIRAC import gLogger, S_OK, S_ERROR, gConfig
from DIRAC.Core.DISET.TransferClient import TransferClient
from... |
from server import WebSocketHttpServer
from handler import BlenderHandler
import customButtons
import threading
def main():
if 'Server' in bge.logic.globalDict:
return
else:
print("\n\n------------------ BUILDING THE SERVER -----------------------")
scene=bge.logic.getCurrentScene();
... |
"""Handler resources for Design API endpoints.
NOTICE - THIS API IS DEPRECATED
"""
import falcon
import json
import uuid
import drydock_provisioner.policy as policy
import drydock_provisioner.objects as hd_objects
import drydock_provisioner.error as errors
from .base import StatefulResource
class DesignsResource(... |
import pytest
from django.core.checks.registry import run_checks
from normandy.base import checks as base_checks
from normandy.recipes import checks as recipe_checks, geolocation as geolocation_module
@pytest.mark.django_db
def test_run_checks_happy_path():
errors = set(e.id for e in run_checks())
expected ... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from coaster.sqlalchemy import BaseMixin, IdMixin
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy_utils import JSONType
from .fields import FileField
from .constants import PRIVACY_TYPE
from ..utils import STRING_LEN, GENDER_TYPE, id_genera... |
# -*- coding: utf-8 -*-
# -*- mode: python -*-
from __future__ import unicode_literals
import uuid
import datetime
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.urls import reverse
from django.db import models
from django.conf i... |
import typing
import os
from . import line
from ..repo import description as desc
from ..repo import implementation as impl
class Tree(object):
""" Represents a Tree of Repositories """
def __init__(self):
""" Creates a new Tree object"""
self.__lines = []
self.__base_directory = os... |
from lxml import etree
from six import BytesIO
import sys
if sys.version_info[:2] < (2, 7):
import unittest2 as unittest
else:
import unittest
# ignore index= attribute in xml comparison, as it is not stable between python versions
IGNORE_ATTRIBS = {'index'}
class BaseTestCase(unittest.TestCase):
def a... |
import sys
import time
from urllib2 import URLError
import json
import twitter
def make_twitter_request(twitter_api_func, max_errors=3, *args, **kw):
# A nested helper function that handles common HTTPErrors. Return an updated value
# for wait_period if the problem is a 503 error. Block until the rate limit is... |
from . import *
@pytest.fixture
def domain(client):
return client.domain('foo.com')
@pytest.fixture
def domain_from_token(domain):
client = dnsimple.Client(domain_token = domain.token, sandbox = True)
return client.domain(domain.name)
class TestRecords:
def test_default_records(self, domain, domain_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
load, quit, version, help plugins
Plugin read by omero.cli.Cli during initialization. The method(s)
defined here will be added to the Cli class for later use.
The load plugin is used to read in files with omero cli commands
(omitting the omero). For exa... |
import conda
import yaml
import os
import subprocess
import shutil
import conda.plan
import conda_build.config
import conda
def load_sources(sources_yaml):
with open(sources_yaml, 'r') as fh:
return yaml.safe_load(fh)
def fetch_sources(sources, sources_root):
"""
Fetch the given sources to th... |
from openerp import addons
import logging
import time
from openerp.osv import fields, osv
from openerp import tools
_logger = logging.getLogger(__name__)
class it_equipment_function(osv.osv):
_name = 'it.equipment.function'
_description = 'Equipment Function'
_columns = {
'name': fields.char('N... |
"""Sublime commands for the cargo build system."""
import functools
import sublime
import sublime_plugin
import sys
from .rust import (rust_proc, rust_thread, opanel, util, messages,
cargo_settings, target_detect)
from .rust.cargo_config import *
# Maps command to an input string. Used to pre-popul... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import sqlite3
from pyLibrary.debugs.exceptions import Except, extract_stack, ERROR
from pyLibrary.debugs.logs import Log
from pyLibrary.dot import Dict
from pyLibrary.env.files import File
from pyLibrary.th... |
"""Create resources, get sheets/metadata, permission checks."""
from copy import copy
from pyramid.request import Request
from pyramid.util import DottedNameResolver
from pyramid.decorator import reify
from pyramid.traversal import resource_path
from substanced.content import ContentRegistry
from substanced.content im... |
# Django settings for patchman project.
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIR = BASE_DIR
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['127.0.0.1']
ADMINS = ()
# Local time zone for this installatio... |
"""
FIXME(bja, 2017-11) External and SourceTree have a circular dependancy!
"""
import errno
import logging
import os
from .externals_description import ExternalsDescription
from .externals_description import read_externals_description_file
from .externals_description import create_externals_description
from .reposi... |
# -*- coding: utf-8 -*-
'''
Test fixtures for the napalm-logs profiles.
'''
from __future__ import absolute_import
# Import python std lib
import os
import json
import time
import socket
import logging
from multiprocessing import Process
# Import third party lib
import zmq
import pytest
# Import napalm-logs pkgs
imp... |
import blocks
from codecs import open
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
while not f.readline().startswith('Blocks'): # Skip the badges
pass
long_description = 'Bl... |
import random
import math
def categorical_draw(probs):
z = random.random()
cum_prob = 0.0
for i in range(len(probs)):
prob = probs[i]
cum_prob += prob
if cum_prob > z:
return i
return len(probs) - 1
class Exp3():
def __init__(self, gamma, weights):
self.gamma = gamma
self.weights ... |
"""
Starter fabfile for deploying the sis project.
Change all the things marked CHANGEME. Other things can be left at their
defaults if you are happy with the default layout.
"""
import posixpath
from fabric.api import run, local, env, settings, cd, task
from fabric.contrib.files import exists
from fabric.operations... |
import argparse
from helpers import read_strings
from snp import SuffixArray
import time
from numpy import argmin
def FindShortestNonShared(s,t):
m = len(s)
n = len(t)
print (m,n)
r0,p0,l0 = SuffixArray(s,auxiliary=True,padLCP=True)
for i in range(len(r0)):
print (f'{i:2d} {r0[i]:2d} {p0[... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI_AudioControl.ui'
#
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8... |
import sys
sys.path.append('../python/')
import hypoct
import numpy as np
import time
if __name__ == '__main__':
"""
Build quadtree on uniformly spaced points on the unit circle.
"""
# initialize points
n = 2**20
theta = np.linspace(0, 2*np.pi, n+1)[:n]
x = np.array([np.cos(theta), np.sin(theta)], order... |
import os
import sys
import mysql.connector as mariadb
class Job:
def __init__(self, gwf_id):
self.gwf_id = gwf_id
self.db_id = -1
self.tasks = []
class Task:
def __init__(self, gwf_id, job, submit_time, run_time, num_processors, dependency_gwf_ids):
self.gwf_id = gwf_id
... |
"""
Installation script for Glance's development virtualenv
"""
from __future__ import print_function
import os
import subprocess
import sys
import install_venv_common as install_venv
def print_help():
help = """
Glance development environment setup is complete.
Glance development uses virtualenv to track a... |
"""
Support for Xeoma Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.xeoma/
"""
import logging
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import (
CONF_HOST,... |
import logging
import sys
import subprocess
# Execute the "make <pkg>-show-version" command to get the version of a given
# list of packages, and return the version formatted as a Python dictionary.
def get_version(pkgs):
logging.info("Getting version for %s" % pkgs)
cmd = ["make", "-s", "--no-print-directory... |
# All fields except for BlobField written by Jonas Haag <<EMAIL>>
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.related import add_lazy_relation
from django.db.models.fields.subclassing import Creator
from django.db.utils import IntegrityError
from django.... |
# -*- coding: utf-8 -*-
import datetime
import os
import shutil
import tempfile
from StringIO import StringIO
import unittest
import mock
from nectar.config import DownloaderConfig
from nectar.downloaders import local
from nectar.listener import AggregatingEventListener
from nectar.report import DownloadReport
from ... |
from msrest.pipeline import ClientRawResponse
from msrest.exceptions import HttpOperationError
from .. import models
class AvailabilitySets(object):
"""AvailabilitySets operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An objec... |
import pathfix
pathfix.fixpath()
import bcrypt
from tornado import gen
import modules.fingerprint as fingerprint
import modules.ip_address_checker as ip_address_checker
import modules.keystroke_dynamics as keystroke_dynamics
class Launderer():
'''Returns data in a way that circumvents pytest's aversion to yielding... |
"""Utility functions for dtoolcore."""
import os
import errno
import getpass
import hashlib
import json
import platform
import binascii
import base64
import datetime
import re
import socket
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, urlunparse
IS_WIN... |
"""Tests for the Windows EventLog (EVT) parser."""
import unittest
# pylint: disable=unused-import
from plaso.formatters import winevt as winevt_formatter
from plaso.lib import eventdata
from plaso.lib import timelib_test
from plaso.parsers import test_lib
from plaso.parsers import winevt
class WinEvtParserTest(tes... |
try:
import libcloud
except ImportError:
message = ('Missing "apache-libcloud", please install it using pip:\n'
'pip install apache-libcloud')
raise ImportError(message)
from libcloud.compute.providers import get_driver as get_compute_driver
from libcloud.storage.providers import get_driver ... |
# -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Description:
#
# E-mail: <EMAIL>
# Create: 2015-12-05 20:52:10
# Last:
__author__ = 'yuens'
################################### PART1 IMPORT ######################################
impo... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
"""
**DF**: The model based on the document frequency takes into account the number of documents
in which a word appears as an evidence of taxonomic relation. Thus, a word that occurs in more
documents tends to be more general than a word that appears in few documents.
@author... |
from . import tservers
"""
A collection of errors turned up by fuzzing. Errors are integrated here
after being fixed to check for regressions.
"""
class TestFuzzy(tservers.HTTPProxyTest):
def test_idna_err(self):
req = r'get:"http://localhost:%s":i10,"\xc6"'
p = self.pathoc()
ass... |
import logging
import sys
import time
from eventlet import event
from eventlet import greenthread
from ec2api.openstack.common._i18n import _LE, _LW
LOG = logging.getLogger(__name__)
# NOTE(zyluo): This lambda function was declared to avoid mocking collisions
# with time.time() called in the standard l... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Comment'
db.create_table('moviedb_comment', (
('id', self.gf('django.db.models... |
"""Built-in activation functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
from tensorflow.python.keras.ut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.