code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
""" WSGI config for Atypidae project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Atypidae.settings") from django.core...
infosec-o4it/Atypidae
Atypidae/wsgi.py
Python
gpl-3.0
391
# -*- coding: utf-8 -*- from __future__ import absolute_import import theano import theano.tensor as T from theano.tensor.signal import downsample from .. import activations, initializations from ..utils.theano_utils import shared_zeros from ..layers.core import Layer class Convolution1D(Layer): def __init__(se...
kfoss/keras
keras/layers/convolutional.py
Python
mit
7,337
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Jan Thor # 2011-01-11T11:57:56Z (UTC) # 2011-01-11T12:57:56+01:00 (Westeuropäische Normalzeit) # u""" Constructs a P3 Penrose Tiling. A Penrose tiling is an aperiodic tiling. The P3 tiling uses two kinds of rhombs. This algorithm uses the inflation of Robinson tr...
mitselek/penrose
penrose_dataset.py
Python
unlicense
8,726
class Config: BINANCE="Binance" BITTREX="Bittrex" COINBASE="Coinbase" POLONIEX="Poloniex" COINBASEPRO="CoinbasePro" KRAKEN="Kraken" KUCOIN="Kucoin" BALANCE_ZERO=0.00000001 def get_configured_exchange_names(): return [Config.BINANCE, Config.BITTREX, Config.COINBASE, Config.POLONIEX,...
msantl/cryptofolio
cryptofolio/api/Config.py
Python
gpl-3.0
522
from django.contrib import admin # Register your models here. import bythebook.models admin.site.register(bythebook.models.Book) admin.site.register(bythebook.models.Author) admin.site.register(bythebook.models.Topic)
Victory/fun-with-forms
funforms/bythebook/admin.py
Python
apache-2.0
220
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the output module field formatting helper.""" import unittest from dfvfs.path import fake_path_spec from plaso.containers import events from plaso.lib import definitions from plaso.output import formatting_helper from tests.containers import test_lib as co...
Onager/plaso
tests/output/formatting_helper.py
Python
apache-2.0
8,040
# # Hubblemon - Yet another general purpose system monitor # # Copyright 2015 NAVER Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
naver/hubblemon
redis_mon/redis_alarm.py
Python
apache-2.0
1,614
from django.conf.urls import patterns, include, url from django.contrib import admin from cronkite.models import Job admin.autodiscover() # Option 1: # create jobs for any new functions in project.crontab, but do not # delete missing ones or update existing ones. Job.auto_discover('project.crontab', delete_first=Fals...
evilchili/django-cronkite
example-project/project/urls.py
Python
mit
655
# Copyright (C) 2007, Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distrib...
tchx84/debian-pkg-sugar-toolkit
src/sugar/bundle/activitybundle.py
Python
lgpl-2.1
12,570
from pandas import Series import nose # noqa import numpy as np import operator import pandas.util.testing as tm from pandas import compat from pandas.sparse.array import IntIndex, BlockIndex, _make_index import pandas._sparse as splib TEST_LENGTH = 20 plain_case = dict(xloc=[0, 7, 15], xlen=[3, 5, 5], yloc=[2, 9...
andyraib/data-storage
python_scripts/env/lib/python3.6/site-packages/pandas/sparse/tests/test_libsparse.py
Python
apache-2.0
21,788
''' Features for document zoning classification. ''' from __future__ import division import os import string import argparse import yakonfig import dblogger from nltk.corpus import stopwords def fraction_whitespace(line): ''' Feature that computes the fraction of the line that is white space. N.B. we tr...
streamcorpus/streamcorpus-zoner
streamcorpus_zoner/features.py
Python
mit
4,341
#!/usr/bin/python a = 21 b = 2 c = b - a print 'abs = ', abs(c) c = divmod(a,b) print 'divmod = ', c c = pow(a,b) print 'pow = ', c c = round(2.7777,2) print 'round(2.7777,2) = ', c
Bodidze/21v-python
unit_01/6.py
Python
mit
185
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
jaapjorisjaap/python_packaging_cookiecutter
{{cookiecutter.package_name}}/setup.py
Python
mit
3,752
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class ProductTemplate(models.Model): _name = 'product.template' _inherit = 'product.template' @api.model def _get_buy_route(self): buy_route = self.env.ref(...
t3dev/odoo
addons/purchase_stock/models/product.py
Python
gpl-3.0
536
from copy import deepcopy from django import forms from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from core.models import SiteConfiguration from ..models import Preferences, Profile from ..utils import value_without_invalid_marker from ..validators import TooNearPas...
tejo-esperanto/pasportaservo
hosting/forms/profiles.py
Python
agpl-3.0
7,938
""" BeatTheMean app implements DuelingBanditsPureExplorationPrototype author: Kevin Jamieson, kevin.g.jamieson@gmail.com last updated: 1/11/2015 BeatTheMean implements the Beat-The-Mean algorithm described in Yue and Joachims, "Beat the Mean Bandit," COLT 2011 originally designed for idenitfying the condorcet winner ...
kgjamieson/NEXT-psych
next/apps/DuelingBanditsPureExploration/algs/BeatTheMean/BeatTheMean.py
Python
apache-2.0
4,838
from __future__ import absolute_import, division, unicode_literals from numpy import ascontiguousarray from numpy_sugar import (is_all_equal, is_all_finite) from limix_inference.lik import BinomialProdLik from limix_inference.link import LogitLink class BinomialPhenotype(object): def __init__(self, nsuccesses, n...
glimix/lim
lim/genetics/phenotype/binomial.py
Python
mit
1,134
from extractors.extract_phonenumber import ExtractPhoneNumber from datawakestreams.extractors.extractor_bolt import ExtractorBolt class PhoneBolt(ExtractorBolt): name ='phone_extractor' def __init__(self): ExtractorBolt.__init__(self) self.extractor = ExtractPhoneNumber()
Sotera/Datawake-Legacy
memex-datawake-stream/src/datawakestreams/extractors/phone_bolt.py
Python
apache-2.0
301
from os.path import join as pjoin import logging from collections import defaultdict log = logging.getLogger("main") from nprlib.task import Msf from nprlib.master_task import ConcatAlgTask from nprlib.master_job import Job from nprlib.utils import SeqGroup, GLOBALS, generate_runid, strip, pexist, md5 from nprlib imp...
jhcepas/npr
nprlib/task/concat_alg.py
Python
gpl-3.0
9,748
from parsers.allow_in import allow_in_parser from hooks.registry import call_hook from generators.registry import register_generator from generators.addr import addr_generator from os import linesep class AllowInGenerator(object): def generate(self, rule): rule_str = "-A FORWARD -j ACCEPT " if ru...
youknow0/iptgen
generators/allow_in.py
Python
gpl-2.0
989
''' Created on Oct 30, 2014 @author: Arrington ''' from pyHopeEngine import engineCommon as ECOM from pyHopeEngine.actors.components.aiComponent import AIComponent from superPong.actors.ballAI.ballProcesses.ballChooseStateProcess import BallChooseStateProcess from superPong.actors.ballAI.pongBallBrain import MainBall...
Trinak/SuperPong
superPong/actors/components/ballAIComponent.py
Python
gpl-3.0
1,814
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
davidsminor/gaffer
python/GafferTest/StringPlugTest.py
Python
bsd-3-clause
5,340
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio 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...
ludmilamarian/invenio-oauthclient
invenio_oauthclient/contrib/cern.py
Python
gpl-2.0
7,075
# -*- coding: utf8 -*- # # Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License,...
ndp-systemes/odoo-addons
stock_specific_inventory/tests/__init__.py
Python
agpl-3.0
827
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf as h2o_rf, h2o_import as h2i, h2o_exec, h2o_util, h2o_browse as h2b # we can pass ntree thru kwargs if we don't use the "trees" parameter in runRF # only classes 1-7 in the 55th col # this sucks! ALLOWED_DELTA=40 D...
111t8e/h2o-2
py/testdir_kevin/test_rf_covtype_train_oobe_fvec.py
Python
apache-2.0
9,239
# -*- coding: utf-8 -*- # # essence documentation build configuration file, created by # sphinx-quickstart on Mon Oct 5 13:43:34 2015. # # 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 # autogenerated file. # # A...
chromy/essence
docs/source/conf.py
Python
mit
9,499
""" This file contains everything related to persistence for the market community. """ from os import path from Tribler.community.market.core.message import TraderId from Tribler.community.market.core.order import Order, OrderId, OrderNumber from Tribler.community.market.core.payment import Payment from Tribler.commu...
vandenheuvel/tribler
Tribler/community/market/database.py
Python
lgpl-3.0
13,956
from config import Config from core import Core
jmruizt/TransOnion
transonion/transonion/__init__.py
Python
gpl-3.0
47
# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import io import os import re import unittest import tempfile fr...
zmughal/pygments-mirror
tests/test_html_formatter.py
Python
bsd-2-clause
6,843
import json import os import sys if sys.version_info < (3, 0): from unittest2 import TestCase else: from unittest import TestCase import requests import github3 try: from unittest import mock except ImportError: import mock from io import BytesIO from requests.structures import CaseInsensitiveDict ...
h4ck3rm1k3/github3.py
tests/utils.py
Python
bsd-3-clause
3,211
# -*- coding: utf-8 -*- import sqlite3 from flask import g, current_app def connect_db(): db = sqlite3.connect(current_app.config['DATABASE_URI']) db.row_factory = sqlite3.Row return db # http://flask.pocoo.org/docs/0.10/appcontext/ def get_db(): """Opens a new database connection if there is none ...
gaowhen/summer
summer/db/connect.py
Python
mit
485
_ = input() # number of test cases; we can ignore this since it has no significance temps = map(int, input().split()) # all the temps stored to a list with type int subercold = 0 # how many temps below 0 we got for i in temps: # for every temp we recorded if it's less than 0 add +1 to subercold if i < 0: ...
6ftunder/open.kattis
py/Cold-puter Science/cold_puter.py
Python
mit
358
#!/usr/bin/python """ create Autosupport module to enable, disable or modify """ # (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadat...
tumbl3w33d/ansible
lib/ansible/modules/storage/netapp/na_ontap_autosupport.py
Python
gpl-3.0
10,836
# Copyright 2015 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. import argparse class CustomHelpAction(argparse.Action): '''Allows defining custom help actions. Help actions can run even when the parser would other...
junhuac/MQUIC
src/build/android/pylib/utils/argparse_utils.py
Python
mit
1,802
import logging from autotest.client.shared import error from autotest.client import utils from virttest import utils_test @error.context_aware def run_ping(test, params, env): """ Ping the guest with different size of packets. 1) Login to guest 2) Ping test on nic(s) from host 2.1) Ping with ...
kylazhang/virt-test
tests/ping.py
Python
gpl-2.0
4,855
# Copyright 2014 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. import os import unittest import shutil import tempfile from telemetry import page as page_module from telemetry.page import page_set from telemetry.timelin...
CTSRD-SOAAP/chromium-42.0.2311.135
tools/telemetry/telemetry/value/trace_unittest.py
Python
bsd-3-clause
3,688
# -*- encoding: utf-8 -*- # # Copyright 2012 Martin Zimmermann <info@posativ.org>. All rights reserved. # License: BSD Style, 2 clauses -- see LICENSE. from __future__ import print_function import sys import logging import warnings from logging import INFO, WARN, DEBUG from acrylamid.colors import bold, red, green, y...
markvl/acrylamid
acrylamid/log.py
Python
bsd-2-clause
3,688
from __future__ import print_function import pandas as pd from bs4 import BeautifulSoup as BSoup from sys import path as syspath syspath.insert(0, "..") from CanslimParams import CanslimParams from myAssert import areEqual from os import path as ospath testDir = ospath.join("..", "TestData") all10Ks = pd.read_csv(osp...
cielling/jupyternbs
tests/tester_nvda.py
Python
agpl-3.0
3,747
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
mojwang/selenium
py/test/selenium/webdriver/common/select_class_tests.py
Python
apache-2.0
12,546
SAMPLES_YAML = { 'a': """\ - a1-a: [pk] - [A1] - [A2] - [B1] - [C1] - [C2] - [D1] - [E1] - [P1] """, 'b': """\ - a1-a: [pk] - [B1] - [C1] - [C2] - [D1] - [E1] - a1-b: [pk] ...
katakumpo/nicedjango
tests/samples_compact_yaml.py
Python
mit
6,357
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'mongobacked.DataEntry.views.index'), url(r'^medinfo/', 'mongobacked.DataEntry.views.medinfo'), url(r'^update/', 'mongobacked.DataEntry.views.update'), url(r'^adm...
ludi1001/IonMedicationSystem
mongobacked/mongobacked/urls.py
Python
gpl-2.0
355
from unit_test_common import execute_csv2_command, initialize_csv2_request, ut_id, sanity_commands, table_commands from sys import argv # lno: GV - error code identifier. def main(gvar): if not gvar: gvar = {} if len(argv) > 1: initialize_csv2_request(gvar, selections=argv[1]) ...
hep-gc/cloudscheduler
unit_tests/test_cli_group_metadata_list.py
Python
apache-2.0
1,630
from django.conf.urls import url app_name = "ofertas" urlpatterns = [ ]
andree1320z/deport-upao-web
deport_upao/apps/cotizaciones/urls.py
Python
mit
77
import envi import envi.bits as e_bits import envi.bytesig as e_bsig from envi.archs.z80.regs import * from envi.archs.z80.const import * import envi.archs.z80.z80opcode as z80_opcode sigtree = e_bsig.SignatureTree() for row in z80_opcode.z80table: sighex, maskhex = row[0] sig = sighex.decode('hex') m...
joxeankoret/pyew
envi/archs/z80/disasm.py
Python
gpl-2.0
3,062
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import pytest import functools from devtools_testutils import recorded_by_proxy from azure.ai.formrecognizer._generated.v2022_01_30_preview.models import...
Azure/azure-sdk-for-python
sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dac_analyze_layout.py
Python
mit
7,732
from setuptools import setup import sys, os exec(open('tooldog/version.py').read()) setup(name="tooldog", version=__version__, description='Tool description generator (from https//bio.tools to XML and CWL)', author='Kenzo-Hugo Hillion, Ivan Kuzmin and Herve Menager', author_email='kehi...
khillion/ToolDog
setup.py
Python
mit
1,072
import tempfile import shutil from django.conf import settings from django_ztask.decorators import task from system import services @task() def restart_rockstor(ip, port): services.update_nginx(ip, port)
gkadillak/rockstor-core
src/rockstor/smart_manager/views/ztask_helpers.py
Python
gpl-3.0
209
#!/usr/bin/env python # # PyGab - Python Jabber Framework # Copyright (c) 2008, Patrick Kennedy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # - Redistributions of source code must r...
PatrickKennedy/pygab
framework/plugin.py
Python
bsd-2-clause
10,905
version = '5.4.0' module_apiversion = '2'
jhaynie/titanium_mobile
build/titanium_version.py
Python
apache-2.0
42
""" WorkCalendar class with datetime operations on working hours, handling holidays merges and improves `BusinessHours <http://pypi.python.org/pypi/BusinessHours/>`_ and `workdays <http://pypi.python.org/pypi/workdays/>`_ packages """ __author__ = "Philippe Guglielmetti" __copyright__ = "Copyright 2012, Philippe G...
goulu/Goulib
Goulib/workdays.py
Python
lgpl-3.0
10,075
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin OK comando PLINE per disegnare una polilinea ------------------- begin : 2013-05-22 copyright : i...
gam17/QAD
cmd/qad_pline_cmd.py
Python
gpl-3.0
77,915
# Copyright 2012 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 or agreed to in...
reeshupatel/demo
keystone/identity/core.py
Python
apache-2.0
42,880
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.common.abstracts import Package from lib.common.rand import random_string class Generic(Package)...
cuckoobox/cuckoo
cuckoo/data/analyzer/windows/modules/packages/generic.py
Python
mit
1,129
#coding: utf-8 import re def strip_empty_tags(ofx): """Strips open/close tags that have no content.""" strip_search = '(<(?P<tag>[^>]+)>\s*</(?P=tag)>|<(?P<closed_tag>[^>]+)/>)' return re.sub(strip_search, '', ofx)
myfreecomm/fixofx
lib/ofxtools/util.py
Python
apache-2.0
229
#!/usr/bin/env python # Copyright Hugh Perkins 2005 # # 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 p...
hughperkins/osmp-cpp
pyConfigFileUpdating.py
Python
gpl-2.0
4,289
import numpy as np import scipy as sp from openpnm.algorithms import ReactiveTransport from openpnm.utils import logging, GenericSettings, Docorator logger = logging.getLogger(__name__) docstr = Docorator() @docstr.get_sectionsf('StokesFlowSettings', sections=['Parameters']) @docstr.dedent class...
TomTranter/OpenPNM
openpnm/algorithms/StokesFlow.py
Python
mit
3,933
#!/usr/bin/env python3 import os import re __all__ = ['load_refdict', 'bibsub'] _DEFAULT_DICT = os.path.join(os.path.dirname(__file__), 'refdict.dat') def load_refdict(dictpaths): """Load "refdict.txt" and transform it into a dict object.""" refdict = {} for fname in dictpaths: with open(fname)...
yhebik/texbenri
texbenri/bibsub/__main__.py
Python
bsd-2-clause
2,590
from pytest import raises from graphql.language import parse_type, TypeNode from graphql.type import GraphQLList, GraphQLNonNull, GraphQLObjectType from graphql.utilities import type_from_ast from ..validation.harness import test_schema def describe_type_from_ast(): def for_named_type_node(): node = par...
graphql-python/graphql-core
tests/utilities/test_type_from_ast.py
Python
mit
1,371
# -*- coding: utf-8 -*- ############################################################################### # # ListAllUsers # Retrieves a list of all existing users. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this...
jordanemedlock/psychtruths
temboo/core/Library/Zendesk/Users/ListAllUsers.py
Python
apache-2.0
4,516
__author__ = 'Luke Merrett' from database.playtime_operations import PlaytimeOperations if __name__ == '__main__': s = PlaytimeOperations() s.chart_stored_playtime()
lukemerrett/SteamProgress
graph_playtime.py
Python
mit
177
from mfr.core.exceptions import RendererError class TabularRendererError(RendererError): def __init__(self, message, *args, **kwargs): super().__init__(message, *args, renderer_class='tabular', **kwargs) class MissingRequirementsError(TabularRendererError): __TYPE = 'tabular_missing_requirements' ...
CenterForOpenScience/modular-file-renderer
mfr/extensions/tabular/exceptions.py
Python
apache-2.0
2,233
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py
Python
mit
6,625
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
google-research/google-research
rrlfd/adroit_ext/hammer_v0.py
Python
apache-2.0
1,602
# -*- coding: utf-8 -*- from __future__ import unicode_literals import collections import copy import datetime import decimal import math import uuid import warnings from base64 import b64decode, b64encode from django.apps import apps from django.db import connection from django.db.models.lookups import default_looku...
jhoos/django
django/db/models/fields/__init__.py
Python
bsd-3-clause
92,964
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from os.path import dirname import platform import sys import tempfile import unittest import driver_env import driver_...
yantrabuddhi/nativeclient
pnacl/driver/tests/driver_test_utils.py
Python
bsd-3-clause
4,058
""" Module to generate Systems and positions for simple reference molecular systems for testing. DESCRIPTION This module provides functions for building a number of test systems of varying complexity, useful for testing both OpenMM and various codes based on pyopenmm. Note that the PYOPENMM_SOURCE_DIR must be set to...
choderalab/openmmtools
openmmtools/testsystems.py
Python
mit
170,458
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from scrapenhl2.scrape.schedules import ( _get_current_season, schedule_setup, get_season_schedule_filename, get_season_schedule, get_team_schedule, write_season_schedule, get_game_data_from_schedule, _CURRENT_SEASON, _SCHEDULES, ) fro...
muneebalam/scrapenhl2
tests/test_schedule.py
Python
mit
3,204
# -*- coding: iso-8859-1 -*- # # Copyright (C) 2009 Rene Liebscher # # This program 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 3 of the License, or (at your option) any # later ver...
arruda/pyfuzzy
fuzzy/operator/Operator.py
Python
lgpl-3.0
1,442
from django.db.backends.oracle.base import \ DatabaseWrapper as OracleDatabaseWrapper from .features import DatabaseFeatures from .introspection import OracleIntrospection from .operations import OracleOperations from .schema import OracleGISSchemaEditor class DatabaseWrapper(OracleDatabaseWrapper): SchemaEd...
KrzysztofStachanczyk/Sensors-WWW-website
www/env/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/base.py
Python
gpl-3.0
603
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/apps/zookeeper/src/zookeeper/windmilltests.py
Python
gpl-2.0
1,060
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
xiangel/hue
desktop/libs/liboozie/src/liboozie/oozie_api.py
Python
apache-2.0
10,373
import unittest import mock import datetime import time import logging import uuid import tornado.ioloop import phonon import phonon.event import phonon.connections import phonon.reference import phonon.lock logging.disable(logging.CRITICAL) def get_milliseconds_timestamp(): return int((datetime.datetime.utcno...
buzzfeed/phonon
test/process_test.py
Python
mit
9,690
#!/usr/bin/env python3 class Solution(object): def topKFrequent(self, words, k): """ :type words: List[str] :type k: int :rtype: List[str] """ import collections d = collections.defaultdict(int) for w in words: d[w] += 1 l = [[] fo...
eroicaleo/LearningPython
interview/leet/692_Top_K_Frequent_Words.py
Python
mit
828
from django.http import HttpResponse from django.core.urlresolvers import reverse from semanticizer.forms import * from semanticizer.formats import * from semanticizer.models import * import json def fetch_data(request,id): ds = DataSet.objects.get(id=id) meta = do_fetch_data(ds) ...
citizennerd/VivaCity
semanticizer/views.py
Python
mit
2,729
VALID_JSON_SCHEMA = """ { "swagger": "2.0", "info": {"title": "Mini API", "version": "1.0.0"}, "host": "example.com", "basePath": "/api", "schemes": ["https"], "consumes": ["application/json"], "produces": ["application/json"], "paths": { "/items": { "get": { ...
artemdevel/python-swagger-validator
tests/utils.py
Python
apache-2.0
5,196
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. __import__('pkg_resources').declare_namespace(__name__) AUTH_OTP_REQUIRED = 2 AUTH_U2F_REQUIRED = 3...
gonicus/gosa
common/src/gosa/common/components/auth/__init__.py
Python
lgpl-2.1
374
# -*- coding=utf8 -*- import os, sys import select, threading, Queue import configparser as cf from mysocket import MySocket g_messageQueues = {} #每个scoket分配一个队列用于读写 g_messageQueues['main'] = Queue.Queue() #主队列用于接收服务器的返回消息 svrSockets = [] #MySocket 列表,对应每一个服务器 class MsgItem: def __init__(self, msgType, socket, da...
dilworm/pytest
base/client.py
Python
gpl-2.0
3,292
# Exports (for `from manticore.ethereum import ...`) from .abi import ABI from .manticore import ManticoreEVM, config from .state import State from .detectors import ( Detector, DetectEnvInstruction, DetectExternalCallAndLeak, DetectReentrancySimple, DetectSuicidal, DetectUnusedRetVal, Detec...
trailofbits/manticore
manticore/ethereum/__init__.py
Python
agpl-3.0
698
#!/usr/bin/env python import os import sys packages = [ 'moose' , 'moogli' , 'moose-python' , 'moose-gui' , 'libmoose' ] def generate_script(package): print("Info: Generating for %s" % package) pkgDir = os.path.join('..', package) if not os.path.isdir(pkgDir): ...
BhallaLab/moose-full
OBS/home:moose/scripts/generate_spec_files.py
Python
gpl-2.0
475
import time import sys import traceback from browser import document, window, ajax import javascript def forward(req): cpython_time = float(req.text) results[-1]['CPython'] = cpython_time test_next() def run_cpython(script_name, next_step): """Send an async POST Ajax call to run the CPython script. ...
kikocorreoso/brython
www/speed/make_report.py
Python
bsd-3-clause
1,921
# -*- coding: utf8 -*- from .player import PlayerEntity from .base import MobEntity from .item import ItemEntity __all__ = [ 'PlayerEntity', 'MobEntity', 'ItemEntity', ]
nosix/PyCraft
src/pycraft/service/composite/entity/__init__.py
Python
lgpl-3.0
188
#!/usr/bin/env python from sys import argv from os.path import abspath try: from coverage import coverage HAS_COVERAGE = True except ImportError: HAS_COVERAGE = False from circuits import Component from circuits.app import Daemon class App(Component): def init(self, pidfile, **kwargs): ...
treemo/circuits
tests/app/app.py
Python
mit
709
# -*- encoding: utf-8 -*- import datetime import discograph class Test(discograph.DiscographTestCase): def test_1(self): date_string = '1989-06-23' date = discograph.Bootstrapper.parse_release_date(date_string) assert date == datetime.datetime(1989, 6, 23) def test_2(self): d...
josiah-wolf-oberholtzer/discograph
discograph/library/test/test_Bootstrapper_element_to_datetime.py
Python
mit
1,944
if ( x == ( 3 ) or y == 4): pass y = x == 2 \ or x == 3 if x == 2 \ or y > 1 \ or x == 3: pass if x == 2 \ or y > 1 \ or x == 3: pass if (foo == bar and baz == frop): pass if ( foo == bar and baz == frop ): pas...
tst-eboersma/pep8
testsuite/E12not.py
Python
mit
11,605
from collections import OrderedDict import hashlib import base64 import hmac import httplib import json import random import string import time import urllib """ API configuration. """ API_HOSTNAME = 'api.formcorp.com.au' # Module constants _constants = { 'SIGNATURE_ENCODING': "utf-8", 'REQUEST_TYPE_POST': 'P...
formcorp/python-formcorp
formcorp/api.py
Python
apache-2.0
5,641
# # Copyright 2014-2015 Boundary, 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...
wcainboundary/boundary-api-cli
boundary/source_list.py
Python
apache-2.0
856
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
eLBati/odoo
openerp/addons/base/ir/ir_cron.py
Python
agpl-3.0
14,088
from setuptools import setup, find_packages from filehandle import __version__ setup( name = 'filehandle', version = __version__, py_modules = ['filehandle'], install_requires = [], author = 'Tyghe Vallard', author_email = 'vallardt@gmail.com', description = 'Normalize the way you get a fi...
necrolyte2/filehandle
setup.py
Python
gpl-2.0
487
import subprocess from sys import stdout, stderr, argv from collections import deque from diffu import parseDiff, writeMergedChunks from blame import blameCursor, defaultBlame, mergeBlames, pickNewest verbose = 0 ignoreCharacters = ' \t\r\n' def ignoreWhitespace(str): return str.translate(None, ignoreCharacters...
martinthomson/blame-bridge
blame_bridge/bridge.py
Python
mit
7,204
import Skype4Py import sys skype = Skype4Py.Skype() skype.Attach() x = 1 skype.PlaceCall(sys.argv[1]) while (x == 1): if (len(skype.ActiveCalls) != 0): if (skype.ActiveCalls[0].Status == 'INPROGRESS'): break skype.ActiveCalls[0].StartVideoSend()
andrewparrish/SkypeConferenceAutomator
makecall.py
Python
mit
256
# -*- coding: utf-8 -*- """ Store white point data for various illuminants. Change log: 2015/10/10 -- WhitePoint and illuminants added; nloomis@gmail.com """ import collections import numpy class WhitePoint(collections.namedtuple('WhitePoint', ['X', 'Y', 'Z', 'name'])): ...
nickloomis/loomsci-examples
python/color/whitepoint.py
Python
mit
2,444
# -*- coding: utf-8 -*- from fluxi import Fluxi fl=Fluxi("TestChoose") #%% #c=fl.Choose("Choose") #print c.values,repr(c.value) #%% c=fl.Choose("Choose",values=['a','b','c']) print c.values,repr(c.value) #%% c.v='c' #%% print c.v #%% c=fl.Choose("Choose",values=['a','b','c','d']) print c.values,repr(c.value) #%% fl.sa...
fluxiresearch/fluxi
devtests/test_Choose.py
Python
mit
458
# Copyright 2008-2015 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # from __future__ import absolute_import, print_function import collections import itertools import sys import types import logging from operator import methodcaller, attrgetter from ....
skoslowski/gnuradio
grc/core/FlowGraph.py
Python
gpl-3.0
17,712
from collections import defaultdict from itertools import count class Vocab: def __init__(self, w2i=None): if w2i is None: w2i = defaultdict(count(0).next) self.w2i = dict(w2i) self.i2w = {i:w for w,i in w2i.iteritems()} @classmethod def from_corpus(cls, corpus): w2i = defaul...
yoavg/cnn
pyexamples/util.py
Python
apache-2.0
1,072
#------------------------------------------------------------------------------- # Name: CSC492 - Coding Assignment #1 # Purpose: # # Author: Marion # # Created: 13/10/2017 # Copyright: (c) Marion 2017 # Licence: <your licence> #------------------------------------------------------------...
arasdar/DL
uri-dl/uri-dl-hw-1/Marion/assignment1bis.py
Python
unlicense
3,377
#!/usr/bin/env python2 import os import re import urllib import json import contextlib THIS_DIR = os.path.dirname(os.path.realpath(__file__)) def download(url): # contextlib is to be eliminated in Python 3 where with statement is applicable. with contextlib.closing(urllib.urlopen(url)) as f: return...
niboshi/annoto
test/face-detection/download_test_images.py
Python
gpl-2.0
1,988
#!/usr/bin/python2.7 # Copyright 2015 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 ...
AwesomeTurtle/personfinder
app/add_note.py
Python
apache-2.0
7,586
#!/usr/bin/env python from peacock.Execute.ExecuteOptionsPlugin import ExecuteOptionsPlugin from PyQt5.QtTest import QTest from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QFileDialog, QMainWindow from peacock.utils import Testing from mock import patch import os class Tests(Testing.PeacockTester): def setU...
backmari/moose
python/peacock/tests/execute_tab/ExecuteOptionsPlugin/test_ExecuteOptionsPlugin.py
Python
lgpl-2.1
3,930
from wargaming import WoT, WoTB, WoWS, WoWP, WoTX def main(): region_map = [ ('ru', 'ru'), ('en', 'asia'), ('en', 'na'), ('en', 'eu'), ] for game in [WoT, WoTB, WoWS, WoWP]: for region in region_map: if game == WoWP and region[1] == 'asia': ...
monester/python-wargaming
tests/validate_endpoints.py
Python
mit
691
import time import os from concurrent.futures import as_completed from ..core import Executor ## SINGLE JOB print 'SUBMIT' future = Executor().submit('qbfutures.test.work:func', 'single') print future print future.result() print ## MAP print 'MAP' for x in Executor(cpus=4).map('qbfutures.test.work:func', xra...
westernx/qbfutures
qbfutures/test/submit.py
Python
bsd-3-clause
869