text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import py.test
from mock import Mock, mocksignature
from docutils import nodes
from sphinx.addnodes import pending_xref
from sphinxcontrib import issuetracker
def pytest_funcarg__issue_info(request):
return dict(uri='http://example.com/issues/10', closed=... |
import datasource
from amcatmetadatasource import ConceptMapper, MappedField
import codingjob
import article
import collections
import ont
import project
import toolkit
import cachable
PARTIES = [514,2045,2653,952,1019,1052,1098,1142,1156,1373,1545,1857,1906,1934]
IDEAL = 1625
REALITY = 2547
class NETDataSource(data... |
# -*- coding: utf-8 -*-
"""Tests for the Wikidata parts of the page module."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
#
import copy
import json
from decimal import Decimal
import pywikibot... |
from django.contrib import admin
try:
from django.urls import path
except ImportError:
from django.conf.urls import url as path
from controlcenter.views import controlcenter
urlpatterns = [
path('admin/dashboard/', controlcenter.urls),
path('admin/', admin.site.urls),
]
|
def sort(arr, length):
if length == 1:
return
pivot = choose_pivot(arr, length)
return (arr, length, pivot)
def choose_pivot(arr, length):
return arr[0]
if __name__ == '__main__':
unsorted = list(reversed(range(1000)))
initial_len = len(unsorted)
print sort(unsorted, initial_len) |
# coding: utf-8
from flask.ext.mail import Mail
from flask.ext.security import Security as _Security
from flask.ext.security import MongoEngineUserDatastore
from dealer.contrib.flask import Dealer
from quokka.core.db import db
from quokka.core.cache import cache
from quokka.core.admin import configure_admin
from quokk... |
import logging
import os
import subprocess
import tempfile
import yaml
from .config import config
from .misc import decanonicalize_hostname
from .lockstatus import get_status
from .misc import get_distro
from .misc import get_distro_version
log = logging.getLogger(__name__)
def _get_downburst_exec():
"""
Fi... |
import copy
import logging
import os
import pwd
import re
import time
import yaml
from humanfriendly import format_timespan
from datetime import datetime
from tempfile import NamedTemporaryFile
from teuthology import repo_utils
from teuthology.config import config, JobConfig
from teuthology.exceptions import (
B... |
import logging
from ..orchestra import run
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Run chef-solo on all nodes.
"""
log.info('Running chef-solo...')
run.wait(
ctx.cluster.run(
args=[
'wget',
# '-q',
'-O-',
# ... |
#!/usr/bin/env python
# encoding: utf-8
"""
process.py
Created by Thomas Mangin on 2011-05-02.
Copyright (c) 2009-2012 Exa Networks. All rights reserved.
"""
import subprocess
import select
from exabgp.log import Logger
logger = Logger()
class Processes (object):
def __init__ (self,supervisor):
self.supervisor =... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.shortcuts import render
from text_viewer.kiln_requester import CachedRequesterKiln
from django.core.cache import caches
from api_vars import API_Vars
from text_alignment.api_vars import get_key_from_name
from cms.templatetags.cms_tags import json
de... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Fast R-CNN config system.
This file specifies default config option... |
#!/usr/bin/env python
"""
This script extracts metrics from a RabbitMQ instance.
The usage of this script is as follows:
rabbitmq_monitoring.py <hostname> <port> <user> <password>
"""
import json
from time import sleep
import collections
import sys
from os.path import basename
import urllib2
from base64 import b6... |
#!/usr/bin/env python
"""
This script extracts metrics from a RabbitMQ instance.
The usage of this script is as follows:
rabbitmq_monitoring.py
"""
import json
from time import sleep
import collections
import sys
from os.path import basename
import urllib2
from base64 import b64encode
from string import replace
... |
from threading import Thread
# Emulator
# import pifacecad_emulator as pifacecad
import pifacecad as pifacecad
import time
from threads.piFaceSwitchesThread import PiFaceSwitchesThread
cad = pifacecad.PiFaceCAD()
# PLAY_SYMBOL = pifacecad.LCDBitmap(
# [0x10, 0x18, 0x1c, 0x1e, 0x1c, 0x18, 0x10, 0x0])
# PAUSE_SYMB... |
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage
import threading
class OutputFileQueue(object):
def __init__(self, fp):
self.fp = fp
self.lock = threading.RLock()
def enqueue(self, coord):
with self.lock:
payload = serialize_coord(coord)
... |
import numpy as np
__all__ = ['TimeSeries']
class TimeSeries:
"""TimeSeries class
A TimeSeries object is the main interface from which to sample time series.
You have to provide at least a signal generator; a noise generator is optional.
It is recommended to set the sampling frequency.
Paramete... |
#!/usr/bin/env python
import ConfigParser
import os
import runpy
import shutil
import sys
from argparse import ArgumentParser as ArgumentParserBase
# Be a good neighbour.
if sys.platform == 'win32':
GLOBAL_CONFIG_FILE = 'tipfy.cfg'
else:
GLOBAL_CONFIG_FILE = '.tipfy.cfg'
MISSING_GAE_SDK_MSG = "%(script)r wa... |
from collections import defaultdict
import itertools
import logging
import typing
from typing import Any, Dict, Hashable, List, Optional, Set, Text, Tuple, Type, Iterable
from rasa.shared.exceptions import RasaException
from rasa.shared.nlu.constants import TRAINABLE_EXTRACTORS
from rasa.nlu.config import RasaNLUModel... |
import json
import logging
import os
import chainer
import numpy
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from lib import util
from lib.gui_main.mainwindow import Ui_MainWindow
from lib.node import ControlNode
from lib.subwindows.data_config import DataD... |
import logging
import cv2
import numpy as np
from raspicam.localtypes import Dimension, Point2D
LOG = logging.getLogger(__name__)
def blit(canvas, image, size: Dimension, offset: Point2D):
"""
Resizes an image and copies the resized result onto a canvas at position *offset* with size *size*.
NOTE: The... |
import os
import sublime
import sublime_plugin
import json
import re
from .theme_generator import ThemeGenerator
class ToggleRubyCoverageCommand(sublime_plugin.TextCommand):
"""Show/hide coverage of current file based on a previous coverage run."""
def run(self, edit):
if 'source.ruby' not in self.vi... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import hashlib
from Naked.toolshed.file import FileReader
from Naked.toolshed.system import file_exists, stdout, stderr
#------------------------------------------------------------------------------
# Hasher class - generate MD5 and SHA hash digests from files
#----... |
from django.shortcuts import render, get_object_or_404
from django.views.generic.base import View, TemplateView
from django.template.context_processors import csrf
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import PermissionDenied
from django.contrib import messages
from django.ht... |
#!/usr/bin/env python
import yaml
import json
from pprint import pprint as pp
with open("list_output.yml") as f:
yaml_list=yaml.load(f)
with open("list_output.json") as f:
json_list=json.load(f)
print("YAML List:")
pp(yaml_list)
print("")
print("JSON List:")
pp(json_list)
|
from UserDict import UserDict
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db.models import permalink
from django.template.defaultfilters import truncatechars
from lxml.etree import XMLSyntaxError
import json
import logging
import os
from urllib import urlencode, unquote
im... |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... |
__version__ = '1.0.0'
|
"""Test utilities for code working with files and commands"""
from .asserts import *
from .env import temporary_env, modified_env, make_env_restorer
from .commands import MockCommand, assert_calls
__version__ = '0.5.0'
|
#!/usr/bin/env python
"""
A script to export subtitle information out of Amara onto the local drive.
Launches a thread for each download, so it should be relatively fast.
Then, we can convert this data into CrowdIn format and upload it there.
Also includes a resume mode to pick up where we left off.
TODO(mattfaus): A... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Manas Ranjan Kar
# @Date: 2016-06-21
# @Email: manas@jsm.email
# @Github username: @manasRK
# @Last Modified by: Manas Ranjan KAr
# @Last Modified time: 2016-06-26
import os
import sys
import ast
import gensim
import json
from gensim impor... |
VERSION = (0, 0, 5)
|
import sys
import numpy
from recordlinkage.types import is_list_like, is_numpy_like
# Errors and Exception handlers
class IndexError(Exception):
""" Error class for errors related to indexing. """
pass
# Checks and conversions
def listify(x):
""" make a list of the argument """
if is_list_like(x... |
from flask import Blueprint, request, current_app, flash, redirect, url_for
from flask_security.decorators import login_required
from flask_security import roles_accepted, current_user
from recruit_app.user.eve_api_manager import EveApiManager
from recruit_app.user.models import EveApiKeyPair
from flask import Response... |
"""
A model (``RegistrationProfile``) for storing user-registration data,
and an associated custom manager (``RegistrationManager``).
"""
import datetime, random, re, sha
from django.conf import settings
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation i... |
from __future__ import unicode_literals
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.db import models
from django.template import RequestContext, TemplateDoesNotExist
from django.template.loader import render_to... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 S... |
"""
A registration profile model and associated manager.
The RegistrationProfile model and especially its custom manager
implement nearly all the logic needed to handle user registration and
account activation, so before implementing something in a view or
form, check here to see if they can take care of it for you.
... |
#
# Copyright (C) 2012 - 2017 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring, protected-access
from __future__ import absolute_import
import os.path
import unittest
import anyconfig.backend.ini as TT
import tests.common
from anyconfig.compat import OrderedDict as ODict
from te... |
"""
A model (``RegistrationProfile``) for storing user-registration data,
and an associated custom manager (``RegistrationManager``).
"""
import datetime
import random
import re
import sha
from django.conf import settings
from django.db import models
from django.template.loader import render_to_string
from django.u... |
# -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import os
import re
import copy
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
import django_filters
from django.contrib.auth.models import User, Group
from .models import Source, Registration
from rest_hooks.models import Hook
from rest_framework import viewsets, mixins, generics, status, filters
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.views import... |
import unittest
import os
import tempfile
import overrides_hack
import shutil
import subprocess
import six
import locale
import re
import tarfile
from utils import create_sparse_tempfile, create_lio_device, delete_lio_device, skip_on, get_avail_locales, requires_locales, run_command, read_file
from gi.repository impor... |
#copyright ReportLab Inc. 2000
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/utils.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/lib/utils.py,v 1.65 2004/03/23 13:54:42 rgbecker Exp $
__version__=''' $Id: utils.py,v 1.65 2004/03/23 13:54:42 rgbecker ... |
# -*- coding: utf-8 -*-
# Copyright 2017 EMBL - European Bioinformatics Institute
#
# 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 requ... |
#!/usr/bin/env python
# =============================================================================
# Two-armed Bandit
#
# @author: Elisha Lai
# @description: Program for computing the greedy choice, optimal reward,
# optimal choice or greedy reward for a two-armed bandit
# @version: 0.0.1 30/10/2016
# =====... |
from datetime import datetime
from epsilon.extime import Time
from twisted.internet.defer import succeed
from txaws.credentials import AWSCredentials
from txaws.service import AWSServiceEndpoint
from txaws.storage import client
from txaws.testing import payload
from txaws.testing.base import TXAWSTestCase
from txaws... |
#!/usr/bin/python
import sys
import copy
from pprint import pformat
from sfa.generic import Generic
from optparse import OptionParser
from pprint import PrettyPrinter
from sfa.util.xrn import Xrn
from sfa.storage.record import SfaRecord
from sfa.client.sfi import save_records_to_file
pprinter = PrettyPrinter(indent=4... |
##
# This module implements a hierarchy of authorities and performs a similar
# function as the "tree" module of the original SFA prototype. An HRN
# is assumed to be a string of authorities separated by dots. For example,
# "planetlab.us.arizona.bakers". Each component of the HRN is a different
# authority, with the l... |
##
# This module implements the client-side of the Geni API. Stubs are provided
# that convert the supplied parameters to the necessary format and send them
# via XMLRPC to a Geni Server.
#
# TODO: Investigate ways to combine this with existing PLC API?
##
### $Id$
### $URL$
from sfa.trust.gid import *
from sfa.trust... |
#!/usr/bin/python
import os, sys
import traceback
import logging, logging.handlers
CRITICAL=logging.CRITICAL
ERROR=logging.ERROR
WARNING=logging.WARNING
INFO=logging.INFO
DEBUG=logging.DEBUG
# a logger that can handle tracebacks
class _SfaLogger:
def __init__ (self,logfile=None,loggername=None,level=logging.INF... |
#!/usr/bin/python
"""create BIDS tsv files from raw behavioral data
"""
import numpy as np
import h5py
import warnings
import pandas as pd
from collections import Counter
import os
def create_tsv_df(behavioral_results, unshuffled_stim_description, run_num):
"""create and return the df with info for BIDS tsv for a... |
from .about import __version__
__version__ # Silence unused import warning.
import time
import hashlib
import secrets
import socket
import itertools
import functools
import msgpack
import ipaddress
import os
import struct
import logging
from enum import Enum
from sanic import Sanic
from sanic.request import Request a... |
# -*- coding: utf-8 -*-
from django import VERSION as django_version
if django_version[0] >= 1 and django_version[1] >=3: # pragma: no cover
from django.views.generic import TemplateView, ListView, DetailView, View
else:# pragma: no cover
from cbv import TemplateView, ListView, DetailView, View
class ShopTempl... |
# -*- coding: utf-8 -*-
"""
This models the checkout process using views.
"""
from django.core.urlresolvers import reverse
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from shop.forms import BillingShippingForm
from shop.models import AddressModel
from shop.models.ordermod... |
import numpy as np
from gensim.corpora import Dictionary
from gensim.models import TfidfModel
from scipy.sparse import dok_matrix
import pandas as pd
import pickle
from . import compactmodel_io as cio
dtm_suffices = ['_docids.pkl', '_dictionary.dict', '_dtm.pkl']
@cio.compactio({'classifier': 'dtm'}, 'dtm', dtm_s... |
import os
import json
from sifra.logger import rootLogger
class Configuration:
"""
Reads all the simulation configuration constants to be read
by other classes
"""
def __init__(self, configuration_file_path,
run_mode='impact', output_path=''):
"""
:param configura... |
from __future__ import print_function
from __future__ import division
from builtins import str, zip, range
import numpy as np
np.seterr(divide='print', invalid='raise')
import pandas as pd
import os
import copy
import itertools
import matplotlib.pyplot as plt
plt.switch_backend('agg')
plt.rcParams['mathtext.fonts... |
import copy
import simplejson
import requests
from requests.auth import HTTPBasicAuth
import warnings
from ..endpoint import ApiEndpoint
from ..exception import ApiException
from ..interface import BaseConnection
from ..objects import ApiObject, Observation, Experiment, Suggestion
from .resource import ApiResource
de... |
import Coordonnees
import Intersection
from math import sqrt
import copy
class Vehicule:
distance_minimale_roulant = 150 #cm
distance_minimale = 30 #cm
proportion_discourtois = 0.8
acceleration_max = 1 # m.s^(-2)
deceleration_conf = 3 # m.s^{-2}
temps_reaction = 1.5 # secondes
largeur = 170... |
import Coordonnees
import Intersection
from math import sqrt
class Vehicule:
distance_minimale_roulant = 150 #cm
distance_minimale = 30 #cm
proportion_discourtois = 0.8
acceleration_max = 100 # cm.s^(-2)
deceleration_conf = 300 # cm.s^{-2}
temps_reaction = 1.5 # secondes
count = 0
v_max... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Malcolm Ramsay <malramsay64@gmail.com>
#
# Distributed under terms of the MIT license.
"""Set running a series of simulations."""
import subprocess
import sys
from pathlib import Path
import numpy as np
pbs_file = """
#!/bin/bash
#... |
# -*- coding: utf-8 -*-
u"""SRW execution template.
:copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import glob
import json
import numpy as np
import os
import py.path
imp... |
#!/usr/bin/env python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# 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... |
# -*- coding: utf-8 -*-
""" This script contains tests for the core.queue module.
"""
import unittest
from datetime import datetime
from core.message import Message
from core.queue import MessageQueue
class MessageQueueTest(unittest.TestCase):
def test_put_pop_users(self):
q = MessageQueue(2)
sel... |
#!/usr/bin/env python3
import logging
from collections import defaultdict
from errno import ENOENT
from stat import S_IFDIR, S_IFLNK, S_IFREG, S_ISDIR, S_ISREG
from sys import argv, exit
from time import time, sleep
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
import socket
import sys
import select
im... |
#!/usr/bin/env python3
import unittest
import sys
sys.path.append('..')
from Geometry import Point
from Geometry.exceptions import *
class NumberFactory(object):
@classmethod
def List(cls,n=3,v=0):
if n == 0:
return []
return [v]*n
@classmethod
def Dict(cls,keys='xyz',v=0)... |
import sys
sys.path.append('./BPRC/bprc')
sys.path.append('./BPRC/bprc/tests')
print(sys.path)
import unittest
import yaml
from ddt import ddt, data, file_data, unpack
from bprc.recipe import Recipe
from bprc.stepprocessor import StepProcessor
from bprc.utils import *
import sys
print(sys.path)
#TODO: Add mocking for... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import os
import re
import unittest
import uuid
import warnings
import numpy as np
import properties
import six
class TestBasi... |
from elasticsearch import Elasticsearch
ES_HOST = 'localhost:9200'
ES_INDEX_NAME = 'smartapi_3'
ES_DOC_TYPE = 'api'
def get_es(es_host=None):
es_host = es_host or ES_HOST
es = Elasticsearch(es_host, timeout=120)
return es
def create_index(index_name):
body = {}
mapping = {
"api" : {
... |
from __future__ import division
from dials.array_family import flex
from scitbx import matrix
import math
from iotbx import phil
from dials.algorithms.shoebox import MaskCode
absorption_defs = """
absorption_correction
.multiple = True {
apply = False
.type = bool
.help = must be supplied as a us... |
#!/usr/bin/env python
# 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.
"""Linux specific tests."""
from __future__ import division
import collections
import contextlib
import errno
import io
import os
i... |
#! /usr/bin/env python
"""This Module provides the functions from bitcoin.de Trading API"""
import requests
import time
import json
import hmac
import hashlib
import logging
import codecs
# these two lines enable debugging at httplib level
# (requests->urllib3->httplib)
# you will see the REQUEST, including HEADERS a... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# Tai Sakuma <tai.sakuma@gmail.com>
import os
import logging
import subprocess
import collections
##__________________________________________________________________||
class SubprocessRunner(object):
def __init__(self, pipe=False):
self.running_procs = collections.deque()
self.pipe = pipe
def... |
from unittest import TestCase
from mock import patch
import btcde
class TestBtcdeApi(TestCase):
"""Test Api Functions."""
def setUp(self):
self.patcher = patch('btcde.APIConnect')
self.mock_APIConnect = self.patcher.start()
def tearDown(self):
self.patcher.stop()
... |
from nose.tools import eq_, ok_
from path import Path
from pyavrutils.arduino import Arduino, ArduinoCompileError
from pyavrutils.support import simple_targets
import logging
from nose_ittr import IttrMultiplier, ittr
import tempfile
root = Path(__file__).abspath().parent.parent
sample_cfg = root / 'sample_cfg.h'
'''... |
"""Workbench: Open Source Security Framework """
# Okay this monkey patch call needs to be first
# Note: The thread=False parameters appears to be needed
# for MongoDB, if you know a better way please do PR :)
from gevent import monkey; monkey.patch_all(thread=False) # Monkey!
from gevent import signal as geven... |
"""Event arrays are 2D label arrays (time x ROI) that are generated from an
array of fluorescent traces of the same size. Event dection is based on the
method of Dombeck et al., 2007, and looks for events that cross a multiple
of the standard deviation of the baseline, and last until the traces goes
back down to 0.75... |
# -*- coding: utf-8 -*-
import time
import unittest
from tracblockdiag import cache
class TestFunction(unittest.TestCase):
def test_is_obsolete(self):
entry = {'time': time.time()}
self.assertTrue(cache.is_obsolete(entry, 0))
self.assertFalse(cache.is_obsolete(entry, 3600))
def test... |
def cforange_split_dataset(input_dict):
import orange
output_dict = {}
data = input_dict['dataset']
selection = orange.MakeRandomIndices2(data,float(input_dict['p']))
train_data = data.select(selection,0)
test_data = data.select(selection,1)
output_dict['train_data']=train_data
output_di... |
import os
import logging
import itertools
import datetime
from collections import defaultdict
import operator
from django.conf import settings
from rest_framework.exceptions import ValidationError
from django.contrib.gis.geos import Point, Polygon
from django.contrib.gis.gdal import SpatialReference, CoordTransform
fr... |
from . import file_utils
from . import web_utils
from .config_util import ConfigUtil
import os
import inspect
import logging
log = logging.getLogger(__file__)
class CacheBase(object):
cache_expire = 31
_cache_dir = None
_config = None
def __init__(self, section="cache", cache_dir=None):
# im... |
from django.core.urlresolvers import reverse
from ..models import Organization, Person, TrainingRequest
from .base import TestBase
class TestSearchOrganization(TestBase):
'''Test cases for searching on Organization.'''
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
def test_... |
import uuid
from django.core.urlresolvers import reverse
from rest_framework import status
from django.test.testcases import TestCase
from ownership.views import MISSING_TRANSFER_ID_MSG, TRANSFER_ID_NOT_FOUND, REASON_REQUIRED_MSG, NOT_RECIPIENT_MSG
from switchboard.dds_util import SHARE_IN_RESPONSE_TO_DELIVERY_MSG
from... |
#!/usr/bin/env python
# Copyright 2015-2016, EMC, Inc.
"""
The script compute the version of a package, just like:
1.1.1-20161129UTC
usage:
./on-tools/manifest-build-tools/HWIMO-BUILD on-tools/manifest-build-tools/application/version_generator.py \
--repo-dir /home/onrack/rackhd/release/rackhd-repos/PengTian0/b/b/on-... |
# coding=utf-8
from unittest import TestCase
from click.testing import CliRunner
import yoda
class TestDiary(TestCase):
"""
Test for the following commands:
Assumes empty diary.
| Module: diary
| command: diary tasks, nt, ct
"""
def __init__(self, methodName='ru... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... |
"""
owtf.managers.config_manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import logging
import os
import yaml
from owtf.config import config_handler
from owtf.db import models
from owtf.lib.exceptions import InvalidConfigurationReference
from owtf.utils.error import abort_framework
from owtf.utils.file import FileOperations... |
#!/usr/bin/env python
import os
from tempfile import NamedTemporaryFile
from snakemake.shell import shell
# All wrappers must be able to handle an optional params.extra.
extra = snakemake.params.get('extra', '')
# This lets us handle whether to write to a log file or to write to stdout.
# See snakemake.script.log_fm... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 - 2012 -- Lars Heuer <heuer[at]semagia.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:
#
# * Redistributions of source code must retain th... |
from __future__ import print_function
import json
import warnings
from os import listdir, path
from unittest import TestCase
import six
from jsontest import JsonTest
from pyinfra.api import StringCommand
from pyinfra.api.facts import FACTS, ShortFactBase
from pyinfra_cli.util import json_encode
from .util import g... |
#import modules
from __future__ import division
import re
from collections import Counter
from sets import Set
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import MySQLdb
#create xml collection of "docs" (i.e., programs in NYPhil's definition)
tree = ET.parse('../Programs/complete.xml')
root = tr... |
# Landsat Util
# License: CC0 1.0 Universal
"""Tests for image processing"""
from os.path import join, abspath, dirname, exists
import errno
import shutil
import unittest
from tempfile import mkdtemp
from landsat.image import Simple, PanSharpen
from landsat.ndvi import NDVI, NDVIWithManualColorMap
class TestProces... |
#!/usr/bin/env python
## \file find_cfl_number.py
# \author Trent Lukaczyk
#
# SU2, Copyright (C) 2012-2013 Aerospace Design Laboratory (ADL).
#
# SU2 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 Foun... |
"""
Test for: mongo
"""
from nose.tools import assert_raises, raises, eq_, ok_
from m2s3 import mongo
import os
@raises(TypeError)
def test_make_tarfile_nonstr():
# _make_tarfile with non-string src_dir
mongo._make_tarfile(123)
def test_make_tarfile():
# whether the file name return is the expected
... |
# $Id$
import pycurl
m = pycurl.multi_init()
c1 = pycurl.init()
c2 = pycurl.init()
c1.setopt(pycurl.URL, 'http://curl.haxx.se')
c2.setopt(pycurl.URL, 'http://python.org')
m.add_handle(c1)
m.add_handle(c2)
while 1:
num_handles = m.perform()
if num_handles == 0:
break
m.remove_handle(c2)
m.remove_handle(... |
from datetime import datetime
import httplib as http
import logging
import json
import time
import urlparse
import httpretty
from nose.tools import * # noqa
from framework.auth import authenticate
from framework.exceptions import PermissionsError, HTTPError
from framework.sessions import session
from website.oauth.m... |
# -*- coding: UTF-8 -*-
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
import sys
import webbrowser
import p7doi
class TestP7doi(unittest.TestCase):
def setUp(self):
self.wb_args = None
def fake_open_new_tab(*args):
s... |
"""
Python translation of Zhigang Xu's tidal_ellipse MATLAB tools, available at
http://woodshole.er.usgs.gov/operations/sea-mat/tidal_ellipse-html/ap2ep.html
Converted to Python by Pierre Cazenave (Plymouth Marine Laboratory), October
2012. Email: pica@pml.ac.uk
Authorship Copyright:
The author retains the copyri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.