text stringlengths 17 737k |
|---|
from lexos.processors.prepare.cutter import split_keep_whitespace, \
cut_by_number
class TestCutByNumbers:
def test_split_keep_whitespace(self):
assert split_keep_whitespace("Test string") == ["Test", " ", "string"]
assert split_keep_whitespace("Test") == ["Test"]
assert split_keep_whi... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import unittest
from scipy.stats import multivariate_normal
from scipy.sparse.linalg import spsolve, LinearOperator, bicgstab
import inspect
import di... |
import pytest
from panda3d import core
# Skip these tests if we can't import egg.
egg = pytest.importorskip("panda3d.egg")
COORD_SYSTEMS = [core.CS_zup_right, core.CS_yup_right, core.CS_zup_left, core.CS_yup_left]
@pytest.mark.parametrize("egg_coordsys", COORD_SYSTEMS)
@pytest.mark.parametrize("coordsys", COORD_SY... |
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
'''
'''
# Licensed to the Apache Software Foundation (ASF) 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");... |
"""
7. The lookup API
This demonstrates features of the database API.
"""
from django.db import models
from django.conf import settings
class Article(models.Model):
headline = models.CharField(maxlength=100)
pub_date = models.DateTimeField()
class Meta:
ordering = ('-pub_date', 'headline')
d... |
import os
import conda_smithy.configure_feedstock as cnfgr_fdstk
import pytest
import copy
import yaml
def test_noarch_skips_appveyor(noarch_recipe, jinja_env):
cnfgr_fdstk.render_appveyor(
jinja_env=jinja_env,
forge_config=noarch_recipe.config,
forge_dir=noarch_recipe.recipe,
)
#... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, unicode_literals
import nose.tools as nose
from tests.utils import run_filter
def test_ignore_case():
"""should ignore case when querying songs"""
results = run_filter('playsong', 'mr Blue SKY')
nose.assert_equal(results[0]['ti... |
# -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import os
import time
import tempfile
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support... |
"""
Production Configurations
- Use WhiteNoise for serving static files
- Use Amazon's S3 for storing uploaded media
- Use mailgun to send emails
- Use Redis for cache
- Use sentry for error logging
- Use opbeat for error reporting
"""
import logging
from .base import * # noqa
# SECRET CONFIGURATION
# ------... |
import math
import sys
from tob.log import sanitize_for_html
#####
# Python version detection
py = sys.version_info
py30 = py >= (3, 0, 0)
# box_bold_grid = 'col-3 col-md-2 box_bold'
# box_section_grid = 'col-8 col-md-9 box_section'
# box_datum_grid = 'col-3 col-md-2 box_datum'
# box_value_grid = 'col-8 col-md-9 box_... |
class NamedPackage:
""" Represents a package specified by Name """
def __init__(self, name):
""" Initialize with the name """
self.name = name
@property
def installAs(self):
""" Return the string to use to Install the package via pip """
return s... |
import unittest
from geopy.compat import u
from geopy.point import Point
from geopy.geocoders import Bing
from test.geocoders.util import GeocoderTestBase, env
class BingTestCaseUnitTest(GeocoderTestBase):
def test_user_agent_custom(self):
geocoder = Bing(
api_key='DUMMYKEY1234',
... |
############################################################################
#
# Copyright 2017-2018
#
# https://github.com/HPC-buildtest/buildtest-framework
#
# This file is part of buildtest.
#
# buildtest is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... |
from discord.ext import commands
import discord
import sqlite
class Raffle:
def __init__(self, yeebot):
self.yeebot = yeebot
self.conn = sqlite.connect('db/yee.db')
self.cur = self.conn.cursor()
self.cur.execute("CREATE TABLE IF NOT EXISTS raffles (raffle_id INTEGER P... |
#
# Copyright (c) 2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... |
"""
Django settings for O-Car-Go project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: rel(rel_path)
import os
BASE... |
#! /usr/bin/env python
#-*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import os
import platform
import time
import json
import hashlib
import argparse
import signal
import base64
import webbrowser
import traceback
from io import BytesIO
import atx
import tornado... |
# coding: utf-8
import json
import requests
from typing import Optional
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import ContentFile
from django.core.management.base import BaseCommand
from rest_fram... |
# -*- coding: utf-8 -*-
"""Release data for the IPython project."""
#-----------------------------------------------------------------------------
# Copyright (c) 2008, IPython Development Team.
# Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>... |
# File: CeResources.py ; This file is part of Twister.
# version: 2.039
# Copyright (C) 2012-2013 , Luxoft
# Authors:
# Adrian Toader <adtoader@luxoft.com>
# Andrei Costachi <acostachi@luxoft.com>
# Andrei Toma <atoma@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Daniel Cioa... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""This module handles the On Demand Backup utility"""
from __future__ import unicode_literals, print_function
#Imports
from frappe import _
import os, frappe
from datetime import datetime
from frappe.utils import cst... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe, os, copy, json, re
from frappe import _, get_module_path
from frappe.core.doctype.access_log.access_log import make_access_log
from frappe.utils import cint, sanitize_html, strip_html
from frappe.utils.jinj... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 10 17:33:11 2017
@author: Lennart
"""
import Wolke
import CharakterFertigkeiten
import TalentPicker
import Fertigkeiten
from PyQt5 import QtWidgets, QtCore, QtGui
class FertWrapper(object):
def __init__(self):
super().__init__()
self.formFert = QtWidg... |
#!/usr/bin/env python3
import CNVworkflowlib
import argparse
####################################
### Parse command-line arguments ###
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("algorithm_CNV_filename", type=str)
parser.add_argument("benchmark_CNV_fi... |
from __future__ import print_function
import copy
import itertools
import math
import random
import sys
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import jit, types, utils, njit
import numba.unittest_support as unittest
from numba import testing
from .support import TestCase, Me... |
#!/usr/bin/env python
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='',top_path=None):
config = Configuration('distutils',parent_package,top_path)
config.add_subpackage('command')
config.add_subpackage('fcompiler')
confi... |
from .. import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
"+39 {{area_code}}#####!!",
"{{area_code}}#####!!",
)
area_codes = (
# Landline: https://en.wikipedia.org/wiki/List_of_dialling_codes_in_Italy
"010#",
"011#",
"0... |
# Last Changed: .
"""This initialize a scons environment using info from distutils, and all our
customization (python extension builders, build_dir, etc...)."""
import sys
import os
import os.path
from os.path import join as pjoin
from numscons.core.default import tool_list
from numscons.core.compiler_config import ... |
import json
import bleach
from bottle import Bottle, redirect, response, request
import common as c
app = Bottle()
def v2to3(items):
convert = {
'plugname': 'plugin_name',
'name': 'slug',
'repo': 'server',
'link': 'dbo_page',
'slug': 'name',
}
data = []
for ite... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# 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... |
{
'variables' : {
"conditions": [
["OS == 'linux' ", {
'Rose_lib': '$(ROSE)/lib/linux_x86_64_gcc_3.4_pic/lib',
'lib_ext': '.a'
}],
["OS == 'mac' ", {
'Rose_lib':'$(ROSE)/lib/macosx_all_clang/lib',
'lib_ext':'.a'
}],
["OS =='win' ", {
'Rose_li... |
{
"targets":
[
{
"target_name": "nj",
"sources": [ "nj.cpp" , "Exception.cpp" , "JMain.cpp" , "JuliaExecEnv.cpp" ],
"cflags!": [ "-fno-exceptions" ],
"cflags": [ "-std=c++11" , "-I/usr/local/julia/include/julia" ],
"cflags_cc!": [ "-fno-exceptions" ],
"condition... |
from bioagents.tra import kappa_client
__all__ = ['TRA', 'get_ltl_from_pattern', 'apply_condition',
'get_create_observable', 'pysb_to_kappa', 'get_sim_result',
'get_all_patterns', 'TemporalPattern', 'TimeInterval',
'InvalidTemporalPatternError', 'InvalidTimeIntervalError',
'M... |
"""
birthday.py
Author: Avery Wallis
Credit: None so far
Assignment:
Your program will ask the user the following questions, in this order:
1. Their name.
2. The name of the month they were born in (e.g. "September").
3. The year they were born in (e.g. "1962").
4. The day they were born on (e.g. "11").
If the user'... |
class AbstractRequest(dict):
TYPE_DETERMINER = None
def __init__(self, request_dict):
if not isinstance(request_dict, dict):
raise TypeError(
'request_dict must be dict not %s' % type(request_dict)
)
self.request_dict = request_dict
@property
de... |
# JSON2Blender v0.1
#
# Author: Cole Reed
# Email: info@auralgrey.com
# https://github.com/ichabodcole
#
# Please report issues at https://github.com/ichabodcole/AE2JSON
#
# Copyright (c) 2012 Cole Reed. All rights reserved.
#
# Description:
# A script to convert AE2JSON encoded After Effects project data to Blender... |
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse, JsonResponse, HttpResponseNotAllowed
from models import *
import json
import oauth2
from django.core import serializers
import urllib2, urllib
from django.views.decorators.csrf import csrf_exempt
import xml.etree.Elemen... |
# -*- coding: utf-8 -*-
'''
Support for Apache
.. note::
The functions in here are generic functions designed to work with
all implementations of Apache. Debian-specific functions have been moved into
deb_apache.py, but will still load under the ``apache`` namespace when a
Debian-based system is detect... |
#!/usr/bin/env python
import git_visitor_base
import git_repo_query
import git_fetch
import sys
def visitor_fetch(repos, options):
ORIGINAL_COLOR = "\033[0m" # mvtodo: would be better to try to detect the terminal's current standard color
report = []
for rp in repos:
remotes = git_repo_query.ge... |
import csv
import MySQLdb
from decimal import Decimal
class DataWriter(object):
"""Write out the data to our preferred logging mechanism"""
#Write out the data stream to our preferred location
def __init__(self):
#Do Nothing
pass
def __del__(self):
#Do nothing
... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
# Access control
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
import xpath
import base64
import random
import time
import ur... |
import numbers
from operator import mul, add
from functools import reduce
# multiplicative compliment to sum
prod = lambda l: reduce(mul, l)
# if a fraction or number
isNumeric = lambda n: isinstance(n, (Fraction, numbers.Number))
# coerce to a polynomial
poly = lambda p: P.make_constant(p) if isNumeric(p) else p
#... |
import unittest
from . import base
class TestBasicTypes(base.SchemaTestCase):
def test_single_type(self):
self.add_object('bacon')
self.add_object('egg')
self.add_object('spam')
self.assertResult({'type': 'string'})
def test_multi_type(self):
self.add_object('string')... |
'''
Some of the utils used by salt
'''
from __future__ import absolute_import
# Import python libs
import datetime
import distutils.version # pylint: disable=E0611
import fnmatch
import hashlib
import imp
import inspect
import logging
import os
import platform
import random
import re
import shlex
import shutil
import... |
# /test/test_jobstamps.py
#
# Unit tests for the jobstamps module.
#
# See /LICENCE.md for Copyright information
"""Unit tests for the jobstamps module."""
import os
import shutil
import time
from test import testutil
from jobstamps import jobstamp
from mock import Mock, call
from nose_parameterized import param... |
import os
def test_notebooks():
notebooks = ['Nearest_Neighbors_and_Gram_Matrix.ipynb']
for notebook in notebooks:
cmd = 'wget -q https://raw.githubusercontent.com/fabriziocosta/EDeN_examples/master/%s' % notebook
os.system(cmd)
cmd = 'jupyter nbconvert --stdout --ExecutePreprocessor.... |
# Copyright 2015 Mirantis, 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, s... |
# coding=utf-8
"""
Indexing service for Abilian.
Adds Whoosh indexing capabilities to SQLAlchemy models.
Based on Flask-whooshalchemy by Karl Gyllstrom.
:copyright: (c) 2013-2014 by Abilian SAS
:copyright: (c) 2012 by Stefane Fermigier
:copyright: (c) 2012 by Karl Gyllstrom
:license: BSD (see LICENSE.txt)
"""
from _... |
from ..Qt import QtGui, QtCore
__all__ = ['BusyCursor']
class BusyCursor(object):
"""Class for displaying a busy mouse cursor during long operations.
Usage::
with pyqtgraph.BusyCursor():
doLongOperation()
May be nested.
"""
active = []
def __enter__(self):
if QtG... |
#!/usr/bin/env python
# blogware - a python blogging system
# Copyright (C) 2016-2017 izrik
#
# This file is a part of blogware.
#
# Blogware 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 vers... |
# -*- coding: utf8 -*-
__author__ = 'Clemens Prescher'
import numpy as np
from scipy import interpolate
import lmfit
from .scattering_factors import calculate_coherent_scattering_factor, calculate_incoherent_scattered_intensity
from . import Spectrum
import scattering_factors
from copy import copy
__all__ = ['calc... |
from __future__ import with_statement
import errno
import os
import psutil
import signal
import socket
import sys
import time
try: # Python 2.6 unittest module doesn't have skip decorators.
from unittest import skip, skipIf, skipUnless
import unittest
except ImportError:
from unittest2 import skip, skipIf... |
import dnest4.classic as dn4
import numpy as np
import matplotlib.pyplot as plt
data = dn4.my_loadtxt("fake_data.txt")
posterior_sample = np.atleast_2d(dn4.my_loadtxt("posterior_sample.txt"))
x = np.linspace(-20.0, 20.0, 2001)
plt.figure(figsize=(13, 4))
for i in range(0, posterior_sample.shape[0]):
plt.plot(x, ... |
import os
import logging
import requests
import yaml
from datetime import datetime
from selenium import webdriver
from urllib.parse import urlparse
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
default_logger = logging.getLogger(__file__)
def get_log_handler():
formatter = logging.Formatter('%(asctime)s ... |
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import print_function, division, absolute_import
import sys
import os.path
import subp... |
from Bio import SeqIO
import logging
import unittest
from select_taxa import select_genomes_by_ids
import translate
class Test(unittest.TestCase):
def setUp(self):
self.longMessage = True
logging.root.setLevel(logging.DEBUG)
def test_translate_genomes(self):
# Select genomes
... |
import subprocess
import os
import sys
import argparse
import atexit
import parsers
import parts
import cases
def get_http10long():
return cases.base['10long'].data
def get_websites(size=2 ** 18):
data = b''
while len(data) < size:
for c in cases.websites.values():
data += c.data
... |
"""
Infrastructure code for testing Mission Control
"""
import base64
import os
import sha
import sys
import constants as cs
import servicetest
import twisted
from twisted.internet import reactor
import dbus
import dbus.service
def make_mc(bus, event_func, params=None):
default_params = {
}
if par... |
from .models import *
import os, sys
from .main import create_app
import argparse
import json
from sqlalchemy.sql import select
def _go(args):
app = create_app(args)
with app.app.app_context():
def dump_event(e):
return {
'id': e.id,
'type': e.type_id,
... |
import click
import numpy as np
import rasterio as rio
from scipy import sparse
import pyamg
from pyamg.relaxation.smoothing import change_smoothers
from geoblend import blend
from geoblend.utilities import get_mask
from geoblend.coefficients import matrix_from_mask
from geoblend.solver import create_multilevel_solv... |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... |
from django import test
from django.conf import settings
from django.core import cache, management
from django.core.handlers import wsgi
from django.db import connection, connections, DEFAULT_DB_ALIAS
from django.db.models import loading
from django.utils.encoding import smart_unicode as unicode
from django.utils.trans... |
import py
import execnet
from xdist.workermanage import NodeManager
def test_dist_incompatibility_messages(testdir):
result = testdir.runpytest("--pdb", "--looponfail")
assert result.ret != 0
result = testdir.runpytest("--pdb", "-n", "3")
assert result.ret != 0
assert "incompatible" in result.stde... |
import json
import logging
import random
import Algorithmia
import nltk
from textblob import TextBlob
from text_corpus import TextCorpus
from aylienapiclient import textapi
import tensorflow as tf
logger = logging.getLogger(__name__)
class RtmEventHandler(object):
def __init__(self, slack_clients, msg_writer):
... |
"""
Sony Bravia RC API
By Antonio Parraga Navarro
dedicated to Isabel
"""
import logging
import base64
import collections
import json
import socket
import struct
import requests
TIMEOUT = 10
_LOGGER = logging.getLogger(__name__)
class BraviaRC:
def __init__(self, host, mac=None): # mac address is optional ... |
import random
import requests
import json
import time
import xml.etree.ElementTree as ET
from firebase import firebase, jsonutil
from copy import deepcopy
from threading import Thread
TOKEN = '91a4cf30bfdaae8a3fa2a54d55fe7cfa79ce882bed94bff73f7db8c584c27817'
def doGet(path, args={}):
print(args)
resp = json.lo... |
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
import deferred2 as deferred
import pytest
uses = pytest.mark.usefixtures
@pytest.fixture
def mockito():
import mockito
yield mockito
mockito.unstub()
messages = []
@pytest.fixture
def clear_messages():
messages[:]... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from hashlib import md5
import logging
import re
import zlib
import unicodedata
# 3p
import requests
import simplejson as json
# project
from config import get_version
from utils.proxy import set_no_pr... |
#!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS Authors
#
# 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
#
# Unle... |
"""
Server Density Plugin
IPMI measurements (temp, fan, power)
https://github.com/serverdensity/sd-agent-plugins/
Version: 1.0.0
"""
import re
import json
import logging
import sys
import subprocess
import time
class Ipmi(object):
"""SD Plugin for reading available data from the machines IPMI board se... |
import sys
import tensorflow as tf
import numpy as np
from src.Utilities import Utilities
from src.Autoencoder import InputLayer
from src.Autoencoder import HiddenLayer
from src.Autoencoder import OutputLayer
# Number of epochs to run
numEpochs = 100
# Size of each batch
batchSize = 10
# Scaling factor for sparsity co... |
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __f... |
#!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
"""Restricted execution facilities.
The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
r_import(), which correspond roughly to the built-in operations
exec, eval(), execfile() and import, but executing the code in an
environment that only exposes those built-in operations that are
deemed safe. To t... |
import os
import unittest
import subprocess
TEST_PROJECT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'test_project/')
SRC_DIR = os.path.join(
os.path.dirname(os.path.abspath(os.path.dirname(__file__))),
'django_fake_database_backends')
class MySqlTest(unittest.TestCase):
@classmethod
... |
import BASEX
import matplotlib.pyplot as plt
filename = 'example_data/Xenon_800_nm.tif'
raw_data = plt.imread(filename)
# Specify the center in x,y (horiz,vert) format
center = (681,491)
print 'Performing the inverse Abel transform:'
# Transform the data
recon,speeds = BASEX.center_and_transform(raw_data,center,medi... |
#!/usr/bin/env python
#
# exclude - C++ unused includes removal tool
# Romain Dura | romain@shazbits.com
# https://github.com/shazbits/exclude
#
# Copyright (c) 2013, Romain Dura romain@shazbits.com
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby gran... |
#! /usr/bin/python
import numpy as np
from astropy import units as u
from astropy import constants as c
import rvrms
'''
Exposure time calculator for a list of target stars, desired measurement quality, and optical system specifications. Currently a proof of concept derived from HARPS, but capable to some degree of co... |
from unittest import mock
from concurrent.futures import Future
from gmncurses import executor
# Auth
def test_login_method_returns_a_future():
client = mock.Mock()
e = executor.Executor(client)
f = e.login("admin", "123123")
assert isinstance(f, Future)
# Project
def test_projects_method_returns_a_... |
"""
Implements a finite state machine to extract the learntris
test descriptions from testplan.org.
The org file format is described here:
http://orgmode.org/worg/dev/org-syntax.html
However, there is no need to fully parse the outline
structure, since we are only interested in the actual
test cases, and these are... |
from __future__ import absolute_import
import sys
import time
import greenify
greenify.greenify()
import pylibmc
from tornado.ioloop import IOLoop
from tornado.gen import coroutine
from tornado.web import RequestHandler, Application
from gtornado import green
greenify.patch_lib("/usr/lib/x86_64-linux-gnu/libmemcached.... |
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
# pylint: disable=missing-docstring,protected-access
import khmer
from screed.fas... |
try:
import unittest2 as unittest
except ImportError:
import unittest
import eventlet
from village import _luabject
from village import luabject
class TestDirect(unittest.TestCase):
def test_new(self):
state = _luabject.new()
# PyCObject isn't available to assertIsInstance, so:
... |
import unittest
import random
import pyrtl
from helperfunctions import *
# -------------------------------------------------------------------
class TestRTLMemBlockDesign(unittest.TestCase):
def setUp(self):
pyrtl.reset_working_block()
self.bitwidth = 3
self.addrwidth = 5
self.out... |
from mutmut import mutate, count_mutations, ALL
import pytest
@pytest.mark.parametrize(
'actual, expected', [
('1+1', '2-2'),
('1-1', '2+2'),
('1*1', '2/2'),
('1/1', '2*2'),
# ('1.0', '1.0000000000000002'), # using numpy features
('1.0', '101.0'),
('True', ... |
import itertools
import numpy as np
import pytest
from conftest import skipif, time, x, y, z
from devito import (Grid, Eq, Operator, Constant, Function, TimeFunction,
SparseFunction, SparseTimeFunction, Dimension, error, SpaceDimension,
NODE, CELL, dimensions, configuration, Ten... |
import unipath
from fabric.api import *
from fabric.contrib import files
# Fab settings
env.hosts = ['ve.djangoproject.com']
# Deployment environment paths and settings and such.
env.deploy_base = unipath.Path('/home/www/djangoproject.com')
env.virtualenv = env.deploy_base
env.code_dir = env.deploy_base.child('src')
... |
"""
tests.test_packages
~~~~~~~~~~~~~~~~~~~~~
Test packages API.
:copyright: (c) 2019 Yoan Tournade.
:license: AGPL, see LICENSE for more details.
"""
import requests
def test_api_packages_list(latex_on_http_api_url):
"""
The API list available/installed Texlive/tlgmr packages.
"""
... |
# Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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 la... |
"""
Copyright (c) 2015, EDINA
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclai... |
"""Main test file for the pyrabbit Client."""
import json
try:
#python 2.x
import unittest2 as unittest
except ImportError:
#python 3.x
import unittest
import sys
sys.path.append('..')
import pyrabbit
from mock import Mock, patch
class TestClient(unittest.TestCase):
def setUp(self):
self... |
# Copyright (c) 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.
"""Top-level presubmit script for Skia.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
from fabric.api import *
from fabric.decorators import runs_once
env.runtime = 'production'
env.hosts = ['chimera.ericholscher.com', 'ladon.ericholscher.com', 'mozbuild.ericholscher.com']
env.user = 'docs'
env.code_dir = '/home/docs/sites/readthedocs.org/checkouts/readthedocs.org'
env.virtualenv = '/home/docs/sites/re... |
# Copyright (c) 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.
"""Top-level presubmit script for Blink.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2014, MIT Probabilistic Computing Project
#
# 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/LICENS... |
#!/usr/bin/env python3
import argparse
import common
import functools
import multiprocessing
import os
import os.path
import pathlib
import re
import subprocess
import stat
import sys
import traceback
import shutil
import paths
EXCLUDED_PREFIXES = ("./generated/", "./thirdparty/", "./build", "./.git/", "./bazel-", ".... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.