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
""" Computes the observed order of convergence for the velocity components and the pressure using the solution on 4 consistently refined grids. """ import os import numpy import h5py import pprint def read_fields_from_hdf5(filepath, gridpath, names=[]): fields = {} f = h5py.File(filepath, 'r') fg = h5py.File(g...
mesnardo/PetIBM
examples/navierstokes/convergence/liddrivencavity2dRe100_20/scripts/getOrderConvergence.py
Python
bsd-3-clause
3,069
# Generated by Django 2.2.6 on 2020-03-02 00:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('logs', '0003_logentry_username'), ] operations = [ migrations.AlterField( model_name='logentry', name='timestamp', ...
bmun/huxley
huxley/logging/migrations/0004_auto_20200302_0046.py
Python
bsd-3-clause
425
#!/usr/bin/python #-*- coding: UTF-8 -*- # __init__.py: Defines the module for musictheory. # # Copyright (c) 2008-2020 Peter Murphy <peterkmurphy@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condition...
peterkmurphy/musictheory
musictheory/__init__.py
Python
bsd-3-clause
1,864
from .version import version as __version__ # noqa from .sda_file import SDAFile
enthought/sandia-data-archive
sdafile/__init__.py
Python
bsd-3-clause
84
import random import uuid from datetime import date, timedelta from django.test import TestCase from corehq.apps.accounting.models import ( BillingAccount, DefaultProductPlan, SoftwarePlanEdition, Subscription, SubscriptionAdjustmentMethod, ) from corehq.apps.accounting.utils.subscription import e...
dimagi/commcare-hq
corehq/apps/accounting/tests/test_migrations.py
Python
bsd-3-clause
5,282
# flake8: noqa """ namespace for quantecon.tests @author : Spencer Lyon @date : 2014-08-01 13:13:59 """ from . util import capture, get_data_dir, max_abs_diff
QuantEcon/QuantEcon.py
quantecon/tests/__init__.py
Python
bsd-3-clause
161
"""Unit tests for socket timeout feature.""" import functools import unittest from test import support from test.support import socket_helper # This requires the 'network' resource as given on the regrtest command line. skip_expected = not support.is_resource_enabled('network') import time import errno import socket...
brython-dev/brython
www/src/Lib/test/test_timeout.py
Python
bsd-3-clause
11,369
from typing import List, Any, Mapping, Tuple, SupportsIndex import numpy as np import numpy.typing as npt def mode_func( ar: npt.NDArray[np.number[Any]], width: Tuple[int, int], iaxis: SupportsIndex, kwargs: Mapping[str, Any], ) -> None: ... AR_i8: npt.NDArray[np.int64] AR_f8: npt.NDArray[np.float64]...
simongibbons/numpy
numpy/typing/tests/data/reveal/arraypad.py
Python
bsd-3-clause
728
# -*- coding: utf-8 -*- import functools import hashlib import json import os import shutil import unittest import uuid import zipfile from datetime import datetime, timedelta from django.conf import settings from django.core import mail from django.core.files.storage import default_storage as storage from django.db.m...
Joergen/zamboni
mkt/webapps/tests/test_models.py
Python
bsd-3-clause
66,033
from __future__ import unicode_literals from django.db import models from django.db.models.signals import post_save from django.utils.translation import ugettext_lazy as _ class TableMap(models.Model): """ Combines local tables with google fusion tables via fusiontable table id and local name created fro...
kula1922/kfusiontables
kfusiontables/models.py
Python
bsd-3-clause
2,610
""" WSGI config for DjangoChannel 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
ivermac/DjangoChannel
Config/wsgi.py
Python
bsd-3-clause
396
from django.conf.urls.defaults import * from django.views.generic.simple import redirect_to from django.views.generic.simple import direct_to_template from django.contrib.auth import views as auth_views #from registration.views import activate from profiles.views import userprofile_show from profiles.views import se...
spreeker/democracygame
democracy/profiles/urls.py
Python
bsd-3-clause
2,960
"""Tests for cement.core.setup.""" import os import sys import json import signal from time import sleep from cement.core import foundation, exc, backend, config, extension, plugin from cement.core.handler import CementBaseHandler from cement.core.controller import CementBaseController, expose from cement.core import ...
akhilman/cement
tests/core/foundation_tests.py
Python
bsd-3-clause
16,592
#!/usr/bin/env python # # BSD 3-Clause License # # Copyright (c) 2016-21, University of Liverpool # 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 t...
rigdenlab/conkit
conkit/command_line/conkit_precision.py
Python
bsd-3-clause
4,257
import json from functools import wraps from pkg_resources import resource_stream from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks from twisted.internet.protocol import Protocol, Factory from twisted.trial.unittest import TestCase from vumi.tests.helpers import VumiTestCase from ...
praekelt/vumi-wikipedia
vumi_wikipedia/tests/test_wikipedia_api.py
Python
bsd-3-clause
11,063
# proxy module from __future__ import absolute_import from chaco.abstract_controller import *
enthought/etsproxy
enthought/chaco/abstract_controller.py
Python
bsd-3-clause
94
# $ANTLR 3.1 ./Java.g 2013-07-16 16:21:24 import sys from antlr3 import * from antlr3.compat import set, frozenset # for convenience in actions HIDDEN = BaseRecognizer.HIDDEN # token types T__159=159 T__158=158 T__160=160 LEFT_SHIFT_ASSIGN=65 T__167=167 T__168=168 EOF=-1 T__165=165 T__166=166 T__163=163 T__164=164 ...
leriomaggio/code-coherence-evaluation-tool
code_comments_coherence/source_code_analysis/code_analysis/JavaLexer.py
Python
bsd-3-clause
118,769
# coding: utf-8 from dj_diabetes.models import HatModel class Foods(HatModel): """ Foods """ class Meta: verbose_name = 'Foods' verbose_name_plural = 'Foods' def __str__(self): return "%s" % self.title
foxmask/dj-diabetes
dj_diabetes/models/foods.py
Python
bsd-3-clause
254
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from setuptools import setup, find_packages, Command readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') def read_reqs(name): with open(os.path.join(os.path.dirname(__file__), name)) as f: ...
TriOptima/tri.declarative
setup.py
Python
bsd-3-clause
3,007
from __future__ import print_function from sympy import symbols from galgebra.deprecated import MV from galgebra.printer import enhance_print,Get_Program,Print_Function def MV_setup_options(): Print_Function() (e1,e2,e3) = MV.setup('e_1 e_2 e_3','[1,1,1]') v = MV('v', 'vector') print(v) (e1,e2,e3...
arsenovic/galgebra
examples/Old Format/mv_setup_options.py
Python
bsd-3-clause
775
from djangosanetesting.cases import UnitTestCase from djangosanetesting.cases import DatabaseTestCase from mock import Mock from unit_project.tests.helpers import ( MockJob, MockBuildComputer, MockProject, EchoJob, MultipleEchoJob, register_mock_jobs_and_commands, ) import os, os.path from datetime import ...
centrumholdings/cthulhubot
tests/unit_project/tests/test_assignment.py
Python
bsd-3-clause
14,108
import re import os, os.path import numpy #A / E(B-v) avebv= {} avebvsf= {} def _read_extCurves(): """Read the extinction curves files in extCurves""" extFile= open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'extCurves','extinction.tbl'),'r') global avebv ...
jobovy/mwdust
mwdust/util/extCurves.py
Python
bsd-3-clause
2,028
# -*- coding: utf-8 -*- import numpy as np import sklearn from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier, RandomForestRegressor, ExtraTreesRegressor from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, _tree from distutils.version import LooseVersion if LooseVersion(sklear...
andosa/treeinterpreter
treeinterpreter/treeinterpreter.py
Python
bsd-3-clause
8,824
""" Abstract machine class to handle all of the interactions with a virtual or physical machine. (c) 2015 Massachusetts Institute of Technology """ # Native import os import shutil import socket import logging import time import multiprocessing logger = logging.getLogger(__name__) # LO-PHI from lophi.sens...
mit-ll/LO-PHI
python-lophi/lophi/machine/__init__.py
Python
bsd-3-clause
18,193
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from configurations import values # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings...
garry-cairns/correspondence
api/correspondence/config/production.py
Python
bsd-3-clause
2,091
from django.utils.translation import ugettext_lazy as _ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import models PROPERTY_LABELS = ( ('home', _('home')), ('work', _('work')), ('other', _('other')), ) IM_SERVICES = ( ...
Saviq/django-addressbook
addressbook/models.py
Python
bsd-3-clause
8,986
from django.views.generic.list import ListView from pari.article.common import get_result_types from .models import get_search_results class SearchList(ListView): context_object_name = "results" template_name = 'search/search_list.html' def get_queryset(self): query = self.request.GET.get("quer...
RuralIndia/pari
pari/search/views.py
Python
bsd-3-clause
808
''' Created on Apr 25, 2014 @author: sstober ''' import os; import sys; import logging; log = logging.getLogger(__name__); from deepthought.experiments.ismir2014.util import load_config; from deepthought.util.config_util import merge_params; from deepthought.experiments.ismir2014.train_convnet import train_convnet ...
sstober/deepthought
deepthought/experiments/ismir2014/hyper_search_cnn.py
Python
bsd-3-clause
2,756
"""Utility functions""" from datetime import datetime from uuid import uuid4 import pytz def create_message_structure(content, sender, message_type): """ Creates a message dictionary Args: content (str): a string representing a message sender (str): a string representing the sender ...
giocalitri/calichat
calichat/utils.py
Python
bsd-3-clause
2,241
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.test import TestCase from example.models import Customer class UserManagerTest(TestCase): user_email = 'user@example.com' user_password = 'pa$sw0Rd' def test_create_user(self): user = get_us...
mishbahr/django-users2
tests/test_managers.py
Python
bsd-3-clause
1,983
# -*- 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): def forwards(self, orm): # Deleting field 'TaskHistory.db_id' db.delete_column(u'notification_task...
globocom/database-as-a-service
dbaas/notification/migrations/0007_auto__del_field_taskhistory_db_id.py
Python
bsd-3-clause
2,089
# -*- coding: UTF-8 -*- from django.http import HttpResponse, HttpResponseRedirect from datetime import datetime, date from apps.seguridad.decorators import login_required, credential_required from apps.seguridad.models import Usuario, Perfil from apps.registro.models.Establecimiento import Establecimiento import csv ...
MERegistro/meregistro
meregistro/apps/reportes/views/establecimiento.py
Python
bsd-3-clause
1,400
from nose.tools import assert_true, assert_false, assert_equals from pygow import validation, maybe def multBy(x): def k(y): return x * y return k def divBy(x): def k(y): if (x == 0): return validation.Invalid(['doh']) else: return validation.Valid(y / x) ...
udacity/pygow
tests/test_validation.py
Python
bsd-3-clause
3,827
import os import production_settings BASEDIR = os.path.abspath(os.path.dirname(__file__)) class Config: DEBUG = False TESTING = False SECRET_KEY = 'im!mx2m(69)b^7n3j!yi)k!a7n(^09=^&*+pnan78hl^%_yp4u' CSRF = True CSRF_SECRET = 'im!mx2m(69)b^7n3j!yi)k!a7n(^09=^&*+pnan78hl^%_yp4u' JSONIFY_PRE...
saklar13/Meowth
config.py
Python
bsd-3-clause
3,882
SIZEOF_DOUBLE = 8 ONE_MIB = 1048576 NC = 4080 MY_NC = 2040 LC = 256 MY_KC = 252 KC = 256 MC = 72 MR = 6 NR = 8 def panel_matrix_entries(dim, other_dim, panel_dim): n_panels = dim // panel_dim if n_panels * panel_dim < dim: n_panels += 1 return (n_panels + 1) * panel_dim * other_dim def memory_m...
krzysz00/momms
results/memory_usage.py
Python
bsd-3-clause
1,355
"""Creates the guests table Revision ID: 38dbe9301b4c Revises: 6451c45cc96d Create Date: 2016-04-21 09:38:28.846577 """ # revision identifiers, used by Alembic. revision = '38dbe9301b4c' down_revision = '6451c45cc96d' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by...
Rdbaker/WPI-IFC
migrations/versions/38dbe9301b4c_.py
Python
bsd-3-clause
1,001
from optparse import make_option from django.core.management.base import LabelCommand class Command(LabelCommand): help = "Generate Sphinx documentation skeleton for given models." option_list = LabelCommand.option_list + ( make_option('--locale', '-l', default=None, dest='locale', ...
bmihelac/django-simpleadmindoc
simpleadmindoc/management/commands/docgenmodel.py
Python
bsd-3-clause
849
from unittest import mock from bfg9000.builtins.install import installify from bfg9000.path import Root from .. import * class MockInstallOutputs: class Mapping: def __init__(self, env=None, bad=set()): self.env = env self.bad = bad def __getitem__(self, key): ...
jimporter/bfg9000
test/unit/tools/__init__.py
Python
bsd-3-clause
882
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'regsvr32', 'Author': ['@subTee', '@enigma0x3'], 'Description': ('Generates an sct file (COM Scriptlet) Host this anywhere'), 'Comments': [ ...
pierce403/EmpirePanel
lib/stagers/launcher_sct.py
Python
bsd-3-clause
4,194
# # ------------------------------------------------------------ # Copyright (c) All rights reserved # SiLab, Institute of Physics, University of Bonn # ------------------------------------------------------------ # import logging from basil.TL.TransferLayer import TransferLayer from sensirion_shdlc_driver import Sh...
SiLab-Bonn/basil
basil/TL/SensirionSensorBridge.py
Python
bsd-3-clause
2,893
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Repackage expected/actual GM results as needed by our HTML rebaseline viewer. """ # System-level imports import argparse import fnmatch import json import logging import...
zhongzw/skia-sdl
gm/rebaseline_server/results.py
Python
bsd-3-clause
21,859
import csv import xlrd def xlstocsv(infile, outfile, ws=0): book = xlrd.open_workbook(infile) outcsv = csv.writer(open(outfile, 'w'), delimiter='\t') sheet = book.sheet_by_index(ws) numrows = sheet.nrows numcols = sheet.ncols for ry in range(numrows): temprow = list() for rx in ...
mubdi/MubdiScripts
mubdiscripts/xlstocsv.py
Python
bsd-3-clause
440
import pytest from pytest_bdd import scenarios, given, when, then from scenarios_run import * scenarios('../feature/config', example_converters=dict(command = str, environment = Environment, pattern = PatternType)) @given('the <environment> is configured for <command> command in the configuration') def add_environme...
bverhagen/exec-helper
test/integration/src/test_config.py
Python
bsd-3-clause
1,444
""" A *lock* defines access to a particular subsystem or property of Evennia. For example, the "owner" property can be impmemented as a lock. Or the disability to lift an object or to ban users. A lock consists of three parts: - access_type - this defines what kind of access this lock regulates. This just a stri...
feend78/evennia
evennia/locks/lockhandler.py
Python
bsd-3-clause
20,594
import backslash # py.test style tests here
yotamr/backslash-python
tests/test_backslash.py
Python
bsd-3-clause
44
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Entry point for both build and try bots This script is invoked from XXX, usually without arguments to package an SDK. It automa...
leighpauls/k2cro4
native_client_sdk/src/build_tools/build_sdk.py
Python
bsd-3-clause
31,480
# $Id$ # # Copyright (C) 2007,2008 Greg Landrum # # @@ All Rights Reserved @@ # import os import sys import unittest from rdkit import RDConfig #import pickle from rdkit.six.moves import cPickle as pickle from rdkit import DataStructs as ds class TestCase(unittest.TestCase): def setUp(self) : pass def test1...
AlexanderSavelyev/rdkit
Code/DataStructs/Wrap/testDiscreteValueVect.py
Python
bsd-3-clause
7,665
#!/usr/bin/env python # (C) 2001 by Argonne National Laboratory. # See COPYRIGHT in top-level directory. # # Note that I repeat code for each test just in case I want to # run one separately. I can simply copy it out of here and run it. # A single test can typically be chgd simply by altering its value(s) # f...
gnu3ra/SCC15HPCRepast
INSTALLATION/mpich2-1.4.1p1/src/pm/mpd/test/test5.py
Python
bsd-3-clause
3,936
import tests.missing_data.test_missing_data_air_passengers_generic as gen gen.test_air_passengers_missing_data('DiscardRow', None)
antoinecarme/pyaf
tests/missing_data/test_missing_data_air_passengers_DiscardRow_None.py
Python
bsd-3-clause
132
""" Paired density and scatterplot matrix ===================================== _thumb: .5, .5 """ import seaborn as sns sns.set(style="white") df = sns.load_dataset("iris") g = sns.PairGrid(df, diag_sharey=False) g.map_upper(sns.scatterplot) g.map_lower(sns.kdeplot, colors="C0") g.map_diag(sns.kdeplot, lw=2)
anntzer/seaborn
examples/pair_grid_with_kde.py
Python
bsd-3-clause
314
from __future__ import division, print_function, absolute_import import numpy as np import itertools as itr import amitgroup as ag from scipy.special import logit from scipy.misc import logsumexp from sklearn.base import BaseEstimator import time class PermutationMM(BaseEstimator): """ A Bernoulli mixture mode...
jiajunshen/partsNet
pnet/permutation_mm.py
Python
bsd-3-clause
9,041
# Authors: Phani Vadrevu <pvadrevu@uga.edu> # Roberto Perdisci <perdisci@cs.uga.edu> import sys from datetime import timedelta, date import time import simplejson import logging import logging.config from config import * import vt_api import util LOG_CONF_FILE = "logging.conf" class VTSubmissions: de...
phani-vadrevu/amico
amico_scripts/vt_submit.py
Python
bsd-3-clause
10,726
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
nephila/djangocms-markitup
docs/conf.py
Python
bsd-3-clause
8,236
import os import re import requests from urllib.parse import urljoin from rdflib import Graph, RDF, URIRef, Literal, plugin from rdflib.store import Store from rdflib.parser import StringInputSource from os.path import join as pjoin from .protect import cstring test_dois = ('10.1016/0097-3165(79)90023-2', ...
douglas-larocca/articles
articles/articles.py
Python
bsd-3-clause
2,932
# Copyright (c) 2009-2010, Steve 'Ashcrow' Milner # 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...
enderlabs/django-error-capture-middleware
src/error_capture_middleware/admin.py
Python
bsd-3-clause
1,957
"""On 'the N word'. --- layout: post source: Louis CK source_url: https://youtu.be/dF1NUposXVQ?t=30s title: the 'n-word' date: 2014-06-10 12:31:19 categories: writing --- Take responsibility with the shitty words you wanna say. """ from proselint.tools import existence_check, memoize @memoize de...
amperser/proselint
proselint/checks/cursing/nword.py
Python
bsd-3-clause
549
""" Experiments of the paper 'The Approximation of the Dissimilarity Projection' accepted at PRNI2012. Quantification of the dissimilarity approximation of tractography data across different prototype selection policies and number of prototypes. Copyright (c) 2012, Emanuele Olivetti Distributed under the New BSD lic...
emanuele/prni2012_dissimilarity
dissimilarity_streamlines.py
Python
bsd-3-clause
1,471
# -*- coding: utf-8 -*- import os import csv import numpy as np import dirfiles from confparser import load_config import expyriment from expyriment import design, control, stimuli, io, misc def launch_protocol(protocol_ini, exp, gender, vs): # %% # ======================== LOAD CONFIG.INI FILE ===========...
hbp-brain-charting/public_protocols
self/protocol/protocol.py
Python
bsd-3-clause
14,601
from settings import * # flake8: noqa def create_db(): from django.db import connection connection.creation.create_test_db(autoclobber=True) create_db() from tests.models import * # flake8: noqa from tests.factories import * # flake8: noqa for i in range(100): ExampleModelFactory.create()
kevinastone/django-cursor-pagination
tests/playground.py
Python
bsd-3-clause
305
""" The module is used by the Twisted plugin system (twisted.plugins.slyd_plugin) to register twistd command to manage slyd server. The command can be used with 'twistd slyd'. """ from os import listdir from os.path import join, dirname, isfile from twisted.python import usage from twisted.web.resource import Resource ...
nju520/portia
slyd/slyd/tap.py
Python
bsd-3-clause
3,029
""" A module interface to shapelet functions """ __version__ = '0.2' #this needs to be kept up to date with setup.py import decomp, fileio, img, measure, shapelet
griffinfoster/shapelets
shapelets/__init__.py
Python
bsd-3-clause
166
""" This plugin captures stdout during test execution, appending any output captured to the error or failure output, should the test fail or raise an error. It is enabled by default but may be disable with the options -s or --nocapture. """ import logging import os import sys from nose.plugins.base import Plugin from n...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/plugins/capture.py
Python
bsd-3-clause
2,780
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines the `Quantity` object, which represents a number with some associated units. `Quantity` objects support operations like ordinary numbers, but will deal with unit conversions internally. """ # Standard libra...
bsipocz/astropy
astropy/units/quantity.py
Python
bsd-3-clause
70,750
import subprocess import pytest from ..helpers import BaseWFC3 class TestIR10Single(BaseWFC3): """Tests for WFC3/IR.""" detector = 'ir' def _single_raw_calib(self, rootname): raw_file = '{}_raw.fits'.format(rootname) # Prepare input file. self.get_input_file(raw_file) #...
jhunkeler/hstcal
tests/wfc3/test_ir_10single.py
Python
bsd-3-clause
861
# 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): # Deleting field 'UniApplicationEntry.reason' db.delete_column('uniapply_uniapplicationentry', ...
team-xue/xue
xue/uniapply/migrations/0003_use_material.py
Python
bsd-3-clause
8,698
# -*- coding: utf-8 -*- __author__ = 'Christopher D\'Cunha' __email__ = 'me@christopherdcunha.com' __version__ = '0.1.0' from .signals import * __all__ = [ 'pre_get_detail', 'pre_put_detail', 'pre_post_detail', 'pre_delete_detail', 'pre_get_list', 'pre_put_list', 'pre_post_list', 'pre_delete_list', 'post...
christopherdcunha/tastypie_signals
tastypie_signals/__init__.py
Python
bsd-3-clause
476
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-01-10 16:38 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [("repository", "0001_initial"), ("build", "0001_in...
SalesforceFoundation/mrbelvedereci
metaci/testresults/migrations/0001_initial.py
Python
bsd-3-clause
26,271
"""Mapping of GDAL to Numpy data types. Since 0.13 we are not importing numpy here and data types are strings. Happily strings can be used throughout Numpy and so existing code will not break. Within Rasterio, to test data types, we use Numpy's dtype() factory to do something like this: if np.dtype(destination.d...
brendan-ward/rasterio
rasterio/dtypes.py
Python
bsd-3-clause
4,498
""" PRE-PROCESSORS ============================================================================= Preprocessors work on source text before we start doing anything too complicated. """ from __future__ import absolute_import from __future__ import unicode_literals from . import util from . import odict import re def b...
Situphen/Python-ZMarkdown
markdown/preprocessors.py
Python
bsd-3-clause
13,793
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-05-23 13:25 from __future__ import unicode_literals import bluebottle.utils.utils from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields import django_extensions.db.fields....
jfterpstra/bluebottle
bluebottle/payments/migrations/0001_initial.py
Python
bsd-3-clause
5,943
from __future__ import unicode_literals import json from decimal import Decimal from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.core.cache import caches from dynamic_preferences.registries import ( global_preferences_registry as ...
haroon-sheikh/django-dynamic-preferences
tests/test_rest_framework.py
Python
bsd-3-clause
9,073
import graphene import pytest from saleor.extensions import ConfigurationTypeField from saleor.extensions.manager import get_extensions_manager from saleor.extensions.models import PluginConfiguration from tests.api.utils import get_graphql_content from tests.extensions.sample_plugins import PluginSample from tests.ex...
maferelo/saleor
tests/api/test_extensions.py
Python
bsd-3-clause
12,488
"""Tools for easy persistance of configuration and user preferences for tools. Configurations are split into sections and keys; sections are conceptually for each tool (or other grouping of settings), and keys are for individual settings within that tool/section. In the current implementation, individual sections are ...
mikeboers/metatools
metatools/config.py
Python
bsd-3-clause
3,791
#!/usr/bin/env python """ runtests.py [OPTIONS] [-- ARGS] Run tests, building the project first. Examples:: $ python runtests.py $ python runtests.py -s {SAMPLE_SUBMODULE} $ python runtests.py -t {SAMPLE_TEST} $ python runtests.py --ipython $ python runtests.py --python somescript.py $ python...
MSeifert04/numpy
runtests.py
Python
bsd-3-clause
18,292
''' Renderers for various kinds of annotations that can be added to Bokeh plots ''' from __future__ import absolute_import from six import string_types from ..core.enums import (AngleUnits, Dimension, FontStyle, LegendClickPolicy, LegendLocation, Orientation, RenderMode, SpatialUnits, TextA...
philippjfr/bokeh
bokeh/models/annotations.py
Python
bsd-3-clause
33,790
__all__ = [ 'OAG_RootNode', 'OAG_RootD', 'OAG_RpcDiscoverable' ] import attrdict import datetime import hashlib import inflection import inspect import os import signal import socket import sys from ._db import * from ._env import * from ._rdf import * from ._rpc import reqcls, RpcTransaction, RpcPro...
kchoudhu/openarc
openarc/_graph.py
Python
bsd-3-clause
18,675
from django.contrib import admin from django.db.models import Sum from sorl.thumbnail.admin import AdminImageMixin from .admin_views import download_donor_report from .models import DjangoHero, Donation, InKindDonor, Payment, Testimonial class DonatedFilter(admin.DateFieldListFilter): def __init__(self, *args, *...
nanuxbe/django
fundraising/admin.py
Python
bsd-3-clause
2,556
import logging import plugins.metric.metric as metric class ReadmeMetric(metric.Metric): """ Locate a README file Looks in the root of the repository, for files named: 'README', 'README.txt', 'README.md', 'README.html' Scores: 0 if no README found 100 if README file with non-zero length conten...
softwaresaved/software-assessment-framework
plugins/metric/readme.py
Python
bsd-3-clause
1,737
# $Id: udp.py 23 2006-11-08 15:45:33Z dugsong $ """User Datagram Protocol.""" import dpkt import dns UDP_PORT_MAX = 65535 class UDP(dpkt.Packet): __hdr__ = ( ('sport', 'H', 0xdead), ('dport', 'H', 0), ('ulen', 'H', 8), ('sum', 'H', 0) ) def unpack(self, buf): ...
insomniacslk/dpkt
dpkt/udp.py
Python
bsd-3-clause
473
import os from matplotlib import pyplot as plt import numpy as np import matplotlib.gridspec as gridspec import class_objects as co import cv2 import action_recognition_alg as ara from textwrap import wrap def extract_valid_action_utterance(action, testing=False, *args, **kwargs): ''' Visualizes action ...
VasLem/KinectPainting
construct_actions_table.py
Python
bsd-3-clause
8,161
from .assign import Assign from .variables import * Declare = "cx_double %(name)s ;" Imag = "cx_double(0, %(value)s)"
jonathf/matlab2cpp
src/matlab2cpp/rules/_cx_double.py
Python
bsd-3-clause
119
from django.db import models # Create your models here. class FileUpload(models.Model): title = models.CharField(max_length=128) file = models.FileField(upload_to='uploads') created = models.DateTimeField(auto_now_add=True) edited = models.DateTimeField(auto_now=True) def __unicode__(self): return self....
brendan1mcmanus/whartonfintech-v3
file_upload/models.py
Python
bsd-3-clause
326
from django.contrib import admin from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from .models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): actions = ['activate_users', 'resend_activat...
husarion/django-registration
registration/admin.py
Python
bsd-3-clause
1,611
import tensorflow as tf from global_module.settings_module import set_params, set_dir class DeepAttentionClassifier: def __init__(self, params, dir_obj): self.params = params self.dir_obj = dir_obj self.call_pipeline() def call_pipeline(self): self.create_network_pipeline() ...
krayush07/deep-attention-text-classifier-tf
global_module/implementation_module/model.py
Python
bsd-3-clause
11,389
''' Copyright (c) 2011, Joseph LaFata 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...
OldhamMade/unitbench
tests/test_unitbench.py
Python
bsd-3-clause
7,579
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('login', '0011_auto_20160526_0738'), ] operations = [ migrations.AlterField( model_name='userprofile', ...
BuildmLearn/University-Campus-Portal-UCP
UCP/login/migrations/0012_auto_20160529_0607.py
Python
bsd-3-clause
492
# Copyright 2019 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 calendar import datetime import logging import multiprocessing from multiprocessing.dummy import Pool as ThreadPool TELEMETRY_TEST_PATH_FORMAT = 'te...
endlessm/chromium-browser
tools/perf/core/results_processor/util.py
Python
bsd-3-clause
2,989
import json from django import forms from django.test.utils import override_settings from django_webtest import WebTest from . import build_test_urls class FileInputForm(forms.Form): test_field = forms.FileField() data_field = forms.BooleanField(required=False, widget=forms.HiddenInput, ...
2947721120/django-material
tests/test_widget_fileinput.py
Python
bsd-3-clause
4,140
import os from setuptools import setup, find_packages CURRENT_DIR = os.path.dirname(__file__) def read(fname): return open(os.path.join(CURRENT_DIR, fname)).read() # Info for setup PACKAGE = 'reddit_view' NAME = 'reddit_view' DESCRIPTION = 'a reddit image collector' AUTHOR = 'Jorge Perez' AUTHOR_EMAIL = 'japrogra...
japrogramer/reddit_view
setup.py
Python
bsd-3-clause
1,317
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
matthiaskramm/corepy
corepy/arch/ppc/lib/iterators.py
Python
bsd-3-clause
27,693
from django.apps import AppConfig class UserPanelConfig(AppConfig): name = 'djdt_user_panel'
rosco77/djdt_user_panel
djdt_user_panel/apps.py
Python
bsd-3-clause
99
from __future__ import annotations import os from xia2.Driver.DriverFactory import DriverFactory def ImportXDS(DriverType=None): """A factory for ImportXDSWrapper classes.""" DriverInstance = DriverFactory.Driver(DriverType) class ImportXDSWrapper(DriverInstance.__class__): def __init__(self):...
xia2/xia2
src/xia2/Wrappers/Dials/ImportXDS.py
Python
bsd-3-clause
3,161
"""SCons.Tool.zip Tool-specific initialization for zip. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of...
datalogics/scons
src/engine/SCons/Tool/zip.py
Python
mit
3,093
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-31 10:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TestMod...
dahfool/navigator
core/migrations/0001_initial.py
Python
mit
1,001
#!/usr/bin/env python import sys import json import time from controller.framework.ControllerModule import ControllerModule import controller.framework.fxlib as fxlib import sleekxmpp from collections import defaultdict from sleekxmpp.xmlstream.stanzabase import ElementBase, ET, JID from sleekxmpp.xmlstream import regi...
ipop-project/controllers
controller/modules/XmppClient.py
Python
mit
16,248
# -*- coding: utf-8 -*- """ Sewage source heat exchanger """ import pandas as pd import numpy as np import scipy from cea.constants import HEX_WIDTH_M,VEL_FLOW_MPERS, HEAT_CAPACITY_OF_WATER_JPERKGK, H0_KWPERM2K, MIN_FLOW_LPERS, T_MIN, AT_MIN_K, P_SEWAGEWATER_KGPERM3, P_WATER_KGPERM3 import cea.config import cea.inpu...
architecture-building-systems/CEAforArcGIS
cea/resources/sewage_heat_exchanger.py
Python
mit
7,301
""" Testing reload. """ from __future__ import division from __future__ import unicode_literals __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import os import shutil import logging import unittest import tempfile import deepchem as dc import numpy as np lo...
ktaneishi/deepchem
deepchem/data/tests/test_reload.py
Python
mit
4,125
# (c) 2016, Hao Feng <whisperaven@gmail.com> import logging from .jobs import Job from ._async import AsyncRunner from .context import Context from exe.executor.utils import * from exe.utils.err import excinst from exe.exc import ExecutorPrepareError, ExecutorNoMatchError LOG = logging.getLogger(__name__) class ...
whisperaven/0ops.exed
exe/runner/service.py
Python
mit
2,674
# udis86 - scripts/ud_itab.py # # Copyright (c) 2009, 2013 Vivek Thampi # 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...
lvous/hadesmem
src/udis86/udis86/scripts/ud_itab.py
Python
mit
16,682
# -*- coding: utf-8 -*- from cobradb.models import * from cobradb.util import * from cobradb.util import _find_data_source_url import pytest def test_increment_id(): assert increment_id('ACALD_1') == 'ACALD_2' assert increment_id('ACALD_1a') == 'ACALD_1a_1' assert increment_id('ACALD') == 'ACALD_1' ...
SBRG/ome
cobradb/tests/test_util.py
Python
mit
3,409