text stringlengths 12 6.59M |
|---|
'''
Classes that manage file clients
'''
# Import python libs
import contextlib
import logging
import hashlib
import os
import shutil
import string
import subprocess
# Import third party libs
import yaml
# Import salt libs
from salt.exceptions import MinionError, SaltReqTimeoutError
import salt.client
import salt.cr... |
'''
Classes that manage file clients
'''
# Import python libs
import contextlib
import logging
import hashlib
import os
import shutil
import string
import subprocess
# Import third party libs
import yaml
# Import salt libs
from salt.exceptions import MinionError, SaltReqTimeoutError
import salt.client
import salt.cr... |
# -*- coding: utf-8 -*-
'''
Wrapper module for at(1)
Also, a 'tag' feature has been added to more
easily tag jobs.
'''
from __future__ import absolute_import
# Import python libs
import re
import time
import datetime
# Import 3rd-party libs
# pylint: disable=import-error,redefined-builtin
from salt.ext.six.moves imp... |
'''
A salt interface to psutil, a system and process library.
See http://code.google.com/p/psutil.
:depends: - psutil Python module
'''
# Import python libs
import sys
import time
# Import third party libs
try:
import psutil
HAS_PSUTIL = True
except ImportError:
HAS_PSUTIL = False
def __virtual__():
... |
'''
Package Management
==================
Salt can manage software packages via the pkg state module, packages can be
set up to be installed, latest, removed and purged. Package management
declarations are typically rather simple:
.. code-block:: yaml
vim:
pkg:
- installed
'''
import logging
from di... |
import enum
from .exception import *
__all__ = (
'KEY_LENGTH',
'NONCE_LENGTH',
'NONCE_FORMATTER',
'COOKIE_LENGTH',
'HASH_LENGTH',
'RELAY_TIMEOUT',
'KEEP_ALIVE_TIMEOUT',
'KEEP_ALIVE_INTERVAL',
'SubProtocol',
'CloseCode',
'AddressType',
'MessageType',
'available_slot_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import json
import socket
import logging
import requests
import threading
import http.server
import socketserver
import urllib.parse
import tgcli
from itsdangerous import URLSafeTimedSerializer
RE_INVALID = re.compile("[\000-\0... |
# Copyright (c) 2016, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Class for handling asynchronous connections to a blockchain
daemon.'''
import asyncio
import json
import aiohttp
import lib.util as util
class DaemonE... |
from __future__ import division
import numpy as np
import networkx as nx
import pylab as p
import scipy.stats as st
import tables as t
import random
from math import log, exp, pi, lgamma
from numpy import log2
class TreeNet():
def __init__(self, numnodes, data=None, template=None, priorweight=1.0,
g... |
from __future__ import print_function, unicode_literals
from collections import defaultdict
from binascii import hexlify
from attr import attrs, attrib
from attr.validators import instance_of, provides, optional
from automat import MethodicalMachine
from zope.interface import implementer
from twisted.internet.task impo... |
import unittest
from hashlib import sha256
from pypeerassets.kutil import Kutil
class KutilTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('''Starting Kutil class tests.
This class handles all things cryptography.''')
def test_network_parameter_load(self):
... |
#!/usr/bin/env python
from __future__ import division
import re, sys, math
def usage():
print '''\
Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p]
[-s <system>] [-r <runs> ] [-u <username>] <command> [command args]
''' % sys.argv[0]
sys.exit(1)
def getopts(list, flags):
import getopt
... |
#!/usr/bin/env python
import sys
# import warnings # Uncomment this if you want to treat warnings as errors.
from utilBMF.HTSUtils import printlog as pl, TrimExt
from MawCluster.FFPE import TrainAndFilter, FilterByDeaminationFreq
# from pudb import set_trace
"""
bmftools contains various utilities for barcoded reads... |
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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 of the License, or
# (at your option) any later version.
#
# OpenQuake is distri... |
import csv
import datetime
from dateutil.parser import parse
from value_maps import ethnicity, war_participated
from api.models import Client
from api.models import Services
def sync_client():
with open('sample_data/client.csv') as csvfile:
reader = csv.DictReader(csvfile)
bulk_create = []
... |
import unittest
import os
import re
import overrides_hack
from utils import create_sparse_tempfile, create_nvmet_device, delete_nvmet_device, setup_nvme_target, teardown_nvme_target, find_nvme_ctrl_devs_for_subnqn, find_nvme_ns_devs_for_subnqn, fake_utils, fake_path, run_command, run, TestTags, tag_test
from gi.reposi... |
#!/usr/bin/env python
import yaml
import os
import os.path
import subprocess
def run(cmd, **kwargs):
print repr(cmd), repr(kwargs)
subprocess.check_call(cmd, **kwargs)
test_root = os.path.dirname(__file__)
test_root = os.path.realpath(test_root)
test_specs_dir = os.path.join(test_root, 'specs')
test_tmp = o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
def literalize(content, is_unicode=False):
'''Literalize the content.
Examples:
>>> print literalize('str')
'str'
>>> print literalize('\'str\'')
"'str'"
>>> print literalize('\"\'str\'\"')
'"\'str\'"'
'''
quote_mark = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
def literalize_string(content, is_unicode=False):
r'''Literalize a string content.
Examples:
>>> print literalize_string('str')
'str'
>>> print literalize_string('\'str\'')
"'str'"
>>> print literalize_string('\"\'str\'\"')
'"\'... |
#!/usr/bin/env python
"""
Author: Nitesh Turaga
Email: nturaga1 at jhu dot edu
Please contact me for any questions regarding this abstract and code.
This script works entirely in the user specified folder:
1. Clones the BIOCONDUCTOR REPOSITORY in the folder
2. Creates an archive in the same specified folder.
3. If t... |
#!/usr/bin/env python
__all__ = ['nicovideo_download']
from ..common import *
def nicovideo_login(user, password):
data = "current_form=login&mail=" + user +"&password=" + password + "&login_submit=Log+In"
response = request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", he... |
#!/usr/bin/env python
__all__ = ['universal_download']
from ..common import *
from .embed import *
def universal_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
try:
content_type = get_head(url, headers=fake_headers)['Content-Type']
except:
content_type = get_head(url, h... |
class GetUserInfoOnException(object):
def process_exception(self, request, exception):
if request.user.is_authenticated():
request.META['CURRENT_USER'] = '%s: %s' % \
(request.user.pk, request.user.username)
|
# -*- coding: utf-8 -*-
"""
ZUGBRUECKE
Calling routines in Windows DLLs from Python scripts running on unixlike systems
https://github.com/pleiszenburg/zugbruecke
src/zugbruecke/core/arg_contents.py: (Un-) packing of argument contents
Required to run on platform / side: [UNIX, WINE]
Copyright (C) 2017 Sebastian... |
import time, cjson
from request import *
def listCatalogs(serverURL):
return jsonRequest(pycurl.Curl(), "GET", serverURL + "/catalogs")
def openCatalog(serverURL, catalog, user=None, password=None):
return Catalog(serverURL + catalog, user, password)
class Catalog:
def __init__(self, url, user=None, pass... |
# -*- coding: utf-8 -*-
# Zinc dumping and parsing module
# (C) 2016 VRT Systems
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
import hszinc
from hszinc.pintutil import to_pint
import datetime
import pytz
import random
import string
import six
STR_CHARSET = string.ascii_letters + string.digits + '\n\r\t\f\b'
def gen_ran... |
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from matplotlib import pyplot as plt
from matplotlib import gridspec
import numpy as np
from .fit import linear_fit, linear_fun, align
def mask(xs, mask_xs, invert=False):
'''Create mask from ranges. Mask... |
import os
import subprocess
from utop.lib.dataobject import DataObject
class Process(DataObject):
def __init__(self, pid, uid, *args, **kwargs):
"""
Creates a Process object from the data of various files in /proc/<pid>/
"""
self.pid = pid
self.uid = uid
super().... |
import asyncio
import os
import uuid
import logging
import pytest
import shortuuid
import time
import unittest
import aio_pika
import aio_pika.exceptions
from copy import copy
from aio_pika import connect, connect_url, Message, DeliveryMode
from aio_pika.exceptions import ProbableAuthenticationError, MessageProcessErro... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
import time
import base64
import unittest
import storjcore
from btctxstore import BtcTxStore
class TestAuth(unittest.TestCase):
def setUp(self):
self.btctxstore = BtcTxStore()
self.sender_wif = self.btctxstore.create_key()
self.sender = self.btctxstore.get_address(self.sender_wif)
... |
__all__ = ['shortest_simple_paths', 'bfs_search', 'find_sources',
'get_path_iter', 'bfs_search_multiple_nodes']
import sys
import logging
from collections import deque
from copy import deepcopy
import networkx as nx
import networkx.algorithms.simple_paths as simple_paths
from heapq import heappush, heappop... |
import asyncio
import logging
import threading
import time
import uvloop
from unittest import mock
from uvloop._testbase import UVTestCase, AIOTestCase
class _TestBase:
def test_close(self):
self.assertFalse(self.loop.is_closed())
self.loop.close()
self.assertTrue(self.loop.is_closed())... |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tests.test_main
~~~~~~~~~~~~~~~
Provides main unit tests.
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import sys
import nose.tools as nt
import pygogo as gogo
from builtins import *
sys.path.... |
from vcfkit import calc
from subprocess import Popen, PIPE
import hashlib
from test import Capturing, terminal
def test_sample_hom_gt():
with Capturing() as out:
calc.main(["calc", "sample_hom_gt", "data/test.vcf.gz"])
assert out[0] == 'sample\tfreq_of_gt\tn_gt_at_freq'
assert out[10] == 'QG536\t10... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
import pytest
from rocketchat_API.APIExceptions.RocketExceptions import RocketMissingParamException
def test_chat_post_notext_message(logged_rocket):
chat_post_message = logged_rocket.chat_post_message(None, channel="GENERAL").json()
assert chat_post_message.get("channel") == "GENERAL"
assert chat_post_m... |
# coding=utf-8
"""
Cmd2 unit/functional testing
Copyright 2016 Federico Ceratto <federico.ceratto@gmail.com>
Released under MIT license, see LICENSE file
"""
import os
import sys
import io
import tempfile
import mock
import pytest
import six
from code import InteractiveConsole
# Used for sm.input: raw_input() for P... |
import sys
import os
import os.path
import re
import readline
import shlex
try:
import swiftclient as cloud
except ImportError:
print
"OpenStack Swift python API package are needed, download at:"
"swiftclient https://github.com/openstack/python-swiftclient.git"
sys.exit(1)
import swiftclient as cloud... |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... |
import re
import datetime
from datetime import timedelta
from urllib2 import urlopen
from pandas import DataFrame, concat, date_range, read_csv
class Lime:
'''
A simple API for extracting stock tick data
'''
def __init__(self, file_format='csv', *args, **kwargs):
df = DataFrame.from_items([('A... |
"""AWS Elasticsearch Service.
Blueprint to configure AWS Elasticsearch service.
Example::
- name: elasticsearch
class_path: stacker_blueprints.elasticsearch.Domain
variables:
Roles:
- ${empireMinion::IAMRole}
InternalZoneId: ${vpc::InternalZoneId}
InternalZoneName: $... |
####################################
# Driftwood 2D Game Dev. Suite #
# inputmanager.py #
# Copyright 2014 PariahSoft LLC #
# Copyright 2017 Michael D. Reiley #
# & Paul Merrill #
####################################
# **********
# Permission is hereby granted, free of charge,... |
import collections
from unittest import mock
import pytest
import requests
import omgorm as orm
@pytest.fixture
def resource(SessionSubclass):
class Post(orm.Resource, session_cls=SessionSubclass):
title = orm.Field()
body = orm.Field()
user = orm.Field()
return Post
class TestFi... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 EIA-FR (https://eia-fr.ch/)
# Copyright (C) 2014 The DoMo Team (https://launchpad.net/~domo)
# Luis Domingues & Romain Monnard
#
# This program is free software: you can redistribute... |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... |
# -*- coding: utf-8 -*-
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------... |
# Copyright (c) 2016 - Bryan Worrell
# For license information, see the LICENSE file
"""
Not really unit tests. Just smoke testing.
"""
import time
import logging
import unittest
import threading
from narcolepsy import narcoleptic
LOG = logging.getLogger(__name__)
class DecoratorTests(unittest.TestCase):
def t... |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... |
# -*- coding: utf-8 -*-
import os
import unittest
from kisell import core
_license_file_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'LICENSE'
)
_license_file_content = None
with open(_license_file_path, 'r') as f:
_license_file_content = f.read()
class BaseTester(unittest.TestCase):
... |
#!/usr/bin/env python3
import csv
import glob
import os
import pandas
import pytest
import re
import unittest
columns = ['candidate', 'county', 'district', 'office', 'votes']
@pytest.mark.parametrize("year,date,election_type", [
("2014", "0603", "primary"),
("2014", "1104", "general"),
("2015", "0317",... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
test_dibs
----------------------------------
Tests for `dibs` module.
'''
from dibs.models import Item
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
import pytest
pytestmark = pytest.mark.django_db
UserModel = get_... |
import pytest
from marshmallow import Schema, fields, validate
from marshmallow_jsonschema import JSONSchema, UnsupportedValueError
from marshmallow_jsonschema.compat import dot_data_backwards_compatible
from . import UserSchema, validate_and_dump
def test_dump_schema():
schema = UserSchema()
dumped = valid... |
import unittest
from httmock import all_requests, HTTMock, response
from flask import Flask
from flask.ext.goat import Goat
try:
from urlparse import urlparse
except:
from urllib.parse import urlparse
class TestGoat(unittest.TestCase):
def setUp(self):
self.app = Flask(__name__)
self.app... |
#!/usr/bin/env python
import math
import os
import unittest
import gemmi
try:
import numpy
except ImportError:
numpy = None
class TestFloatGrid(unittest.TestCase):
def test_reading(self):
path = os.path.join(os.path.dirname(__file__), '5i55_tiny.ccp4')
m = gemmi.read_ccp4_map(path)
... |
# -*- coding: utf-8 -*-
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests that HTML generation is awesome."""
import datetime
import glob
import json
import os
import os.path
import re
import sys
import ... |
import unittest
from tornado import httputil
from microproxy import http
class HttpTest(unittest.TestCase):
def test_req_serialize(self):
http_headers = httputil.HTTPHeaders()
http_headers.parse_line("Content-Type: text/html")
http_message = http.HttpRequest(version="1.1",
... |
from __future__ import unicode_literals
import unittest
import mock
from mopidy_alarmclock import http
class HttpTest(unittest.TestCase):
def test_SetAlarmRequestHandler(self):
config = mock.Mock()
core = mock.Mock()
alarm_manager = mock.Mock()
msg_store = mock.Mock()
... |
import time
from pyroute2 import IPDB
from pyroute2.common import basestring
from pyroute2.netlink import NetlinkError
from pyroute2.netlink.ipdb import clear_fail_bit
from pyroute2.netlink.ipdb import set_fail_bit
from pyroute2.netlink.ipdb import set_ancient
from pyroute2.netlink.ipdb import _FAIL_COMMIT
from pyroute... |
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.util import check_grads
from autograd import grad
npr.seed(1)
def test_getter():
def fun(input_list):
A = np.sum(input_list[0])
B = np.sum(input_list[1])
C = np.sum(input_list[1])
return A + B + C
d_f... |
from pyiso import client_factory, BALANCING_AUTHORITIES
from pyiso.base import BaseClient
from pyiso.eu import EUClient
from unittest import TestCase
import unittest
import pytz
from datetime import datetime, timedelta
#import freezegun
#import requests_mock
class TestBaseLoad(TestCase):
def setUp(self):
... |
#!/usr/bin/env python
from utils import *
def test_cheat_destroy_deck():
game = prepare_game()
game.player1.discard_hand()
game.player2.discard_hand()
game.player1.give(DESTROY_DECK).play(target=game.player2.hero)
assert not game.player2.deck
game.end_turn()
assert not game.player2.hand
assert game.player2.h... |
'''
Translate text with the 'Google AJAX Language API'
http://code.google.com/apis/ajaxlanguage/documentation/
'''
import os
import urllib
try:
#python2.6+
import json
except ImportError:
#python2.5
import simplejson as json
apiVersion = '1.0'
baseUrl = 'http://ajax.googleapis.com/ajax/se... |
#!/usr/bin/env python
from utils import *
def test_cheat_destroy_deck():
game = prepare_game()
game.player1.discard_hand()
game.player2.discard_hand()
game.player1.give(DESTROY_DECK).play(target=game.player2.hero)
assert not game.player2.deck
game.end_turn()
assert not game.player2.hand
assert game.player2.h... |
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QMessageBox, QPlainTextEdit, QShortcut
from PyQt5 import QtCore, QtGui
from mainwindow import Ui_MainWindow
import subprocess
class IdeMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
QMainWindow.__init__(self)
... |
from __future__ import division
import sys
import math
import pytest
from gmpy_cffi import mpfr, mpq, mpz
from math import sqrt
invalids = [(), [], set(), dict(), lambda x: x**2]
class TestInit(object):
ints = [0, -1, 1, 3, -25]
def test_init_empty(self):
assert mpfr() == mpfr('0.0')
def tes... |
#!/usr/bin/env python
import os
os.environ['GLOG_minloglevel'] = '2' # suprress Caffe verbose prints
import settings
import site
site.addsitedir(settings.caffe_root)
# imports and basic notebook setup
import numpy as np
import math
import os,re,random
import PIL.Image
import sys, subprocess
from IPython.display impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wdom.element import Element
from wdom.node import Node, NodeList
from wdom.node import ParentNode, NonDocumentTypeChildNode, ChildNode
from wdom.node import Text, DocumentType, DocumentFragment, RawHtml
from wdom.node import Comment, CharacterData
from .base import ... |
import numpy as np
import pytest
import dynesty
import multiprocessing as mp
from utils import get_rstate
"""
Run a series of basic tests to check whether anything huge is broken.
"""
nlive = 1000
printing = False
ndim = 2
gau_s = 0.01
def loglike_gau(x):
return (-0.5 * np.log(2 * np.pi) * ndim - np.log(gau_s)... |
#
# Copyright 2012 Quantopian, 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 wr... |
#!/usr/bin/env python
# coding=utf-8
"""
Unit tests for the Python port of SMAZ
Copyright (c) 2014 Max Smith except for portions of Moby Dick which are in the public domain
Public domain
"""
from unittest import TestCase
import bz2
import zlib
import datetime
import itertools
import random
import sys
from smaz import... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot/blob/master/LICENSE
import os
import unittest
from collections import namedtuple
import numpy
import pytest
import awkward
import uproot
def basest(array):
while getattr(array, "base", None) is not None:
array = arr... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pickle
from collections import Mapping
import pytest
import hypothesis.strategies as st
from hypothesis import given, assume
import marisa_trie
from .utils import text
@given(st.sets(text), text)
def test_init(keys, missing_ke... |
import re
import pytest
from lektor.context import _ctx_stack
from lektor.context import Context
from lektor.utils import cleanup_path
from lektor.utils import cleanup_url_path
def test_cleanup_path():
assert cleanup_path("/") == "/"
assert cleanup_path("/foo") == "/foo"
assert cleanup_path("/foo/") == ... |
# pylint: disable = missing-docstring
import base64
import random
import tempfile
import sys
from saml2 import server, BINDING_HTTP_POST, BINDING_HTTP_REDIRECT
from saml2.authn_context import AuthnBroker, authn_context_class_ref, PASSWORD
from saml2.cert import OpenSSLWrapper
from saml2.client import Saml2Client
from ... |
from __future__ import print_function
import openravepy
import prpy.util
import unittest
import os # environ, path
import subprocess
import sys # stderr
import numpy # allclose, zeros
# Add the models included with OpenRAVE to the OPENRAVE_DATA path.
# These may not be available if the user manually set the OPENRAV... |
from functools import partial
import unittest
import os.path as osp
from pylinac.vmat import VMAT
from pylinac.core.geometry import Point
_vmat_test_files_dir = osp.join(osp.dirname(__file__), 'test_files', 'VMAT')
within_1 = partial(unittest.TestCase().assertAlmostEqual, delta=1)
within_01 = partial(unittest.TestC... |
__doc_all__ = []
import unittest
import sys
import exceptions
import datetime
import time
import random
import threading
import wsgiref.validate
import httplib
import os
import tempfile
import socket
from cStringIO import StringIO
from cogen.common import *
from cogen.core import reactors
from cogen... |
# coding: utf-8
from delphin.util import safe_int, SExpr, detect_encoding
import pytest
def test_safe_int():
assert safe_int('1') == 1
assert safe_int('1.0') == '1.0'
assert safe_int('-12345') == -12345
assert safe_int('1a') == '1a'
def test_SExpr():
# atoms outside of parens
# assert SExpr.... |
"""Core functions used in compositional data analysis."""
# Part of Tetrahydra library
# Copyright (C) 2016-2017 Omer Faruk Gulban
#
# 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 vers... |
#!/usr/bin/python
import os
import sys
import yaml
import psutil
import subprocess
import tempfile
import logging
import getpass
from teuthology import beanstalk
from teuthology import report
from teuthology.config import config
from teuthology import misc
log = logging.getLogger(__name__)
def main(args):
run_... |
import argparse
import json
import logging
import subprocess
import yaml
import re
import collections
import os
import requests
import urllib
import teuthology
from . import misc
from . import provision
from .config import config
from .lockstatus import get_status
log = logging.getLogger(__name__)
# Don't need to see... |
import argparse
import json
import logging
import subprocess
import yaml
import re
import collections
import os
import requests
import urllib
from distutils.spawn import find_executable
import teuthology
from . import misc
from . import provision
from .config import config
from .contextutil import safe_while
from .loc... |
"""
Miscellaneous teuthology functions.
Used by other modules, but mostly called from tasks.
"""
from cStringIO import StringIO
import argparse
import os
import logging
import configobj
import getpass
import socket
import subprocess
import sys
import tarfile
import time
import urllib2
import urlparse
import yaml
impor... |
import os
import subprocess
import glob
from bcbio import utils
from bcbio.provenance import do
from bcbio.pipeline import config_utils
from bcbio import bam
HS = {"hg19": "2.7e9",
"GRCh37": "2.7e9",
"hg38": "2.7e9",
"mm10": "1.87e9",
"dm3": "1.2e8"}
def run(name, chip_bam, input_bam, genome... |
"""Top level driver functionality for processing a sequencing lane.
"""
import copy
import os
import re
from bcbio import utils, broad
from bcbio.log import logger
from bcbio.bam import callable
from bcbio.bam.trim import brun_trim_fastq, trim_read_through
from bcbio.pipeline.fastq import get_fastq_files, needs_fastq_... |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
from __future__ import absolute_import
import pickle
from django.db import connection, models
from django.db.models import F
from django.test import TestCase
from bitfield import BitHandler, Bit, BitField
from bitfield.compat import bitand, bitor
from .forms import BitFieldTestModelForm
from .models import BitField... |
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Arvind Tomar
#
from org.xdi.service.cdi.util import CdiUtil
from org.gluu.jsf2.message import FacesMessages
from javax.faces.application import FacesMessage
from org.xdi.util... |
import os
import errno
import shutil
from pprint import pformat
import pyblish.api
from mindbender import api, io
class IntegrateMindbenderAsset(pyblish.api.InstancePlugin):
"""Write to files and metadata
This plug-in exposes your data to others by encapsulating it
into a new version.
Schema:
... |
"""Module for intervention access strategy functions
Determining whether or not to provide access to a given intervention
for a user is occasionally tricky business. By way of the access_strategies
property on all interventions, one can add additional criteria by defining a
function here (or elsewhere) and adding it ... |
#!/usr/bin/env python
import hashlib
import operator
import os
import sys
import traceback
def AssertWithError(condition, error):
""" If condition is false, exit with error."""
if callable(condition):
condition = condition()
if not condition:
ExitWithError(error)
def Concat(li):
""" Concat :: [[a]... |
import re
from portality.lib import dataobj, swagger
from portality import models, regex
from portality.util import normalise_issn
from copy import deepcopy
from portality.regex import DOI,DOI_COMPILED
BASE_ARTICLE_STRUCT = {
"fields": {
"id": {"coerce": "unicode"}, # Note that we'll leave ... |
from portality.core import app
from lxml import etree
import re
from portality.bll import exceptions
from portality.crosswalks.exceptions import CrosswalkException
from portality import models
from datetime import datetime
class DOAJXWalk(object):
format_name = "doaj"
schema_path = app.config.get("SCHEMAS", {... |
#!/usr/bin/env python
'''
Bigmetadata tasks
tasks to download and create metadata
'''
#import requests
#import datetime
#import json
import csv
import json
import os
from collections import OrderedDict
from sqlalchemy import Column, Numeric, Text
from luigi import Parameter, BooleanParameter, Task, WrapperTask, Loca... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from telemetry.core import exceptions
from telemetry.internal.platform import android_platform_backend as \
android_platform_backend_module... |
import matplotlib.pyplot as plt
workloads_to_be_plotted = [
"cmtDatasetSimple",
"cmtDatasetComplex",
"milanTelecomSimple",
"milanTelecomComplex",
"campaignExpendituresSimple",
"campaignExpendituresComplex",
"fedDisbursementsSimple",
"fedDisbursementsComplex"
]
timing_types = [
'Loading',
'Summariz... |
import enum
import typing as tp
from benchbuild.utils import run
WorkloadFunction = tp.Callable[..., None]
class WorkloadProperty: # pylint: disable=too-few-public-methods
"""
Empty base class to encode workload properties.
"""
class EnumProperty(WorkloadProperty, enum.Enum):
"""
Empty base c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.