code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
'''author@esilgard''' # # Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center # # Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 # from OneFieldPerReport import OneFieldPerReport import global_strings as gb class PathStageN(OneFieldPerReport): ''' extract the...
esilgard/BreastMR
fhcrc_pathology/PathStageN.py
Python
apache-2.0
696
#!/usr/bin/env python import pytest from pyxenon_snippets import slurm_queues_getter_with_props def test_slurm_queues_getter_with_props(): slurm_queues_getter_with_props.run_example()
NLeSC/Xenon-examples
readthedocs/code-tabs/python/tests/test_slurm_queues_getter_with_props.py
Python
apache-2.0
192
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import User from django.shortcuts import reverse from django.test import TestCase from rest_framework.test import APIClient from ...views.index_views import user_login from app.models import TheUser # ------------...
OlegKlimenko/Plamber
api/tests/test_views/test_index.py
Python
apache-2.0
8,371
import theano import theano.tensor as T import numpy as np import sys sys.path.insert(0, '../data_loader/') import load from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d # load data x_train, t_train, x_test, t_test = load.cifar10(dtype=theano.config.floatX, grayscale=F...
JBed/Simple_Theano
4_simple_conv_net/better_conv_net.py
Python
apache-2.0
2,609
from termcolor import colored def test_Browser_logs(app): wd = app.wd sidebar = wd.find_element_by_xpath("//td[@id='sidebar']") sidebar.find_element_by_xpath(".//span[normalize-space(.)='Catalog']").click() wd.find_element_by_xpath("//i[@class='fa fa-folder']/../a").click() products_qty = len(wd.f...
Dob3r/python_seleniumwebdriver
Tests/test_Browser_logs.py
Python
apache-2.0
819
"""Automatically generated by hassfest. To update, run python3 -m script.hassfest """ # fmt: off SSDP = { "deconz": [ { "manufacturer": "Royal Philips Electronics" } ], "heos": [ { "st": "urn:schemas-denon-com:device:ACT-Denon:1" } ], "huawe...
Teagan42/home-assistant
homeassistant/generated/ssdp.py
Python
apache-2.0
1,185
"""Classes to help gather user submissions.""" import abc import logging from typing import Any, Dict, List, Optional, cast import uuid import voluptuous as vol from .core import HomeAssistant, callback from .exceptions import HomeAssistantError _LOGGER = logging.getLogger(__name__) RESULT_TYPE_FORM = "form" RESULT...
Teagan42/home-assistant
homeassistant/data_entry_flow.py
Python
apache-2.0
9,791
#!/usr/bin/env python # -*- coding: utf-8 -*- from googlemaps import GoogleMaps gmaps = GoogleMaps() address = u'東京' lat, lng = gmaps.address_to_latlng(address.encode('utf-8')) print lat, lng
ojimac/RenoirKensaku-by-Titanium
scripts/map.py
Python
apache-2.0
198
## # Copyright (c) 2015-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
macosforge/ccs-calendarserver
txdav/common/datastore/podding/migration/test/test_migration.py
Python
apache-2.0
30,577
# Copyright 2020. ThingsBoard # # 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 ...
thingsboard/thingsboard-gateway
tests/converters/test_bytes_can_uplink_converter.py
Python
apache-2.0
7,578
def check_vivado(args): vivado_path = get_command("vivado") if vivado_path == None: # Look for the default Vivado install directory if os.name == 'nt': base_dir = r"C:\Xilinx\Vivado" else: base_dir = "/opt/Xilinx/Vivado" if os.path.exists(base_dir): ...
litex-hub/lxbe-tool
lxbe_tool/providers/tool/fpga/xilinx/vivado.py
Python
apache-2.0
844
from distutils.core import setup from setuptools import find_packages setup( name='cla_tool', version='1.2.0', packages=find_packages(exclude=['res']), url='https://github.com/dickrd/cla_tool', license='Apache License 2.0', author='DickRD', author_email='dickdata7@gmail.com', descripti...
dickrd/cla_tool
setup.py
Python
apache-2.0
492
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
iwm911/plaso
plaso/parsers/winreg_plugins/outlook.py
Python
apache-2.0
2,761
#!/usr/bin/env python # File: dataset_libs.py # Author: Kiri Wagstaff, 5/7/13 # # Readers and plotters for LIBS (ChemCam) data sets # # Copyright 2013-2015, by the California Institute of Technology. ALL # RIGHTS RESERVED. United States Government Sponsorship # acknowledged. Any commercial use must be negotiated with ...
wkiri/DEMUD
demud/dataset_libs.py
Python
apache-2.0
29,015
# -*- coding: utf-8 -*- u"""Common execution template. :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkcompat from pykern import pkio from pykern impor...
mkeilman/sirepo
sirepo/template/template_common.py
Python
apache-2.0
23,341
# Copyright (C) 2016, Hitachi, Ltd. # # 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...
ge0rgi/cinder
cinder/volume/drivers/hitachi/vsp_iscsi.py
Python
apache-2.0
6,591
#!/usr/bin/python #-*- coding:utf-8 -*- __author__ = 'david' import numpy as np import nibabel as nib import resources as rs # from vispy import app from plot import Canvas import matplotlib.pyplot as plt import gc np.random.seed() class Clarity(object): def __init__(self,token,imgfile=None,pointsfile=None): ...
NeuroDataDesign/seelviz
scripts/clearity/__init__.py
Python
apache-2.0
5,716
#!/usr/bin/env python """Stubs of client actions. Client actions shouldn't be used on the server, stubs should be used instead. This way we prevent loading effectively the whole client code into ours server parts. """ from __future__ import absolute_import from __future__ import division from __future__ import unicode...
demonchild2112/travis-test
grr/server/grr_response_server/server_stubs.py
Python
apache-2.0
12,170
def fibonacci_with_digits(num_digits): if num_digits == 1: return 1 n = 3 fib = 2 (fa, fb) = (1, 2) while len(str(fib)) < num_digits: fib = fa + fb (fa, fb) = (fb, fib) n += 1 return n
plilja/project-euler
problem_25/fibonacci_with_digits.py
Python
apache-2.0
241
# Copyright (c) 2016 Mirantis 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 writing, so...
SVilgelm/CloudFerry
tests/lib/copy_engines/test_base.py
Python
apache-2.0
4,186
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. """ pycroft.helpers.building_helper ~~~~~~~~~~~~~~ :copyright: (c) 2012 by AG DSN. """ import re f...
agdsn/pycroft
pycroft/helpers/facilities.py
Python
apache-2.0
1,251
# -*- coding: utf-8 -*- ''' Module to provide redis functionality to Salt .. versionadded:: 2014.7.0 :configuration: This module requires the redis python module and uses the following defaults which may be overridden in the minion configuration: .. code-block:: yaml redis.host: 'localhost' redis.port: ...
smallyear/linuxLearn
salt/salt/modules/redismod.py
Python
apache-2.0
10,610
"""Timetabler DOF9 import functions.""" import unsync import petl @unsync.command() @unsync.option('--input-file', '-i', type=unsync.Path(exists=True, dir_okay=False, readable=True, resolve_path=True), help='Timetabler DOF9 file to extract data from.', required=True) @unsync.option('--destination', '-d', required=Tru...
PGower/Unsync
unsync_timetabler/unsync_timetabler/dof9/emergency_teacher_import.py
Python
apache-2.0
2,918
import torch.nn as nn class MetalModule(nn.Module): """An abstract class of a module that accepts and returns a dict""" def __init__(self): super().__init__() class MetalModuleWrapper(nn.Module): def __init__(self, module): super().__init__() self.module = module def forwar...
HazyResearch/metal
metal/mmtl/modules.py
Python
apache-2.0
613
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
LUTAN/tensorflow
tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_op_test.py
Python
apache-2.0
13,381
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008-2019 Contributor # # 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 co...
quattor/aquilon
tests/broker/orderedsuite.py
Python
apache-2.0
30,308
#! /usr/bin/env python #edited on c9 import os import array as array import sys if (len(sys.argv)==1): print "usage >>seqCheck.py [fileRootName, path ('.') for cwd]" sys.exit() elif (len(sys.argv)==2): fileRootName = sys.argv[1] rootpath = os.getcwd() elif (len(sys.argv)==3): fileRootName = sys.a...
bkonersman/utils
seqCheck.py
Python
artistic-2.0
1,631
import requests import math import re from bs4 import BeautifulSoup ROOT_URL = "http://nces.ed.gov/collegenavigator" INDEX_URL = ROOT_URL + "?s=all&l=93&ct=2&ic=1&an=5&ax=50" PAGINATION_DIV_ID = "ctl00_cphCollegeNavBody_ucResultsMain_divMsg" def get_num_pages(pagination): """Returns the total number of pages given p...
vivhou/Python-coursework-files
final project data analysis/webscraping scripts/private_school_tuition_data.py
Python
artistic-2.0
2,969
import numpy as np import cv2 from skimage.morphology import closing, erosion, opening from pyKinectTools.algs.BackgroundSubtraction import * class BasePlayer(object): depthIm = None colorIm = None users = None backgroundModel = None foregroundMask = None mask = None prevcolorIm = None def __init__(self, b...
colincsl/pyKinectTools
pyKinectTools/dataset_readers/BasePlayer.py
Python
bsd-2-clause
3,177
#!/usr/bin/env python3 # # (c) Christian Sommerfeldt OEien # All rights reserved import itertools import sys, os def extrapatt(patt): if "%" in patt: return patt else: return patt + "%d.jpeg" class FileSeq: def __init__(self, patt): self.patt = extrapatt(patt) self.count = sel...
biotty/rmg
graphics/py/edseq.py
Python
bsd-2-clause
3,127
# coding: utf-8 from pyramid.view import view_config from dogpile.cache import make_region from analytics.control_manager import base_data_manager from citedby.custom_query import journal_titles cache_region = make_region(name='views_ajax_cache') @view_config(route_name='bibliometrics_document_received_citations'...
fabiobatalha/analytics
analytics/views_ajax.py
Python
bsd-2-clause
17,098
#! /usr/bin/env python basket = ['apple','orange','apple','pear','orange','banana'] fruit = set(basket) print fruit print 'orange in fruit :','orange' in fruit #--------------------------------- a = set('abcd abcd efg') print 'a:', a b = set('abdefghij') print 'b:',b print "a - b :", a-b print "a & b :",a &...
xiongerqi/enki
sample/datastructure/collection.py
Python
bsd-2-clause
374
from __future__ import absolute_import import community import networkx as nx from networkx.algorithms.community import asyn_lpa_communities import numpy as np from .base import LabelGraphClustererBase from .helpers import _membership_to_list_of_communities class NetworkXLabelGraphClusterer(LabelGraphClustererBase)...
scikit-multilearn/scikit-multilearn
skmultilearn/cluster/networkx.py
Python
bsd-2-clause
6,829
import torch import sys import opcode import random import time from termcolor import colored from .distributions import Normal, Categorical, Uniform, TruncatedNormal from .trace import Variable, Trace from . import util, TraceMode, PriorInflation, InferenceEngine, ImportanceWeighting _trace_mode = TraceMode.PRIOR _...
probprog/pyprob
pyprob/state.py
Python
bsd-2-clause
23,874
import easydev from cno import CNOGraph def plot_dependencies(package='cno', show=False, filename=None): main = easydev.dependencies.get_dependencies(package) # first, we fetch all dependencies c = CNOGraph() deps = easydev.dependencies.get_dependencies(package) package_version = [dep.version fo...
cellnopt/cellnopt
cno/misc/dependencies.py
Python
bsd-2-clause
1,784
# -*- coding: UTF-8 -*- # Copyright 2009-2018 Luc Saffre # License: GNU Affero General Public License v3 (see file COPYING for details) """ Import legacy data from TIM (basic version). """ import traceback import os from clint.textui import puts, progress from django.conf import settings from django.db import models ...
lino-framework/xl
lino_xl/lib/tim2lino/utils.py
Python
bsd-2-clause
12,793
# coding: utf-8 import random from deworld.layers.base_layer import BaseLayer class VEGETATION_TYPE: DESERT = 0 GRASS = 1 FOREST = 2 class VegetationLayer(BaseLayer): MIN = 0.0 MAX = 1.0 HEIGHT_FOREST_BARIER_START = None HEIGHT_FOREST_BARIER_END = None HEIGHT_GRASS_BARIER_START ...
Tiendil/deworld
deworld/layers/vegetation_layer.py
Python
bsd-2-clause
5,066
# Importing Libraries import sys ''' Function that generates the results for all the test cases. Iterates through the test cases and delegates the work ot getCount ''' def genResults(cases): results = [] for case in cases: results.append(getCount(case)) return results ''' Function that...
tejasnikumbh/Algorithms
Warmup/AlternatingCharacgters.py
Python
bsd-2-clause
1,034
# Primal Python: # # Functions for calculating primeness of numbers. # Implementation (c) 2016-2020 Brig Young (github.com/Sonophoto) # License: BSD-2c, i.e. Cite. [LINK TO REPO] # # Original Problem Statement # accept number input # list all primes upto and including this number. # return a python list in ascending or...
Sonophoto/PythonNotes
primalPython/primalPython.py
Python
bsd-2-clause
2,338
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'lift_meet_manager.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^lift_tables/', include('lift_tables.urls')), url(r'^admin/', include...
rbjorklin/lift-meet-manager
lift_meet_manager/urls.py
Python
bsd-2-clause
342
# -*- coding: utf-8 -*- import pytest from .utils import last_activity @pytest.mark.usefixtures('versioning_manager', 'table_creator') class TestActivityCreationWithColumnExclusion(object): @pytest.fixture def audit_trigger_creator(self, session, user_class): session.execute( '''SELECT au...
kvesteri/postgresql-audit
tests/test_sql_files.py
Python
bsd-2-clause
1,919
import os import pandas as pd import sys import plotter from PyQt4 import QtGui, QtCore # The main window inherits from QWidget (an empty window). class MainLayout(QtGui.QWidget): def __init__(self): # Initialize the object as a QWidget QtGui.QWidget.__init__(self) self.setWindowTitle("M...
Juaanma/MultipleStocksPlotter
src/main.py
Python
bsd-2-clause
4,658
""" >>> image = np.zeros((50, 75), dtype=np.uint8) >>> numpy_image = image.copy() >>> image = create_fractal(-2.0, 1.0, -1.0, 1.0, image, 20) >>> numpy_image = create_fractal.py_func(-2.0, 1.0, -1.0, 1.0, numpy_image, 20) >>> assert np.allclose(image, numpy_image) """ from numba import * import numpy as np @autojit(n...
shiquanwang/numba
numba/tests/test_mandelbrot.py
Python
bsd-2-clause
1,319
import turtle from lsystem import LSystem plant = dict( axiom = 'X', productions = {'X': 'F-[[X]+X]+F[+FX]-X', 'F':'FF'}) plantL = LSystem(**plant) q = [] def restore(): pos, angl = q.pop() turtle.up() turtle.setposition(pos) turtle.seth(angl) turtle.down() methods = { 'F...
kvoss/lsystem
example-plant.py
Python
bsd-2-clause
787
weblab_db_username = 'weblab' weblab_db_password = 'weblab' ############################## # RemoteFacade configuration # ############################## login_facade_soap_bind = '' login_facade_soap_port = 10623 login_facade_soap_service_name = '/weblab/login/soap/' login_facade_xmlrpc_bind = '' log...
ganeshgore/myremolab
server/launch/sample_unixsocket/main_machine/main_instance/login/server_config.py
Python
bsd-2-clause
459
# Copyright (c) 2016, Kevin Rodgers # Released subject to the New BSD License # Please see http://en.wikipedia.org/wiki/BSD_licenses import redis from uuid import uuid4 UUID = 'uuid' class SimpleRedisDb(object): def __init__(self, host, key, port=6379): """ :param host: database host :p...
kfrodgers/active-mail-filter
active_mail_filter/simple_db.py
Python
bsd-2-clause
3,390
# $Id: components.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Docutils component-related transforms. """ __docformat__ = 'reStructuredText' import sys import os import re import time from docutils import nodes,...
akiokio/centralfitestoque
src/.pycharm_helpers/docutils/transforms/components.py
Python
bsd-2-clause
2,003
# -*- coding: utf-8 -*- import sys, os sys.path.insert(0, os.path.abspath('../..')) import unittest, pandas, numpy, datetime, itertools, mlp from sklearn import cross_validation, preprocessing class MLP(unittest.TestCase): """Test cases for Ibovespa tendency problem.""" grid_search = True def test_1(sel...
fberanizo/neural_network
tests/ibovespa/mlp.py
Python
bsd-2-clause
5,708
#!/usr/bin/env python """ @package ion.agents.platform.responses @file ion/agents/platform/responses.py @author Carlos Rueda @brief Some constants for responses from platform agents/drivers. """ from ion.agents.instrument.common import BaseEnum __author__ = 'Carlos Rueda' __license__ = 'Apache 2.0' class Nor...
ooici/marine-integrations
mi/platform/responses.py
Python
bsd-2-clause
1,069
### Implementation of the numerical Stehfest inversion inspired by J Barker https://www.uni-leipzig.de/diffusion/presentations_DFII/pdf/DFII_Barker_Reduced.pdf import inversion import math def finiteConc(t, v, De, R, deg, x, c0, L, N): ''' t is time (T), v is velocity (L/T), De is effective hydrodynamic dis...
tachylyte/HydroGeoPy
one_d_numerical.py
Python
bsd-2-clause
3,784
import numpy as np from scipy.interpolate import interp1d from astropy.io import ascii from astropy import units as u from newdust import constants as c from newdust.graindist.composition import _find_cmfile __all__ = ['CmSilicate'] RHO_SIL = 3.8 # g cm^-3 class CmSilicate(object): """ | **ATTRIBUTES...
eblur/newdust
newdust/graindist/composition/cmsilicate.py
Python
bsd-2-clause
3,341
from google.appengine.ext.webapp import template register = template.Library() @register.filter def inttofloat(value, arg): return float(value) / 1000.0;
phsmit/Smit-Fuel
templatetags/extratags.py
Python
bsd-2-clause
159
__author__ = 'zhengwang' from model import load_data, NeuralNetwork input_size = 120 * 320 data_path = "training_data/*.npz" X_train, X_valid, y_train, y_valid = load_data(input_size, data_path) # train a neural network layer_sizes = [input_size, 32, 4] nn = NeuralNetwork() nn.create(layer_sizes) nn.train(X_train, ...
hamuchiwa/AutoRCCar
computer/model_training.py
Python
bsd-2-clause
709
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012, 2013 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: # # 1. Redistributions of source code must retain the above copyright no...
mbakke/ganeti
lib/server/rapi.py
Python
bsd-2-clause
11,971
# Import tests from each test file. # e.g. if we have tests/sources.py, then "from sources import *" from sources import * from tasks import *
DevangS/CoralNet
images/tests/__init__.py
Python
bsd-2-clause
144
# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSProperty, AWSObject, Tags from .validators import json_checker, boolean class IEMap(AWSProperty): props = { 'ACCOUNT': ([basestring], False), } class Policy(AWSObject...
ikben/troposphere
troposphere/fms.py
Python
bsd-2-clause
1,072
#!/usr/bin/env python3 # ################################################################################ # Important note: # Because of the highly individual nature of the ODT files to be processed, each # user will have to adjust this script according to their needs. It will fail # out of the box unless you happen to...
mssever/odt2dynalist
sermons_to_dynalist.py
Python
bsd-2-clause
8,843
import numpy as np from Orange.classification import Learner, Model from Orange.data import Instance, Storage, Table, DiscreteVariable from Orange.statistics import contingency from Orange.preprocess import Discretize __all__ = ["NaiveBayesLearner"] class NaiveBayesLearner(Learner): """ Naive Bayes classifi...
qusp/orange3
Orange/classification/naive_bayes.py
Python
bsd-2-clause
2,302
#!/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...
trevorlinton/skia
gm/rebaseline_server/results.py
Python
bsd-3-clause
22,208
#!/usr/bin/env python # # Curriculum Module Run Script # - Run once per run of the module by a user # - Run inside job submission. So in an allocation. # - onramp_run_params.cfg file is available in current working directory # import os import sys from subprocess import call from configobj import ConfigObj # # Read t...
koepked/onramp
modules/hpl/bin/onramp_run.py
Python
bsd-3-clause
653
from setuptools import setup, find_packages version = '2.0a2-incuna' LONG_DESCRIPTION = """ Using django-avatar =================== Basics ------ To integrate ``django-avatar`` with your site, there are relatively few things that are required. A minimal integration can work like this: 1. List this application i...
incuna/django-avatar
setup.py
Python
bsd-3-clause
5,542
""" ===================================================== Spatiotemporal permutation F-test on full sensor data ===================================================== Tests for differential evoked responses in at least one condition using a permutation clustering test. The FieldTrip neighbor templates will be used to d...
mne-tools/mne-tools.github.io
0.20/_downloads/7bb433a8c5a4cf876b244e99c2c7c8b7/plot_stats_spatio_temporal_cluster_sensors.py
Python
bsd-3-clause
7,444
""" The middlewares in this file do mobile detection, provide a user override, and provide a cookie override. They must be used in the correct order. MobileMiddleware must always come after any of the other middlewares in this file in `settings.MIDDLEWARE_CLASSES`. """ import urllib from warnings import warn from djan...
lgp171188/fjord
fjord/base/middleware.py
Python
bsd-3-clause
5,915
# -*- coding: utf-8 -*- from django.contrib import admin from models import Status, User class TwitterModelAdmin(admin.ModelAdmin): def get_readonly_fields(self, request, obj=None): if obj: return [field.name for field in obj._meta.fields] return [] class StatusAdmin(TwitterModelAdm...
manoranjanp/django-twitter-api
twitter_api/admin.py
Python
bsd-3-clause
516
#! /usr/bin/env python3 import config config.import_libs() import unittest from xmlui import Connector, Logout from xmlui import GatewayRegister, GatewayUnregister from xmlui import DeviceParameterGet from xmlui import DeviceParameterCreate, DeviceParameterUpdate, DeviceParameterDelete class TestCRUDeviceParameter(...
BeeeOn/server
t/xmlui/t2007-parameter-create-update-delete.py
Python
bsd-3-clause
8,043
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Mixed-Dimensions Trick # # Description: Applies mixed dimension trick to embeddings to reduce # embedding sizes. # # References: # [1] Anto...
hfp/libxsmm
samples/deeplearning/sparse_training/dlrm/tricks/md_embedding_bag.py
Python
bsd-3-clause
3,016
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. # pylint: disable=E0611 from pytest import raises from multiconf import mc_config, ConfigItem, ConfigException, ConfigExcludedAttributeError, MC_REQUIRED, McInvalidValue from multiconf.dec...
lhupfeldt/multiconf
test/include_exclude2_test.py
Python
bsd-3-clause
13,628
# Note: not using cStringIO here because then we can't set the "filename" from StringIO import StringIO from copy import copy from datetime import datetime, timedelta from django.contrib.auth.models import User, AnonymousUser from django.contrib.messages import SUCCESS from django.core.urlresolvers import reverse from...
mozilla/mozilla-ignite
apps/challenges/tests/test_views.py
Python
bsd-3-clause
32,366
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('lab_members', '0012_scientist_email'), ] operations = [ migrations.AddField( model_name='advisor', n...
mfcovington/django-lab-members
lab_members/migrations/0013_advisor_url.py
Python
bsd-3-clause
517
from pathlib import Path import unittest from saw_client import * from saw_client.exceptions import VerificationError from saw_client.crucible import cry, cry_f from saw_client.llvm import Contract, LLVMType, PointerType, void, i32, array_ty from typing import Union class FPointsToContract(Contract): def __init__...
GaloisInc/saw-script
saw-remote-api/python/tests/saw/test_points_to_at_type.py
Python
bsd-3-clause
1,590
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') setup( name='pvl', version='0.2.0', description='Python imple...
bvnayak/pvl
setup.py
Python
bsd-3-clause
1,274
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("DecisionTreeRegressor" , "freidman1" , "mssql")
antoinecarme/sklearn2sql_heroku
tests/regression/freidman1/ws_freidman1_DecisionTreeRegressor_mssql_code_gen.py
Python
bsd-3-clause
137
from datetime import datetime import re import time import urllib import simplejson as json from actions import Action from webservice import WebService class MobileMe(WebService): loginform_url = 'https://auth.me.com/authenticate' loginform_data = { 'service': 'account', 'ssoNamespace': 'pr...
wrboyce/autolat
autolat/mobileme.py
Python
bsd-3-clause
8,757
from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest skltest.test_reg_dataset_and_model("RandomReg_500" , "SVR_poly_8")
antoinecarme/sklearn_explain
tests/skl_datasets_reg/RandomReg_500/skl_dataset_RandomReg_500_SVR_poly_8_code_gen.py
Python
bsd-3-clause
149
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_yadi ---------------------------------- Tests for `yadi` module. """ import unittest from yadi import yadi class TestYadi(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(self): pass ...
saltzm/yadi
tests/test_yadi.py
Python
bsd-3-clause
367
def extractThatbadtranslatorWordpressCom(item): ''' Parser for 'thatbadtranslator.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'transla...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractThatbadtranslatorWordpressCom.py
Python
bsd-3-clause
574
import logging; logger = logging.getLogger("morse." + __name__) import pymoos.MOOSCommClient import morse.core.middleware import bge class MOOSClass(morse.core.middleware.MorseMiddlewareClass): """ Handle communication between Blender and MOOS.""" def __init__(self): """ Initialize the MOOS app"...
Arkapravo/morse-0.6
src/morse/middleware/moos_mw.py
Python
bsd-3-clause
5,831
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division from django.shortcuts import redirect, get_object_or_404 from django.db import transaction from xue.common.decorators import quickview, limit_role from xue.tutor.forms import StudentApplicationForm, ProjectSelectionForm from xue.tutor.models ...
team-xue/xue
xue/tutor/studentviews.py
Python
bsd-3-clause
2,757
#! /usr/bin/env python import logging from operator import itemgetter from pbcore.io.FastqIO import FastqWriter from pbhla.fasta.utils import write_fasta, get_num_reads from pbhla.external.utils import get_alignment_file from pbhla.filenames import get_file_type from pbhla.io.BlasrIO import BlasrReader from pbhla.uti...
bnbowman/HlaTools
src/pbhla/alleles/extract.py
Python
bsd-3-clause
6,294
from django.db import models from django.db.models.fields.related import ( RECURSIVE_RELATIONSHIP_CONSTANT, ManyToManyDescriptor, ManyToManyField, ManyToManyRel, RelatedField, create_many_to_many_intermediary_model, ) from django.utils.functional import curry class CustomManyToManyField(RelatedField): ...
Matt-Deacalion/django
tests/schema/fields.py
Python
bsd-3-clause
2,822
class CreateMapping(object): def __init__(self): self.request_id = '' self.mapping = ''
M4gn4tor/mastercard-api-python
Services/moneysend/domain/card_mapping/createmapping.py
Python
bsd-3-clause
108
# Copyright 2015, 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...
leifurhauks/grpc
src/python/grpcio/tests/unit/beta/test_utilities.py
Python
bsd-3-clause
2,422
# -*- coding: utf-8 -*- """Create an application instance.""" from flask.helpers import get_debug_flag from haha.app import create_app from haha.settings import DevConfig, ProdConfig CONFIG = DevConfig if get_debug_flag() else ProdConfig app = create_app(CONFIG)
starduliang/haha
autoapp.py
Python
bsd-3-clause
266
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.test_settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv[:1] + ['test'] + sys.argv[1:])
iwoca/django-deep-collector
runtests.py
Python
bsd-3-clause
281
#!/usr/bin/env python import sys import vtk from vtk.test import Testing useBelowRangeColor = 0 if sys.argv.count("--useBelowRangeColor") > 0: useBelowRangeColor = 1 useAboveRangeColor = 0 if sys.argv.count("--useAboveRangeColor") > 0: useAboveRangeColor = 1 cmap = vtk.vtkDiscretizableColorTrans...
hlzz/dotfiles
graphics/VTK-7.0.0/Rendering/Core/Testing/Python/TestOutOfRangeDiscretizableColorTransferFunction.py
Python
bsd-3-clause
1,475
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from glob import glob import os import sys from setuptools import setup, Extension from Cython.Build import cythonize if sys.version_info[:2] < (2, 7): print( 'nxcpy requires Python version 2.7 or later' + ' ({}.{...
OrkoHunter/nxcpy
setup.py
Python
bsd-3-clause
1,193
from mocket import Mocket, mocketize from mocket.async_mocket import async_mocketize from mocket.compat import byte_type, text_type from mocket.mockhttp import Entry as MocketHttpEntry from mocket.mockhttp import Request as MocketHttpRequest from mocket.mockhttp import Response as MocketHttpResponse def httprettifier...
mindflayer/python-mocket
mocket/plugins/httpretty/__init__.py
Python
bsd-3-clause
3,152
""" Generative Stochastic Networks This is described in: - "Generalized Denoising Auto-Encoders as Generative Models" Bengio, Yao, Alain, Vincent. arXiv:1305.6663 - "Deep Generative Stochastic Networks Trainable by Backprop" Bengio, Thibodeau-Laufer. arXiv:1306.1091 There is an example of training both unsuper...
lisa-lab/pylearn2
pylearn2/models/gsn.py
Python
bsd-3-clause
36,325
# -*- coding: utf-8 -*- import json import datetime from decimal import Decimal from requests.packages.urllib3.util import parse_url from .models import BaseModel from .errors import OptimoError DEFAULT_API_VERSION = 'v1' class CoreOptimoEncoder(json.JSONEncoder): """Custom JSON encoder that knows how to ser...
fieldaware/optimoroute
optimo/util.py
Python
bsd-3-clause
2,432
#!/usr/bin/env python ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] tags will be kept. ...
tu-darmstadt-ros-pkg/hector_flexbe_behavior
behaviors/behavior_detect_pipes/src/behavior_detect_pipes/detect_pipes_sm.py
Python
bsd-3-clause
16,710
import csv from . import WorksheetBase, WorkbookBase, CellMode class CSVWorksheet(WorksheetBase): def __init__(self, raw_sheet, ordinal): super().__init__(raw_sheet, ordinal) self.name = "Sheet 1" self.nrows = len(self.raw_sheet) self.ncols = max([len(r) for r in self.raw_sheet]) def parse_cell(s...
treycucco/py-utils
idb/spreadsheet/csv.py
Python
bsd-3-clause
862
# Generated by Django 2.2.16 on 2021-02-08 21:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('commtrack', '0003_create_config_models'), ] operations = [ migrations.AlterField( model_name='sqlstocklevelsconfig', ...
dimagi/commcare-hq
corehq/apps/commtrack/migrations/0004_update_overstock_threshold.py
Python
bsd-3-clause
449
# -*- coding: utf-8 -*- # Copyright (c) 2015 Simon Jagoe and Enthought Ltd # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. import os import subprocess from setuptools import setup MAJOR = 0 MINOR = 1 MICRO ...
enthought/graystruct
setup.py
Python
bsd-3-clause
4,358
from sqlalchemy import ( Column, Index, Integer, Text, Table, ForeignKey, String, Boolean, DateTime, ) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( scoped_session, sessionmaker, relationship, ) from zope.sqlalchemy import...
jaduff/goodstanding
goodstanding/models.py
Python
bsd-3-clause
2,768
from django import forms from timer.models import Timer, Location class TimerForm(forms.ModelForm): location = forms.ModelChoiceField(Location.objects.none()) class Meta: model = Timer
nikdoof/limetime
app/timer/forms.py
Python
bsd-3-clause
204
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
ericmjl/bokeh
tests/unit/bokeh/io/test___init___io.py
Python
bsd-3-clause
2,190
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-09-12 19:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("ui", "0010_video_default_sort"), ] operations = [ migrations.AddField( ...
mitodl/odl-video-service
ui/migrations/0011_collection_created_at.py
Python
bsd-3-clause
602
""" This GA code creates the gaModel with a circular island model """ from operator import attrgetter # import sys from deap import base, creator, tools import numpy from csep.loglikelihood import calcLogLikelihood as loglikelihood from models.mathUtil import calcNumberBins import models.model import random import arr...
PyQuake/earthquakemodels
code/gaModel/parallelGAModelP_AVR.py
Python
bsd-3-clause
6,277
""" Read graphs in LEDA format. See http://www.algorithmic-solutions.info/leda_guide/graphs/leda_native_graph_fileformat.html """ # Original author: D. Eppstein, UC Irvine, August 12, 2003. # The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain. __author__ = """Aric Hagberg (hagberg@lanl.gov)""...
JaneliaSciComp/Neuroptikon
Source/lib/CrossPlatform/networkx/readwrite/leda.py
Python
bsd-3-clause
2,097
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Logit'] , ['LinearTrend'] , ['Seasonal_DayOfMonth'] , ['SVR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Logit/model_control_one_enabled_Logit_LinearTrend_Seasonal_DayOfMonth_SVR.py
Python
bsd-3-clause
160