content stringlengths 4 20k |
|---|
"""
Gaussian Processes classification examples
"""
import GPy
default_seed = 10000
def oil(num_inducing=50, max_iters=100, kernel=None, optimize=True, plot=True):
"""
Run a Gaussian process classification on the three phase oil data. The demonstration calls the basic GP classification model and uses EP to app... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MLSTLocus'
db.create_table(u'mlst_mlstlocus', (
(u'id', self.gf('django.db.model... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**layouts_manager.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines the :class:`LayoutsManager` and :class:`Layout` classes.
**Others:**
"""
from __future__ import unicode_literals
from PyQt4.QtCore import QObject
from PyQt4.QtCore imp... |
import copy
import fixtures
import mock
import oslo_messaging as messaging
from oslo_serialization import jsonutils
import testtools
from nova import context
from nova import rpc
from nova import test
# Make a class that resets all of the global variables in nova.rpc
class RPCResetFixture(fixtures.Fixture):
def... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tensorflow_models as tf_models
from six.moves import range
def normal_mlp(settings, inputs, is_training):
architecture ... |
from __future__ import print_function, unicode_literals
from os import path, getcwd, listdir
import subprocess
import sys
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)
from servo.command_base import CommandBase, cd, call
CARGO_PATHS = [
path.join('components', 'servo'),
... |
'''
urlresolver XBMC Addon
Copyright (C) 2016 Gujal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
from igelmain.models import Kapitel, Beispiel, Aufgabe, Kategorie, Skript
from django.contrib import admin
class KapitelAdmin(admin.ModelAdmin):
fields = ['titel', 'kategorie', 'platz', 'zusammenfassung', 'quelltext', 'bild', ]
class Media:
css = {'all': ('css/admin.css', ), }
admin.site.register(Ka... |
from structures import Escape, Macro, Pre
# Generic functionality to create a texopic processor.
#
# This has changed a lot over time. It will likely still
# change a bit, but I don't know when.
# It feels pretty good now.
# There is example of use in texopic2html.py -script.
class Env(object):
def __init__(self, ... |
"""
notenames.py: Human-readable and shorthand note name to MIDI note number
mappings.
"""
# Note names and numbers taken from the GM1 Sound Set
# http://www.midi.org/techspecs/gm1sound.php
# and the GM2 Sound Set
# http://en.wikipedia.org/wiki/General_MIDI_Level_2#Drum_sounds
GM_SPEC_NOTE_NAME_TO_NUMBER_MAP = {
#... |
import os
import sys
import unittest
from availability_finder import AvailabilityFinder
from branch_utility import BranchUtility
from compiled_file_system import CompiledFileSystem
from fake_url_fetcher import FakeUrlFetcher
from object_store_creator import ObjectStoreCreator
from test_file_system import TestFileSyste... |
import datetime
import logging
from django.db import models
from django.db.backends.dummy.base import IntegrityError
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
f... |
import numpy
import essentia
import glob
import essentia
from essentia.extractor.extractor import compute
input_files = glob.glob("../../../../audio/recorded/*.wav")
for input_file in input_files:
pool = compute(input_file, True, True)
desc = pool.aggregate_descriptors()
key_strength = desc['key_strengt... |
import unittest
from support import CatchLogs
from openid.message import Message, OPENID2_NS, OPENID1_NS, OPENID_NS
from openid import association
from openid.consumer.consumer import GenericConsumer, ServerError
from openid.consumer.discover import OpenIDServiceEndpoint, OPENID_2_0_TYPE
class ErrorRaisingConsumer(Ge... |
{'name': 'Sale Cancel Reason',
'version': '8.0.1.1.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
'category': 'Sale',
'license': 'AGPL-3',
'complexity': 'normal',
'images': [],
'website': "http://www.camptocamp.com",
'description': """
Sale Cancel Reason
==================
When a sale order is ca... |
# -*- coding: utf-8 -*-
import sphinx.roles
import sphinx.environment
from sphinx.writers.html import HTMLTranslator
from docutils.writers.html4css1 import HTMLTranslator as DocutilsTranslator
def patch():
# navify toctree (oh god)
@monkey(sphinx.environment.BuildEnvironment)
def resolve_toctree(old_resolv... |
"""Evaluation of macros acccording to an overapproximation semantics.
This module generally follows CPP semantics for the evalution of macros. But we
treat every define as a possible one, because we don't know whether it is
actually executed when a file is really preprocessed. Our semantics is thus
multi-valued: an ex... |
#This test is used to check if engine runs with default behaviour when recordBoostField is not specified.
import sys, urllib2, json, time, subprocess, os, commands, signal
sys.path.insert(0, 'srch2lib')
import test_lib
port = '8087'
#Function of checking the results
def checkResult(query, responseJson,resultValue):... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... |
from spack import *
class RClassint(RPackage):
"""Selected commonly used methods for choosing univariate class intervals
for mapping or other graphics purposes."""
homepage = "https://cran.r-project.org/package=classInt"
url = "https://cran.r-project.org/src/contrib/classInt_0.1-24.tar.gz"
... |
import datetime
from django.conf import settings # noqa
from horizon import exceptions
from horizon import middleware
from horizon.test import helpers as test
class MiddlewareTests(test.TestCase):
def test_redirect_login_fail_to_login(self):
url = settings.LOGIN_URL
request = self.factory.post(... |
"""Define tests for the Brother Printer config flow."""
import json
from brother import SnmpError, UnsupportedModel
from homeassistant import data_entry_flow
from homeassistant.components.brother.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.const import ... |
# -*- coding: utf-8 -*-
'''
test_analysis.py
--------------------------------------
Date : September 2012
Copyright : (C) 2012 by Tim Sutton
email : <EMAIL>
******************************************************... |
# Mongo Attack file
import threading
import pymongo
from pymongo import MongoClient
from termcolor import colored
from dbattacks.utils import screenshot
import requests
global passfound
def mongo_conn(target, port=27017, mass=False):
"""
Establishes Connection with MongoDB and Determines whether alive or no... |
"""
Lasagne implementation of CIFAR-10 examples from "Identity Mappings in Deep Residual Networks" (https://arxiv.org/abs/1603.05027) and "Wide Residual Networks" (https://arxiv.org/abs/1605.07146)
"""
import os
import sys
import gzip
import time
import pickle
import datetime
import random
import numpy as np
import pan... |
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'providerresourceassociations',
sa.Column('provider_name', sa.String(length=255), nullable=False),
sa.Column('resource_id', sa.String(length=36), nullable=False),
sa.PrimaryKeyConstraint('provider_name',... |
class PathTransforms:
@staticmethod
def lead(X):
"""
Returns the lead component of the lead lag transform of a path X (or single dimension of a path value)
:param X: X is a path consists of tuples (time, value)
:return: A list of points which represent the lead component of the... |
#!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import star
from ddb_ngsflow.variation.sv import manta
if __name__ == "__main__":
parser = a... |
"""
Agent wrapper around /proc/dev/net to filter an interface statistics. The
interface *eth0* is used as default.
"""
import socket
from logging import *
from threading import Thread
import subprocess
from node import Node
from agent import Agent
import Queue
import fcntl
import socket
import struct
# End Flag
EOT_F... |
#!/usr/bin/env python
''' Checkout gitwash repo into directory and do search replace on name '''
from __future__ import (absolute_import, division, print_function)
import os
from os.path import join as pjoin
import shutil
import sys
import re
import glob
import fnmatch
import tempfile
from subprocess import call
from... |
#!/usr/bin/env python
import roslib; roslib.load_manifest('smacha')
import rospy
import smach
import smach_ros
# define state Bas
class Bas(smach.State):
def __init__(self):
smach.State.__init__(self, outcomes=['outcome3'])
def execute(self, userdata):
rospy.loginfo('Executing state BAS')
... |
# -*- coding: Latin-1 -*-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always ... |
"""
Component that will help set the Microsoft face for verify processing.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/image_processing.microsoft_face_identify/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core impo... |
"""test serialization tools"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import pickle
from collections import namedtuple
import nose.tools as nt
from ipykernel.serialize import serialize_object, deserialize_object
from IPython.testing import decorators as ... |
import os
import aiofiles
import httpx
import idx2numpy
import pandas as pd
import asyncio
from dataget import utils
from dataget.dataset import Dataset
class fashion_mnist(Dataset):
@property
def name(self):
return "image_fashion_mnist"
async def download(self):
base_url = "https://st... |
#!/usr/intel/pkgs/python/2.4/bin/python2.4
#!/usr/bin/python
"""
usage code_cache_gui.py
This GUI was designed to work with the event_trace pintool.
When started it opens the file "ctrace.out" for reading
cache trace data. (event_trace opens this very same file by default and
it is best to make it a named pipe, i.... |
from __future__ import unicode_literals
import base
import unittest
class TestConcrete(base.TestPyConcreteBase):
def test_decrypt_exception(self):
import pyconcrete
print(pyconcrete.__file__)
data = 'abc'
self.assertLess(len(data), 16)
with self.assertRaises(pycon... |
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory that is passed as an
argument:
nodes_main.txt
nodes_test.txt
These files must consist of lines in the format
<ip>
<ip>:<port>
[<ipv6>]
[<ipv6>]:<port>
<onion>.onion
0xD... |
'''
Created on Aug 23, 2012
@package: superdesk media archive
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Ioan v. Pocol
SQL Alchemy based implementation for the video data API.
'''
from ally.cdm.spec import ICDM
from ally.container import wire
from ally.container.... |
import logging
logger = logging.getLogger(__name__)
# TODO: use these errors in the future - keeping it for future
def log_error(expression: str, message: str) -> None:
logger.error("FAILED: " + expression + " " + message)
class Error(Exception):
"""Base class for all sort of exceptions"""
class Externa... |
import time
import pygame
import events
from config import *
##\brief CPU controller
##
##posts tick events to the event manager. also is used as the server for
##networking
class CPUController:
##\brief CPUController constructor
##
##\param eventManager THE event manager
##\return None
def __init__ ( se... |
from sqlalchemy import Boolean, Column, DateTime, UniqueConstraint
from sqlalchemy import Integer, MetaData, String, Table, ForeignKey
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
volume_types = Table('volume_types', meta, autoload=True)
is_public = Column('is_public', Boo... |
from spack import *
class PyTorchvision(PythonPackage):
"""The torchvision package consists of popular datasets, model
architectures, and common image transformations for computer vision."""
homepage = "https://github.com/pytorch/vision"
url = "https://github.com/pytorch/vision/archive/v0.7.0.ta... |
import pandas
import pandasql
def avg_weekend_temperature(filename):
'''
This function should run a SQL query on a dataframe of
weather data. The SQL query should return one column and
one row - the average meantempi on days that are a Saturday
or Sunday (i.e., the the average mean temperature on ... |
from neutron import manager
from neutron.tests.unit.bigswitch import test_base
from neutron.tests.unit import test_extension_security_group as test_sg
from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc
class RestProxySecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase,
... |
from Tkinter import *
from Bio import Clustalw
from Bio.Align import AlignInfo
from clustalalignment import columnsummary
from config import INTRONS
LINEDISTANCE = 8 # distance between lines
HIGHLIGHTCOLOR = "#d9d984"
INTRONCOLOR = "#b2b2e8"
class AlignmentviewerLines( Frame ):
"""Class for viewing an alignment (... |
#!/usr/bin/env python
"""Utils for flow related tasks."""
import time
import logging
from grr.lib import aff4
from grr.lib import flow
# How long to wait, by default, for a flow to finish.
DEFAULT_TIMEOUT = 650
def GetUserInfo(client, user):
"""Get a User protobuf for a specific user.
Args:
client: A VFS... |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, cint
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes import msgprint, _
from webnotes.model.controller import DocListController
class WarehouseNotSet(Exception): pass
class Doc... |
"""Cedula (Dominican Republic national identification number).
A cedula is is an 11-digit number issues by the Dominican Republic government
to citizens or residents for identification purposes.
>>> validate('00113918205')
'00113918205'
>>> validate('00113918204')
Traceback (most recent call last):
...
InvalidChe... |
import os
from flask import Blueprint, request, current_app, send_file
from werkzeug.utils import secure_filename
from datetime import datetime
from modules.meta import blob_meta_enqueue
bp_ra_meta = Blueprint('reactapp_module_metadata', __name__)
@bp_ra_meta.route('/api/v0/uploadmetadata', methods=['POST'])
def uplo... |
# -*- coding: utf-8 -*-
import mock
import pytest
from future.moves.urllib.parse import urlparse, urljoin
import responses
from framework.auth import Auth
from nose.tools import (assert_equal, assert_true, assert_false)
from addons.base.tests import views
from addons.base.tests.utils import MockLibrary, MockFolder
fro... |
from datetime import datetime
from openerp.tests import common
from openerp.osv import orm
class test_account_partner_required(common.TransactionCase):
def setUp(self):
super(test_account_partner_required, self).setUp()
self.account_obj = self.registry('account.account')
self.account_typ... |
from __future__ import absolute_import, division, print_function
import appr.pack as packager
DEFAULT_MEDIA_TYPE = 'kpm'
class BlobBase(object):
def __init__(self, package_name, blob, b64_encoded=True):
self.package = package_name
self.packager = packager.ApprPackage(blob, b64_encoded)
@cla... |
from __future__ import absolute_import, unicode_literals
from mopidy import listener
class AudioListener(listener.Listener):
"""
Marker interface for recipients of events sent by the audio actor.
Any Pykka actor that mixes in this class will receive calls to the methods
defined here when the corres... |
import logging
import json
import re
import time
import sqlite3
import StringIO
from pprint import pprint
from twisted.web.resource import Resource
from twisted.web.server import NOT_DONE_YET
from twisted.web import http
import util
import qasino_table
import csv_table_reader
class MyLoggingHTTPChannel(http.HTTPChan... |
"""
ts_ref_altcoin.py: Altcoin reference file tests for the test.py test suite
"""
import os
from mmgen.globalvars import g
from mmgen.opts import opt
from .common import *
from .ts_ref import *
from .ts_base import *
class TestSuiteRefAltcoin(TestSuiteRef,TestSuiteBase):
'saved and generated altcoin reference files... |
#!/usr/bin/env python
#
# Cmake
#
# Cmake packages and versions
#
# Author P G Jones - 2014-02-24 <<EMAIL>> : New file.
####################################################################################################
import nusoft.package.local as local_package
import os
class Cmake(local_package.LocalPackage):
... |
import os
from datadog_checks.dev import get_here
COMPOSE_FILE = os.path.join(get_here(), 'compose', 'compose.yaml')
# Calling the binary on nfs-client container from the agent container
CONFIG = {
"init_config": {"nfsiostat_path": "docker exec nfs-client /usr/sbin/nfsiostat"},
"instances": [{"tags": ["tag1:... |
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import NestedSet
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow
class ItemGroup(NestedSet... |
""" Test class for Job Agent
"""
# imports
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
from mock import MagicMock
# DIRAC Components
from DIRAC.WorkloadManagementSystem.Agent.JobAgent import JobAgent
from DIRAC import gLogger
gLogger.setL... |
"""Classification and regression network."""
# pylint: disable=g-classes-have-attributes
from __future__ import absolute_import
from __future__ import division
# from __future__ import google_type_annotations
from __future__ import print_function
import tensorflow as tf
@tf.keras.utils.register_keras_serializable(pa... |
from pysnmp.smi import builder
from datetime import datetime
import conpot.core as conpot_core
class DatabusMediator(object):
def __init__(self, oid_mappings):
""" initiate variables """
self.evasion_table = {} # stores the number of requests
self.start_time = datetime.now()
... |
# TO-DO: to be moved to tests directory
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import cmd
import sys
import os.path
from DIRAC.DataManagementSystem.Client.CmdDirCompletion.AbstractFileSystem import UnixLikeFileSystem
from DIRAC.DataManagementSystem... |
from __future__ import unicode_literals
import frappe
def boot_session(bootinfo):
"""boot session - send website info if guest"""
bootinfo.custom_css = frappe.db.get_value('Style Settings', None, 'custom_css') or ''
bootinfo.website_settings = frappe.get_doc('Website Settings')
if frappe.session['user']!='Guest'... |
import datetime
import time
try:
from pysqlcipher.libsqlite import *
except ImportError:
from pysqlcipher._sqlite import *
paramstyle = "qmark"
threadsafety = 1
apilevel = "2.0"
Date = datetime.date
Time = datetime.time
Timestamp = datetime.datetime
def DateFromTicks(ticks):
return Date(*time.localt... |
"""Helpers for listening to events."""
import asyncio
import functools as ft
from datetime import timedelta
from ..const import (
ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL)
from ..util import dt as dt_util
from ..util.async import run_callback_threadsafe
def track_state_change(hass, entity_ids... |
import xml.etree.ElementTree as ET
import os
import cPickle
import numpy as np
def parse_rec(filename):
""" Parse a txt file """
objects = []
with open(filename, 'r') as fd:
for line in fd:
segs = line.strip().split(' ')
obj_struct = {}
obj_struct['na... |
"""Unit tests for nupic.data.utils."""
from datetime import datetime
from nupic.data import utils
from nupic.support.unittesthelpers.testcasebase import (TestCaseBase,
unittest)
class UtilsTest(TestCaseBase):
"""Utility unit tests."""
def testParseTimesta... |
from gi.repository import Gtk
class ViewContainer(Gtk.Container):
__gtype_name__ = 'SugarViewContainer'
def __init__(self, layout, owner_icon, activity_icon=None, **kwargs):
Gtk.Container.__init__(self, **kwargs)
self.set_has_window(False)
self.set_can_focus(True)
self._activ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
##pseudotiger2
#implementation of TIGER2 algorithm to use in AMBER without momentum scalling
#<EMAIL>
import sys
import os
import subprocess
import time
import signal
import fileinput
import operator
import random
import itertools
import re
from argparse import ArgumentPa... |
from gi.repository import Gtk
from sugar3.graphics.toolbutton import ToolButton
from sugar3.graphics.toolbarbox import ToolbarBox, ToolbarButton
window = Gtk.Window()
box = Gtk.VBox()
window.add(box)
toolbar = ToolbarBox()
box.pack_start(toolbar, False)
tollbarbutton_1 = ToolbarButton(
page=Gtk.Button('sub-wid... |
"""
Provides a :class:`WebHdfsTarget` and :class:`WebHdfsClient` using the
`Python hdfs <https://pypi.python.org/pypi/hdfs/>`_
"""
from __future__ import absolute_import
import logging
import os
from luigi import six
from luigi import configuration
from luigi.target import FileSystemTarget, AtomicLocalFile
from lui... |
from base import Module, post_url, key_in_data, valid_key
class Offer(Module):
def __init__(self, base_url, **kwargs):
''' Define a offer '''
self.base_url = base_url
self.data = {}
self.keys = (
'offer_id',
'description',
'discount',
... |
import errno
import logging
import os
from oslo_config import cfg
LOG = logging.getLogger(__name__)
def read_cached_file(cache, filename, force_reload=False):
"""Read from a file if it has been modified.
:param cache: dictionary to hold opaque cache.
:param filename: the file path to read.
:param f... |
# Stripped down sample settings for django-spambayes project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'data.db'
TIME_ZONE = 'America/New_York'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = False
ADMIN_MEDIA_PREFIX = '/media/'
SECRET_KEY = '$hh4h!xor*cp9fb03a$0ew06_ou3qpx7vn... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# from "Starfield" (Daniel Shiffman)
# Video: https://youtu.be/17WoOqgXsRM
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import random
def mapFromTo(x, a, b, c, d):
"""map() function of javascript"""
y = (float(x)... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.fortran
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Fortran languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, words, usin... |
from setuptools import setup, find_packages
import textwrap
setup(name='githubtools',
version='0.3.1',
author='nricklin',
author_email='<EMAIL>',
license='MIT',
description='Some simple commandline tools for interacting with github: status, merge, pull, etc.',
long_description=textw... |
import sys
from oba_rvtd_deployer.aws import launch_new, tear_down
from oba_rvtd_deployer.gtfs import validate_gtfs, update
from oba_rvtd_deployer.oba import install, deploy, start, copy_gwt,\
install_watchdog
def run_all():
'''A single script to deploy OBA in one command to a new EC2 instance
'''
... |
# -*- coding: utf-8 -*-
from django.db import models
from core.models import (SubjectGroup, User)
class PlaceType(models.Model):
name = models.CharField(max_length=30)
def __unicode__(self):
return self.name
class Place(models.Model):
number = models.IntegerField()
placetype = models.Forei... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import copy
import traceback
from collections import defaultdict
from ansible.module_util... |
"""Functions to parse human-readable analyses into analysis protobuf messages.
"""
import functools
import re
from typing import List
from turkish_morphology import analysis_pb2
_Affix = analysis_pb2.Affix
_Analysis = analysis_pb2.Analysis
_AFFIX_REGEX = re.compile(
# Derivation or inflection delimiter.
r"[... |
"""
SmartOS packages
================
This module provides tools to manage `SmartOS`_ packages.
.. _SmartOS: http://smartos.org/
"""
from fabric.api import hide, quiet, run, settings
from fabtools.files import is_file
from fabtools.utils import run_as_root
MANAGER = 'pkgin'
def update_index(force=False):
"... |
#!/usr/bin/env python
import sys
import os
import time
import atexit
from signal import SIGTERM
class Daemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(
self, pidfile,
stdin='/dev/null', stdout='/dev/null',... |
"""The consistencygroups api."""
import webob
from webob import exc
from cinder.api import common
from cinder.api import extensions
from cinder.api.openstack import wsgi
from cinder.api.views import consistencygroups as consistencygroup_views
from cinder.api import xmlutil
from cinder import consistencygroup as cons... |
import logging
import shutil
import os
import sys
import json
import numpy as np
import linecache, bisect
import csv
import pandas as pd
from collections import OrderedDict
from multiprocessing import Process
from utils import Util,ProgressBar
from components.data.data import Data
from components.geoloc.geoloc import ... |
import sys
import mock
from six import moves
from neutron.tests import base
from neutron.tests import post_mortem_debug
class TestTesttoolsExceptionHandler(base.BaseTestCase):
def test_exception_handler(self):
try:
self.assertTrue(False)
except Exception:
exc_info = sys.... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
try_get,
urlencode_postdata,
)
class YandexDiskIE(InfoExtractor):
_VALID_URL = r'https?://yadi\.sk/[di]/(?... |
"""Handelsregisternummer (German company register number).
The number consists of the court where the company has registered, the type
of register and the registration number.
The type of the register is either HRA or HRB where the letter "B" stands for
HR section B, where limited liability companies and corporations... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This KWord python script implements import of with doxygen generated content into KWord.
To generate the handbook from within the commandline;
cd kspread/plugins/scripting/docs
doxygen kspreadscripting.doxyfile
cd xml
xsltproc combine.xslt index.xml | ... |
from .components import *
from .plugins import *
from .core import componentsList
'''
A mode is a tuple: (components, links) where:
* components is a list of uninitialized components
* links is a list of links, where a link is a tuple:
((destination_index, var_name), (origin_index, var_name))
where `destination_i... |
import numpy as np
def get_ex_spectrums(spectrums, n_occ_states, get_neg=True):
r"""
Parameters
----------
spectrums : array-like
An array containing energies (eigenvalues) corresponding to some
matrix.
n_occ_states : integer
Number of occupied states.
get_neg : Boolean
... |
from libqtile.log_utils import logger
from . import base
import six
class Net(base.ThreadedPollText):
"""Displays interface down and up speed"""
orientations = base.ORIENTATION_HORIZONTAL
defaults = [
('interface', 'wlan0', 'The interface to monitor'),
('update_interval', 1, 'The update int... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes... |
# -*- coding: utf-8 -*-
import os,math
from qgis.core import NULL
from mole3 import oeq_global
from mole3.project import config
from mole3.extensions import OeQExtension
from mole3.stat_corr import rb_contemporary_base_uvalue_by_building_age_lookup
def calculation(self=None, parameters={},feature = None):
from sc... |
# coding=utf-8
from __future__ import print_function, unicode_literals
import re
import os
import posixpath
from bs4 import BeautifulSoup
from datetime import date
import sickbeard
from sickbeard import helpers
from sickrage.helper.encoding import ek
class imdbPopular(object):
def __init__(self):
"""Ge... |
# -*- coding: utf-8 -*-
template = '''
<b>BBOX</b> (xmin,ymin,xmax,ymax):<br>
{xmin},{ymin},{xmax},{ymax}<br>
<b>Centroid</b> (X,Y):<br>
{cx},{cy}<br>
<b>Geographic dimensions</b> (widht,height):<br>
{geowidth},{geoheight}<br>
<b>Graphic dimensions</b> (widht,height):<br>
{grwidth},{grhe... |
import json
import os
from twisted.internet import defer
from twisted.protocols import basic
from twisted.python import log
from twisted.spread import pb
from buildbot import pbutil
from buildbot.process.properties import Properties
from buildbot.schedulers import base
from buildbot.util import bytes2unicode
from bui... |
import sys
import optparse
import glib
import gobject
gobject.threads_init()
import gst
import ges
class Effect:
def __init__(self, effects):
ges.init()
self.mainloop = glib.MainLoop()
self.timeline = ges.timeline_new_audio_video()
layer = ges.TimelineLayer()
self.src = g... |
import base64
import logging
import urlparse
from integration_tests import chrome_proxy_metrics as metrics
from metrics import loading
from telemetry.core import util
from telemetry.page import page_test
class ChromeProxyLatency(page_test.PageTest):
"""Chrome proxy latency measurement."""
def __init__(self, *ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.