code stringlengths 1 199k |
|---|
"""
Boiler Pre-treatment for Heat Processing
At the moment, process heat is excluded form the optimization process.
It is considered that whenever the case, the most competitive alternative is to have a dedicated natural gas boiler
"""
import pandas as pd
from cea.technologies import boiler
from cea.technologies.consta... |
"""Get storage details for a virtual server."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Get storage details for a virtu... |
"""
Class for representing hierarchical language structures, such as
syntax trees and morphological trees.
"""
from __future__ import print_function, unicode_literals
import re
from nltk.grammar import Production, Nonterminal
from nltk.probability import ProbabilisticMixIn
from nltk.util import slice_bounds
from nltk.c... |
__version__ = '1.3.1' |
from senmolib.components.fusion import Fusion
import numpy as np
class exampleFusion(Fusion):
def fuse(self, arr):
print(len(arr))
hr_sp = np.ediff1d(arr)
bpm_mv_avg = 100/np.average(hr_sp) * 60
return bpm_mv_avg
exampleFusion(10,True).start() |
"""Handles low-level interfacing for files' tags. Wraps Mutagen to
automatically detect file types and provide a unified interface for a
useful subset of music files' tags.
Usage:
>>> f = MediaFile('Lucy.mp3')
>>> f.title
u'Lucy in the Sky with Diamonds'
>>> f.artist = 'The Beatles'
>>> f.save()
A f... |
import asyncio
import contextlib
import copy
import datetime
import io
import logging
import discord
import lifesaver
from discord.ext import commands
from lifesaver.utils import pluralize
from ruamel.yaml import YAML
from dog.formatting import represent
from .converters import UserReference
from .keeper import Keeper
... |
from __future__ import absolute_import # Python 2 only
import os
import os.path
import functools
import warnings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.conf import settings
from django.template import loader, RequestContext
from djang... |
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x05\xc3\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x18\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0\x77\x3d\xf8\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x0... |
import bpy
import sys
argv = sys.argv
argv = argv[argv.index("--") + 1:] # get all args after "--"
obj_out = argv[0]
if not bpy.ops.export_scene.xml3d:
sys.exit("XML3D Exporter script is not registered.")
bpy.ops.export_scene.xml3d(filepath=obj_out) |
import project.bar
import project.sub1
import bli
import sub2
import project.alien
import project.alien.alien2
import sub1.test |
__author__ = "Krios Mane"
__license__ = "GPL - https://opensource.org/licenses/GPL-3.0"
__version__ = "1.0"
import serial
import ConfigParser
import os
from fabtotum.os.paths import CONFIG_INI, SERIAL_INI
from fabtotum.fabui.config import ConfigService
configService = ConfigService()
''' Set the highest baudrate avail... |
import json
import os
import platform
import re
import subprocess
import sys
def _CheckNoIOStreamInHeaders(input_api, output_api):
"""Checks to make sure no .h files include <iostream>."""
files = []
pattern = input_api.re.compile(r'^#include\s*<iostream>',
input_api.re.MULTILINE)... |
import re
LANGUAGES = {
'Afrikaans': 'af',
'Albanian': 'sq',
'Arabic': 'ar',
'Asturian': 'ast',
'Basque': 'eu',
'Belarusian': 'be',
'Bosnian': 'bs',
'Breton': 'br',
'Bulgarian': 'bg',
'Catalan': 'ca',
'Cibemba': 'bem',
'Corsican': 'co',
'Croation': 'hr',
'Czech': ... |
from opus_core.resources import Resources
from opus_core.store.storage import Storage
from numpy import asarray, array, where, ndarray, ones, concatenate, maximum, resize, logical_and
from opus_core.misc import ematch, unique
from opus_core.variables.variable_name import VariableName
from opus_core.logger import logger... |
{
'name': 'partner_id_validation',
'version': '0.1',
'category': 'General',
'description': "Module that validates that sale orders, purchase orders and invoices are assigned a partner that is a company.",
'author': 'Moldeo Interactive',
'website': 'http://business.moldeo.coop/',
'images': []... |
from Tools.Directories import resolveFilename, SCOPE_SYSETC
from Components.Console import Console
import sys
import time
import re
from boxbranding import getImageVersion, getMachineBrand
from sys import modules
import socket, fcntl, struct
def getVersionString():
return getImageVersion()
def getImageVersionString():... |
import logging
log = logging.getLogger("Thug")
def SetAction(self, val):
self.__dict__['Action'] = val
if len(val) > 512:
log.ThugLogging.log_exploit_event(self._window.url,
"Myspace UPloader ActiveX",
"Overflow in Actio... |
__author__ = 'Markus Weber'
import Communicator
import Sensor
class SensorListe(list, object):
def __init__(self, iterableInput=None):
if not iterableInput:
iterableInput = []
for element in iterableInput:
self.append(element)
if iterableInput.count(element) > 1: ... |
import fnmatch
import glob
import optparse
import os
import platform
import re
import subprocess
import sys
import time
from optparse import OptionGroup
from optparse import OptionGroup
from optparse import OptionParser
from sys import stderr
from sys import stdout
class AbortError( Exception ):
def __init__( self,... |
"""
This module contains the BlockNotebook class.
"""
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from blockstreeview import BlocksTreeView
from harpia.system import System as System
class BlockNotebook(Gtk.Notebook):
"""
This class contains methods related the BlockNotebook class.
... |
"""empty message
Revision ID: 425d457e8385
Revises: 4bbc6d803aef
Create Date: 2016-06-02 14:05:46.102059
"""
revision = '425d457e8385'
down_revision = '4bbc6d803aef'
from alembic import op
import sqlalchemy as sa
from datetime import date
from sqlalchemy.sql import table, column
from sqlalchemy import String, Integer, ... |
__all__ = ["cpv_expand"]
from portage.exception import AmbiguousPackageName
from portage.localization import _
from portage.util import writemsg
from portage.versions import _pkgsplit
def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
"""Given a string (packagename or virtual) expand it into a valid
cat/pa... |
"""unused import"""
import xml.etree # [unused-import]
import xml.sax # [unused-import]
import os.path as test # [unused-import]
from sys import argv as test2 # [unused-import]
from sys import flags # [unused-import]
from collections import deque, OrderedDict, Counter
DATA = Counter()
from fake import SomeName, So... |
from math import *
import copy
class Heap(object):
"""最大二叉堆实现"""
def __init__(self, *arg):
super(Heap, self).__init__()
self.__array = list(arg)
self.length = len(arg)
self.height = int(log(self.length))
self.__build_heap()
@classmethod
def make_heap(cls, li):
... |
'''
Created on 27 Feb 2014
@author: Éric Piel
Copyright © 2014 Éric Piel, Delmic
This file is part of Odemis.
Odemis 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.
Odemis is distributed in the hope that... |
"""
Copyright (C) 2013, Digium, Inc.
Kevin Harwell <kharwell@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
URL = 'deviceStates'
DEVICE = 'Stasis:Test'
INITIAL_STATE = 'NOT_INUSE'
CHANGED_STATE = 'INUSE'
def on_start(ari, event, obj):
# add a ... |
from mutagen.id3 import ID3, Frames, Frames_2_2, TextFrame
class TCMP(TextFrame):
pass
class TSO2(TextFrame):
pass
class TSOC(TextFrame):
pass
class XDOR(TextFrame):
pass
class XSOP(TextFrame):
pass
class CompatID3(ID3):
"""
Additional features over mutagen.id3.ID3:
* iTunes' TCMP frame... |
from enigma import eConsoleAppContainer
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
class Console(Screen):
#TODO move this to skin.xml
skin = """
<screen position="100,100" size="550,400" title="Command execution..." >
<widget name="... |
from glob import glob
from astrometry.util.file import *
import numpy as np
from legacypipe.bits import IN_BLOB
indir = '/global/cscratch1/sd/dstn/dr9.3'
outdir = '/global/cscratch1/sd/dstn/dr9.3.1'
fns = glob(os.path.join(indir, 'checkpoints', '*', 'checkpoint-*.pickle'))
fns.sort()
for fn in fns:
outfn = fn.repla... |
from glob import glob
import os
import sys
import tempfile
import logging
import xkit.xutils
import xkit.xorgparser
import Quirks.quirkreader
import Quirks.quirkinfo
class QuirkChecker:
def __init__(self, handler, path='/usr/share/jockey/quirks'):
self._handler = handler
self.quirks_path = path
... |
from virtaal.models import StoreModel
from test_scaffolding import TestScaffolding
class TestStoreModel(TestScaffolding):
def test_load(self):
self.model = StoreModel(self.testfile[1], None) # We can pass "None" as the controller, because it does not have an effect on this test
self.model.load_file(... |
import pytest
class TestDcop:
@pytest.mark.complete("dcop ", require_cmd=True)
def test_1(self, completion):
assert completion |
__author__ = 'simranjitsingh'
from nltk.probability import FreqDist
from nltk.corpus import stopwords
import nltk.tag, nltk.util, nltk.stem
import re
import math
from decimal import *
import mysql.connector
import sys
import json
import string
from ConfigParser import SafeConfigParser
from nltk.tokenize import Whitespa... |
import threading
from subprocess import Popen, PIPE
import os
import shutil
import common as c
class TaskGenerator(threading.Thread):
"""
Thread to generate unique tasks using task generator scripts.
"""
####
# init
####
def __init__(self, name, queues, dbs, submission_mail, tasks_dir, \
... |
"""
Least recently used algorithm
"""
class Node(object):
"""
Node to be stored in the LRU structure
"""
def __init__(self, prev, value):
self.prev = prev
self.value = value
self.next = None
class LRU(object):
"""
Implementation of a length-limited O(1) LRU cache
"""
... |
a="hello"
print a.x |
"""
Shared resources for storing a possibly unlimited amount of objects supporting
requests for specific objects.
The :class:`Store` operates in a FIFO (first-in, first-out) order. Objects are
retrieved from the store in the order they were put in. The *get* requests of a
:class:`FilterStore` can be customized by a fil... |
import wx
class ButtonFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Button Example',
size=(300, 100))
panel = wx.Panel(self, -1)
self.button = wx.Button(panel, -1, "Hello", pos=(50, 20))
self.Bind(wx.EVT_TOGGLEBUTTON, self.OnClick, self.butto... |
"""
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
from nose.tools import eq_, timed
from pysimavr.avr import Avr
def test_avr():
avr = Avr(mcu='atmega48', f_cpu=8000000)
eq_(avr.f_cpu, 8000000)
eq_(avr.mcu, 'atmega48')
eq_(avr.pc, 0)
avr.step(1)
eq_(avr.pc, 2) |
../../../../share/pyshared/dbus/glib.py |
import os, sys
sys.path.append(os.environ['PYTHON_LIBPATH'])
DEBUG = os.getenv('DEBUG') or os.getenv('VERBOSE') or 0
DEBUG = int(DEBUG)
xtab_version = '0.1.3'
import proxy.tokenizer as tokenizer
xtab_error_status = 0
return_xtab_query = False
xtab_help_messages = (
('xtab - version ' + xtab_version + ' - (C) MySQL... |
import os
import unittest
from django.conf import settings
from django.db.models.loading import get_app
from django.contrib.staticfiles.finders import AppDirectoriesFinder
class TestStaticfiles(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# FIXME: Why test the configura... |
"""Classes and functions for interfacing with te923 weather stations.
These stations were made by Hideki and branded as Honeywell, Meade, IROX Pro X,
Mebus TE923, and TFA Nexus. They date back to at least 2007 and are still
sold (sparsely in the US, more commonly in Europe) as of 2013.
Apparently there are at least tw... |
import codecs
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
def __iter__(self):
return self
def next(self):
return self.reader.next().encode("u... |
"""
in nodetree_name s d='' n=2
in node_name s d='' n=2
in input_name s d='' n=2
out data s
"""
if nodetree_name and node_name and input_name:
data = bpy.data.node_groups[nodetree_name].nodes[node_name].inputs[input_name].sv_get() |
from __future__ import absolute_import
from .biobloomtools import MultiqcModule |
"""
GRIn is a program which computed a set of read's Genome Repeat Index (GRI). The
GRI is defined as being the proportion of k-mers in a set of read's k-mer
spectrum which are repetitive. All of this is explained in much more detail in
the paper accompanying this program (still being written as of this commit).
For an... |
import sys
import math
import cmath
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
def main():
# files having only one received block
files = ["rtl1.dat", "rtl2.dat", "rtl3.dat", "rtl4.dat"]
signals = []
index = 1;
for filename in files:
a = np.fromfile(filename, dtype=np.dtype("u1")... |
import bpy
from bpy.props import IntProperty, EnumProperty, StringProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, match_long_repeat
'''
- range exclusive n
Start, stop, step. Like range()
Start, step, count
See class unit tests for behaviours
'''
def intRange... |
from abc import abstractmethod
from ...plugins import PluginBase
class Painter(PluginBase):
"""
Mount point for plugins which refer to the painting of data, i.e.,
gridding a field to a mesh
Plugins of this type should provide the following attributes:
plugin_name : str
A class attribute that... |
"""
The API basically only provides one class. You can create a :class:`Script` and
use its methods.
Additionally you can add a debug function with :func:`set_debug_function`.
Alternatively, if you don't need a custom function and are happy with printing
debug messages to stdout, simply call :func:`set_debug_function` ... |
import sys
import os
from daemon import Daemon
from server import HydraServer
class HydraDaemon(Daemon):
def run(self):
server = HydraServer()
server.run_server()
if __name__ == '__main__':
HOMEDIR = os.path.expanduser('~')
pidfile = HOMEDIR + '/.hydra/hydra_server.pid'
outfile = HOMEDIR... |
"""Tests for qutebrowser.misc.msgbox."""
import pytest
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMessageBox, QWidget
from qutebrowser.misc import msgbox
from qutebrowser.utils import utils
@pytest.fixture(autouse=True)
def patch_args(fake_args):
fake_args.no_err_windows = False
def test_attributes(qt... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: get_url
short_description: Downloads files from HTTP, HTTPS, or FTP to node
description:
- Downloads files from HTTP, HTTPS, or FTP to the remote server. The remote
server I(must) have dire... |
from bottle import *
from xml.dom import minidom
import xml.etree.cElementTree as ET
import json
import datetime as dt
import sys
_startup_cwd = os.getcwd()
""" Bottle helper functions """
def raise404():
raise HTTPError(404, "Not found: " + repr(request.path))
def get_type(key, type):
if type == 'int':
return get_... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
statefile = "ventstate.html"
GPIO.setup(11, GPIO.OUT)
GPIO.output(11, False)
time.sleep(1)
GPIO.output(11, True)
FILE = open(statefile,"w")
FILE.writelines("Vent is is <b>CLOSED</b>")
FILE.close()
print 'Done\n' |
""" Mission 5-CORAL SURVEY
Set map border, size and origin
Set quadrants of interest
Do zigzag scouting to respective quadrants (perpetual)
If shape identified or duration timeout
Shape identified->set global parameter for gui
continue to next quadrant
If both shapes identified or total time exceeded, termina... |
from ladybug.config import folders
def test_config_init():
"""Test the initialization of the config module and basic properties."""
assert hasattr(folders, 'default_epw_folder')
assert isinstance(folders.default_epw_folder, str) |
import contextlib
import fnmatch
import imp
import itertools
import json
import os
import re
import StringIO
import subprocess
import sys
import colorama
import toml
import yaml
from licenseck import MPL, APACHE, COPYRIGHT, licenses_toml, licenses_dep_toml
CONFIG_FILE_PATH = os.path.join(".", "servo-tidy.toml")
config ... |
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p
import sys
from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
if sys.hexversion >= 0x03000000:
unicode_string = str
bytes_strin... |
from errno import ENOENT as NO_SUCH_FILE_OR_DIRECTORY
from glob import glob
import shutil
import gzip
import itertools
import locale
import os
from os import path
import platform
import re
import contextlib
import subprocess
from subprocess import PIPE
import sys
import tarfile
import zipfile
from xml.etree.ElementTree... |
from __future__ import unicode_literals
import requests
from django.db import models
from django.contrib.postgres import fields
from django.utils import timezone
from django.dispatch import receiver
from guardian.models import GroupObjectPermissionBase
from guardian.models import UserObjectPermissionBase
from .api_clie... |
from unittest import mock
from django.test import TestCase, override_settings
from osis_common.queue.queue_listener import SynchronousConsumerThread
@override_settings(
QUEUES={
'QUEUES_NAME': {
'QUEUE': 'NAME'
}
}
)
class WSGITestCase(TestCase):
@mock.patch.object(SynchronousCon... |
import math
from openerp.osv import osv, fields
import openerp.addons.product.product
class res_users(osv.osv):
_inherit = 'res.users'
_columns = {
'ean13' : fields.char('EAN13', size=13, help="BarCode"),
'pos_config' : fields.many2one('pos.config', 'Default Point of Sale', domain=[('state', '='... |
import cPickle as pkl
import numpy
import os
from classification_network import configureNetwork
from fluent.encoders.cio_encoder import CioEncoder
from fluent.models.classification_model import ClassificationModel
from fluent.utils.network_data_generator import NetworkDataGenerator
from nupic.data.file_record_stream i... |
from django.db import migrations
from oscar.core.loading import get_model
from ecommerce.core.constants import COUPON_PRODUCT_CLASS_NAME
ProductAttribute = get_model("catalogue", "ProductAttribute")
ProductClass = get_model("catalogue", "ProductClass")
def create_inactive_attribute(apps, schema_editor):
"""Create c... |
{
'name': 'Capture employee picture with webcam',
'version': '1.0',
'category': 'Generic Modules/Human Resources',
'description': """
HR WebCam
=========
Capture employee pictures with an attached web cam.
""",
'author': 'Michael Telahun Makonnen <mmakonnen@gmail.com>',
'website': 'http://mi... |
"""
This module bundles commonly used utility methods or helper classes that are used in multiple places withing
OctoPrint's source code.
"""
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import os
import traceback
import sys
import r... |
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 field 'SyncNode.date_last_seen'
db.add_column(u'core_syncnode', 'date_last_seen',
... |
{
"name": "Libro de IVA",
"version": "8.0.1.0.1",
"author": "PRAXYA, "
"Odoo Community Association (OCA)",
"website": "http://www.praxya.com",
"license": "AGPL-3",
"category": "Accounting",
"depends": [
'account',
'base_vat',
'l10n_es',
'l10n_es_... |
import sys
sys.path.append('../../lib/python')
import signal
import unittest
import datetime
import decimal
import socket
import threading
import struct
import subprocess
import time
import array
from voltdbclient import *
SERVER_NAME = "EchoServer"
decimal.getcontext().prec = 19
def signalHandler(server, signum, frame... |
import imp
import sys
def create_modules(module_path):
path = ""
module = None
for element in module_path.split('.'):
path += element
try:
module = __import__(path)
except ImportError:
new = imp.new_module(path)
if module is not None:
... |
import argparse
import json
import re
import sys
parser = argparse.ArgumentParser(
description="processes prediction json and var and updates json with other "
"mutations to display in the prediction report, and includes a "
"new category of lineage mutations. Includes a set of drugs and"
"gene names"
)... |
from datetime import date as real_date, datetime as real_datetime, timedelta
import dateutil.parser
import time
import re
try:
from dateutil import tz
except ImportError:
raise ImportError('Please install python-dateutil')
__all__ = ['local2utc', 'utc2local', 'LinearDateGuesser', 'date', 'datetime', 'new_date',... |
import setuptools
setuptools.setup() |
class Libksba(AutotoolsPackage):
"""Libksba is a library to make the tasks of working with X.509
certificates, CMS data and related objects easier.
"""
homepage = "https://gnupg.org/software/libksba/index.html"
url = "https://gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2"
maintainers = ['al... |
from itertools import count
import logging
import inspect
import copy
import re
from .settings import config
from .errors import DataJointError
from .fetch import Fetch, Fetch1
from .preview import preview, repr_html
from .condition import AndList, Not, \
make_condition, assert_join_compatibility, extract_column_na... |
"""SCons.Tool.lex
Tool-specific initialization for lex.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
__revision__ = "/home/scons/scons/branch.0/baseline/src/engine/SCons/Tool/lex.py 0.96.1.D001 2004/08/23 09:... |
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()
mobileTe... |
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()
mobileTe... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from opendai_bcn_web.models import Pollution
from opendai_bcn_web import views
from opendai_client.geocod... |
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()
mobileTe... |
from tethyscluster.logger import log
from completers import VolumeCompleter
class CmdRemoveVolume(VolumeCompleter):
"""
removevolume [options] <volume_id>
Delete one or more EBS volumes
WARNING: This command will *PERMANENTLY* remove an EBS volume.
Please use caution!
Example:
$ tethyscl... |
percol.view.PROMPT = ur"<blue>Input:</blue> %q"
percol.view.RPROMPT = ur"(%F) [%i/%I]"
percol.import_keymap({
"C-h" : lambda percol: percol.command.delete_backward_char(),
"C-d" : lambda percol: percol.command.delete_forward_char(),
"C-k" : lambda percol: percol.command.kill_end_of_line(),
"C-y" : lambd... |
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_HTTPError,
compat_http_client,
compat_urllib_error,
comp... |
controlsList=[
('Select From List', '//select'), # Get SELECTS
('Select Radio Button', '//input[@type="radio"]'), # Get RADIOS
('Select checkbox', '//input[@type="checkbox"]'), # Get CHECKBOXES
('Click button', '//input[@type="submit"]'), # Get... |
from oslo_config import cfg
from oslo_log import log as logging
from sahara import conductor as cond
from sahara import context
from sahara.i18n import _LI
from sahara.i18n import _LW
from sahara.plugins import provisioning as common_configs
from sahara.utils import cluster as c_u
CONF = cfg.CONF
LOG = logging.getLogge... |
"""
An EBS implementation of the ``IBlockDeviceAPI``.
"""
from subprocess import check_output
import threading
import time
import logging
from uuid import UUID
from bitmath import Byte, GiB
from pyrsistent import PRecord, field, pset
from zope.interface import implementer
from boto import ec2
from boto import config
fr... |
''' HTTP API extensions of COSC (versus ODL).
@author: Ken Jarrad (kjarrad@cisco.com)
'''
from __future__ import print_function as _print_function
from requests import post
from basics import odl_http
single_url_encode = odl_http.url_encode
double_url_encode = lambda val: single_url_encode(single_url_encode(val))
o... |
import os
import argparse
def generate_metricset(base_path, metricbeat_path, module, metricset):
generate_module(base_path, metricbeat_path, module, metricset)
metricset_path = base_path + "/module/" + module + "/" + metricset
meta_path = metricset_path + "/_meta"
if os.path.isdir(metricset_path):
... |
"""Worker utilities for representing MapTasks.
Each MapTask represents a sequence of ParallelInstruction(s): read from a
source, write to a sink, parallel do, etc.
"""
import collections
from apache_beam import coders
from apache_beam.runners import common
def build_worker_instruction(*args):
"""Create an object repr... |
from synapse.util.caches import register_cache
from collections import OrderedDict
import logging
logger = logging.getLogger(__name__)
class ExpiringCache(object):
def __init__(self, cache_name, clock, max_len=0, expiry_ms=0,
reset_expiry_on_get=False, iterable=False):
"""
Args:
... |
import datetime
import iso8601
import netaddr
from oslo_utils import timeutils
import six
from nova.network import model as network_model
from nova.objects import base as obj_base
from nova.objects import fields
from nova import test
class FakeFieldType(fields.FieldType):
def coerce(self, obj, attr, value):
... |
import mock
from trove.common.db import models
from trove.tests.unittests import trove_testtools
class DatastoreSchemaTest(trove_testtools.TestCase):
def setUp(self):
super(DatastoreSchemaTest, self).setUp()
self.dbname = 'testdb'
self.serial_db = {'_name': self.dbname,
... |
from __future__ import absolute_import
import mock
import time
import pytest
import opentracing
from opentracing import Format
class APICompatibilityCheckMixin(object):
"""
A mixin class for validation that a given tracer implementation
satisfies the requirements of the OpenTracing API.
"""
def trac... |
"""Implementation of Unix-like du command for cloud storage providers."""
from __future__ import absolute_import
import sys
from gslib.boto_translation import S3_DELETE_MARKER_GUID
from gslib.bucket_listing_ref import BucketListingObject
from gslib.command import Command
from gslib.command_argument import CommandArgume... |
"""Editor Plugin"""
import os
import os.path as osp
import re
import time
from qtpy import API, PYQT5
from qtpy.compat import from_qvariant, getopenfilenames, to_qvariant
from qtpy.QtCore import QByteArray, Qt, Signal, Slot
from qtpy.QtGui import QKeySequence
from qtpy.QtPrintSupport import QAbstractPrintDialog, QPrint... |
import unittest
from pants_test.contrib.python.checks.checker.plugin_test_base import CheckstylePluginTestBase
from pants.contrib.python.checks.checker.print_statements import PrintStatements
class PrintStatementsTest(CheckstylePluginTestBase):
plugin_type = PrintStatements
def test_print_override(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.