code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('libreosteoweb', '0006_examination_status_reason'),
]
operations = [
migrations.CreateModel(
name='Invoice',
... | garthylou/Libreosteo | libreosteoweb/migrations/0007_auto_20150123_0851.py | Python | gpl-3.0 | 2,744 |
import os
from functools import partial
from PyQt4.QtCore import QObject, SIGNAL
from PyQt4.QtGui import QIcon
from qgis.utils import iface
from processing.core.Processing import Processing
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.GeoAlgorithm import GeoAlgorithm
from process... | ricardogsilva/qgisconefor | processing/processingconeforinputs.py | Python | gpl-3.0 | 9,891 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | marcsowen/homematicip-rest-api | homematicip/_version.py | Python | gpl-3.0 | 18,466 |
#!/usr/bin/env python
#
# Copyright (C) 2012 Strahinja Val Markovic <val@markovic.io>
#
# This file is part of MatchTagAlways.
#
# MatchTagAlways 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 versio... | vim-IDE/MatchTagAlways | python/mta_core.py | Python | gpl-3.0 | 8,519 |
"""
Manual Topology Experiment with Background Traffic
"""
from __future__ import print_function, division
import settings
from core.ns3.NS3Config import BackgroundTrafficConfig
from core.ns3.Topology import ManualTopologyNet
from experiments import experiment_factory
from core.configure import gen_anomaly_dot
import ... | JBonsink/GSOC-2013 | experiments/ManualTopoBTExperiment.py | Python | gpl-3.0 | 6,305 |
# -*- encoding: utf-8 -*-
from abjad import *
from abjad.tools import tonalanalysistools
def test_tonalanalysistools_ChordSuspension___eq___01():
chord_suspension = tonalanalysistools.ChordSuspension(4, 3)
u = tonalanalysistools.ChordSuspension(4, 3)
voice = tonalanalysistools.ChordSuspension(2, 1)
... | mscuthbert/abjad | abjad/tools/tonalanalysistools/test/test_tonalanalysistools_ChordSuspension___eq__.py | Python | gpl-3.0 | 634 |
# vim: set fileencoding=utf-8 :
# GNU Solfege - free ear training software
# Copyright (C) 2009, 2011 Tom Cato Amundsen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | allancarlos123/Solfege | solfege/fpeditor.py | Python | gpl-3.0 | 34,015 |
import pytest
import elephant
import neo
import quantities as pq
import numpy as np
def test_baysian():
from exana.stimulus import baysian_latency, generate_salt_trials
from exana.misc import concatenate_spiketrains
from elephant.spike_train_generation import homogeneous_poisson_process as hpp
np.rand... | CINPLA/exana | exana/tests/_test_baysian_latency.py | Python | gpl-3.0 | 3,442 |
import unittest
import sys
import os.path
sys.path.append(os.path.abspath('..'))
from sickbeard import common
class QualityTests(unittest.TestCase):
# TODO: repack / proper ? air-by-date ? season rip? multi-ep?
def test_SDTV(self):
self.assertEqual(common.Quality.SDTV, common.Quality.nameQuality("... | wschwa/Mr-Orange-Sick-Beard | tests/common_tests.py | Python | gpl-3.0 | 6,501 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Andrew Dunham <andrew@du.nham.ca>
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on macports (Jimmy Tang <jcftang@gmail.com>)
#
# This module is free software: you can redistribute it and/or modify
... | kbrebanov/ansible-modules-extras | packaging/os/homebrew.py | Python | gpl-3.0 | 28,076 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from pootle_format.models imp... | ta2-1/pootle | tests/pootle_fs/receivers.py | Python | gpl-3.0 | 1,046 |
#
# Copyright 2019-2020 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
import logging
import numpy
import megaradrp.instrument.focalplane as fp
from numina.frame.utils import copy_img
def subtract_sky(img, ignored_sky_bu... | sergiopasra/megaradrp | megaradrp/processing/sky.py | Python | gpl-3.0 | 2,585 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tests various schema replication scenarios
#
# Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fou... | lidan-fnst/samba | source4/torture/drs/python/replica_sync.py | Python | gpl-3.0 | 36,840 |
########################################################################
# $HeadURL$
# File : DIRACPilotDirector.py
# Author : Ricardo Graciani
########################################################################
"""
Dirac PilotDirector class, it uses DIRAC CE backends to submit and monitor pilots.
It include... | hgiemza/DIRAC | WorkloadManagementSystem/private/DIRACPilotDirector.py | Python | gpl-3.0 | 13,788 |
import collections
import io
import os
import re
from ruamel import yaml
from borgmatic.config import load
INDENT = 4
SEQUENCE_INDENT = 2
def _insert_newline_before_comment(config, field_name):
'''
Using some ruamel.yaml black magic, insert a blank line in the config right before the given
field and it... | witten/borgmatic | borgmatic/config/generate.py | Python | gpl-3.0 | 10,638 |
from parabem.pan2d import doublet_2_1
import parabem
import numpy as np
v1 = parabem.PanelVector2(-1, 0)
v2 = parabem.PanelVector2(1, 0)
panel = parabem.Panel2([v2, v1])
vals = ([doublet_2_1(parabem.Vector2(x, 0), panel, True) for x in np.linspace(-2, 2, 20)])
print(vals)
| looooo/panel-method | examples/tests/test_linear_2d_doublet.py | Python | gpl-3.0 | 276 |
#!/usr/bin/env python3
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This... | Passtechsoft/TPEAlpGen | blender/doc/blender_file_format/BlendFileDnaExporter_25.py | Python | gpl-3.0 | 15,484 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-10 18:20
from __future__ import unicode_literals
from django.db import migrations
from django.db import connection
def table_exists(tablename):
cursor = connection.cursor()
cursor.execute(
"""SELECT EXISTS (SELECT * FROM pg_tables WHERE... | WorldBank-Transport/DRIVER | app/data/migrations/0011_copy_ashlar_tables.py | Python | gpl-3.0 | 2,467 |
"""
Unittest for time.strftime
"""
import calendar
import sys
import os
import re
from test import test_support
import time
import unittest
# helper functions
def fixasctime(s):
if s[8] == ' ':
s = s[:8] + '0' + s[9:]
return s
def escapestr(text, ampm):
"""
Escape text to deal with possible ... | mancoast/CPythonPyc_test | cpython/266_test_strftime.py | Python | gpl-3.0 | 6,966 |
# Rest Imports
from rest_framework import status
# Local Imports
from ava_core.abstract.test_data import AvaCoreTestData
from ava_core.integration.integration_ldap.models import LDAPIntegrationAdapter
# Implementation
class LDAPIntegrationAdapterTestData(AvaCoreTestData):
"""
Test data for LDAPIntegrationAdap... | alzeih/ava | ava_core/integration/integration_ldap/test_data.py | Python | gpl-3.0 | 6,603 |
# coding: utf-8
import sqlalchemy as sa
import pandas as pd
from niamoto.data_providers.base_occurrence_provider import \
BaseOccurrenceProvider
from niamoto.exceptions import MalformedDataSourceError
class SQLOccurrenceProvider(BaseOccurrenceProvider):
"""
SQL occurrence provider. Instantiated with a s... | dimitri-justeau/niamoto-core | niamoto/data_providers/sql_provider/sql_occurrence_provider.py | Python | gpl-3.0 | 2,139 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
This script check that only whitelisted headers are included (transitivly) by
including chemfiles.h or chemfiles.hpp.
"""
from __future__ import print_function
import os
import sys
import re
import codecs
ROOT = os.path.join(os.path.dirname(__file__), "..", "..")
GENERA... | Luthaf/Chemharp | tests/lints/check-public-headers.py | Python | mpl-2.0 | 3,005 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | infrastructure/learning_unit/domain/service/tutor_distributed_to_class.py | Python | agpl-3.0 | 2,385 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | john-wang-metro/metro-openerp | metro_project/project_engineer.py | Python | agpl-3.0 | 6,452 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | VitalPet/report-print-send | __unported__/printer_tray/ir_report.py | Python | agpl-3.0 | 2,414 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.core.exceptions import ValidationError
from django.contrib.gis.db import models
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from djang... | recklessromeo/otm-core | opentreemap/importer/models/trees.py | Python | agpl-3.0 | 15,243 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | houssine78/vertical-travel-porting-v8-wip | motor_vehicle/vehicle_category.py | Python | agpl-3.0 | 1,375 |
"""
A set of built-in default checks for the platform heartbeat endpoint
Other checks should be included in their respective modules/djangoapps
"""
from datetime import datetime, timedelta
from time import sleep, time
from django.conf import settings
from django.core.cache import cache
from django.db import connectio... | lduarte1991/edx-platform | openedx/core/djangoapps/heartbeat/default_checks.py | Python | agpl-3.0 | 4,002 |
"""
Tests for hitting the xanalytics API.
"""
import json
import logging
from unittest import TestCase
from django.conf import settings
import responses
from xanalytics import send_request, get_result, _call
log = logging.getLogger(__name__)
class TestAPI(TestCase):
"""
Tests using mocks to avoid actual H... | mitodl/lore | xanalytics/tests/test_api.py | Python | agpl-3.0 | 2,673 |
from dependencies.dependency import ModuleSecurityInfo#, #allow_module
from dependencies.dependency import DateTime
from dependencies.dependency import DisplayList
from dependencies.dependency import getToolByName
from dependencies.dependency import TranslationServiceTool
from lims.browser import BrowserView
from lims ... | yasir1brahim/OLiMS | lims/idserver.py | Python | agpl-3.0 | 8,055 |
#
# Copyright (c) 2015 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | PuZZleDucK/pixelated-user-agent | service/pixelated/adapter/mailstore/leap_mailstore.py | Python | agpl-3.0 | 15,900 |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
class Command(BaseCommand):
help = 'Update SPIN SOS112 feed.'
def handle(self, *args, **options):
from prometapi.sos112.models import SOS112, fetch_sos112, parse_sos112
i... | zejn/prometapi | prometapi/sos112/management/commands/update_sos112.py | Python | agpl-3.0 | 707 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
def set_assets_processor(request):
"""
Simple context processor that overwrite the assets of 'org' on the context if org
is present in the request.
"""
if getattr(request, "org", None):
... | rapidpro/ureport | ureport/assets/context_processors.py | Python | agpl-3.0 | 689 |
from blinker import Namespace
namespace = Namespace()
#: Trigerred when a reuse is published
on_reuse_published = namespace.signal('on-reuse-published')
| opendatateam/udata | udata/core/reuse/signals.py | Python | agpl-3.0 | 155 |
# assign epitope fitness to each node in the phylogeny
import time
from io_util import *
from tree_util import *
from date_util import *
from seq_util import *
import numpy as np
from itertools import izip
from collections import defaultdict
def append_nonepitope_sites(viruses):
for virus in viruses:
sites_ne = no... | doerlbh/Indie-nextflu | augur/scratch/fitness_nonepitope.py | Python | agpl-3.0 | 2,409 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Setup and install the archive interface with hpss."""
import sys
from os.path import isfile
from os import path
from setuptools.extension import Extension
from setuptools import setup, find_packages
HPSS = Extension(
'pacifica.archiveinterface.backends.hpss._hpssExtensi... | dmlb2000/pacifica-archiveinterface | setup.py | Python | lgpl-3.0 | 1,765 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Lucien Loiseau
#
# This file is part of a weboob module.
#
# This weboob module 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 Licen... | laurentb/weboob | modules/wordreference/pages.py | Python | lgpl-3.0 | 1,432 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Unit tests for the :meth:`iris.experimental.ugrid.mesh.Mesh.from_coords`.
"""
# Import iris.tests first so that some thing... | SciTools/iris | lib/iris/tests/unit/experimental/ugrid/mesh/test_Mesh__from_coords.py | Python | lgpl-3.0 | 9,316 |
'''
This file for provoking a serie of tests relating all basic componnents
in OPAL. It is used to provoke as well as the simple examples that are
in the `examples` directory.
The `nose` package is required to run the tests.
For testing OPAL installation, just launch at shell prompt a command:
shell$ python test.... | dpo/opal | test.py | Python | lgpl-3.0 | 587 |
import unittest
from elasticd.plugins import BasePlugin
from elasticd.plugins import ResourceLocator
from elasticd.plugins import Driver
from elasticd.plugins import Datastore
from elasticd.plugin_manager import PluginManager
import os
import ConfigParser
def get_test_plugin_manager():
config_file = os.path.dirnam... | SMxJrz/Elasticd | test/__init__.py | Python | apache-2.0 | 566 |
#coding=utf-8
"""Contains the logic to create cohesive forms on the explore view"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import OrderedDict
from copy import copy
import json
import math
fro... | wbsljh/caravel-aidp | caravel/forms.py | Python | apache-2.0 | 54,325 |
import fnmatch
import glob
import os
import re
import tempfile
from gppylib import gplog
from gppylib.commands.base import WorkerPool, Command, REMOTE
from gppylib.commands.unix import Scp
from gppylib.db import dbconn
from gppylib.db.dbconn import execSQL
from gppylib.gparray import GpArray
from pygresql import pg
fro... | foyzur/gpdb | gpMgmt/bin/gppylib/operations/backup_utils.py | Python | apache-2.0 | 38,070 |
"""
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
Copyright (C) 2012 University of Auckland
This file is part of MAP Client. (http://launchpad.net/mapclient)
MAP Client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publi... | mapclient-plugins/fieldworkgait2392geomstep | mapclientplugins/__init__.py | Python | apache-2.0 | 909 |
#!/usr/bin/env python
# Elijah: Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
#
# Copyright (C) 2011-2014 Carnegie Mellon University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | cmusatyalab/elijah-openstack | client/cloudlet_client.py | Python | apache-2.0 | 36,615 |
import mock
from nose.tools import * # flake8: noqa
import pytest
from addons.github.models import GithubFile
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_p... | leb2dg/osf.io | api_tests/preprints/views/test_preprint_list.py | Python | apache-2.0 | 38,270 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | djkonro/client-python | kubernetes/test/test_v1beta1_storage_class.py | Python | apache-2.0 | 891 |
# Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.lib.request impor... | jackrzhang/zulip | zerver/webhooks/airbrake/view.py | Python | apache-2.0 | 1,393 |
# Copyright (c) 2013 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 writi... | TechJournalist/stackalytics | tests/unit/test_web_utils.py | Python | apache-2.0 | 3,954 |
# -------------------------------------------------------------
#
# 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 unde... | apache/incubator-systemml | src/main/python/systemds/operator/nodes/matrix.py | Python | apache-2.0 | 16,930 |
# -*- coding: utf-8 -*-
import mock
import pytest
import six
import pylast
def mock_network():
return mock.Mock(
_get_ws_auth=mock.Mock(return_value=("", "", ""))
)
@pytest.mark.parametrize('artist', [
u'\xe9lafdasfdsafdsa', u'ééééééé',
pylast.Artist(u'B\xe9l', mock_network()),
'fdasfds... | yanggao1119/pylast | tests/unicode_test.py | Python | apache-2.0 | 727 |
import os
import time
from motorway.messages import Message
from motorway.ramp import Ramp
"""
Requires pip install recurly
"""
class RecurlyRamp(Ramp):
@property
def recurly(self):
import recurly
recurly.SUBDOMAIN = os.environ.get('RECURLY_SUBDOMAIN')
recurly.API_KEY = os.environ.ge... | plecto/motorway | motorway/contrib/recurly_integration/ramps.py | Python | apache-2.0 | 1,594 |
from sopel import module
from sopel.tools import Identifier
import time
import re
TIMEOUT = 36000
@module.rule('^(</?3)\s+([a-zA-Z0-9\[\]\\`_\^\{\|\}-]{1,32})\s*$')
@module.intent('ACTION')
@module.require_chanmsg("You may only modify someone's rep in a channel.")
def heart_cmd(bot, trigger):
luv_h8(... | ridelore/sopel-modules | rep.py | Python | apache-2.0 | 4,834 |
# -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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 ... | clarkperkins/stackdio | stackdio/api/blueprints/admin.py | Python | apache-2.0 | 1,615 |
#!/usr/bin/python
#
# Copyright 2017 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 a... | daydayuplo/gee | earth_enterprise/src/server/wsgi/serve/kh_constants.py | Python | apache-2.0 | 1,227 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 26 18:03:24 2014
@author: KDB
"""
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.dates import date2num, num2date, HourLocator, DayLocator, AutoDateLocator, DateFormatter
from matplotl... | JrtPec/opengrid | opengrid/library/plotting.py | Python | apache-2.0 | 6,242 |
# Copyright 2012 OpenStack Foundation.
# 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 req... | bgxavier/neutron | neutron/context.py | Python | apache-2.0 | 4,387 |
# Copyright 2015 Metaswitch Networks
#
# 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 w... | plwhite/libcalico | calico_containers/pycalico/datastore.py | Python | apache-2.0 | 41,654 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Deutsche Telekom AG
# 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... | adkerr/tempest | tempest/tests/stress/test_stress.py | Python | apache-2.0 | 1,945 |
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
"""
Entry points.
"""
import os
import os.path
import sys
### Utility functions
def get_specifications():
"""Get entry point specifications
See:
* https://pythonhosted.org/distlib/reference.html#distlib.scripts.ScriptMak... | nerdvegas/rez | src/rez/cli/_entry_points.py | Python | apache-2.0 | 6,916 |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | USGSDenverPychron/pychron | pychron/hardware/watlow/watlow_ezzone.py | Python | apache-2.0 | 8,596 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# 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.... | yamahata/tacker | tacker/tests/unit/test_agent_rpc.py | Python | apache-2.0 | 4,837 |
from __future__ import with_statement
import unittest
from pony.orm.core import *
from testutils import *
db = Database('sqlite', ':memory:')
class Student(db.Entity):
name = Required(unicode)
scholarship = Optional(int)
db.generate_mapping(create_tables=True)
with db_session:
Student(id=1, name="Joe",... | buddyli/private2w | libs/pony/orm/tests/test_declarative_method_monad.py | Python | apache-2.0 | 3,351 |
#!/usr/bin/env python3
""" CDP tests """
from scapy.packet import Packet
from scapy.all import ShortField, StrField
from scapy.layers.l2 import Dot3, LLC, SNAP
from scapy.contrib.cdp import CDPMsgDeviceID, CDPMsgSoftwareVersion, \
CDPMsgPlatform, CDPMsgPortID, CDPv2_HDR
from framework import VppTestCase
from ... | FDio/vpp | test/test_cdp.py | Python | apache-2.0 | 4,468 |
from six import PY2
from apitools.base.py.exceptions import HttpNotFoundError
import jinja2
import pytest
from ruamel.yaml import YAML
from cloud_foundation_toolkit.deployment import Config
from cloud_foundation_toolkit.deployment import ConfigGraph
from cloud_foundation_toolkit.deployment import Deployment
if PY2:
... | GoogleCloudPlatform/cloud-foundation-toolkit | dm/tests/unit/test_deployment.py | Python | apache-2.0 | 2,633 |
# Copyright 2011 OpenStack Foundation
# 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 requ... | openstack/nova | nova/tests/unit/api/openstack/compute/test_limits.py | Python | apache-2.0 | 24,448 |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for the Volumes Plugin API provided by the plugin.
"""
from uuid import uuid4, UUID
from twisted.web.http import OK
from twisted.internet import reactor
from .._api import VolumePlugin, DEFAULT_SIZE
from ...apiclient import FakeFlockerClient, Datas... | adamtheturtle/flocker | flocker/dockerplugin/test/test_api.py | Python | apache-2.0 | 6,785 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Classes and functions for layer 2 protocols.
"""
import os,struct,time
from scapy.base_classes import Net
from scapy... | kisel/trex-core | scripts/external_libs/scapy-2.3.1/python3/scapy/layers/l2.py | Python | apache-2.0 | 17,955 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests that HTML generation is awesome."""
import datetime
import glob
import json
import os
import os.path
import re
import sys
from unittest import mock
impor... | nedbat/coveragepy | tests/test_html.py | Python | apache-2.0 | 44,058 |
"""Config flow for TP-Link."""
from homeassistant.helpers import config_entry_flow
from homeassistant import config_entries
from .const import DOMAIN
from .common import async_get_discoverable_devices
config_entry_flow.register_discovery_flow(
DOMAIN,
"TP-Link Smart Home",
async_get_discoverable_devices,
... | fbradyirl/home-assistant | homeassistant/components/tplink/config_flow.py | Python | apache-2.0 | 364 |
# Copyright 2016 Battelle Energy Alliance, 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 agr... | idaholab/civet | ci/client/tests/ClientTester.py | Python | apache-2.0 | 1,836 |
# -*- coding: utf-8 -*-
import os
import httplib as http
from flask import request
from flask import send_from_directory
from framework import status
from framework import sentry
from framework.auth import cas
from framework.routing import Rule
from framework.flask import redirect
from framework.sessions import sessi... | reinaH/osf.io | website/routes.py | Python | apache-2.0 | 47,853 |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/options/group/base_group_options.py | Python | apache-2.0 | 1,645 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-08 22:37:13
from __future__ import unicode_literals, division
import os
import six
import time
import unittest2 as unittest
from pyspider import ... | jttoday/spider | tests/test_database.py | Python | apache-2.0 | 18,226 |
# Copyright (c) 2014 Red Hat, 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... | NetApp/manila | manila/tests/share/drivers/test_ganesha.py | Python | apache-2.0 | 13,337 |
# ====================================================================
# 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 re... | romanchyla/pylucene-trunk | samples/LuceneInAction/lia/tools/SnowballTest.py | Python | apache-2.0 | 1,290 |
# Copyright (c) 2016 - 2017, Intel Corporation.
#
# 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 agre... | taf3/taf | taf/testlib/dev_trextg.py | Python | apache-2.0 | 5,943 |
#!/usr/bin/python
import sys
import os
from numpy import *
from scipy import stats
if len(sys.argv) >= 4 :
ref_filename = sys.argv[1]
tag_filename =sys.argv[2]
Npt = int(sys.argv[3])
Nbin = int(sys.argv[4])
else:
print("usage: ~/3seq/bin/exp_len_density.py multiexon_refFlat.txt_positive_known_inta... | jason-weirather/IDP-fusion-release-1 | bin/Bfile.py | Python | apache-2.0 | 4,958 |
import os
import nose.tools
import ndar
def test_nifti_nifti():
"""image is already a NIfTI-1 file"""
im = ndar.Image('test_data/06025B_mprage.nii.gz')
assert im.nifti_1 == im.path(im.files['NIfTI-1'][0])
def test_nifti_unzipped_nifti():
"""image is already an uncompressed NIfTI-1 file"""
im = nda... | NDAR/NITRC-Pipeline-for-NDAR | unsupported/tests/test_nifti.py | Python | bsd-2-clause | 1,410 |
"""
Copyright (c) 2014, Samsung Electronics Co.,Ltd.
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 copyright notice, this
list of conditions and... | ajkxyz/cuda4py | src/cuda4py/blas/__init__.py | Python | bsd-2-clause | 2,953 |
"""Generic testing tools.
Authors
-------
- Fernando Perez <Fernando.Perez@berkeley.edu>
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import re
import sys
import tempfile
from contextlib import contextmanager
from io import StringIO
from subproc... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/testing/tools.py | Python | bsd-2-clause | 13,960 |
"""
This file is meant to try the idea of having the diffraction pattern data appear in
one window, and then give the user the option of simply having
"""
| cduff4464/2016_summer_XPD | out_of_date/reverse_engineer/display2.py | Python | bsd-2-clause | 155 |
from __future__ import division
from pySDC.Hooks import hooks
from pySDC.Stats import stats
import matplotlib.pyplot as plt
import numpy as np
class particles_output(hooks):
def __init__(self):
"""
Initialization of particles output
"""
super(particles_output,self).__init__()
... | torbjoernk/pySDC | examples/spiraling_particle/HookClass.py | Python | bsd-2-clause | 1,411 |
from typing import Dict
from unittest import mock
from conductor.accounts.forms import DeactivateForm, SignupForm
from conductor.tests import TestCase
class TestSignupForm(TestCase):
def test_valid(self) -> None:
product_plan = self.ProductPlanFactory.create()
data = {
"username": "ma... | mblayman/lcp | conductor/accounts/tests/test_forms.py | Python | bsd-2-clause | 5,205 |
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
from iris import db
from iris.role_lookup import IrisRoleLookupException
import logging
logger = logging.getLogger(__name__)
class mailing_list(object):
d... | dwang159/iris-api | src/iris/role_lookup/mailing_list.py | Python | bsd-2-clause | 2,203 |
print '... Importing simuvex/plugins/cgc.py ...'
from angr.state_plugins.cgc import *
| Ruide/angr-dev | simuvex/simuvex/plugins/cgc.py | Python | bsd-2-clause | 86 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import os
import sys
from optparse import OptionParser, BadOptionError
from celery import __version__
from celery.platforms import EX_FAILURE, detached
from celery.utils.log import get_logger
from celery.bin.base im... | couchbaselabs/celery | celery/bin/celeryd_detach.py | Python | bsd-3-clause | 4,792 |
# encoding: utf-8
from south.v2 import DataMigration
from corehq.apps.app_manager.migrations import AppFilterMigrationMixIn
class Migration(AppFilterMigrationMixIn, DataMigration):
def get_app_ids(self):
return self._get_all_app_ids()
| puttarajubr/commcare-hq | corehq/apps/app_manager/migrations/0004_add_detail_filter_unreleased_builds.py | Python | bsd-3-clause | 250 |
"""Tests for the deprecated version of the django-reversion API."""
from __future__ import with_statement
import datetime
from django.db import models, transaction
from django.test import TestCase
from django.core.management import call_command
import reversion
from reversion.models import Version, Revision, VERSIO... | cbrepo/django-reversion | src/reversion/tests_deprecated.py | Python | bsd-3-clause | 25,219 |
from datetime import datetime
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _
class SourceManager(models.Manager):
def active(self):
return self.filter(is_active=True)
class Source(models.Model):
is_active = ... | matthiask/django-newswall | newswall/models.py | Python | bsd-3-clause | 2,672 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the photometry module.
"""
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_equal,
assert_array_less)
from astropy.coordinates import SkyCoord
from astropy.io import fits
f... | astropy/photutils | photutils/aperture/tests/test_photometry.py | Python | bsd-3-clause | 32,618 |
import os.path
import sys
import getopt
import math
import pandas as pd
import numpy as np
from log import logger
from Codecs.AdcpCodec import AdcpCodec
import Ensemble.Ensemble as Ensemble
import matplotlib.pyplot as plt
import seaborn as sns
from bokeh.charts import HeatMap, output_file, show
from bokeh.models impo... | ricorx7/rti-python | tests/test_plot_mag_bokeh.py | Python | bsd-3-clause | 5,892 |
#!/usr/bin/env python3
""" NumPy is the fundamental package for array computing with Python.
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
- and muc... | endolith/numpy | setup.py | Python | bsd-3-clause | 17,447 |
#!/usr/bin/env python
"""Back door shell server
This exposes an shell terminal on a socket.
--hostname : sets the remote host name to open an ssh connection to.
--username : sets the user name to login with
--password : (optional) sets the password to login with
--port : set the local port for th... | youtube/cobalt | third_party/llvm-project/lldb/third_party/Python/module/pexpect-2.4/examples/bd_serv.py | Python | bsd-3-clause | 10,471 |
#!/bin/env python
# Copyright (c) 2006-2008 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.
"""Unittests that verify that the various test_types (e.g., simplified_diff)
are working."""
import difflib
import os
import unit... | amyvmiwei/chromium | webkit/tools/layout_tests/layout_package/test_types_unittest.py | Python | bsd-3-clause | 1,667 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-20 22:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('podcast', '0006_auto_20170920_1833'),
]
operations = [
migrations.RenameField(
... | richardcornish/django-itunespodcast | podcast/migrations/0007_auto_20170920_2212.py | Python | bsd-3-clause | 429 |
'''
Copyright (c) 2011-2015, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
from chai import Chai
from collections import deque
from haigha import channel
from haigha.channel import Channel, SyncWrapper
from haigha.exceptions import ChannelError, ChannelClosed,... | vitaly-krugl/haigha | tests/unit/channel_test.py | Python | bsd-3-clause | 18,150 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import *
from past.utils import old_div
fr... | shankari/e-mission-server | emission/analysis/modelling/tour_model/trajectory_matching/DifferenceMetricPipeline.py | Python | bsd-3-clause | 5,060 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Intensity-based image registration
"""
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
import scipy.ndimage as nd
from nibabel import Nifti1Ima... | alexis-roche/nireg | nireg/histogram_registration.py | Python | bsd-3-clause | 23,075 |
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.db import models
from django.utils import timezone
from django.utils.http import urlquote
from django.utils.translation import ugettext_lazy as _
import warnings
from django.contrib.auth.models import (
BaseUs... | pusnik/django-libtech-emailuser | emailuser/models.py | Python | bsd-3-clause | 3,681 |
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from . import caffe_train
from digits import test_utils
def test_caffe_imports():
test_utils.skipIfNotFramework('caffe')
import numpy
import google.protobuf
| TimZaman/DIGITS | digits/model/tasks/test_caffe_train.py | Python | bsd-3-clause | 281 |