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
def omp_parallel_for_lastprivate(): sum = 0 i0 = -1 'omp parallel for reduction(+:sum) schedule(static,7) lastprivate(i0)' for i in range(1,1001): sum += i i0 = i known_sum = (1000 * (1000 + 1)) / 2 return known_sum == sum and i0 == 1000
pombredanne/pythran
pythran/tests/openmp.legacy/omp_parallel_for_lastprivate.py
Python
bsd-3-clause
279
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserKey' db.create_table('sshkey_userkey', ( ('id', self.gf('django.db.models....
ClemsonSoCUnix/django-sshkey
django_sshkey/south_migrations/0001_initial.py
Python
bsd-3-clause
5,536
from __future__ import absolute_import from __future__ import with_statement import sys import time from functools import partial from itertools import chain, izip from Queue import Empty from mock import Mock, patch from celery.app.registry import TaskRegistry from celery.task.base import Task from celery.utils im...
couchbaselabs/celery
celery/tests/slow/test_buckets.py
Python
bsd-3-clause
10,768
#!/usr/bin/env python # # Copyright 2013, 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 contains a base class and utility functions for sharding tests. """ import struct import logging from vtdb import keyrange_c...
mapbased/vitess
test/base_sharding.py
Python
bsd-3-clause
16,306
#!/usr/bin/python # -*- coding: utf-8 -*- # # Urwid BigText fonts # Copyright (C) 2004-2006 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1...
DarkPurpleShadow/ConnectFour
urwid/font.py
Python
bsd-3-clause
24,937
import flask from ..app import bokeh_app ## This URL heirarchy is important, because of the way we build bokehjs ## the source mappings list the source file as being inside ../../src @bokeh_app.route('/bokehjs/static/<path:filename>') def bokehjs_file(filename): """ Return a specific BokehJS deployment file ...
almarklein/bokeh
bokeh/server/views/statics.py
Python
bsd-3-clause
844
#!/usr/bin/env python """ HTML Tidy Extension for Python-Markdown ======================================= Runs [HTML Tidy][] on the output of Python-Markdown using the [uTidylib][] Python wrapper. Both libtidy and uTidylib must be installed on your system. Note than any Tidy [options][] can be passed in as extensio...
DJMelonz/basic-blog
markdown/extensions/html_tidy.py
Python
bsd-3-clause
2,159
from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='TinyContent', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_ke...
dominicrodger/django-tinycontent
tinycontent/migrations/0001_initial.py
Python
bsd-3-clause
570
from genshi.builder import tag from trac.core import implements,Component from trac.ticket.api import ITicketActionController from trac.perm import IPermissionRequestor revision = "$Rev$" url = "$URL$" class DeleteTicketActionController(Component): """Provides the admin with a way to delete a ticket. Illust...
dokipen/trac
sample-plugins/workflow/DeleteTicket.py
Python
bsd-3-clause
1,496
# -*- coding: utf-8 -*- import json from django.contrib.admin.sites import site from django.template import Context from django.template.base import Template from django.utils.encoding import force_text from cms.api import add_plugin from cms.constants import PLUGIN_MOVE_ACTION, PLUGIN_COPY_ACTION from cms.models imp...
keimlink/django-cms
cms/tests/test_static_placeholder.py
Python
bsd-3-clause
9,892
from django.conf.urls import patterns, url from .views import ( picturegallery, dashboard, events, approvals, suggestions, vidly_media, comments, loggedsearches, users, groups, channels, locations, regions, templates, topics, tags, recruitmentmessages...
tannishk/airmozilla
airmozilla/manage/urls.py
Python
bsd-3-clause
12,711
import numpy as np from numpy.testing import assert_almost_equal from menpo.math import eigenvalue_decomposition, pca, ipca # Positive semi-definite matrix cov_matrix = np.array([[3, 1], [1, 3]]) # Data values taken from: # http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf # Tested values ar...
patricksnape/menpo
menpo/math/test/test_decomposition_base.py
Python
bsd-3-clause
6,220
import audio def from_file(file, frame): ln = -1 while ln: ln = file.readinto(frame) yield frame def reverb_gen(src, buckets, reflect, fadeout): bucket_count = len(buckets) bucket = 0 for frame in src: echo = buckets[bucket] echo *= reflect echo += frame ...
JoeGlancy/micropython
examples/reverb.py
Python
mit
1,345
# coding: utf-8 """Test that longer and mixed texts are tokenized correctly.""" from __future__ import unicode_literals import pytest def test_tokenizer_handles_long_text(de_tokenizer): text = """Die Verwandlung Als Gregor Samsa eines Morgens aus unruhigen Träumen erwachte, fand er sich in seinem Bett zu eine...
aikramer2/spaCy
spacy/tests/lang/de/test_text.py
Python
mit
1,571
"""A test script to compare MD5 implementations. A note about performance: the pure Python MD5 takes roughly 160 sec. per MB of data on a 233 MHz Intel Pentium CPU. """ from __future__ import absolute_import import md5 # CPython's implementation in C. from lib_pypy import _md5 as pymd5 ...
sauloal/pycluster
pypy-1.9_64/lib_pypy/pypy_test/test_md5_extra.py
Python
mit
6,315
import unittest import holmium.core class TestOptions(unittest.TestCase): def test_browser_set(self): self.assertEqual(self.driver.name, "remote") def test_remote_set(self): self.config["remote"] = "{{holmium.remote}}" self.assertEqual(self.config["remote"], 'http://nowhere.org') d...
jlecount-sungevity/holmium.core
tests/support/options/test_options.py
Python
mit
483
from __future__ import unicode_literals from reviewboard.hostingsvcs.errors import (AuthorizationError, TwoFactorAuthCodeRequiredError) from reviewboard.hostingsvcs.forms import HostingServiceAuthForm from reviewboard.hostingsvcs.models import HostingServiceAccount from revi...
davidt/reviewboard
reviewboard/hostingsvcs/tests/test_hosting_service_auth_form.py
Python
mit
16,079
import numpy as np from sklearn.preprocessing import PolynomialFeatures from sklearn import linear_model if __name__ == "__main__": (f, n) = map(int, raw_input().split()) x = [] y = [] poly = PolynomialFeatures(degree = 4) for i in range(n): v = map(float, raw_input().split()) x.app...
EdisonAlgorithms/HackerRank
practice/ai/machine-learning/predicting-office-space-price/predicting-office-space-price.py
Python
mit
596
# -*- coding: utf-8 -*- from __future__ import print_function from acq4.util import Qt from acq4.pyqtgraph.WidgetGroup import WidgetGroup class AnalysisModule(Qt.QWidget): def __init__(self, taskRunner): Qt.QWidget.__init__(self) self.pr = taskRunner self.pr.sigNewFrame.connect(self.newFram...
pbmanis/acq4
acq4/modules/TaskRunner/analysisModules/AnalysisModule.py
Python
mit
1,578
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in ...
oberstet/autobahn-python
examples/twisted/wamp/rpc/progress/backend.py
Python
mit
2,522
from src.core.log import * from src.core import node_resource as nr from src.core import config from src.core import utility from time import sleep import os def monitor(fuzzy): """ """ # known crashes; key is idx (top level folder before crash info); value is known_crashes = {} try: ut...
GHubgenius/PeachOrchard
node/src/core/monitor.py
Python
mit
1,446
""" Distribution of PM2.5 at Various Sites across Delhi =================================================== _thumb: .2, .6 """ import matplotlib.pyplot as plt import seaborn as sns import openaq sns.set(style="ticks", font_scale=1.) api = openaq.OpenAQ() # grab the data res = api.measurements(city='Delhi', parameter...
dhhagan/py-openaq
examples/pm25_histogram_delhi.py
Python
mit
833
# This set of tests exercises the backward-compatibility class # in mailbox.py (the ones without write support). import mailbox import os import time import unittest from test import test_support # cleanup earlier tests try: os.unlink(test_support.TESTFN) except os.error: pass FROM_ = "From some.body@dummy.d...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7/Lib/test/test_old_mailbox.py
Python
mit
4,669
# Natural Language Toolkit: Applications package # # Copyright (C) 2001-2013 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Interactive NLTK Applications: chartparser: Chart Parser chunkpar...
TeamSPoon/logicmoo_workspace
packs_sys/logicmoo_nlu/ext/pldata/nltk_3.0a3/nltk/app/__init__.py
Python
mit
1,644
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import os import logging import tempfile from flexget import plugin from flexget.event import event log = logging.getLogger('check_subtitles') class MetainfoSubs(object): ...
oxc/Flexget
flexget/plugins/metainfo/subtitles_check.py
Python
mit
2,678
from __future__ import absolute_import, print_function, unicode_literals from .base import * # noqa isort:skip @UnusedWildImport INSTALLED_APPS += ['rest_framework_swagger'] # noqa REST_SWAGGER = True
christianmemije/kolibri
kolibri/deployment/default/settings/dev.py
Python
mit
206
from django_evolution.tests.utils import test_sql_mapping tests = r""" >>> from django.db import models >>> from django_evolution.mutations import ChangeField >>> from django_evolution.tests.utils import test_proj_sig, execute_test_sql, register_models, deregister_models >>> from django_evolution.diff import Diff >>...
broderboy/ai-stager
stager/django_evolution/tests/change_field.py
Python
mit
27,957
from __future__ import with_statement from distutils.version import StrictVersion from itertools import chain import os import socket import sys import threading import warnings try: import ssl ssl_available = True except ImportError: ssl_available = False from redis._compat import (b, xrange, imap, byte_...
lamby/pkg-python-redis
redis/connection.py
Python
mit
40,079
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: See license.txt from __future__ import unicode_literals import frappe, json, os from frappe.utils import strip, cint from frappe.translate import (set_default_language, get_dict, send_translations) from frappe.geo.country_info import get_...
mbauskar/frappe
frappe/desk/page/setup_wizard/setup_wizard.py
Python
mit
8,424
# encoding: utf-8 from ztq_core import async import time @async def send(body): print 'START: ', body time.sleep(3) print 'END: ', body @async(queue='mail') def send_failed(body): print 'FAIL START:', body raise Exception('connection error...') @async(queue='mail') def failed_callback(return_code...
liangsuilong/ztq
ztq_demo/tasks.py
Python
mit
586
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, copy, json from frappe import _, msgprint from frappe.utils import cint import frappe.share rights = ("read", "write", "create", "delete", "submit", "cancel", "ame...
indictranstech/reciphergroup-frappe
frappe/permissions.py
Python
mit
13,272
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008-2010 Craig J. Anderson # Copyright (C) 2014 Paul Franklin # # 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...
Nick-Hall/gramps
gramps/plugins/lib/libtreebase.py
Python
gpl-2.0
34,876
#! /usr/bin/env python ############################################################################### # # simulavr - A simulator for the Atmel AVR family of microcontrollers. # Copyright (C) 2001, 2002 Theodore A. Roth # # This program is free software; you can redistribute it and/or modify # it under the terms of th...
simark/simulavr
regress/test_opcodes/test_BLD.py
Python
gpl-2.0
2,630
#!/usr/bin/env python # -*- coding: utf-8 -*- from LangSupport import splitChinese """This file contains assorted general utility functions used by other modules in the PyAIML package. """ # TODO: andelf, add chinese sentence support def sentences(s): """Split the string s into a list of sentences."...
AaronZhangL/az-AIchart-AIML-py
aiml/Utils.py
Python
gpl-2.0
1,169
# # (re)generate unicode property and type databases # # This script converts Unicode database files to Modules/unicodedata_db.h, # Modules/unicodename_db.h, and Objects/unicodetype_db.h # # history: # 2000-09-24 fl created (based on bits and pieces from unidb) # 2000-09-25 fl merged tim's splitbin fixes, separate ...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Tools/unicode/makeunicodedata.py
Python
gpl-2.0
48,917
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of Logilab-Common. # # Logilab-Common is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as publ...
esparta/logilab_common3
test/unittest_registry.py
Python
gpl-2.0
6,824
''' Vidhog urlresolver plugin Copyright (C) 2013 Vinnydude 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. This program is dis...
SMALLplayer/smallplayer-image-creator
storage/.xbmc/addons/script.module.urlresolver/lib/urlresolver/plugins/vidhog.py
Python
gpl-2.0
4,269
# Copyright (C) 2003 Python Software Foundation import unittest import shutil import tempfile import sys import stat import os import os.path from os.path import splitdrive from distutils.spawn import find_executable, spawn from shutil import (_make_tarball, _make_zipfile, make_archive, register_ar...
antb/TPT----My-old-mod
src/python/stdlib/test/test_shutil.py
Python
gpl-2.0
29,086
from property import * # Neuron common parameters iaf_neuronparams = {'E_L': -70., 'V_th': -50., 'V_reset': -67., 'C_m': 2., 't_ref': 2., 'V_m': -60., 'tau_syn_ex': 1., 'tau_syn_i...
magnastrazh/NEUCOGAR
nest/GDP/scripts/parameters.py
Python
gpl-2.0
3,431
import numpy as np from environment_explauto.environment import TestEnvironment from learning import Learning if __name__ == "__main__": print "Create environment" environment = TestEnvironment() print "Create agent" learning = Learning(dict(m_mins=environment.conf.m_mins, ...
sebastien-forestier/NIPS2017
ros/nips2017/src/nips2017/learning/test_learning.py
Python
gpl-3.0
3,920
from module.plugins.Hoster import Hoster from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader class ReloadCc(Hoster): __name__ = "ReloadCc" __version__ = "0.5" __type__ = "hoster" __description__ = """Reload.Cc hoster plugin""" # Since we want to allo...
Rusk85/pyload
module/plugins/hoster/ReloadCc.py
Python
gpl-3.0
4,866
# Copyright 2016 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QLin...
tuxlifan/moneyguru
qt/controller/panel.py
Python
gpl-3.0
5,750
# Copyright (C) 2020 Gustaf Blomqvist # # 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. # # This program is distr...
GBlomqvist/blender-Wirebomb
src/ops.py
Python
gpl-3.0
4,735
# Copyright (C) 2007-2008 www.stani.be # # 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. # # This program is distributed...
tibor95/phatch-python2.7
phatch/lib/pyWx/screenshot.py
Python
gpl-3.0
2,264
# Helpers for pytest tests import subprocess import json import os def find_cppcheck_binary(): possible_locations = [ "./cppcheck", "./build/bin/cppcheck", r".\bin\cppcheck.exe", ] for location in possible_locations: if os.path.exists(location): break else: ...
boos/cppcheck
addons/test/util.py
Python
gpl-3.0
1,250
from __future__ import with_statement from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import isInt, toUnicode from couchpotato.core.helpers.request import getParams, jsonified from couchpotato.core.helpers.variable import mergeDicts, t...
mozvip/CouchPotatoServer
couchpotato/core/settings/__init__.py
Python
gpl-3.0
6,744
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
kustodian/ansible
lib/ansible/module_utils/network/common/utils.py
Python
gpl-3.0
21,313
import logging from django.conf import settings from django.http import HttpResponse from django.http.request import validate_host from django.utils.http import is_safe_url from httplib import HTTPConnection, HTTPSConnection from urlparse import urlsplit from geonode.geoserver.helpers import ogc_server_settings logger...
state-hiu/rogue_geonode
geoshape/views.py
Python
gpl-3.0
3,021
# Copyright 2013 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
s20121035/rk3288_android5.1_repo
cts/apps/CameraITS/pymodules/its/error.py
Python
gpl-3.0
791
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max.toordinal(...
bgris/ODL_bgris
lib/python3.5/datetime.py
Python
gpl-3.0
75,899
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2018, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
rhyolight/nupic.research
projects/thing_classification/l2l4l6_experiment.py
Python
gpl-3.0
8,785
# coding=utf-8 """InaSAFE Wizard Step InaSAFE Raster Default Fields.""" # noinspection PyPackageRequirements import logging from parameters.qt_widgets.parameter_container import ParameterContainer from safe import messaging as m from safe.utilities.i18n import tr from safe.common.parameters.default_value_parameter i...
Gustry/inasafe
safe/gui/tools/wizard/step_kw49_inasafe_raster_default_values.py
Python
gpl-3.0
7,187
''' This file is part of the LibreOffice project. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. This file incorporates work covered by the following license noti...
beppec56/core
sw/qa/python/check_change_color.py
Python
gpl-3.0
3,675
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Owais Lone <hello@owaislone.org> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software ...
andrenam/Fogger
fogger/FoggerWindow.py
Python
gpl-3.0
10,132
import unittest import json from privacyidea.app import create_app from privacyidea.models import db from privacyidea.lib.resolver import (save_resolver) from privacyidea.lib.realm import (set_realm) from privacyidea.lib.user import User from privacyidea.lib.auth import create_db_admin from privacyidea.api.lib.postpoli...
woddx/privacyidea
tests/base.py
Python
agpl-3.0
4,803
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, 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 p...
cogmission/nupic.research
projects/sequence_prediction/continuous_sequence/swarm_description/SWARM_CONFIG_sine.py
Python
agpl-3.0
1,556
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
HBEE/odoo-addons
project_analytic_integration/__openerp__.py
Python
agpl-3.0
1,908
# This file is part of Booktype. # Copyright (c) 2013 Borko Jandras <borko.jandras@sourcefabric.org> # # Booktype 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 # (a...
btat/Booktype
lib/booktype/apps/convert/urls.py
Python
agpl-3.0
1,060
import math import matplotlib.pyplot as plt import numpy as np import time, os, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF (fs, x) = UF.wavread('../../../sounds/orchestra.wav') N = 2048 start = 1.0*fs ...
timqian/sms-tools
lectures/8-Sound-transformations/plots-code/FFT-filtering.py
Python
agpl-3.0
1,677
#!/usr/bin/env python ## \file filter_adjoint.py # \brief Applies various filters to the adjoint surface sensitivities of an airfoil # \author T. Lukaczyk, F. Palacios # \version 5.0.0 "Raven" # # SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com). # Dr. Thomas D. Ec...
cspode/SU2
SU2_PY/SU2/util/filter_adjoint.py
Python
lgpl-2.1
16,651
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
TheTimmy/spack
lib/spack/spack/schema/modules.py
Python
lgpl-2.1
6,919
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2006 Jean-Francois Doyon # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at yo...
ninowalker/mapnik-trunk
bindings/python/mapnik/ogcserver/modserver.py
Python
lgpl-2.1
6,001
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
TheTimmy/spack
var/spack/repos/builtin/packages/slurm/package.py
Python
lgpl-2.1
4,160
from PyQt5 import QtCore, QtWidgets import chigger import peacock from peacock.ExodusViewer.plugins.ExodusPlugin import ExodusPlugin from MeshBlockSelectorWidget import MeshBlockSelectorWidget class BlockHighlighterPlugin(peacock.base.PeacockCollapsibleWidget, ExodusPlugin): """ Widget for controlling the visi...
yipenggao/moose
python/peacock/Input/BlockHighlighterPlugin.py
Python
lgpl-2.1
3,928
# 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 PerlError(PerlPackage): """The Error package provides two interfaces. Firstly Error provid...
iulian787/spack
var/spack/repos/builtin/packages/perl-error/package.py
Python
lgpl-2.1
800
"""Pyblish initialisation Attributes: _registered_paths: Currently registered plug-in paths. _registered_plugins: Currently registered plug-ins. """ from .version import version, version_info, __version__ _registered_paths = list() _registered_callbacks = dict() _registered_plugins = dict() _registered_ser...
mottosso/pyblish
pyblish/__init__.py
Python
lgpl-3.0
720
""" put in your project's management/commands/freshdb.py """ from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Drops and re-creates the database" def handle(self, *args, **options): from django.db import connection from django.conf import settings ...
intelligenia/django-cmsutils
cmsutils/management/commands/freshdb.py
Python
lgpl-3.0
553
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals import base64 import binascii import calendar import codecs import contextlib import ctypes import datetime import email.utils import email.header import errno import functools import gzip import io import itertools import json import local...
rrooij/youtube-dl
youtube_dl/utils.py
Python
unlicense
126,259
# -*- coding: utf-8 -*- # Licensed to the StackStorm, Inc ('StackStorm') 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 "Licen...
alfasin/st2
st2actions/setup.py
Python
apache-2.0
1,752
# Copyright 2017 The TensorFlow Authors. 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 applica...
yanchen036/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/weibull.py
Python
apache-2.0
5,266
# Copyright 2008-2015 Nokia Solutions and 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 l...
caio2k/RIDE
src/robotide/editor/formatters.py
Python
apache-2.0
786
import pytest import re import logging from dtest import Tester since = pytest.mark.since logger = logging.getLogger(__name__) @since('2.2') class TestLargeColumn(Tester): """ Check that inserting and reading large columns to the database doesn't cause off heap memory usage that is proportional to the s...
aweisberg/cassandra-dtest
largecolumn_test.py
Python
apache-2.0
3,367
# pylint: disable=no-self-use import numpy from numpy.testing import assert_almost_equal from keras.layers import Input from keras.models import Model from deep_qa.layers import BiGRUIndexSelector class TestBiGRUIndexSelector(): def test_batched_case(self): document_length = 5 gru_hidden_dim = 2...
matt-gardner/deep_qa
tests/layers/bigru_index_selector_test.py
Python
apache-2.0
1,944
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
tempbottle/ironpython3
Tests/modules/type_related/array_test.py
Python
apache-2.0
10,771
#!/usr/bin/python # # Copyright 2015 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 b...
coxmediagroup/googleads-python-lib
examples/dfp/v201505/network_service/make_test_network.py
Python
apache-2.0
1,901
""" preHeatEx.py - (Run this before heatExchanger2.py) Performs inital energy balance for a basic heat exchanger design Originally built by Scott Jones in NPSS, ported and augmented by Jeff Chin NTU (effectiveness) Method Determine the heat transfer rate and outlet temperatures when the type ...
whiplash01/pyCycle
src/pycycle/heat_exchanger.py
Python
apache-2.0
4,907
# # 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 us...
amitsela/incubator-beam
sdks/python/apache_beam/io/localfilesystem.py
Python
apache-2.0
8,015
#!/bin/env python # Import modules import unittest import subprocess from xdd.flow import * # "constants" TEST_PORT = 40010 # Standard testing strategy: try to check each side of each branch statement # for correctness # Test checkPreconditions method of Flow class FlowCheckPreconditionsTestCase(unittest.TestCase):...
eunsungc/gt6-RAMSES_8_5
xdd-7.0.0.rc-ramses3/tests/unit/site-packages/xdd_flow_test.py
Python
apache-2.0
15,116
# 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 u...
nusdbsystem/incubator-singa
python/singa/opt.py
Python
apache-2.0
5,529
# 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...
jasondunsmore/heat
heat_integrationtests/functional/test_default_parameters.py
Python
apache-2.0
3,045
import datetime import mock from django.utils import timezone from nose.tools import * # noqa from tests.base import fake, OsfTestCase from osf_tests.factories import ( EmbargoFactory, NodeFactory, ProjectFactory, RegistrationFactory, UserFactory, UnconfirmedUserFactory ) from framework.exceptions import Per...
mattclark/osf.io
tests/test_registrations/test_registration_approvals.py
Python
apache-2.0
12,424
# Copyright (c) Goutham Pacha Ravi. # 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 requir...
NetApp/manila
manila/tests/db/test_api.py
Python
apache-2.0
2,190
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import unittest from iptest import run_test globals()["gblvar"] = 1 def setvar() : globals()["gblvar"] += 1 c...
slozier/ironpython2
Tests/test_tcf.py
Python
apache-2.0
10,501
import json import logging import time import pystache from authentication import current_org from flask import current_app, render_template, request, safe_join, send_file from flask_login import current_user, login_required from flask_restful import abort from funcy import project from redash import models, serialize...
imsally/redash
redash/handlers/embed.py
Python
bsd-2-clause
3,983
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
dennisobrien/bokeh
bokeh/sampledata/tests/test_commits.py
Python
bsd-3-clause
1,961
# -*- coding: utf-8 -*- from decimal import Decimal import urllib from django import http, test from django.conf import settings from django.core import mail from mock import patch, Mock from nose.tools import eq_ from test_utils import RequestFactory import waffle import amo.tests from amo.urlresolvers import rever...
Joergen/zamboni
apps/paypal/tests/test_views.py
Python
bsd-3-clause
18,653
# Copyright (c) 2014, Facebook, Inc. All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # """Thrift Server task using TNon...
facebook/sparts
sparts/tasks/thrift/nbserver.py
Python
bsd-3-clause
3,112
"""Compressed Sparse Column matrix format""" __docformat__ = "restructuredtext en" __all__ = ['csc_matrix', 'isspmatrix_csc'] from warnings import warn import numpy as np from sparsetools import csc_tocsr from sputils import upcast, isintlike from compressed import _cs_matrix class csc_matrix(_cs_matrix): "...
lesserwhirls/scipy-cwt
scipy/sparse/csc.py
Python
bsd-3-clause
4,895
from __future__ import absolute_import import inspect import six import sys from sentry.utils.imports import import_string PACKAGES = { "django.db.backends.postgresql_psycopg2": "psycopg2.extensions", "sentry.db.postgres": "psycopg2.extensions", "django.core.cache.backends.memcached.MemcachedCache": "mem...
mvaled/sentry
src/sentry/utils/settings.py
Python
bsd-3-clause
2,420
#!/usr/bin/env python import visvis as vv import OpenGL.GL as gl class CustomWobject(vv.Wobject): """ Example Custom wobject. This example is not optimal, it is just to illustrate how Wobject can be subclassed. """ def __init__(self, parent): vv.Wobject.__init__(self, parent) ...
chrisidefix/visvis
examples/customWobject.py
Python
bsd-3-clause
2,033
import unittest from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import (oracle, postgis, spatialite, SpatialRefSys) from django.db import connection from django.test import skipUnlessDBFeature from django.utils import six test_srs = ({ 'srid': 4326, 'auth_name': ('EPSG', ...
pwmarcz/django
django/contrib/gis/tests/test_spatialrefsys.py
Python
bsd-3-clause
4,891
from django.conf.urls.defaults import patterns, url from ga_ows.views.wfs import WFS from ga_ows.views.wms import WMS, GeoDjangoWMSAdapter
hydroshare/hydroshare_temp
ga_ows/urls.py
Python
bsd-3-clause
140
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2009 Edgewall Software # Copyright (C) 2004-2006 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://...
trac-ja/trac-ja
trac/versioncontrol/diff.py
Python
bsd-3-clause
13,650
from django import forms from django.core.validators import EMPTY_VALUES from django_filters.filters import ChoiceFilter, ModelChoiceFilter from django_filters.filterset import FilterSet import amo import mkt from addons.models import Category from mkt.api.forms import SluggableModelChoiceField from mkt.collections.m...
wagnerand/zamboni
mkt/collections/filters.py
Python
bsd-3-clause
6,380
""" @author: """ import bottle # this variable MUST be used as the name for the cookie used by this application COOKIE_NAME = 'sessionid' def check_login(db, usernick, password): """returns True if password matches stored""" def generate_session(db, usernick): """create a new session and add a cookie to t...
stevecassidy/pyunitgrading
tests/bad/single/43684882/comp249-psst-starter-master/users.py
Python
bsd-3-clause
815
""" ImportedIds gathers identifiers imported by a node. """ from pythran.analyses.globals_analysis import Globals from pythran.analyses.locals_analysis import Locals from pythran.passmanager import NodeAnalysis import pythran.metadata as md import ast class ImportedIds(NodeAnalysis): """Gather ids referenced b...
hainm/pythran
pythran/analyses/imported_ids.py
Python
bsd-3-clause
2,844
from django.contrib import admin from lingcod.group_management.models import GroupRequest class GroupRequestAdmin(admin.ModelAdmin): pass admin.site.register(GroupRequest, GroupRequestAdmin)
Alwnikrotikz/marinemap
lingcod/group_management/admin.py
Python
bsd-3-clause
197
"""Autocomplete fields for QuerySetSequence choices.""" from dal_contenttypes.fields import ( ContentTypeModelMultipleFieldMixin, GenericModelMixin, ) from django import forms from django.contrib.contenttypes.models import ContentType from queryset_sequence import QuerySetSequence class QuerySetSequenceFie...
Eraldo/django-autocomplete-light
src/dal_queryset_sequence/fields.py
Python
mit
4,390
from argparse import Action from flexget.options import ArgumentParser def test_subparser_nested_namespace(): p = ArgumentParser() p.add_argument('--outer') p.add_subparsers(nested_namespaces=True) sub = p.add_subparser('sub') sub.add_argument('--inner') sub.add_subparsers() subsub = sub....
Flexget/Flexget
flexget/tests/test_argparse.py
Python
mit
2,272
from direct.directnotify import DirectNotifyGlobal from toontown.parties.DistributedPartyJukeboxActivityBaseAI import DistributedPartyJukeboxActivityBaseAI import PartyGlobals class DistributedPartyJukeboxActivityAI(DistributedPartyJukeboxActivityBaseAI): notify = DirectNotifyGlobal.directNotify.newCategory("Distr...
Spiderlover/Toontown
toontown/parties/DistributedPartyJukeboxActivityAI.py
Python
mit
549