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 |
|---|---|---|---|---|---|
# Copyright 2013 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... | shakamunyi/nova | nova/api/openstack/compute/plugins/v3/tenant_networks.py | Python | apache-2.0 | 8,183 |
import sys
import argparse
import numpy as np
import pysam
import util
import snptable
import tables
import os
def write_results(out_f, chrom_name, snp_tab, ref_matches,
alt_matches, oth_matches, geno_sample):
haps = None
has_haps = False
if geno_sample:
# get index for t... | bmvdgeijn/WASP | mapping/get_as_counts.py | Python | apache-2.0 | 12,858 |
import unittest
from tingbot.button import Button
class ButtonTestCase(unittest.TestCase):
def setUp(self):
self.button = Button()
def assertActions(self, action_types):
self.assertEqual(action_types, [a.type for a in self.button.actions])
def testPress(self):
self.button.add_eve... | furbrain/tingbot-python | tests/button_test.py | Python | bsd-2-clause | 1,851 |
import nm_p
class Site(nm_p.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://www.nmcompcomm.us/nmcases/NMCASlip.aspx'
self.court_id = self.__module__
def _get_docket_numbers(self):
path = '//table[@id="GridView1"]/tr/td... | Andr3iC/juriscraper | opinions/united_states/state/nmctapp_slip.py | Python | bsd-2-clause | 435 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-01 11:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0006_add_show_security_question_field'),
]
operations = [
migrat... | praekelt/molo.profiles | molo/profiles/migrations/0007_add_password_recovery_retries.py | Python | bsd-2-clause | 845 |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Service'
db.create_table('o_t_service', (
('structure', self.gf... | Anaethelion/Geotrek | geotrek/trekking/migrations/0029_auto__add_service__add_servicetype.py | Python | bsd-2-clause | 32,683 |
#!python
"""
VMController Host - a general purpose host-side virtual machine controller via exposed hypervisors apis.
"""
try:
import os
import sys
import logging
import warnings
import multiprocessing
import time
import inject
from twisted.internet import reactor
from pkg_resource... | dgquintas/vmcontroller.unstable | src/vmcontroller.host/vmcontroller/host/__main__.py | Python | bsd-3-clause | 8,090 |
class Connection(dict):
def set(self, key, value):
self[key] = value
def mget(self, keys):
return [self.get(key) for key in keys]
| jazzband/django-constance | tests/redis_mockup.py | Python | bsd-3-clause | 155 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class RegistrationForm(UserCreationForm):
email = forms.EmailField(help_text='Enter a valid email address')
address = forms.CharFi... | agiliq/fundraiser | authentication/forms.py | Python | bsd-3-clause | 626 |
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import numpy as np
import os.path as op
import warnings
from numpy.testing import assert_raises, assert_equal
from mne import read_events, pick_types, Annotations
from mne.io import read_raw_fif
from mne.utils import requires_version, run_t... | nicproulx/mne-python | mne/viz/tests/test_raw.py | Python | bsd-3-clause | 11,805 |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | FelixZYY/gyp | pylib/gyp/msvs_emulation.py | Python | bsd-3-clause | 45,057 |
#!/usr/bin/env python
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provisions Android devices with settings required for bots.
Usage:
./provision_devices.py [-d <device serial number>]
"""
... | benschmaus/catapult | devil/devil/android/tools/provision_devices.py | Python | bsd-3-clause | 23,798 |
from diofant import Rational
from diofant.integrals.quadrature import (gauss_chebyshev_t, gauss_chebyshev_u,
gauss_gen_laguerre, gauss_hermite,
gauss_jacobi, gauss_laguerre,
gauss_legendre)
__... | diofant/diofant | diofant/tests/integrals/test_quadrature.py | Python | bsd-3-clause | 20,443 |
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.dual import eig
from scipy.special import comb
from scipy.signal import convolve
__all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'morlet2', 'cwt']
def daub(p):
"""
The coefficients for the FIR low-pass fi... | jamestwebber/scipy | scipy/signal/wavelets.py | Python | bsd-3-clause | 13,701 |
import pylab
import string
import matplotlib
matplotlib.rcParams['figure.subplot.hspace']=.45
matplotlib.rcParams['figure.subplot.wspace']=.3
labels=('Step=1','Step=.5','Step=.25','Step=.01')
steps=(1,.5,.25,.01)
pylab.figure(figsize=(8.5,11))
for i,intxt in enumerate(('O_RK1.txt','O_RK_5.txt','O_RK_25.txt','O_RK_... | justincely/classwork | UMD/AST615/HW6_2/plot_orbit.py | Python | bsd-3-clause | 1,806 |
import urllib
import os
def process(url, destination):
destination = "jslibs/%s" % destination
if os.path.exists(destination):
return
try:
print url
urllib.urlretrieve(url, destination)
except Exception as e:
print "Failed", e
def get_pattern(prefix, url_pattern, ve... | magopian/amo-validator | extras/jslibfetcher.py | Python | bsd-3-clause | 9,177 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for Chromium.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presu... | CTSRD-SOAAP/chromium-42.0.2311.135 | PRESUBMIT.py | Python | bsd-3-clause | 65,851 |
from django import http
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage as storage
from django.shortcuts import get_object_or_404, redirect
from django.views import de... | kumar303/addons-server | src/olympia/zadmin/views.py | Python | bsd-3-clause | 9,220 |
'''The veterinary app is for medical issues associated with animals.
The primary functions of this app are to:
* Store data about mice which have some medical problem
* Describe the problem including its duration.
* Store details about the treatment of that problem.
As such there are three data structures in this ap... | BridgesLab/mousedb | mousedb/veterinary/__init__.py | Python | bsd-3-clause | 730 |
from collections import namedtuple
from dataclasses import make_dataclass
import numpy as np
import warnings
from itertools import combinations
import scipy.stats
from scipy.optimize import shgo
from . import distributions
from ._continuous_distns import chi2, norm
from scipy.special import gamma, kv, gammaln
from . im... | WarrenWeckesser/scipy | scipy/stats/_hypotests.py | Python | bsd-3-clause | 45,046 |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from .. import views
urlpatterns = [
url(r'^$',
views.NewWizardView.as_view(),
),
url(r'^new/$',
views.NewWizardView.as_view(),
name='wizard_new',
... | scattermagic/django-wizard-builder | wizard_builder/tests/urls.py | Python | bsd-3-clause | 534 |
# encoding: utf-8
# Unlike what IPython does, we need to have an explicit inputhook because tkinter handles
# input hook in the C Source code
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
... | SlicerRt/SlicerDebuggingTools | PyDevRemoteDebug/ptvsd-4.1.3/ptvsd/_vendored/pydevd/pydev_ipython/inputhooktk.py | Python | bsd-3-clause | 771 |
#!/usr/bin/env python3
"""Example that shows how to easily save a variable number of atoms with a
VLArray."""
import numpy as np
import tables as tb
N = 100
shape = (3, 3)
np.random.seed(10) # For reproductible results
f = tb.open_file("vlarray4.h5", mode="w")
vlarray = f.create_vlarray(f.root, 'vlarray1',
... | avalentino/PyTables | examples/vlarray4.py | Python | bsd-3-clause | 626 |
#!/usr/bin/env python
# encoding: utf-8
"""
Copyright (c) 2010 The Echo Nest. All rights reserved.
Created by Tyler Williams on 2010-09-01
# 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; eithe... | alex/pyechonest | examples/try_new_things.py | Python | bsd-3-clause | 6,593 |
# Copyright 2016 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.
"""
This ensures that each front-end module does not accidentally rely on a module
that isn't listed as a transitive dependency in the module.json.
How this ... | youtube/cobalt | third_party/devtools/scripts/build/dependency_preprocessor.py | Python | bsd-3-clause | 3,349 |
from __future__ import division, print_function, absolute_import
import threading
import warnings
from . import _minpack
import numpy as np
from numpy import (atleast_1d, dot, take, triu, shape, eye,
transpose, zeros, product, greater, array,
all, where, isscalar, asarray, inf, a... | Eric89GXL/scipy | scipy/optimize/minpack.py | Python | bsd-3-clause | 33,497 |
class Solution(object):
def characterReplacement(self, s, k):
"""
:type s: str
:type k: int
:rtype: int
"""
count = [0] * 26
res = char_count = start = end = 0
while end < len(s):
count[ord(s[end]) - ord('A')] += 1
char_count = ... | Mlieou/oj_solutions | leetcode/python/ex_424.py | Python | mit | 629 |
# Time: O(logn)
# Space: O(1)
#
# Follow up for "Search in Rotated Sorted Array":
# What if duplicates are allowed?
#
# Would this affect the run-time complexity? How and why?
#
# Write a function to determine if a given target is in the array.
#
class Solution(object):
def search(self, nums, target):
"... | yiwen-luo/LeetCode | Python/search-in-rotated-sorted-array-ii.py | Python | mit | 1,138 |
#!/usr/bin/env python
# Standard packages
import sys
import cyvcf2
import argparse
import geneimpacts
from cyvcf2 import VCF
def get_effects(variant, annotation_keys):
effects = []
effects += [geneimpacts.SnpEff(e, annotation_keys) for e in variant.INFO.get("ANN").split(",")]
return effects
def get_t... | GastonLab/ddb-scripts | specialist/scan_multi-gene_annotated_snpEff.py | Python | mit | 1,956 |
from GeoHealthCheck.probe import Probe
from GeoHealthCheck.result import Result
from owslib.wms import WebMapService
class MyWMSProbe(Probe):
"""
Example Probe for WMS Probe user plugin. This is a free-form Probe
that overrides perform_request with custom checks.
To configure a probe, use Docker Cont... | tomkralidis/GeoHealthCheck | docker/plugins/user/mywmsprobe.py | Python | mit | 1,652 |
"""Error codes for PostgresSQL
This module contains symbolic names for all PostgreSQL error codes.
"""
# psycopg2/errorcodes.py - PostgreSQL error codes
#
# Copyright (C) 2006-2010 Johan Dahlin <jdahlin@async.com.br>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU ... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/psycopg2/errorcodes.py | Python | mit | 13,241 |
# Copyright (C) 2013 - 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
from .local_process import LocalProcess
from .remote_process import StubProcess
from .vagrant_process import VagrantProcess
class WorkerProcess(object):
"""Return a right process... | danalec/dotfiles | sublime/.config/sublime-text-3/Packages/Anaconda/anaconda_lib/workers/process.py | Python | mit | 636 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import sys
import petl as etl
from petl.test.helpers import ieq
from petl.io.pandas import todataframe, fromdataframe
try:
# noinspection PyUnresolvedReferences
import pandas as pd
except ImportError as e:
print('... | psnj/petl | petl/test/io/test_pandas.py | Python | mit | 1,286 |
# Copyright 2016 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 required by applicable law or ag... | Sorsly/subtle | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/sole_tenancy/sole_tenancy_hosts/flags.py | Python | mit | 967 |
# -*- coding: utf-8 -*-
#
# django-role-permissions documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 9 09:02:16 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogener... | chillbear/django-role-permissions | docs/conf.py | Python | mit | 8,335 |
def solve():
s = map(int, raw_input())
n = len(s) / 2
ans = 6
for i in xrange(10):
for j in xrange(10):
for k in xrange(10):
for l in xrange(10):
for m in xrange(10):
for n in xrange(10):
if ... | EdisonAlgorithms/CodeForces | contest/845/B.py | Python | mit | 673 |
import copy
import numpy as np
from chainer import reporter
import chainer.training.extensions
from chainercv.evaluations import eval_instance_segmentation_coco
from chainercv.utils import apply_to_iterator
try:
import pycocotools.coco # NOQA
_available = True
except ImportError:
_available = False
cl... | chainer/chainercv | chainercv/extensions/evaluator/instance_segmentation_coco_evaluator.py | Python | mit | 7,737 |
import os
from gi.repository import Gtk
from wand.image import Image
class PhotoExporter(Gtk.FileChooserDialog):
def __init__(self, window):
super(PhotoExporter, self).__init__(
'Export photo',
window,
Gtk.FileChooserAction.SAVE,
(
Gtk.STOC... | SamWhited/photoshell | photoshell/views/photo_exporter.py | Python | mit | 1,432 |
import numpy as np
import openmc
###############################################################################
# Simulation Input File Parameters
###############################################################################
# OpenMC simulation parameters
batches = 15
inactive = 5
particles = ... | bhermanmit/openmc | examples/python/boxes/build-xml.py | Python | mit | 4,480 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-31 17:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
... | gileno/djangoecommerce | checkout/migrations/0003_order_orderitem.py | Python | cc0-1.0 | 2,362 |
from collections import OrderedDict
#*************************#
# PARAMS #
#*************************#
#Paths
#workspaceDir = "/Users/slundquist/workspace"
#filenames = [("sheng","/Users/slundquist/Desktop/ptLIF.txt")]
#filenames = [("sheng","/Users/slundquist/Desktop/retONtoLif.txt")]
worksp... | dpaiton/OpenPV | pv-core/python/probe_analysis/readProbeParams.py | Python | epl-1.0 | 4,842 |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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 License, or
(at your option) any later version.
... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/novamov.py | Python | gpl-2.0 | 3,302 |
#!/usr/bin/env python
'''
Copyright (C) 2011 Karlisson Bezerra <contact@hacktoon.com>
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 ve... | yaii/yai | share/extensions/ink2canvas/canvas.py | Python | gpl-2.0 | 6,499 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Machinery for generating tracing-related intermediate files.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"... | cherry-wb/qemu-dbaf | scripts/tracetool/__init__.py | Python | gpl-2.0 | 7,431 |
#! /usr/bin/env python
# Original code by Guido van Rossum; extensive changes by Sam Bayer,
# including code to check URL fragments.
"""Web tree checker.
This utility is handy to check a subweb of the world-wide web for
errors. A subweb is specified by giving one or more ``root URLs''; a
page belongs to the subweb ... | kidmaple/CoolWall | user/python/Tools/webchecker/webchecker.py | Python | gpl-2.0 | 27,274 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid - **Aggregator.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Foundati... | Jannes123/inasafe | safe/impact_statistics/aggregator.py | Python | gpl-3.0 | 69,859 |
#!/usr/bin/env python
"""
Author : Veerendra Kakumanu
Description : Simple yaml file reader and writer
"""
import os
import yaml
import io
def read_yaml(file_name):
if not os.path.exists(file_name):
print "{} not found! Please check.".format(file_name)
exit(1)
with open(file_name) as f:
... | veerendra2/python-scripts | code_snippets/python/yaml_read-write.py | Python | gpl-3.0 | 533 |
""" Agent to extend the number of tasks given the Transformation definition
"""
from DIRAC import S_OK, gLogger
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.ConfigurationSystem.Client.Helpers.Operations ... | sposs/DIRAC | TransformationSystem/Agent/MCExtensionAgent.py | Python | gpl-3.0 | 4,963 |
# -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# NIN... | centaurialpha/ninja-ide | ninja_ide/core/encapsulated_env/plugins_manager.py | Python | gpl-3.0 | 3,254 |
#!/usr/bin/env python
"""
APM automatic test suite
Andrew Tridgell, October 2011
"""
from __future__ import print_function
import atexit
import fnmatch
import glob
import optparse
import os
import shutil
import signal
import sys
import time
import traceback
import apmrover2
import arducopter
import arduplane
import ... | dgrat/ardupilot | Tools/autotest/autotest.py | Python | gpl-3.0 | 18,627 |
# coding: utf-8
# Copyright 2013 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 required by ap... | GirlsCodePy/girlscode-coursebuilder | modules/review/review_tests.py | Python | gpl-3.0 | 68,643 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | hfinucane/ansible | lib/ansible/plugins/action/__init__.py | Python | gpl-3.0 | 32,910 |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('applications', '0028_auto__chg_field_applicant_username'),
)
def forwards(self, orm):
if not db.dry_run:
orm['co... | Karaage-Cluster/karaage-applications | kgapplications/south_migrations/0001_initial.py | Python | gpl-3.0 | 21,468 |
"""
timeparse.py
Implements a single function, `timeparse`, which can parse various
kinds of time expressions.
Created By:
- Will Roberts <wildwilhelm@gmail.com>
Maintainer:
- Luke Rogers <https://github.com/lukeroge>
License:
MIT License
Copyright Will Roberts <wildwilhelm@gmail.com> - 1 February, ... | weylin/CloudBot | cloudbot/util/timeparse.py | Python | gpl-3.0 | 6,244 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils.nestedset import get_root_of
from frappe.utils import cint
from erpnext.accounts.doctype.pos_profile.pos_profile i... | Zlash65/erpnext | erpnext/selling/page/point_of_sale/point_of_sale.py | Python | gpl-3.0 | 4,834 |
"""
Description: class MorphML for loading MorphML from file or xml element into
MOOSE.
NeuroML.py is the preferred interface. Use this only if NeuroML L1,L2,L3 files
are misnamed/scattered. Instantiate MorphML class, and thence use methods:
readMorphMLFromFile(...) to load a standalone MorphML from file OR
readMorp... | rahulgayatri23/moose-core | python/libmumbl/nml_parser/MorphML.py | Python | gpl-3.0 | 32,632 |
from . import fatturapa_common
from . import test_fatturapa_xml_validation
| OCA/l10n-italy | l10n_it_fatturapa_out_sp/tests/__init__.py | Python | agpl-3.0 | 75 |
import sys
import logging
from xmodule.mako_module import MakoDescriptorSystem
from xmodule.x_module import XModuleDescriptor
from xmodule.modulestore.locator import BlockUsageLocator, LocalId
from xmodule.error_module import ErrorDescriptor
from xmodule.errortracker import exc_info_to_str
from xblock.runtime import Db... | TangXT/GreatCatMOOC | common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py | Python | agpl-3.0 | 6,524 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-09-03 16:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0343_auto_20180903_1105'),
]
operations = [
migrations.AlterField(
... | uclouvain/OSIS-Louvain | base/migrations/0344_auto_20180903_1613.py | Python | agpl-3.0 | 626 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('certificates.apps', 'lms.djangoapps.certificates.a... | eduNEXT/edunext-platform | import_shims/lms/certificates/apps.py | Python | agpl-3.0 | 374 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mrcslws/nupic.research | projects/dendrites/profiling/forward_profile.py | Python | agpl-3.0 | 4,642 |
from unittest import TestCase
import os
from opencog.atomspace import AtomSpace, TruthValue, Atom, types
from opencog.bindlink import stub_bindlink, bindlink, single_bindlink,\
first_n_bindlink, af_bindlink, \
satisfaction_link, satisfying_set, \
... | inflector/atomspace | tests/cython/bindlink/test_bindlink.py | Python | agpl-3.0 | 7,002 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class ArgpStandalone(AutotoolsPackage):
"""Standalone version of the argp interface from glibc ... | rspavel/spack | var/spack/repos/builtin/packages/argp-standalone/package.py | Python | lgpl-2.1 | 1,235 |
## \file
## \ingroup tutorial_pyroot
## A Simple histogram drawing example
##
## \macro_image
## \macro_output
## \macro_code
##
## \author Wim Lavrijsen
from ROOT import TCanvas, TPad, TFile, TPaveLabel, TPaveText
from ROOT import gROOT
c1 = TCanvas( 'c1', 'Histogram Drawing Options', 200, 10, 700, 900 )
pad1 = TPa... | krafczyk/root | tutorials/pyroot/h1draw.py | Python | lgpl-2.1 | 2,310 |
# Copyright(c)2015 NTT corp. 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 required by app... | Vaidyanath/tempest | tempest/api/object_storage/test_container_sync_middleware.py | Python | apache-2.0 | 1,985 |
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | bbc/kamaelia | Sketches/DL/modules/DL_Util.py | Python | apache-2.0 | 1,725 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | irinabov/debian-qpid-cpp-1.35.0 | src/tests/acl_1.py | Python | apache-2.0 | 17,802 |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import NotFound
from framework.auth.oauth_scopes import CoreScopes, public_scopes
from api.base.filters import ListFilterMixin
from api.base import permissions as base_permissions
from api.scopes.serializers import Scope... | icereval/osf.io | api/scopes/views.py | Python | apache-2.0 | 2,283 |
#!/usr/bin/env python
"""
This is an example of playing music from Spotify using pyspotify.
The example use the :class:`spotify.AlsaSink`, and will thus only work on
systems with an ALSA sound subsystem, which means most Linux systems.
You can either run this file directly without arguments to play a default
track::... | felix1m/pyspotify | examples/play_track.py | Python | apache-2.0 | 1,694 |
# -*- coding: utf-8 -*-
import os
import importlib
from collections import OrderedDict
import json
from modularodm import storage
from werkzeug.contrib.fixers import ProxyFix
import framework
from framework.flask import app, add_handlers
from framework.logging import logger
from framework.mongo import set_up_storage
... | petermalcolm/osf.io | website/app.py | Python | apache-2.0 | 5,502 |
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import timesince, floatformat
from horizon import tables
from horizon.templatetags.sizeformat import mbformat
class CSVSummary(tables.LinkAction):
name = "csv_summary"
verbose_name = _("Download CSV Summary")
clas... | xhorn/xchorizon | horizon/usage/tables.py | Python | apache-2.0 | 2,032 |
# 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, software
# d... | sebrandon1/neutron | neutron/agent/l3/dvr_snat_ns.py | Python | apache-2.0 | 1,810 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013 Red Hat, 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 r... | phoenixsbk/kvmmgr | packaging/setup/plugins/ovirt-engine-rename/ovirt-engine/tools.py | Python | apache-2.0 | 3,586 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
import json
import yaml
from kubernetes_py.utils import is_valid_string
class DeleteOptions(object):
"""
http://kubernetes.io/docs/... | mnubo/kubernetes-py | kubernetes_py/models/v1/DeleteOptions.py | Python | apache-2.0 | 3,140 |
## Sequencer init file
| sparkslabs/kamaelia_ | Sketches/JL/Sequencer/__init__.py | Python | apache-2.0 | 23 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import random
def lambda_search():
#Log.info("Importing prostate.csv data...\n")
prostate = h2o.import_file(pyunit_utils.locate("smalldata/logreg/prostate.csv"))
#prostate.summary()
# GLM without lambda s... | pchmieli/h2o-3 | h2o-py/tests/testdir_algos/glm/pyunit_NOFEATURE_lambda_search_largeGLM.py | Python | apache-2.0 | 1,894 |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | arenadata/ambari | ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py | Python | apache-2.0 | 14,813 |
# Copyright (c) 2014-2015 Brett Cannon <brett@python.org>
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015 Pavel Roskin <proski@gnu.org>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
... | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/pylint/checkers/python3.py | Python | apache-2.0 | 38,460 |
# Copyright 2014 Spotify AB. All rights reserved.
#
# The contents of this file are 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 requi... | spotify/pyeos | test/unit/config.py | Python | apache-2.0 | 730 |
# Copyright 2014 OpenStack Foundation
#
# 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 ... | shakamunyi/neutron-vrrp | neutron/db/migration/alembic_migrations/versions/19180cf98af6_nsx_gw_devices.py | Python | apache-2.0 | 3,313 |
"""Interfaces with iAlarm control panels."""
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.... | jawilson/home-assistant | homeassistant/components/ialarm/alarm_control_panel.py | Python | apache-2.0 | 1,923 |
"""The tests for the pilight component."""
from datetime import timedelta
import logging
import socket
from unittest.mock import patch
from voluptuous import MultipleInvalid
from homeassistant.components import pilight
from homeassistant.setup import async_setup_component
from homeassistant.util import dt as dt_util
... | partofthething/home-assistant | tests/components/pilight/test_init.py | Python | apache-2.0 | 14,678 |
# -*- coding: utf-8 -*-
'''
Manage Grafana Dashboards
This module uses ``elasticsearch``, which can be installed via package, or pip.
You can specify elasticsearch hosts directly to the module, or you can use an
elasticsearch profile via pillars:
.. code-block:: yaml
mygrafanaprofile:
hosts:
- es1... | smallyear/linuxLearn | salt/salt/states/grafana.py | Python | apache-2.0 | 12,608 |
from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSURLRequest (TestCase):
def testConstants(self):
self.assertEqual(NSURLRequestUseProtocolCachePolicy, 0)
self.assertEqual(NSURLRequestReloadIgnoringLocalCacheData, 1)
self.assertEqual(NSURLRequestReloadIgnoringLocalAn... | albertz/music-player | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsurlrequest.py | Python | bsd-2-clause | 1,565 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('iconcollections', '0001_initial'),
]
operations = [
migrations.AlterField(
mode... | shanzi/myicons | iconcollections/migrations/0002_auto_20141027_1107.py | Python | bsd-2-clause | 2,135 |
"""
Traits constituting sets of types.
"""
from itertools import chain
from .coretypes import (Unit, int8, int16, int32, int64, uint8, uint16, uint32,
uint64, float16, float32, float64, complex64,
complex128, bool_, Decimal, TimeDelta, Option)
__all__ = ['TypeSet', 'm... | ContinuumIO/datashape | datashape/typesets.py | Python | bsd-2-clause | 5,475 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | morelab/weblabdeusto | server/src/weblab/exc.py | Python | bsd-2-clause | 550 |
import re
from datetime import datetime, timedelta
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
import amo
import amo.tests
from amo.urlresolvers import reverse
from amo.tests import formset, initial
from addons.models import Addon
from applications.models import Application, AppVersion
fr... | wagnerand/zamboni | apps/devhub/tests/test_views_versions.py | Python | bsd-3-clause | 31,061 |
from __future__ import division
from builtins import zip
from builtins import next
from builtins import range
import unittest
from string import ascii_lowercase
from itertools import chain, cycle, repeat
import math
from nineml.values import SingleValue, ArrayValue
from operator import (
add, sub, mul, truediv, pow... | INCF/lib9ML | test/unittests/operator_test.py | Python | bsd-3-clause | 30,256 |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import os
import sys
import re
from distutils.dep_util import newer_group, newer
from glob import glob
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.system_info import get_inf... | juliantaylor/scipy | scipy/sparse/linalg/isolve/setup.py | Python | bsd-3-clause | 1,510 |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (
assert_almost_equal, assert_array_equal, assert_array_almost_equal,
TestCase, run_module_suite, assert_allclose, assert_equal, assert_,
assert_raises)
from scipy.interpolate im... | pbrod/scipy | scipy/interpolate/tests/test_polyint.py | Python | bsd-3-clause | 24,329 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create a ccache binary for mac hosts."""
import argparse
import os
import subprocess
import sys
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
INFRA... | youtube/cobalt | third_party/skia_next/third_party/skia/infra/bots/assets/ccache_mac/create.py | Python | bsd-3-clause | 1,385 |
from nose.tools import eq_, ok_
from remo.base.tests import RemoTestCase
from remo.base.utils import get_date
from remo.profiles.forms import ChangeUserForm, UserStatusForm
from remo.profiles.models import UserStatus
from remo.profiles.tests import UserFactory, UserStatusFactory
class ChangeUserFormTest(RemoTestCase... | mozilla/remo | remo/profiles/tests/test_forms.py | Python | bsd-3-clause | 4,057 |
from logger import logger | szeged/csibe | bin/csibe/__init__.py | Python | bsd-3-clause | 25 |
# Copyright (c) 2011 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.
"""Collection of functions and classes to fix various encoding problems on
multiple platforms with python.
"""
from __future__ import print_function
im... | endlessm/chromium-browser | third_party/depot_tools/fix_encoding.py | Python | bsd-3-clause | 12,462 |
#!/usr/bin/python
from metasmt.core import *
from metasmt.operators import *
import random
default_bitwidth = 24
def prime_test(number, solver=boolector_solver(), bitwidth=default_bitwidth):
a = new_bitvector( bitwidth )
b = new_bitvector( bitwidth )
ext = lambda x: zero_extend( bitwidth, x)
## a*b=c (avoid... | hoangmle/crave-bundle-2015-07-22 | metaSMT/bindings/python/examples/prime_test.py | Python | mit | 1,487 |
class PaymentInstrumentType():
PayPalAccount = "paypal_account"
EuropeBankAccount = "europe_bank_account"
CreditCard = "credit_card"
CoinbaseAccount = "coinbase_account"
ApplePayCard = "apple_pay_card"
AndroidPayCard = "android_pay_card"
| DiptoDas8/Biponi | lib/python2.7/site-packages/braintree/payment_instrument_type.py | Python | mit | 263 |
from taiga.requestmaker import RequestMaker
from taiga.models import Role, Roles
import unittest
from mock import patch
class TestRoles(unittest.TestCase):
@patch('taiga.models.base.ListResource._new_resource')
def test_create_role(self, mock_new_resource):
rm = RequestMaker('/api/v1', 'fakehost', 'f... | jespino/python-taiga | tests/test_roles.py | Python | mit | 530 |
"""
This module is meant for vendorizing Python libraries. Most libraries will need
to have some ``sys.path`` alterations done unless they are doing relative
imports.
Do **not** add anything to this module that does not represent a vendorized
library.
Vendored libraries should go into the ``vendor`` directory and imp... | SUSE/ceph-deploy | ceph_deploy/lib/__init__.py | Python | mit | 817 |
import time
import os.path
import shutil
import tempfile
import cPickle
try:
import xg
except:
xg = False
from pebl import config, result
from pebl.taskcontroller.base import _BaseSubmittingController, DeferredResult
class XgridDeferredResult(DeferredResult):
def __init__(self, grid, task):
... | Alwnikrotikz/pebl-project | src/pebl/taskcontroller/xgrid.py | Python | mit | 3,271 |