code stringlengths 1 199k |
|---|
SR = {
"taigaio_url": "https://taiga.io",
"social": {
"twitter_url": "https://twitter.com/taigaio",
"github_url": "https://github.com/taigaio",
},
"support": {
"url": "https://taiga.io/support",
"email": "support@taiga.io",
"mailing_list": "https://groups.google.c... |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
("podcasts", "0020_extend_episode_mimetypes"),
("contenttypes", "__first__"),
]
operations = [
migrations.AlterModelOptions(
name="episode", options={"ordering": ["-released"]... |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
... |
import odoo
from odoo.exceptions import UserError, AccessError
from odoo.tests import Form
from odoo.tools import float_compare
from .test_sale_common import TestCommonSaleNoChart
class TestSaleOrder(TestCommonSaleNoChart):
@classmethod
def setUpClass(cls):
super(TestSaleOrder, cls).setUpClass()
... |
import os
import sys
import logging
import openerp
import openerp.netsvc as netsvc
import openerp.addons.decimal_precision as dp
from openerp.osv import fields, osv, expression, orm
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from openerp import SUPERUSER_ID #, api
from ope... |
import re
from typing import Dict, Tuple, Pattern, ValuesView, Generator
def _patterns(
tag_characters: Dict[str, Tuple[str, str]], expanded: bool = False
) -> Dict[str, Pattern[str]]:
""" Generate compiled regexes from a set of tag characters. """
n: int = 2 if expanded else 1
template: str = r"(?<![\w... |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from healthmonitor.core import support
class TestLoginView(support.ViewTestCase):
def test_should_display_login_form(self):
with self.assertTemplateUsed('core/login.html'):
self.client.get(reverse('login'))
... |
from . import sale_goal
from . import res_partner |
"""
This module provides the GaborFilter class, which encapsulates a
complete gabor transform and provides functions to extract jets
at arbitrary points from images.
Basic example::
import numpy as np
import Image
from pulp.utils.gabor import GaborFilter
# Load image and convert into grayscale matrix
... |
{
'name': "Purchase picking",
'version': '1.0',
'category': 'purchase',
'description': """When a purchase order is confirmed, creates the associated moves without picking.""",
'author': 'Pexego Sistemas Informáticos',
'website': 'www.pexego.es',
"depends": ['base',
'purchase'... |
"""
Unit tests for LMS instructor-initiated background tasks helper functions.
- Tests that CSV grade report generation works with unicode emails.
- Tests all of the existing reports.
"""
import os
import shutil
from datetime import datetime
import urllib
import ddt
from freezegun import freeze_time
from mock import Mo... |
from django.contrib.admin import ModelAdmin
from django.contrib.admin.options import StackedInline
from django.forms import ModelForm
from django.urls import reverse_lazy
from judge.models import TicketMessage
from judge.widgets import HeavySelect2Widget, HeavySelect2MultipleWidget, HeavyPreviewAdminPageDownWidget
clas... |
from . import test_l10n_de_steuernummer |
{
"name": "openstc_achat_stock",
"version": "0.1",
"depends": ["purchase", "account_accountant", "product", "stock", "analytic", "account_budget", "openbase"],
"author": "PYF & BP",
"category": "Category",
"description": """
Module OpenSTC ACHAT - STOCKS pour collecticités territoriales.
... |
from django.db.models import Q
from django.contrib.auth.models import Group
from django.contrib.auth import authenticate
from django.utils.translation import ugettext as _
import rest_framework_jwt.settings
from rest_framework import serializers
from rest_framework.serializers import ValidationError
from rest_framework... |
from django.contrib import admin
from djecks.models import Deck, Case, Card
class CaseAdmin(admin.ModelAdmin):
list_filter = ('decks',)
class CardAdmin(admin.ModelAdmin):
list_filter = ('cases',)
admin.site.register(Deck)
admin.site.register(Case, CaseAdmin)
admin.site.register(Card, CardAdmin) |
from saylua.wrappers import login_required
from flask import render_template, flash, request
@login_required()
def customize():
if request.method == 'POST' and 'img' in request.form:
flash('Human avatar saved.')
return render_template("customize.html") |
import csv
import numpy as np
from scipy import interpolate
from matplotlib import pyplot as plt
with open('vetramham.csv','r') as file:
reader = csv.reader(file)
v1,t1,v2,t2 = list(reader)
with open('sc1_hamvet.csv','r') as file:
reader = csv.reader(file)
sc1v1,sc1t1,sc1v2,sc1t2 = list(reader)
with open('sc3_ham.c... |
import clinic_meeting
import clinic_medical_record
import res_partner
import clinic_medical_insurance
import clinic_room |
import gtk
import os
from random import randint
from db import db
from Timetableasy import app
from TreeMgmt import TreeMgmt
global interface_university
class UniversityInterface(object):
def __init__(self):
from GtkMapper import GtkMapper
mapper = GtkMapper('graphics/dialog_university.glade', self,
app.debu... |
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
from openerp import netsvc
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.osv import fields, orm
from openerp import models, fields, api
class hr_contract(orm.Model):
_name = 'hr.contract'
_inherit = ['... |
import imaplib
import pdb; pdb.set_trace()
server = "server"
port = 993
username = "admin@example.com"
password = "password"
inbox = "Inbox"
box = imaplib.IMAP4_SSL(server, port)
box.login(username, password)
box.select(inbox)
typ, data = box.search(None, 'ALL')
i = 0
for num in data[0].split():
box.store(num, '+FLA... |
import re
import nose
import random
import requests
import main
USERNAME = 'aloneroad@gmail.com'
PASSWORD = '123456'
app = main.app.test_client()
_multiprocess_can_split_ = True
def send_options_request(*args, **kwargs):
return app.open(*args, method='OPTIONS', **kwargs)
def send_get_request(*args, **kwargs):
retur... |
import logging
import os
import time
from peewee import Model, MySQLDatabase, SqliteDatabase, InsertQuery, IntegerField,\
CharField, DoubleField, BooleanField, DateTimeField,\
OperationalError
from datetime import datetime, timedelta
from base64 import b64encode
from . import confi... |
from datetime import datetime
from itertools import product
import logging
import re
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.http imp... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tasks', '0003_task_load'),
]
operations = [
migrations.AlterField(
model_name='task',
name='stat... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ppuser', '0003_auto_20150324_2143'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='set_profile',
... |
from odoo.tests.common import tagged
from .common import CommonBaseSequenceOption
@tagged("post_install", "-at_install")
class TestBaseSequenceTester(CommonBaseSequenceOption):
def test_sequence_options(self):
"""
Test 3 cases,
1. Default
2. Sequence Type A
3. Sequence Type B... |
from . import test_hr_contract_multi_jobs |
from __future__ import absolute_import
import argparse
import click
import json
import os
import pkg_resources
import platform
import signal
import sys
from twisted.python.reflect import qual
from autobahn.twisted.choosereactor import install_reactor
import crossbar
from crossbar._logging import make_logger
try:
im... |
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import redirect
from django.views.generic import CreateView, FormView
from django.contrib import messages
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth import update_session_auth_hash
from app.views import LoginR... |
from django.shortcuts import render
from django.http import HttpResponse
def carddeck(request):
return render(request, 'carddeck.html', {}) |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .base_codelist import BaseCodelist
class TransactionType(BaseCodelist):
name = models.CharField(_('name'), max_length=300, blank=True, null=False)
description = models.TextField(_('description'), blank=True, null=False)
... |
'''
Copyright (C) 2018 The Board of Trustees of the Leland Stanford Junior
University.
Copyright (C) 2016-2018 Vanessa Sochat.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 o... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seqr', '0060_matchmakerresult_match_removed'),
]
operations = [
migrations.AddField(
model_name='... |
import functools
import operator
from typing import Optional, List, Dict, Set
import attr
from django.db import connection
from django.db.models import F, Case, CharField, Value, When, BooleanField, ExpressionWrapper, DateField, Q, OuterRef, \
Subquery
from django.db.models.functions import Coalesce, Cast, Concat, ... |
import socket
import json
global sock
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def createServer(port):
sock.bind(('', port))
global clientList
clientList = []
return True
def send(type, value, client):
sock.sendto(json.dumps({"type": type, "val": value}).encode(), client)
return T... |
from sense_hat import SenseHat
sense = SenseHat()
sense.show_message("T:%s " % round(sense.temp,1))
sense.show_message("H:%s " % round(sense.humidity,1))
sense.show_message("P:%s " % round(sense.pressure,1)) |
from django.test import TestCase
from monki.boards.tests import factories
from monki.boards.models import Board, Category
class BoardTestCase(TestCase):
def test_str(self):
board = factories.BoardFactory.build(name='Lorem Ipsum', directory='li')
self.assertEqual(board.__str__(), '/li/ - Lorem Ipsum'... |
from django import template
register = template.Library()
from documentation.titles import page_titles
@register.simple_tag
def doc_link_full(template_name, language, title=None, text=None):
template_name = template_name.replace('LANG', language)
if not text:
text = page_titles[template_name][0]
if ... |
{
"name": "Quality partner",
"summary": "This module adds the logic to classify and evaluate the partner performance",
"version": "14.0.1.0.0",
"category": "Website",
"author": "NuoBiT Solutions, S.L., Eric Antones",
"website": "https://github.com/nuobit/odoo-addons",
"license": "AGPL-3",
... |
import arrow
import datetime
import calendar
from json import JSONEncoder, dumps
from flask import Response
from inbox.models import (Message, Contact, Calendar, Event, When,
Thread, Namespace, Block, Tag)
from inbox.models.event import RecurringEvent, RecurringEventOverride
def format_address... |
from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import redpanal.utils.models
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependencies = [
('taggit', ... |
from __future__ import unicode_literals
import json
import urllib2
import socket
import requests
import urlparse
import itertools
import datetime
import locale
import pprint
import logging
import decimal
import hashlib
import cStringIO
import time
import ssl
import messytables
from slugify import slugify
import ckanser... |
from twisted.python import log
from bottle import Bottle
from bottle import request
from bottle import response
from bottle import redirect
from bottle import static_file
from bottle import mako_template as render
from tablib import Dataset
from toughradius.console.websock import websock
from toughradius.console import... |
import datetime
import logging
import mock
import unittest
import handlers.common.token
import models.token as mtoken
class TestCommonToken(unittest.TestCase):
def setUp(self):
super(TestCommonToken, self).setUp()
logging.disable(logging.CRITICAL)
self.token = mtoken.Token()
def tearDown... |
"""Test of the fix for bug 511389."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.AssertPresentationA... |
import logging
import mock
import pytest
from leapp.repository.actor_definition import ActorDefinition, ActorInspectionFailedError, MultipleActorsError
from leapp.exceptions import UnsupportedDefinitionKindError
from leapp.repository import DefinitionKind
_FAKE_META_DATA = {
'description': 'Fake Description',
'... |
import sys
from struct import pack,unpack
from time import time
from sets import Set
from cStringIO import StringIO
from threading import currentThread
from socket import gethostbyname
from traceback import print_exc,print_stack
from Tribler.Core.BitTornado.__init__ import createPeerID
from Tribler.Core.BitTornado.BT1.... |
"""Type enforcement rule query unit tests."""
import unittest
from setools import SELinuxPolicy, TERuleQuery
from setools import TERuletype as TRT
from . import mixins
class TERuleQueryTest(mixins.ValidateRule, unittest.TestCase):
"""Type enforcement rule query unit tests."""
@classmethod
def setUpClass(cls... |
from fmn.lib.hinting import hint, prefixed as _
@hint(categories=['github'])
def github_catchall(config, message):
""" All Fedora-related GitHub activity
Adding this rule will indiscriminately match notifications of all types
from `github <https://github.com>`__ (but only the repositories that are
mappe... |
import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNUMirrorPackage):
"""GNU Octave is a high-level language, primarily intended for numerical
computations.
It provides a convenient command line interface for solving linear and
nonlinear ... |
"""
Implementation of a DataFlow Manager based on the original SKA SDP architecture.
""" |
from rez import __version__, module_root_path
from rez.package_repository import package_repository_manager
from rez.solver import SolverCallbackReturn
from rez.resolver import Resolver, ResolverStatus
from rez.system import system
from rez.config import config
from rez.util import shlex_join, dedup
from rez.utils.sour... |
from nose.tools import assert_equal, assert_not_equals
from nose import SkipTest
from Goulib.tests import *
from Goulib.itertools2 import *
class TestTake:
def test_take(self):
assert_equal(take(3, irange(1,10)),[1,2,3])
class TestIndex:
def test_index(self):
assert_equal(index(4, irange(1,10)),... |
import os
import sys
from unittest.mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
def __getattribute__(self, item):
return MagicMock()
MOCK_MODULES = ['mdtraj',
'pyemma',
'pyemma.util',
... |
import sys
import time
import smbus
import FXOS8700CQR1 as imuSens
from ctypes import *
imuSens = imuSens.FXOS8700CQR1() #Configure chip in hybrid mode
def main():
id = imuSens.getID() #Verify chip ID
print "Chip ID: 0x%02X. \r\n" % id
imuSens.standbyMode()
# imuSens.writeByte(0x0B,0x01) #Set to wake up
im... |
"""This module takes care of the actual image creation process.
Each formula is saved as an image, either as PNG or SVG. SVG is advised, since
it is a properly scalable format.
"""
import enum
import os
import re
import shutil
import subprocess
import sys
from .typesetting import LaTeXDocument
DVIPNG_REGEX = re.compile... |
import os
import re
import pyblish.api
@pyblish.api.log
class CollectContextVersion(pyblish.api.Selector):
"""Finds version in the filename or passes the one found in the context
Arguments:
version (int, optional): version number of the publish
"""
order = pyblish.api.Selector.order + 0.1
... |
from textwrap import dedent
try:
import unittest2 as unittest
except ImportError:
import unittest
from rope.base import exceptions
from rope.contrib import generate
from ropetest import testutils
class GenerateTest(unittest.TestCase):
def setUp(self):
super(GenerateTest, self).setUp()
self.p... |
import Adafruit_BBIO.GPIO as GPIO
import time
button="P8_9" # PAUSE=P8_9, MODE=P8_10
LED ="USR3"
GPIO.setup(LED, GPIO.OUT)
GPIO.setup(button, GPIO.IN)
print("Running...")
while True:
state = GPIO.input(button)
GPIO.output(LED, state)
GPIO.wait_for_edge(button, GPIO.BOTH)
print("Pressed") |
import tubex_lib
print('Tubex version: ', tubex_lib.__version__)
from tubex_lib import *
import timeit
time_sum = 0
for i in range(0, 100000):
x = IntervalVector([[2,2.5],[0,0.5],[1.5,2.5],[4,11],[7,8]])
start = timeit.default_timer()
ctc.dist.contract(x) # contractor from Tubex
time_sum += timeit.default_timer... |
from fenrirscreenreader.core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('enables or disables announcement of emoticons instead of chars')
... |
import res_partner
import res_company
import account_invoice
import amount_to_text_bg
import comment
import account_tax |
'''
Created on 2015年2月3日
文字的單詞化
@author: Guan-yu Willie Chen
'''
import re
from collections import namedtuple
NAME = r"(?P<NAME>[a-zA-Z_][a-zA-Z_0-9]*)"
NUM = r"(?P<NUM>\d+)"
PLUS = r"(?P<PLUS>\+)"
TIMES = r"(?P<TIMES>\*)"
EQ = r"(?P<EQ>=)"
WS = r"(?P<WS>\s+)"
Token = namedtuple("Token", ["type", "value"])
def sample()... |
import ifcopenshell
import ifcopenshell.util.element
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"product": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
if self.settings["product"].i... |
import requests
import json
from ..base import ShopifyApiWrapper, datetime_to_string, ShopifyApiError
class FulfillmentsApiWrapper(ShopifyApiWrapper):
max_results_limit = 250
list_endpoint = '/admin/orders/{}/fulfillments.json'
def list(self, id_, limit=50, page=1, since_id=None, created_at_min=None, create... |
import unittest
import modular
class TestStack(unittest.TestCase):
def test_cases(self):
self.assertEqual(modular.stack('a b'), ['a b'])
self.assertEqual(modular.stack('a;b;c'), ['a', 'b', 'c'])
self.assertEqual(modular.stack('a;;b;c'), ['a;b', 'c'])
self.assertEqual(modular.stack('a... |
import datetime
from bitmovin import Bitmovin, Encoding, S3Output, H264CodecConfiguration, AACCodecConfiguration, H264Profile, \
StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, MuxingStream, \
S3Input, FairPlayDRM, TSMuxing, HlsManifest, AudioMedia, VariantStream
from bitmovin.error... |
from rest_framework import generics
from test_project.test_app.models import Promo
class APIPromoSingleView(generics.RetrieveAPIView):
model = Promo
class APIPromoListView(generics.ListAPIView):
model = Promo |
import time
import click
import sys, os
import threading
import screenmanager
from display import disp
class Keymanager:
def run(self):
while True:
if 'key' in locals():
print "Taste: " + key
if(key == "c"):
print "Beende Programm..."
... |
"""
A fake server that "responds" to API methods with pre-canned responses.
All of these responses come from the spec, so if for some reason the spec's
wrong the tests might raise AssertionError. I've indicated in comments the
places where actual behavior differs from the spec.
"""
import json
import requests
import si... |
"""
UI Interface definition
"""
__program__ = "photoplace"
__author__ = "Jose Riguera Lopez <jriguera@gmail.com>"
__version__ = "0.6.1"
__date__ = "Dec 2014"
__license__ = "Apache 2.0"
__copyright__ ="(c) Jose Riguera"
import os
import sys
class InterfaceUI(object):
"""
Interface for PhotoPlace UI's
"""
... |
from pyvows import Vows, expect
from dopplr.solr.query import Highlighting
@Vows.batch
class AHighlightingQuery(Vows.Context):
class WithRequiredParams(Vows.Context):
def topic(self):
return Highlighting(['title']).get_params()
def mustActivateHighlighting(self, topic):
expec... |
'''
Common exponential and logarithmic non-terminal functions and symbols:
- (LN ) ln_op: math.log(x)
- (LOG10) log10_op: math.log10(x)
- (^ ) power_op: x ** y
- (E^ ) exp_op: e ** x
- (10^ ) pow10_op: 10 ** x
- (^2 ) square_op: x ** 2
- (^3 ) cube_op:... |
import pandas as pd
import hillmaker as hm
file_stopdata = '../data/ShortStay.csv'
scenario = 'sstest_60'
in_fld_name = 'InRoomTS'
out_fld_name = 'OutRoomTS'
cat_fld_name = 'PatType'
start = '1/1/1996'
end = '3/30/1996 23:45'
bin_mins = 120
output_path = './output'
df = pd.read_csv(file_stopdata, parse_dates=[in_fld_na... |
from scipy import ndimage
import tensorflow as tf
from spatial_transformer import AffineTransformer
import numpy as np
import scipy.misc
im = ndimage.imread('data/cat.jpg')
im = im / 255.
im = im.astype('float32')
batch_size = 4
batch = np.expand_dims(im, axis=0)
batch = np.tile(batch, [batch_size, 1, 1, 1])
x = tf.pla... |
"""
Created on Wed Sep 27 17:43:39 2017
@author: eduardo
"""
import data.cbis_standart_format as cbis_standart_format
import data.inbreast_standard_format as inbreast_standard_format
import simple_data_processor
import train_loop
import pickle as pkl
import os
"""
PRE DATA PROCESSING
"""
def get_path_predata(dataset,in... |
from __future__ import absolute_import
from flask import current_app
from changes.api.serializer import Crumbler, register
from changes.config import db
from changes.models.option import ItemOption
from changes.models.revision import Revision
@register(Revision)
class RevisionCrumbler(Crumbler):
def get_extra_attrs... |
from unittest import mock
from neutronclient.common import exceptions as qe
from heat.common import exception
from heat.engine.clients.os import neutron
from heat.engine.clients.os.neutron import lbaas_constraints as lc
from heat.engine.clients.os.neutron import neutron_constraints as nc
from heat.tests import common
f... |
import logging
import numpy as np
import gym
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.models.torch.misc import SlimFC, AppendBiasLayer, normc_initializer
from ray.rllib.utils.annotations import override
from ray.rllib.utils.framework import try_import_torch
from ray.rllib.utils.typin... |
import copy
import mock
import testtools
from mock import call
from openstackclient.common import exceptions
from openstackclient.common import utils as common_utils
from openstackclient.compute.v2 import server
from openstackclient.tests.compute.v2 import fakes as compute_fakes
from openstackclient.tests import fakes
... |
"""Interface to find and create the Faucet ACL rules, form an external source (file, db)
yaml keys "_authport_*, and values "_usermac_" are currently used for replacing with values
as discovered at runtime.
Switchport (_authport_) that an authenticated user (_usermac_) has authenticated on & with.
TODO maybe make this... |
from django.db import models
from django.conf import settings
class Volunteer(models.Model):
email = models.EmailField(null=False)
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
date_of_birth = models.DateField()
city = models.CharField(max_length=50)
su... |
"""Tests for tensorflow_transform.mappers."""
import numpy as np
import tensorflow as tf
from tensorflow_transform import mappers
from tensorflow_transform import test_case
mock = tf.compat.v1.test.mock
class MappersTest(test_case.TransformTestCase):
def assertSparseOutput(self, expected_indices, expected_values,
... |
from __future__ import absolute_import
from __future__ import print_function
import json
import os
from happy.Utils import *
options = {}
options["quiet"] = False
options["file_path"] = None
options["output_data"] = None
def option():
return options.copy()
class TestrailResultOutput():
def __init__(self, opts=o... |
"""Support for Belkin WeMo lights."""
import asyncio
from datetime import timedelta
import logging
import async_timeout
from homeassistant import util
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,... |
"""Plotting functions."""
from .time_series import plot_time_series, plot_bursts, plot_instantaneous_measure
from .filt import plot_filter_properties, plot_frequency_response, plot_impulse_response
from .rhythm import plot_swm_pattern, plot_lagged_coherence
from .spectral import (plot_power_spectra, plot_spectral_hist,... |
import exceptions as exc
import glob
import shutil
import sys
import time
from logger import logger
from perfrunner.helpers.cbmonitor import CbAgent
from perfrunner.helpers.experiments import ExperimentHelper
from perfrunner.helpers.memcached import MemcachedHelper
from perfrunner.helpers.metrics import MetricHelper
fr... |
"""
Fileutils.py: A collection of file utilities for Graphyne
"""
__author__ = 'David Stocker'
__copyright__ = 'Copyright 2016, David Stocker'
__license__ = 'MIT'
__version__ = '1.0.0'
__maintainer__ = 'David Stocker'
__email__ = 'mrdave991@gmail.com'
__status__ = 'Production'
import types
import re
import sys
impor... |
"""
File mutex module
"""
import time
import fcntl
import os
import stat
class FileMutex(object):
"""
This is mutex backed on the filesystem. It's cross thread and cross process. However
its limited to the boundaries of a filesystem
"""
def __init__(self, name, wait=None):
"""
Create... |
"""This module contains the general information for AdaptorEthRdmaProfile ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class AdaptorEthRdmaProfileConsts:
pass
class AdaptorEthRdmaProfile(ManagedObject):
"""This is Adapt... |
"""
Copyright 2012 Pontiflex, Inc.
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 JumpScale import j
import os
import gzip
import pwd
import grp
class StorScripts():
# create hexa directory tree
# /00/00, /00/01, /00/02, ..., /ff/fe, /ff/ff
def initTree(self, root):
return """
import os
root = "%s"
for a in range(0, 256):
lvl1 = os.path.jo... |
import os.path
import subprocess
from velstor.restapi import namespace
from velstor.pcapi.exceptions import RESTException
class Volume:
"""
Represents a VP mounted on the local filesystem.
"""
def __init__(self, session, mount_point, workspace):
"""
Uploads the workspace to the vtrq and ... |
import json
import yaml
from ciscoconfparse import CiscoConfParse
parse_file = CiscoConfParse("kirks_config.conf")
interface_objs = parse_file.find_objects("^crypto map CRYPTO")
for obj in interface_objs:
print obj.parent
print obj.children |
from datemike.base import ModuleBase
__all__ = [
'CloudServer', 'CloudLoadBal', 'CloudLoadBalNodes', 'CloudDnsRecord',
'CloudDns', 'CloudFilesContainer', 'CloudFilesObjects', 'CloudKeypair',
'CloudFacts', 'CloudNetwork', 'CloudQueue', 'CloudServersAddHosts'
]
class CloudBase(ModuleBase):
def __init__(
... |
from django.views.generic import View
from django.conf.urls import patterns, url
import os, sys
import inspect
import importlib
sys_path_save = sys.path
try:
# __import__() and importlib.import_module() both import modules from
# sys.path. So we make sure that the path where we can find the views is
# the f... |
"""Test the flow archive."""
import os
import mock
from grr.gui import api_call_handler_utils
from grr.gui import api_call_router_with_approval_checks
from grr.gui import gui_test_lib
from grr.gui import runtests_test
from grr.gui.api_plugins import flow as api_flow
from grr.lib import action_mocks
from grr.lib import ... |
from __future__ import absolute_import
from __future__ import unicode_literals
import math
class Snapshot(object):
"""A snapshot of a reservoir state.
Translated from Snapshot.java
"""
def __init__(self, values=None):
if values is None:
self.values = []
else:
self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.