text stringlengths 12 6.59M |
|---|
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
import os
import sys
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst', format='md')
except (IOError, ImportError):
long_description = open('README.md').read()
try:
from setuptools import setup, find_packages, Extension
except ImportError:
sys.stderr.write('Setuptools not... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Some predefined functions injected into an environment
"""
import operator
import random
import math
import threading
import yalix.utils as utils
from yalix.parser import scheme_parser
from yalix.environment import Env
from yalix.exceptions import EvaluationError
fro... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
# distributions.py: module for probability distributions
##
# © 2012 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free softw... |
# coding: utf-8
import atexit
import glob
import importlib
import os.path
import queue
import threading
import time
import modder
class ModManager(object):
def __init__(self, mod_directory=None):
if not mod_directory:
mod_directory = os.path.join(os.path.dirname(__file__), 'mods')
se... |
__author__ = 'Nick'
from HTMLParser import HTMLParser
class LinkParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.links = []
def feed(self, data):
HTMLParser.feed(self, data)
def handle_starttag(self, tag, attrs):
for attr in attrs:
... |
from time import mktime
from datetime import datetime
from os.path import join
from OpenGL.GLUT import GLUT_KEY_LEFT, GLUT_KEY_RIGHT
from OpenGL.GLUT import GLUT_KEY_DOWN, GLUT_KEY_UP
from OpenGL.GLUT import glutSpecialFunc, glutKeyboardUpFunc, glutKeyboardFunc
class ModelInput:
"""Process input and trigger nee... |
# The MIT License (MIT)
#
# Copyright (c) 2017 Stefan Graupner
#
# 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 the rights
# to use, copy, m... |
# libavg - Media Playback Engine.
# Copyright (C) 2003-2008 Ulrich von Zadow
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any l... |
from pytac.exceptions import PvException
import pytac.device
import pytest
import mock
SP_PV = 'SR01A-PC-SQUAD-01:SETI'
RB_PV = 'SR01A-PC-SQUAD-01:I'
ENABLE_PV = 'SR01C-DI-EBPM-01:CF:ENABLED_S'
ENABLED_VALUE = '1.0'
@pytest.fixture
def create_device(readback=RB_PV, setpoint=SP_PV, _enable_pv=ENABLE_PV, _enabled_valu... |
'''
This module contains the *RBF* class, which is used to symbolically
define and numerically evaluate a radial basis function. *RBF*
instances have been predefined in this module for some of the commonly
used radial basis functions. The predefined radial basis functions are
shown in the table below. For each exp... |
'''
This module defines a class, *GaussianProcess*, which is an
abstraction that allows one to easily work with Gaussian processes.
One main use for the *GaussianProcess* class is Gaussian process
regression (GPR). GPR is also known as Kriging or Least Squares
Collocation. It is a technique for constructing a con... |
import sys
import inspect
import weakref
from contextlib import contextmanager
from collections import OrderedDict
import numpy as np
from scipy.spatial import cKDTree
_SHAPE_ASSERTIONS = True
def assert_shape(arr, shape, label='array'):
'''
Raises a ValueError if `arr` does not have the specified shape
Par... |
from __future__ import print_function, division, absolute_import
import time
import matplotlib
matplotlib.use('Agg') # fix execution of tests involving matplotlib on travis
import multiprocessing
import pickle
import numpy as np
import six.moves as sm
import cv2
import shapely
import shapely.geometry
import imgaug ... |
import unittest
import gzip
import logging
import json
import os
from time import sleep
import random
from multiprocessing.pool import ThreadPool
from SolrClient import SolrClient, IndexQ
from SolrClient.exceptions import *
from .test_config import test_config
from .RandomTestData import RandomTestData
import shutil
t... |
"""Static models for use in testing.
The idea is to use this module (via remote_api_shell.py or a test URL handler)
to create a known set of models in a throwaway namespace for integration testing.
Also, these models may be used in unit tests.
"""
import datetime
import logging
import unittest
from google.appengine... |
# -*- 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... |
###
# Copyright (c) 2005, Jeremiah Fincher
# 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 conditi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
psutil test suite. Run it with:
$ make test
If you're on Python < 2.7 it is recommended to install unit... |
import pathlib
import exdown
this_dir = pathlib.Path(__file__).resolve().parent
test_readme = exdown.pytests(this_dir / ".." / "README.md", syntax_filter="python")
|
"""
Test the search interface.
"""
from test.fixtures import make_test_env, make_fake_space
from wsgi_intercept import httplib2_intercept
import wsgi_intercept
import httplib2
import simplejson
from tiddlyweb.model.user import User
from tiddlyweb.model.tiddler import Tiddler
def setup_module(module):
make_test_... |
from netCDF4 import Dataset
from numpy.random import seed, randint
from numpy.testing import assert_array_equal
import tempfile, unittest, os, random
import numpy as NP
file_name = tempfile.mktemp(".nc")
xdim=9; ydim=10; zdim=11
#seed(9) # fix seed
data = randint(0,10,size=(xdim,ydim,zdim)).astype('u1')
datarev = data... |
import unittest
import twintrimmer
from unittest.mock import patch, mock_open
import builtins
import fake_filesystem_unittest
class TestSomeThings(unittest.TestCase):
def setUp(self):
pass
def test_this_things(self):
assert True
def tearDown(self):
pass
class TestCreateFilenames(... |
#!/usr/bin/env python
#
# Test major functions.
#
# Authors: Julien Cohen-Adad, Benjamin De Leener, Augustin Roux
# Updated: 2014-09-26
import os
import shutil
import getopt
import sys
import time
from numpy import loadtxt
import commands
# get path of the toolbox
status, path_sct = commands.getstatusoutput('echo $SC... |
#!/usr/bin/env python
"""
Copyright (c) 2011, Scott Burns
All rights reserved.
"""
from urllib import urlencode
from urllib2 import Request, urlopen, URLError
class RCAPIError(Exception):
pass
class RCRequest(object):
"""Private class wrapping the REDCap API
see https://redcap.vanderbilt.edu/api/h... |
#!/usr/bin/env python
import asyncio
import asyncio_redis
import asyncio_redis.encoders
import json
import irc3
import traceback
import channelfilter
import configfetcher
import messagebuilder
__version__ = '3.0alpha'
class Redis2Irc(irc3.IrcBot):
def __init__(self, conf, builder, chanfilter, **kwargs):
... |
import boto3
import os
import pymysql.cursors
import urllib.parse
import json
def fire(event, context):
print("Received event: " + json.dumps(event, indent=2))
bucket = event['Records'][0]['s3']['bucket']['name']
key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8'... |
from django.db import models
from hackerhane import settings
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, Group, PermissionsMixin)
from django.core.urlresolvers import reverse
from membership.models import Membership
import logging
logger = logging.getLogger(__name__)
class HsUse... |
from osv import osv, fields
from tools import debug
import time
from dateutil import parser
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('res.country.state','Province',required=True),
'name' : fields.char('Canton Nam... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('res.country.state','Province',required=Tru... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from datetime import date
import calendar
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('... |
from osv import osv, fields
from tools import debug
import time
import constanst
#Class that inherits from res.partner allowing to record the
#necesary data from the clients
class rent_client(osv.osv):
_name = 'rent.client'
_inherit = 'res.partner'
_columns = {
#'client_lastname' : fields.char('Lastname',size=... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from datetime import date
import calendar
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from datetime import date
import calendar
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from datetime import date
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('res.country.stat... |
#!/usr/bin/env python
"""
SDM tar archive creation utility.
example usage:
create_archive.py 8311_17_1_dicoms -f dicoms newarchive
"""
from __future__ import print_function
import os
import glob
import json
import tarfile
import calendar
import datetime
def datetime_encoder(o):
if isinstance(o, datetime.da... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The module aims to handle gentoo arch-specific processes automatically.
TODO: rewrite it using appropriate bugzilla rest-api class"""
import argparse
import os
import re
import sys
from bugzilla import bugtracker
def check_existence(path):
"""The function perfo... |
import xlwt
import colour
import numpy as np
from os.path import dirname, join
from configuration import TimeOfDayFilter,Filter,RelationshipFilter
class report:
bold_style = xlwt.easyxf('font: bold 1')
no_dp_style = xlwt.easyxf(num_format_str='0')
one_dp_style = xlwt.easyxf(num_format_str='0.0')
two_dp... |
# -*- coding: utf-8 -*-
"""Setup the SkyLines application"""
from faker import Faker
from skylines.model import User
def test_admin():
u = User()
u.first_name = u'Example'
u.last_name = u'Manager'
u.email_address = u'manager@somedomain.com'
u.password = u.original_password = u'managepass'
u.a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
from fdbus import *
from time import sleep
class FDBusServerTest(unittest.TestCase):
def test_server_path(self):
self.assertTrue(os.path.exists(server_path))
def test_server_running(self):
self.assertTrue(test_server.r... |
from django.conf import settings
from django.http import JsonResponse
from django.template.loader import get_template, render_to_string
from django.utils.encoding import force_text
from sculpt.json_tools import to_json
import copy
import json
#
# success-ish responses
#
# AJAX mixed response: one or more of results, ... |
from __future__ import absolute_import, print_function, division, unicode_literals
import _io
import inspect
import json as json_module
import logging
import re
import six
from collections import namedtuple
from functools import update_wrapper
from requests.adapters import HTTPAdapter
from requests.exceptions import ... |
"""
Infrastructure code for testing Gabble by pretending to be a Jabber server.
"""
import base64
import os
import sha
import sys
import servicetest
import twisted
from twisted.words.xish import domish, xpath
from twisted.words.protocols.jabber.client import IQ
from twisted.words.protocols.jabber import xmlstream
fr... |
import numpy.testing as test
import numpy as np
from unittest import TestCase
from PyFVCOM.read_results import nodes2elems
from PyFVCOM.grid_tools import *
class GridToolsTest(TestCase):
def setUp(self):
""" Make a really simple unstructured grid of 8 elements as two rows of 4 elements. """
sel... |
# -*- coding: utf-8 -*-
"""
Tests for the page module.
"""
#
# (C) Pywikipedia bot team, 2008
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import unittest
import pywikibot
import pywikibot.page
site = pywikibot.Site('en', 'wikipedia')
mainpage = pywikibot.Page(pywikibot.page.Link("Main... |
# 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 mo_dots import Data
d = Data(a=42)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tempfile
import numpy as np
import librosa
from amen.audio import Audio
from amen.feature import FeatureCollection
from amen.utils import example_audio_file
EXAMPLE_FILE = example_audio_file()
audio = Audio(EXAMPLE_FILE)
mono_audio = Audio(EXAMPLE_FILE, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tempfile
import numpy as np
import librosa
from amen.audio import Audio
from amen.feature import FeatureCollection
from amen.utils import example_audio_file
EXAMPLE_FILE = example_audio_file()
audio = Audio(EXAMPLE_FILE)
mono_audio = Audio(EXAMPLE_FILE, ... |
from unittest import TestCase
from molecupy import exceptions
from molecupy.atomic import CovalentBond, Atom
class BondTest(TestCase):
def check_valid_covalent_bond(self, covalent_bond):
self.assertIsInstance(covalent_bond, CovalentBond)
self.assertIsInstance(covalent_bond.atoms, set)
self... |
from unittest import TestCase
import errno
from mock import ANY, Mock, call, mock_open, patch
from os import path
try:
import __builtin__ as builtins
except ImportError:
import builtins
from ceres import CeresNode, CeresSlice, CeresTree
from ceres import DATAPOINT_SIZE, DEFAULT_NODE_CACHING_BEHAVIOR, DEFAULT_S... |
from unittest import TestCase
import errno
from mock import ANY, Mock, call, mock_open, patch
from os import path
try:
import __builtin__ as builtins
except ImportError:
import builtins
from ceres import CeresNode, CeresSlice, CeresTree
from ceres import DATAPOINT_SIZE, DEFAULT_NODE_CACHING_BEHAVIOR, DEFAULT_S... |
from .context import Sol
import pytest
import json
import pprint
from SmartMeshSDK.IpMgrConnectorSerial import IpMgrConnectorSerial
#============================ defines ===============================
MACMANAGER = [3,3,3,3,3,3,3,3]
TIMESTAMP = 0x12131415
TAGS_DEFAULT = { "mac" : "03-03-03-03-03-03-... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... |
import logging
import os
import pytest
import mongomock
from bripipetools import model as docs
from bripipetools import dbify
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@pytest.fixture(scope='function')
def mock_db():
# GIVEN a mocked version of the TG3 Mongo database
logg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from .base import RedisTestCase
from redis_collections import Dict
class DictTest(RedisTestCase):
def create_dict(self, *args, **kwargs):
kwargs['redis'] = self.redis
return Dict(*args, **kwargs)
def test_set_get(self):
... |
# -*- coding: UTF-8 -*-
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
import os
import os.path
import shutil
from tempfile import mkdtemp
import crosswords.dictionnaries as dicts
class TestDicts(unittest.TestCase):
def setUp(self):
sel... |
import json
import mock
import unittest
import requests_mock
from datetime import datetime
from erply_api import Erply, ErplyAuth, ErplyAPILimitException
try:
# Python 3
from urllib.parse import urlparse, parse_qs
except ImportError:
# Python 2
from urlparse import urlparse, parse_qs
@requests_mock.... |
# test_files.py
import locale
import pytest
from graphviz.files import Source
SOURCE = {
'source': 'digraph { hello -> world }',
'filename': 'hello.gv', 'directory': 'test-output',
'format': 'PNG', 'engine': 'NEATO', 'encoding': 'utf-8',
}
@pytest.fixture(scope='module')
def source():
return Sourc... |
import pytest
from datetime import datetime
@pytest.mark.vcr()
def test_id_hook(status):
assert isinstance(status['id'], int)
@pytest.mark.xfail(reason='fixed in upstream')
@pytest.mark.vcr()
def test_id_hook_in_reply_to(api, status):
reply = api.status_post('Reply!', in_reply_to_id=status['id'])
try:
... |
import pytest
import madam.image
import io
import PIL.Image
import PIL.ImageChops
import piexif
jpeg_exif = {'0th': {piexif.ImageIFD.Artist: b'Test artist'}}
def image_rgb(width=4, height=3, transpositions=[]):
image = PIL.Image.new('RGB', (width, height))
# Fill the image with a shape which is (probably) ... |
"""Tests all major functionality of the isort library
Should be ran using py.test by simply running py.test in the isort project directory
"""
import os
import os.path
import posixpath
import subprocess
import sys
import sysconfig
from tempfile import NamedTemporaryFile
from typing import Any, Dict, Iterator, List, Se... |
import os
import textwrap
import jinja2
import platform
import pytest
import sys
from conda_devenv.devenv import render_jinja
def test_jinja_root():
assert render_jinja(
"{{root}}",
filename="path/to/file",
is_included=False,
) == os.path.abspath("path/to")
def test_jinja_os(monkey... |
"""Test suite for the linop module."""
#Copyright (c) 2013-2014, Ghislain Vaillant <ghisvail@gmail.com>
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions
#are met:
#1. Redistributions of source code must retain... |
# Copyright 2010 Google 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,... |
from graphlite import V
def test_find(graph):
assert list(graph.find(V(1).knows)) == [2, 3, 4]
assert list(graph.find(V().knows(1))) == [2, 3]
def test_union(graph):
assert list(graph.find(V(1).knows)
.union(V(2).knows)) == [1, 2, 3, 4]
def test_intersection(graph):
assert lis... |
from saxpy import SAX
import numpy as np
class TestSAX(object):
def setUp(self):
# All tests will be run with 6 letter words
# and 5 letter alphabet
self.sax = SAX(6, 5, 1e-6)
def test_to_letter_rep(self):
arr = [7,1,4,4,4,4]
(letters, indices) = self.sax.to_letter_rep(... |
import MySQLdb
import pytest
from _mysql_exceptions import OperationalError
from celery import current_app
from django.conf import settings
from django.core.cache import cache
from django.core.management import call_command
@pytest.fixture
def db_conn():
db_config = settings.DATABASES['default']
db_options = ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above... |
#!/usr/bin/env /usr/bin/python3
import unittest
from kmeldb import mounts
# import argparse
# import os
import sys
if sys.platform.startswith('linux'):
from kmeldb.linux_dir_parser import DirWalker
elif sys.platform == 'darwin':
from kmeldb.mac_dir_parser import DirWalker
elif sys.platform == 'win32':
pass... |
# -*- 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... |
"""Tests for tasks.py."""
import os.path
import re
import sys
import types
import unittest
import weakref
from test import support
from test.script_helper import assert_python_ok
from unittest import mock
import asyncio
from asyncio import tasks
from asyncio import test_utils
PY34 = (sys.version_info >= (3, 4))
PY3... |
# Copyright 2010 Google 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,... |
from __future__ import with_statement
import sys
import time
import unittest
import greenhouse
import greenhouse.poller
from test_base import TESTING_TIMEOUT, StateClearingTestCase
class EventsTestCase(StateClearingTestCase):
def test_isSet(self):
ev = greenhouse.Event()
assert not ev.is_set()
... |
import unittest
from utils import *
from fixtures import *
class TestUtils(unittest.TestCase):
def test_html_to_text(self):
self.assertTrue("<script>" in example_html_str)
self.assertTrue("<head>" in example_html_str)
text_str = html_to_text(example_html_str)
self.assertFalse("<scr... |
# -*- 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... |
# This file is part of the Juju GUI, which lets users view and manage Juju
# environments within a graphical interface (https://launchpad.net/juju-gui).
# Copyright (C) 2012-2014 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public... |
import argparse
import tempfile
import warnings
from itertools import product
from tempfile import NamedTemporaryFile, TemporaryDirectory
from unittest.mock import patch
import numpy as np
import pandas as pd
from numpy.testing import assert_almost_equal
from itertools import count
from nose.tools import assert_dict... |
# Copyright 2015-2016 Yelp 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 writin... |
import sys
from fudge.patcher import with_patched_object
from nose.tools import eq_
from nose.tools import raises
from fabric.state import output
from fabric.utils import warn, indent, abort, fastprint
from utils import mock_streams
@mock_streams('stderr')
@with_patched_object(output, 'warnings', True)
def test_war... |
# -*- coding: utf-8 -*-
"""Unit tests for the utils module.
Author: Simon Larsén
"""
import unittest
from unittest.mock import patch
import tempfile
import configparser
import os
import email
from email.mime.multipart import MIMEMultipart
from .context import pdfebc
class UtilsTest(unittest.TestCase):
NUM_ATTACHM... |
import unittest
import os
import json
import numpy
from molml.utils import get_connections
from molml.utils import get_graph_distance
from molml.utils import LazyValues, SMOOTHING_FUNCTIONS
from molml.utils import get_coulomb_matrix, get_element_pairs
from molml.utils import deslugify, _get_form_indices, get_index_ma... |
# -*- coding: utf-8 -*-
import pytest
from datetime import datetime
from time import sleep
from plexapi.exceptions import BadRequest, NotFound
from . import conftest as utils
def test_video_Movie(movies, movie):
movie2 = movies.get(movie.title)
assert movie2.title == movie.title
def test_video_Movie_attribut... |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from pyramid import testing
from pyramid.httpexceptions import (
HTTPNotFound
)
from .fixtures.data import (
trees
)
from skosprovider.skos import (
Concept
)
import unittest
class ProviderViewTests(unittest.TestCase):
def setUp(self):
self.... |
from rest_framework.test import APITestCase
from tests.testapp.models import TimeSeries
from wq.io import load_string
import json
import datetime
class PandasTestCase(APITestCase):
def setUp(self):
data = (
('2014-01-01', 0.5),
('2014-01-02', 0.4),
('2014-01-03', 0.6),
... |
from bson.json_util import loads, dumps
from mongows.mws.db import get_db
from mongows.mws.views import get_internal_collection_name
from tests import MongoWSTestCase
class ViewsSetUpUnitTestCase(MongoWSTestCase):
def test_create_mws_resource(self):
url = '/mws/'
rv = self.app.post(url)
r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Views tests for the OSF.'''
from __future__ import absolute_import
import unittest
import json
import datetime as dt
import mock
import httplib as http
from nose.tools import * # noqa PEP8 asserts
from tests.test_features import requires_search
from webtest.app import... |
# -*- coding: utf-8 -*-
"""Tests for core functions."""
import datetime
import json
import os
import sys
import time
from itertools import product
from unittest.mock import MagicMock, patch
import pytest
from flask_login import login_user
from peewee import SqliteDatabase
from playhouse.test_utils import test_databas... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot/blob/master/LICENSE
from os.path import join
import pytest
import uproot
ROOT = pytest.importorskip("ROOT")
def test_strings(tmp_path):
filename = join(str(tmp_path), "example.root")
with uproot.recreate(filename, compr... |
# This file is part of Maker Keeper Framework.
#
# Copyright (C) 2017-2018 reverendus
#
# 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 of the License, or
# (at your opti... |
import unittest
import numpy as np
from holoviews import NdOverlay, Element
class CompositeTest(unittest.TestCase):
"For testing of basic composite element types"
def setUp(self):
self.data1 = np.zeros((10, 2))
self.data2 = np.ones((10, 2))
self.data3 = np.ones((10, 2)) * 2
... |
#!/usr/bin/env python
from basetest import BaseTest
import sys, tempfile, os
import unittest, logging
sys.path.insert(0, '..')
from zeroinstall.zerostore import unpack, manifest, Store, BadDigest
from zeroinstall import SafeException, support
from zeroinstall.support import find_in_path
def skipIf(condition, reason):... |
# Copyright (c) 2007, Linden Research, Inc.
# Copyright (c) 2007, IBM Corp.
#
# 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 require... |
#
# Titanium API Coverage Generator
#
# Initial Author: Jeff Haynie, 3/30/09
#
import glob, re, os.path as path
import fnmatch, os, sys
import simplejson as json
import traceback
class GlobDirectoryWalker:
# a forward iterator that traverses a directory tree
def __init__(self, directory, patterns=['*']):
self.sta... |
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
__VERSION__ = '0.01'
DEBUG = False
MAX_RETRIES = 20
INITIAL_RECONNECT_DELAY = 500 # milliseconds
CONNECTED = False
COLAB_DIR = ''
PROJECT_PATH = ''
DEFAULT_HOST = ''
DEFAULT_PORT = 3448
SECURE = True
USERNAME = ''
SECRET = ''
ALERT_ON_MSG = True
ROOM_WINDOW = None
CHAT_VIEW = None
CHAT_VIEW_PATH = None
|
from __future__ import unicode_literals, division
# -*- coding: utf-8 -*-
import prestodb
from django.conf import settings
from django.http.response import HttpResponseNotFound
from django.shortcuts import render, redirect
from django.db import connection, connections
from rest_framework.views import APIView
from forms... |
import os
import os.path
import contextlib
import tempfile
import subprocess
import shutil
from nose.tools import istest, assert_equal
from whack.builder import Builders
@istest
def can_build_simple_application_with_install_dir_used_in_install_script():
_TEST_BUILDER_BUILD = r"""#!/bin/sh
INSTALL_DIR=$1
cat > he... |
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2010, James McCoy
# 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 ... |
# The MIT License (MIT)
# Copyright (c) 2018 Massachusetts Institute of Technology
#
# Author: Cody Rude
# This software has been created in projects supported by the US National
# Science Foundation and NASA (PI: Pankratius)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this sof... |
# -*- coding: utf-8 -*-
"""
textpress.models
~~~~~~~~~~~~~~~~
The core models and query helper functions.
:copyright: 2007 by Armin Ronacher.
:license: GNU GPL.
"""
from math import ceil, log
from datetime import date, datetime, timedelta
from textpress.database import users, tags, posts, post_ta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.