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
import datetime import norris class Utilities( object ): def __init__( self ): return None @staticmethod def datestring_to_datetime( date_string ): return datetime.datetime.strptime( date_string[0:-5], '%Y-%m-%dT%H:%M:%S.000' ) @staticmethod def now_as_datestring...
ua-eas/ksd-norris
src/norris/utilities.py
Python
bsd-2-clause
1,491
from functools import partial from django.contrib import admin from django.core.exceptions import ObjectDoesNotExist from django.forms.models import modelform_factory from django.contrib.admin.views.main import ChangeList from django.forms.models import model_to_dict from django.contrib.auth import get_user_model fro...
fusionbox/django-widgy-blog
widgy_blog/admin.py
Python
bsd-2-clause
5,267
# Adapted from unittest2/loader.py from the unittest2 plugins branch. # This module contains some code copied from unittest2/loader.py and other # code developed in reference to that module and others within unittest2. # unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All # Rights Reserved. See: http:/...
ptthiem/nose2
nose2/loader.py
Python
bsd-2-clause
4,345
#!/usr/bin/env python # -*- coding: utf-8 -*- import binascii import base64 import hashlib from Crypto import Random from Crypto.Cipher import AES # binascii.unhexlify # binascii.hexlify # 填充方式 # PKCS#5 和 PKCS#7 唯一的区别就是前者规定了数据块大小是 64 比特(8 字节) # 而 AES 中数据块大小是 128 比特(16字节), 因此在 AES 中, PKCS#5 和 PKCS#7 没有区别. BS = 16 ...
baixuexue123/note
python/others/aes_test.py
Python
bsd-2-clause
2,519
import mutiprocessing ###################################################################### # Controllers for parallel execution, one per worker. # Return when a 'None' job (poison pill) is reached. ###################################################################### class Consumer(multiprocessing.Process): ...
t-brandt/acorns-adi
parallel/multiproc_utils.py
Python
bsd-2-clause
1,069
from copy import deepcopy from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.core.admin import DisplayableAdmin, OwnableAdmin from pleiapp.models import (FrontPageItem, Type, ...
orlenko/plei
pleiapp/admin.py
Python
bsd-2-clause
5,888
"""Initial Revision ID: cfbd6d35cab Revises: Create Date: 2015-03-04 04:13:56.547992 """ # revision identifiers, used by Alembic. revision = 'cfbd6d35cab' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by A...
PEDSnet/pedsnetcdms
pedsnetcdms/pedsnetcdm/alembic/versions/cfbd6d35cab_initial.py
Python
bsd-2-clause
30,989
from __future__ import print_function import logging import random import re from streamlink.compat import urljoin from streamlink.plugin import Plugin, PluginArguments, PluginArgument from streamlink.plugin.api import http from streamlink.plugin.api import useragents from streamlink.plugin.api import validate from s...
javiercantero/streamlink
src/streamlink/plugins/funimationnow.py
Python
bsd-2-clause
11,232
"""Tests of disco_metanetwork""" from unittest import TestCase from mock import MagicMock, call, patch from disco_aws_automation.disco_metanetwork import DiscoMetaNetwork from disco_aws_automation.exceptions import EIPConfigError from tests.helpers.patch_disco_aws import TEST_ENV_NAME MOCK_ROUTE_FILTER = {"vpc-id"...
amplifylitco/asiaq
tests/unit/test_disco_metanetwork.py
Python
bsd-2-clause
12,881
import random import numpy as np from copy import deepcopy class Move: ''' the move data structure. field for colour of robot and direction of move. ''' intToColourConversion = ["BLUE", "RED", "GREEN", "YELLOW"] # index with robot number to get colour as string def __init__(self, colour, direction): self.colou...
ajstarna/RicochetRobots
Brobot/Move.py
Python
bsd-2-clause
1,936
SECRET_KEY = 'secret' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', } } TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', ...
jobec/django-auth-adfs
tests/settings.py
Python
bsd-2-clause
2,308
#!/usr/bin/env python3 import json import os import subprocess def connection_lost(network_id, timeout_seconds): p = subprocess.Popen(["hamachi", "go-online", network_id]) try: p.wait(timeout_seconds) except subprocess.TimeoutExpired: p.kill() return True return False if __na...
frenzykryger/hamachi-watchdog
hamachi-watchdog.py
Python
bsd-2-clause
745
""" file: Calculate_Jump-ratio.py author: Michael Entrup b. Epping (michael.entrup@wwu.de) version: 20170306 info: A script that calculates the Jump-Ratio of two images. The second image is devided by the first one. A drift correction is performed. The first image is shiftet t...
m-entrup/EFTEMj
EFTEMj-pyScripts/src/main/resources/scripts/Plugins/EFTEMj/ESI/Calculate_Jump-ratio.py
Python
bsd-2-clause
3,118
class BaseDrone(object): """ Drone interface """ flipflop = False distances = [] last_direction = 0 last_modifier = 0 fuel = 2000 graph = None kb = None algorithm = None def __init__(self, world_size, x, y): # Initialize knowledge base and starting position ...
DMIAlumni/pydrone-game
pydrone/drones/base.py
Python
bsd-2-clause
790
#!/Users/latzko/work/spmcluster/.tox/docs/bin/python2.7 # $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing LaTeX. """ try: import locale ...
tlatzko/spmcluster
.tox/docs/bin/rst2latex.py
Python
bsd-2-clause
828
import sys import heapq import uvint from pathlib import Path from status import Status def main(): path = Path(sys.argv[1]) out = Path(sys.argv[2]) bytes = path.read_bytes() min_length = 4 max_length = 10 compressor = Compressor(bytes, min_length, max_length) with open(out, 'wb') as f: ...
WojciechMula/toys
fpc-compression/compress.py
Python
bsd-2-clause
5,796
import shm import time, os, sys is_ok, code = shm.memnew(shm.IPC_PRIVATE, 4096, shm.IPC_CREATE | 0o777) if not is_ok: print("failed") sys.exit(-1) else: shmid = code pid = os.fork() if pid == 0: shmoper = shm.shmoper() rs = shmoper.at(shmid, shm.IPC_PRIVATE) rs = shmoper.write(b"do you like ...
fdslight/fdslight
pywind/lib/shm/test.py
Python
bsd-2-clause
481
#!/usr/bin/env python3 # # Copyright (c) 2018, Somia Reality Oy # All rights reserved. from base64 import b64decode, urlsafe_b64encode from time import time from jwcrypto.jwk import JWK from jwcrypto.jwt import JWT def create_secure_metadata(key_id, key_secret, expires, metadata): header = { "alg": "dir...
ninchat/ninchat-api
examples/jwt_secure_metadata.py
Python
bsd-2-clause
1,122
from flask import request from flask_restful import abort from flask_login import login_required import sqlparse from funcy import distinct, take from itertools import chain from redash.handlers.base import routes, org_scoped_rule from redash.handlers.query_results import run_query from redash import models from reda...
jmvasquez/redashtest
redash/handlers/queries.py
Python
bsd-2-clause
4,842
if __name__ == '__main__': import os from bs4 import BeautifulSoup def get_class(cls): class_name = cls['name'] _instance_methods = cls.find_all('method', recursive=False, class_method=lambda m: m != 'true') retval = cls.find('retval') if retval: if retval.has_a...
colinta/MotionLookitup
compile.py
Python
bsd-2-clause
4,942
import sysconfig # Category metadata. # Category icon show in the menu ICON = "icons/star2.svg" # Background color for category background in menu # and widget icon background in workflow. BACKGROUND = "light-blue" # Location of widget help files. WIDGET_HELP_PATH = ( # No local documentation (There are problems...
salvacarrion/orange3-recommendation
orangecontrib/recommendation/widgets/__init__.py
Python
bsd-2-clause
2,082
import bleach from pyramid.config import Configurator from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authorization import ACLAuthorizationPolicy from pyramid.session import UnencryptedCookieSessionFactoryConfig from sqlalchemy import engine_from_config from .models import ( DBSession,...
ethan-nelson/osm-tasking-manager2
osmtm/__init__.py
Python
bsd-2-clause
7,927
from .project import * # noqa # Set debug to True for development DEBUG = True TEMPLATE_DEBUG = DEBUG LOGGING_OUTPUT_ENABLED = DEBUG LOGGING_LOG_SQL = DEBUG PIPELINE_ENABLED = False EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # Disable caching while in development CACHES = { 'default': { ...
kartoza/jakarta-flood-maps
django_project/core/settings/dev.py
Python
bsd-2-clause
3,007
from __future__ import division import json import urllib from flask import request from flask import render_template from flask import abort import jinja2 import rigor.config import rigorwebapp.plugin import rigorwebapp.utils from rigorwebapp.utils import debug_detail, debug_main, debug_error import rigorwebapp.aut...
blindsightcorp/rigor-webapp
plugins/percept_search_page/__init__.py
Python
bsd-2-clause
9,018
# coding:utf-8 """ Created by 捡龙眼 3/4/2016 """ from __future__ import absolute_import, unicode_literals, print_function import public.special_exception LOG_THREAD = "log_thread" TIME_THREAD = "time_thread" GLOBAL_THREAD = {} def add_thread(key, thread_object): if key in GLOBAL_THREAD: raise pub...
yanjianlong/server_cluster
public/global_manager.py
Python
bsd-3-clause
1,046
from flask.ext.wtf import Form from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length from app.models import User class LoginForm(Form): openid = StringField('openid', validators=[DataRequired()]) remember_me = BooleanField('remember_me', default=False)...
hei-hilman/microblog
app/forms.py
Python
bsd-3-clause
1,059
# -*- coding: utf-8 -*- # # paulla.ircbot documentation build configuration file, created by # sphinx-quickstart on Wed Jan 29 07:58:36 2014. # # 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....
cyplp/botanik
paulla.ircbot/docs/source/conf.py
Python
bsd-3-clause
10,828
from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoUser from anaf.core.models import Group, Perspective, ModuleSetting from models import Item, ItemValue, ItemField, ItemType, ItemStatus, ItemServicing class InfrastructureModelsTest(TestC...
tovmeod/anaf
anaf/infrastructure/tests.py
Python
bsd-3-clause
22,223
# Copyright (c) 2011-2022 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). import json import requests import os from decimal import Decimal from django.apps import apps from django.conf import settings from django.core.exceptions import Valid...
bmun/huxley
huxley/core/models.py
Python
bsd-3-clause
33,270
from __future__ import absolute_import, unicode_literals from django.http import HttpResponseBadRequest from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from debug_toolbar.panels.sql.forms import SQLSelectForm @csrf_exempt def sql_select(request): """Returns the output of...
ivelum/django-debug-toolbar
debug_toolbar/panels/sql/views.py
Python
bsd-3-clause
3,971
#!/usr/bin/env python """Create a "virtual" Python installation""" import os import sys # If we are running in a new interpreter to create a virtualenv, # we do NOT want paths from our existing location interfering with anything, # So we remove this file's directory from sys.path - most likely to be # the previous in...
NProfileAnalysisComputationalTool/npact
virtualenv.py
Python
bsd-3-clause
100,693
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osgsharedarray" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgViewer # Translated from file 'osgsharedarray.cpp' # OpenSceneGraph exampl...
JaneliaSciComp/osgpyplusplus
examples/rough_translated1/osgsharedarray.py
Python
bsd-3-clause
11,182
from django.test import TestCase from django.test.client import Client from django.urls import reverse from model_mommy import mommy from devicegroups.models import Devicegroup from users.models import Lageruser class DevicegroupTests(TestCase): def setUp(self): self.client = Client() Lageruser....
MPIB/Lagerregal
devicegroups/tests.py
Python
bsd-3-clause
1,721
from django.conf.urls import patterns, url, include from django.utils.translation import ugettext_lazy as _ from . import feed from . import views from . import views_analysis from . import views_data from . import entity_urls from . import contract_urls from . import category_urls urlpatterns = patterns( '', ...
jorgecarleitao/public-contracts
contracts/urls.py
Python
bsd-3-clause
1,749
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['None'] , ['ConstantTrend'] , ['Seasonal_WeekOfYear'] , ['SVR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_None/model_control_one_enabled_None_ConstantTrend_Seasonal_WeekOfYear_SVR.py
Python
bsd-3-clause
161
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('article', '0009_add_stream_fields_for_modular_article_content'), ] operations = [ migrations.AddField( model_nam...
PARINetwork/pari
article/migrations/0010_add_show_modular_content_field.py
Python
bsd-3-clause
445
# -*- coding: utf-8 -*- def main(): startApplication("sasview") clickTab(waitForObject(":FittingWidgetUI.tabFitting_QTabWidget_2"), "Resolution") test.compare(waitForObjectExists(":groupBox_4.cbSmearing_QComboBox").currentIndex, 0) test.compare(str(waitForObjectExists(":groupBox_4.cbSmearing_QComboBox"...
SasView/sasview
src/sas/qtgui/UnitTesting/SquishTestSuites/suite_sasview_qt/tst_Resolution/test.py
Python
bsd-3-clause
3,434
import mdp from mdp import numx as n from bimdp.nodes import SFABiNode, SFA2BiNode from bimdp.parallel import ParallelBiFlow # TODO: maybe test the helper classes as well, e.g. the new callable class TestParallelBiNode(object): def test_stop_message_attribute(self): """Test that the stop_result attribute...
arnaudsj/mdp-toolkit
bimdp/test/test_parallelbiflow.py
Python
bsd-3-clause
3,496
''' ''' __all__ = [ 'AbstractHandler', 'FakeHandler', ] class AbstractHandler(object): ''' Abstract representation for handler able to send internal model representations to an external host. ''' opts = {} def __init__(self, **kwargs): self.opts = kwargs if kwargs else sel...
SanaMobile/sana.mds
src/mds/api/contrib/backends/handlers.py
Python
bsd-3-clause
9,104
""" Top-level functions for python-tidegates. This contains main functions to evaluate the extent of floodinga and damage due to floods. (c) Geosyntec Consultants, 2015. Released under the BSD 3-clause license (see LICENSE file for more info) Written by Paul Hobson (phobson@geosyntec.com) """ import os import sy...
Geosyntec/python-tidegates
tidegates/analysis.py
Python
bsd-3-clause
15,076
from distutils.core import setup setup( name='TinyCloud', version='0.4dev', packages=['tinycloud',], license='BSD', long_description=open('README.md').read(), scripts=['bin/tiny-add-node', 'bin/tiny-add-app', 'bin/tiny-delete-app', 'bin/tiny-draw', 'bin/tiny-get-apps', 'bin/tiny-ge...
ebagdasa/tinycloud
setup.py
Python
bsd-3-clause
861
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("apps", "0001_initial"), ("organizations", "0001_initial"), ) def forward...
us-ignite/us_ignite
us_ignite/hubs/migrations/0001_initial.py
Python
bsd-3-clause
25,457
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import sys, copy, os, pickle, warnings from twisted.trial import unittest, util from twisted.application import service, internet, app from twisted.persisted import sob from twisted.python import log, usage from twisted.python.util impo...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/test/test_application.py
Python
bsd-3-clause
24,190
import flask import pytest import sqlalchemy from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker TEST_DATABASE_URI = 'sqlite://' @pytest.fixture def app(): application = flask.Flask(__name__) return application @pytest.fixture def db_engine(): return sqlalchemy.create_engi...
maruqu/flask-jsonapi
tests/sqlalchemy_repository/conftest.py
Python
bsd-3-clause
862
import mock import suds.transport import suds_requests def test_open(): session = mock.Mock() session.get.return_value.content = 'abc123' transport = suds_requests.RequestsTransport(session) request = suds.transport.Request('http://url') response = transport.open(request) assert response.re...
chrcoe/suds_requests
tests/test_transport.py
Python
bsd-3-clause
1,143
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
WalkingMachine/sara_behaviors
sara_flexbe_behaviors/src/sara_flexbe_behaviors/action_ask_sm.py
Python
bsd-3-clause
3,157
# # # Copyright (c) 2014, 2015, 2016, 2017 Psyop Media Company, LLC # See license.txt # # import unittest import subprocess import os import OpenImageIO as oiio from OpenImageIO import ImageBuf, ImageSpec, ImageBufAlgo def get_all_arnold_tests(): """ Returns the list of arnold integration tests (Only run in Ar...
anderslanglands/alShaders2
tests/tests.py
Python
bsd-3-clause
17,604
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
kizyle502/collegiatemasters
config/settings/local.py
Python
bsd-3-clause
2,176
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
klim-iv/phantomjs-qt5
src/webkit/Tools/Scripts/webkitpy/port/mac_unittest.py
Python
bsd-3-clause
14,515
from datetime import datetime, timedelta import json from django.conf import settings from django.test import RequestFactory import jwt from rest_framework.exceptions import AuthenticationFailed from rest_framework.response import Response from rest_framework_jwt.settings import api_settings from amo.tests import Te...
Witia1/olympia
apps/api/tests/test_jwt_auth.py
Python
bsd-3-clause
8,589
""" Test and flesh a /spaces handler-space. GET /spaces: list all spaces GET /spaces/{space_name}: 204 if exist GET /spaces/{space_name}/members: list all members PUT /spaces/{space_name}: create a space PUT /spaces/{space_name}/members/{member_name}: add a member DELETE /spaces/{space_name}/members/{member_name}: rem...
FND/tiddlyspace
test/test_space_handler.py
Python
bsd-3-clause
16,154
from datetime import datetime, timedelta import numpy as np import pytest from pandas._libs.tslibs import period as libperiod import pandas as pd from pandas import ( DatetimeIndex, Period, PeriodIndex, Series, notna, period_range) from pandas.util import testing as tm class TestGetItem: def test_ellipsis(...
cbertinato/pandas
pandas/tests/indexes/period/test_indexing.py
Python
bsd-3-clause
25,316
from sgfs import SGFS from sgactions.utils import notify, progress, alert def run_create(**kwargs): _run(False, **kwargs) def run_preview(**kwargs): _run(True, **kwargs) def _run(dry_run, entity_type, selected_ids, **kwargs): title='Preview Folders' if dry_run else 'Creating Folders' verb = 'p...
westernx/sgfs
sgfs/actions/create_structure.py
Python
bsd-3-clause
1,165
from django.conf.urls.defaults import * from wishlist.models import Item from wishlist.views import add_item, delete_item, wishlist, bookmarklet urlpatterns = patterns('', (r'^add/$', add_item), (r'^(?P<id>\d+)/delete/$', delete_item), url(r'^tag/(?P<querytag>[^/]+)/$', view=wishlist, name="items_by_tag"),...
pigmonkey/django-wishlist
wishlist/urls.py
Python
bsd-3-clause
443
from __future__ import absolute_import from datetime import timedelta from random import choice from celery.schedules import crontab from twitter import oauth_dance, Twitter, TwitterError, OAuth from ..ext import cache, db from .models import Status from .signals import tweetchi_beat, tweetchi_reply from .utils impo...
klen/tweetchi
base/tweetchi/tweetchi.py
Python
bsd-3-clause
8,042
# Licensed under a 3-clause BSD style license - see LICENSE.rst import sys from fnmatch import fnmatchcase from . import Command, util from .. import console from ..console import log from ..results import iter_results class Rm(Command): @classmethod def setup_arguments(cls, subparsers): parser = sub...
airspeed-velocity/asv
asv/commands/rm.py
Python
bsd-3-clause
3,669
# 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. DEPS = [ 'recipe_engine/step', 'url', ] def RunSteps(api): api.step('step1', ['/bin/echo', api.url.join('foo', 'bar', 'baz')]) api.step('...
eunchong/build
scripts/slave/recipe_modules/url/example.py
Python
bsd-3-clause
743
#-*- coding: utf-8 -*- from django.forms.models import modelform_factory from django.contrib import admin from django.http import HttpResponse from django.utils import simplejson from django.views.decorators.csrf import csrf_exempt from filer import settings as filer_settings from filer.models import Clipboard, Clipboa...
maykinmedia/django-filer
filer/admin/clipboardadmin.py
Python
bsd-3-clause
4,562
""" Host definition for my.example.com """ from .nginx import NginxSite from .web import * # NOQA NginxSite('my.example.com', '/var/www/my.example.com')
radiac/sermin
examples/webhost/my.example.com.py
Python
bsd-3-clause
156
from __future__ import unicode_literals import re from tempfile import NamedTemporaryFile from django.contrib.gis import gdal from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import ( no_oracle, oracle, postgis, spatialite, ) from django.core.management import call_command from dja...
devops2014/djangosite
django/contrib/gis/tests/geoapp/tests.py
Python
bsd-3-clause
41,661
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
yspanchal/storm-example
petrel/petrel/generated/storm/Nimbus.py
Python
bsd-3-clause
98,735
"""The WaveBlocks Project Compute the norms of the homogeneous wavepackets as well as the sum of all norms. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2016 R. Bourquin @license: Modified BSD License """ from WaveBlocksND import BlockFactory from WaveBlocksND import BasisTransformationHAWP...
WaveBlocks/WaveBlocksND
WaveBlocksND/Interface/NormWavepacket.py
Python
bsd-3-clause
4,912
#!/usr/bin/env python2.7 # Copyright 2017, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
rjshade/grpc
tools/run_tests/run_microbenchmark.py
Python
bsd-3-clause
10,997
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. #!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Thu Apr 11 15:07:59 2013 by generateDS.py version 2.9a. # import sys import getopt import re as re_ import stix.bindings.exploit_target as exploit_targe...
benjamin9999/python-stix
stix/bindings/extensions/vulnerability/cvrf_1_1.py
Python
bsd-3-clause
25,422
from datetime import date, datetime from unittest import TestCase from myob.constants import DEFAULT_PAGE_SIZE from myob.credentials import PartnerCredentials from myob.managers import Manager class QueryParamTests(TestCase): def setUp(self): cred = PartnerCredentials( consumer_key='KeyToTheK...
ABASystems/pymyob
tests/test_managers.py
Python
bsd-3-clause
3,511
# -*- coding: utf-8 -*- """ Test the rabbitpy.message.Message class """ import datetime import json import logging import time try: import unittest2 as unittest except ImportError: import unittest import uuid import mock from pamqp import body from pamqp import header from pamqp import specification from ra...
jonahbull/rabbitpy
tests/message_tests.py
Python
bsd-3-clause
19,295
import os.path def writeToFile(element): if not os.path.exists("interestingThreads.txt"): outF = open("interestingThreads.txt", "w") outF.write(string) outF.close() else: outF = open("interestingThreads.txt", "a") outF.write(string) outF.close() de...
LeereNix/2chParser
optional.py
Python
bsd-3-clause
553
""" Tasks for the grades app """ import logging from celery import group from celery.result import GroupResult from django.contrib.auth.models import User from django.core.cache import caches from django.db import IntegrityError from django.db.models import OuterRef, Exists from django_redis import get_redis_connectio...
mitodl/micromasters
grades/tasks.py
Python
bsd-3-clause
7,724
#!/usr/bin/env python # -*- coding: utf-8 -*- import cplotting as cplot S={2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j} cplot.plot({z*0.5 for z in S},4) cplot.show()
RyodoTanaka/Coding_The_Matrix
python/chap_1/1.4.7.py
Python
bsd-3-clause
192
from __future__ import absolute_import, unicode_literals from django import forms from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel from wagtail.wagtailcore.blocks import ( FieldBlock, RichTextBlock, StreamBlock, StructBlock, ) from wagtail.wagtailcore.fields import StreamFiel...
allcaps/wagtail-robot-nao
wagtailrobot/home/models.py
Python
bsd-3-clause
1,051
""" A grab bag of miscellaneous utility functions for TiddlyWeb that don't fit in elsewhere. Web specific utilities are in tiddlyweb.web.util. """ import logging import codecs import os import sys try: from hashlib import sha1 except ImportError: from sha import sha as sha1 class LockError(IOError): ""...
funkyeah/tiddlyweb
tiddlyweb/util.py
Python
bsd-3-clause
6,686
# -*- coding: utf-8 -*- """ Statistical measures of spike trains (e.g., Fano factor) and functions to estimate firing rates. Tutorial -------- :doc:`View tutorial <../tutorials/statistics>` Run tutorial interactively: .. image:: https://mybinder.org/badge.svg :target: https://mybinder.org/v2/gh/NeuralEnsemble/el...
JuliaSprenger/elephant
elephant/statistics.py
Python
bsd-3-clause
44,328
# encoding: utf-8 """ corduroy.config Internal state """ from __future__ import with_statement import os, sys from .atoms import odict, adict, Document # LATER: add some sort of rcfile support... # from inspect import getouterframes, currentframe # _,filename,_,_,_,_ = getouterframes(currentframe())[-1] # print "fro...
samizdatco/corduroy
corduroy/config.py
Python
bsd-3-clause
1,593
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("DummyClassifier" , "digits" , "sqlite")
antoinecarme/sklearn2sql_heroku
tests/classification/digits/ws_digits_DummyClassifier_sqlite_code_gen.py
Python
bsd-3-clause
137
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2009 Edgewall Software # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> # 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...
jun66j5/trac-ja
trac/wiki/interwiki.py
Python
bsd-3-clause
6,799
import json import copy import pdb # constants wordPairFileName = "wordPairs.json" wordChainFileName = "wordLists.json" chainLength = 6 def appendWordsToChain(partialChain, retList, shortList, pairDictionary): lastWord = partialChain[-1] if lastWord not in pairDictionary: # end of the line shortList.append...
brickman1444/hft-wordchain
chain_generator/generateChains.py
Python
bsd-3-clause
2,594
""" Methods for filtering reflection tables for bad data. The filtering methods are combined into functions to perform the relevant filtering on a reflection table(s), to produce a filtered reflection table ready for export or further processing. The set of classes defined in this module have filtering methods implem...
dials/dials
util/filter_reflections.py
Python
bsd-3-clause
38,269
#!/usr/bin/python """ Pygame script to test that the algorithm works. """ import sys import pygame from pygame.locals import * import gjk pygame.init() SCREEN = pygame.display.set_mode((800, 600)) CLOCK = pygame.time.Clock() BLACK = ( 0, 0, 0) WHITE = (255, 255, 255) BLUE = ( 0, 0, 255) GREEN = ( 0, 255...
Wopple/GJK
python/test.py
Python
bsd-3-clause
2,305
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is an Astropy affiliated package. """ # Affiliated packages may add whatever they like to this file, but # should keep this content at the top. # ---------------------------------------------------------------------------- from ._astropy_init im...
fred3m/astro-toyz
astrotoyz/__init__.py
Python
bsd-3-clause
727
import unittest from jcudc24ingesterapi.schemas.metadata_schemas import DataEntryMetadataSchema from jcudc24ingesterapi.schemas.data_types import * class TestSchemas(unittest.TestCase): def test_valid_schemas(self): """Test that the schema creation APIs properly validate the schemas as they are con...
jcu-eresearch/jcu.dc24.ingesterapi
jcudc24ingesterapi/schemas/tests.py
Python
bsd-3-clause
962
from django.conf import settings from django.conf.urls import url, include from django.conf.urls.static import static from django.contrib.sitemaps.views import sitemap from django.contrib.staticfiles.views import serve from django.views.i18n import javascript_catalog from graphene_django.views import GraphQLView from...
car3oon/saleor
saleor/urls.py
Python
bsd-3-clause
2,079
from .simple import SIMPLE_ADJACENCIES from .combo import ComboAdjacency, LearnedComboAdjacency def construct_adjacency(matrix, **kwargs): if isinstance(matrix, (list,)): if kwargs.get('learned_tradeoff', False): return LearnedComboAdjacency(adj_list=matrix, **kwargs) return ComboAdjace...
isaachenrion/jets
src/architectures/nmp/adjacency/__init__.py
Python
bsd-3-clause
399
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # This software is licensed as described in the README.rst and LICENSE # files, which you should have received as part of this distribution. import setuptools # noinspection PyPep8Naming from raspi_pir import __version__ as VERSION DEPS = ['RPi.Sensor>=0.5.3'] CLASSIFIERS ...
ricco386/broadcaster
RPi.PIR/setup.py
Python
bsd-3-clause
1,382
import os import sys import codecs from fnmatch import fnmatchcase from distutils.util import convert_path from setuptools import setup, find_packages def read(fname): return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read() # Provided as an attribute, so you can append to these instead # of repl...
johncosta/django-like-button
setup.py
Python
bsd-3-clause
4,721
from cms.utils.conf import get_cms_setting from django.conf import settings from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.i18n import JavaScriptCatalog from ...
nephila/djangocms-apphook-setup
tests/test_utils/urls.py
Python
bsd-3-clause
842
from .decorators import use_template_database from .testcases import TemplateDBTestCase from .testcases import TemplateDBTransactionTestCase from .testcases import TemplateDBLiveServerTestCase
wilbuick/django-ttdb
ttdb/__init__.py
Python
bsd-3-clause
194
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Teon Brooks <teon.brooks@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) from collections import Counter, OrderedDict im...
rkmaddox/mne-python
mne/io/meas_info.py
Python
bsd-3-clause
97,239
def extractFujoshimoshiBlogspotCom(item): ''' Parser for 'fujoshimoshi.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('L...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractFujoshimoshiBlogspotCom.py
Python
bsd-3-clause
562
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import dynamic_preferences try: from setuptools import setup except ImportError: from distutils.core import setup version = dynamic_preferences.__version__ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') prin...
n3storm/django-dynamic-preferences
setup.py
Python
bsd-3-clause
1,589
from django.db import models from django.contrib.auth.models import Group from gargoyle import gargoyle from eve_api.models import EVEAPIModel from eve_api.app_defines import * class EVEPlayerCorporation(EVEAPIModel): """ Represents a player-controlled corporation. Updated from a mixture of the alliance...
nikdoof/test-auth
app/eve_api/models/corporation.py
Python
bsd-3-clause
3,689
'''Utility methods ''' import logging import os import numpy as np import torch __author__ = 'R Devon Hjelm' __author_email__ = 'erroneus@gmail.com' logger = logging.getLogger('cortex.util') try: _, _columns = os.popen('stty size', 'r').read().split() _columns = int(_columns) except ValueError: _colum...
rdevon/cortex
cortex/_lib/utils.py
Python
bsd-3-clause
2,635
import string import sys from datetime import datetime from enum import Enum from os import urandom from random import randint from linode_api4.errors import UnexpectedResponseError from linode_api4.paginated_list import PaginatedList from linode_api4.objects import (Base, DerivedBase, Property, Instance, Volume, ...
linode/python-linode-api
linode_api4/objects/tag.py
Python
bsd-3-clause
3,873
import numpy as np import pytest from mirdata.datasets import mtg_jamendo_autotagging_moodtheme from tests.test_utils import run_track_tests def test_track(): default_trackid = "track_0000948" data_home = "tests/resources/mir_datasets/mtg_jamendo_autotagging_moodtheme" dataset = mtg_jamendo_autotagging_m...
mir-dataset-loaders/mirdata
tests/datasets/test_mtg_jamendo_autotagging_moodtheme.py
Python
bsd-3-clause
3,299
# -*- coding: 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 field 'Event.source_id' db.add_column('events_event', 'source_id', self.gf('d...
mozilla/make.mozilla.org
make_mozilla/events/migrations/0003_auto__add_field_event_source_id__add_field_event_organiser_email.py
Python
bsd-3-clause
2,336
from django.test import TestCase from rapidsms_httprouter_src.rapidsms_httprouter.management.commands.send_messages import Command from rapidsms_httprouter_src.rapidsms_httprouter.models import MessageBatch, Message from rapidsms.models import Backend, Connection class SendMessagesCommandTestCase(TestCase): def ...
unicefuganda/edtrac
edtrac_project/rapidsms_httprouter_src/rapidsms_httprouter/tests/test_send_messages.py
Python
bsd-3-clause
2,204
r""" Three.js Enums These correspond to the enum property names in the THREE js object """ # Custom Blending Equation Constants # http://threejs.org/docs/index.html#Reference/Constants/CustomBlendingEquation Equations = [ 'AddEquation', 'SubtractEquation', 'ReverseSubtractEquation', 'MinEquation', ...
jasongrout/pythreejs
pythreejs/enums.py
Python
bsd-3-clause
2,549
import models from django.contrib import admin class ThumbnailInline(admin.StackedInline): model = models.Thumbnail fk_name = 'video' extra = 0 class VideoAdmin(admin.ModelAdmin): readonly_fields = ('video_id', 'youtube_url', 'swf_url',) inlines = [ThumbnailInline] list_filter = ('title', 'u...
laplacesdemon/django-youtube
django_youtube/admin.py
Python
bsd-3-clause
684
from chain import * from matrix_chain_element import *
AversivePlusPlus/AversivePlusPlus
tools/ik/src/kinematics/__init__.py
Python
bsd-3-clause
55
from . import base class Kinesis(base.BaseStream): """Resource which consumes ``Kinesis``streams.""" grn_type = 'kinesis-stream'
jorgebastida/gordon
gordon/resources/kinesis.py
Python
bsd-3-clause
139
# encoding: utf-8 import json import pytest from pytest_factoryboy import LazyFixture, register from . import factories @pytest.fixture def elements(fixture): return json.loads(fixture('simple_form.json'))['form']['elements'] register(factories.FormDataFactory, 'form', elements=LazyFixture('elements')) regist...
transcode-de/hopper
tests/form_data_tests/conftest.py
Python
bsd-3-clause
396