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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2013, First Party Software
# 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 notice,
# t... | filipp/Servo | servo/management/commands/dbrestore.py | Python | bsd-2-clause | 1,991 |
import os
from flask import render_template
from markdown import markdown
__all__ = ["DirContents", "Doc"]
class DirContents(object):
def __init__(self, dir, name=''):
self.dir = dir
if name != '':
self.name = name
else:
self.name = dir
def get_contents(self):
... | aivuk/formcreator | formcreator/blocks/__init__.py | Python | bsd-2-clause | 647 |
import threading
import itertools
from icssploit import (
exploits,
wordlists,
print_status,
print_error,
print_success,
print_table,
http_request,
multi,
threads,
validators,
)
from icssploit.exceptions import StopThreadPoolExecutor
class Exploit(exploits.Exploit):
"""
... | dark-lbp/isf | icssploit/modules/creds/http_basic_bruteforce.py | Python | bsd-2-clause | 3,678 |
import numpy as np
import os
from mpEntropy import mpSystem
import matplotlib as mpl
from matplotlib.pyplot import cm
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from scipy.stats import norm
from scipy.signal import savgol_filter
from scipy.optimize import curve_fit
# This is a workaround until scipy... | marvinlenk/subsystem_entropy_epsplots | pyplot_eps/ent_eps.py | Python | bsd-2-clause | 6,836 |
## ENVISIoN
##
## Copyright (c) 2021 Gabriel Anderberg, Didrik Axén, Adam Engman,
## Kristoffer Gubberud Maras, Joakim Stenborg
## 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. ... | rartino/ENVISIoN | envisionpy/hdf5parser/vasp/check_for_parse.py | Python | bsd-2-clause | 3,028 |
import math
from functools import singledispatch, update_wrapper
import numpy as np
from scipy.sparse import csr_matrix, coo_matrix
import pybinding as pb
def _assertdispatch(func):
"""Adapted `@singledispatch` for custom assertions
* Works with methods instead of functions
* Keeps track of the data st... | MAndelkovic/pybinding | tests/utils/fuzzy_equal.py | Python | bsd-2-clause | 5,216 |
from flask import Blueprint, request, url_for, jsonify
from flask_restful import Api, Resource
from flask_jwt_extended import jwt_required
from potnanny_core.models import Room
from .schemas import RoomSchema
from potnanny.crud import CrudInterface
bp = Blueprint('room_api', __name__, url_prefix='/api/1.0/rooms')
ap... | jeffleary00/greenery | potnanny/apps/room/api.py | Python | bsd-2-clause | 1,520 |
# Copyright (c) 2017, Matt Layman
"""The website model"""
import os
from handroll import template
from handroll.exceptions import AbortError
from handroll.i18n import _
class Site(object):
"""A Site represents a handroll site source.
This class contains validation logic to confirm that a directory
is a... | handroll/handroll | handroll/site.py | Python | bsd-2-clause | 3,736 |
#!/usr/bin/env python
""" tsne_openfmri.py: code to run t-SNE on results from MELODIC ICA applied to the OpenFMRI dataset
requires:
- tsne.py from http://homepage.tudelft.nl/19j49/t-SNE.html
- Numpy
"""
## Copyright 2011, Russell Poldrack. All rights reserved.
## Redistribution and use in source and binary forms, wi... | poldrack/openfmri | openfmri_paper/8.2_mds_wholebrain.py | Python | bsd-2-clause | 3,290 |
"""
SUR and 3SLS estimation
"""
__author__= "Luc Anselin lanselin@gmail.com, \
Pedro V. Amaral pedrovma@gmail.com"
import numpy as np
import numpy.linalg as la
from scipy import stats
from . import summary_output as SUMMARY
from . import user_output as USER
from . import regimes as REGI
from .sur_uti... | lixun910/pysal | pysal/model/spreg/sur.py | Python | bsd-3-clause | 35,446 |
from flask import Flask, render_template, request
from lib.work import work
from lib.loaders.policedata import PoliceData
from lib.loaders.populationdata import PopulationData
from lib.loaders.childpovertydata import ChildPovertyData
from lib.loaders.cancerdata import CancerData
import json
app = Flask(__name__)
@app... | mattyhall/North-South-Divide | divide.py | Python | bsd-3-clause | 2,269 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Anscombe/trend_MovingMedian/cycle_12/ar_/test_artificial_32_Anscombe_MovingMedian_12__20.py | Python | bsd-3-clause | 266 |
import numpy as np
from pymeteo import constants
from .. import OptionsWidget
class straight(OptionsWidget.OptionsWidget):
def __init__(self):
super(straight,self).__init__()
name = 'straight (linear increase)'
variables = [ ('z_constabv', '6000', 'm'),
('z_constblo', '0', 'm'... | cwebster2/pyMeteo | pymeteo/cm1/hodographs/straight.py | Python | bsd-3-clause | 1,428 |
__author__ = 'Bohdan Mushkevych'
import unittest
try:
import mock
except ImportError:
from unittest import mock
from settings import enable_test_mode
enable_test_mode()
from constants import PROCESS_SITE_HOURLY
from synergy.db.dao.job_dao import JobDao
from synergy.db.dao.unit_of_work_dao import UnitOfWorkDa... | mushkevych/scheduler | tests/test_state_machine_recomputing.py | Python | bsd-3-clause | 8,122 |
from orotangi.models import Books, Notes
from rest_framework import serializers
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
class BookSerializer(serializers.ModelSerializer):
class Meta:
... | foxmask/orotangi | orotangi/api/serializers.py | Python | bsd-3-clause | 597 |
####
#### Setup gross testing environment.
####
#### This currently includes the UI instance target and browser type
#### (FF vs PhantomJS).
####
import os
import time
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
###
### Simple (but somewhat excessive f... | jmcmurry/monarch-app | tests/behave/environment.py | Python | bsd-3-clause | 7,314 |
"""
Dec 10, 2015 Developed by Y.G.@CHX
yuzhang@bnl.gov
This module is for the necessary packages for the XPCS analysis
"""
from IPython.core.magics.display import Javascript
from skbeam.core.utils import multi_tau_lags
from skimage.draw import line_aa, line, polygon, ellipse, circle
from modest_image import Modes... | yugangzhang/chxanalys | chxanalys/chx_libs.py | Python | bsd-3-clause | 9,246 |
from patterns.singleton import Singleton
from secure.gae import gaeinit
gaeinit()
import loggr
from utilities import Utils
import secure.settings as settings
import urllib2
from django.utils import timezone
from snakr.models import CityLog, CountryLog, IPLog, HostLog, UserAgentLog, TPIpBls#
import ipaddr
import netaddr... | bretlowery/snakr | snakr/trafficfilters.py | Python | bsd-3-clause | 12,013 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "f 10 0.033, s, f 20 0.033, s, f 30 0.033, s, f 30 0.033, s, q"
tags = "particles, Meteor"
import pyglet
import cocos
from cocos.director import ... | eevee/cocos2d-mirror | test/test_particle_meteor.py | Python | bsd-3-clause | 911 |
# coding=utf-8
"""
malpy.cycleanalyzer.CycleAnalyzer Tests
"""
from __future__ import print_function
from nose.tools import assert_equal
import malpy.cycleanalyzer
import malpy.parser
PARSER = malpy.parser.Parser()
RUNNER = malpy.cycleanalyzer.CycleAnalyzer()
class TestMalCycleAnalyzer(object):
"""Tests the pa... | LSmit202/Mal-Py | tests/test_cycleanalyzer.py | Python | bsd-3-clause | 1,162 |
import numpy as np
from numpy.random import randn
import pytest
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
import pandas._testing as tm
from pandas.core.reshape.concat import concat
from pandas.core.reshape.merge import merge
@pytest.fixture
def left():
"""left dataframe (not mul... | TomAugspurger/pandas | pandas/tests/reshape/merge/test_multi.py | Python | bsd-3-clause | 27,683 |
from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class ChrTests(TranspileTestCase):
pass
class BuiltinChrFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["chr"]
not_implemented = [
'test_bytearray',
'test_class',
'test_complex',
'tes... | glasnt/voc | tests/builtins/test_chr.py | Python | bsd-3-clause | 340 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_PolyTrend/cycle_7/ar_/test_artificial_1024_RelativeDifference_PolyTrend_7__20.py | Python | bsd-3-clause | 274 |
#-----------------------------------------------------------------------------
# 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/test_examples.py | Python | bsd-3-clause | 7,583 |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
import inspect
from coll... | yephper/django | django/db/models/query_utils.py | Python | bsd-3-clause | 13,827 |
# -*- coding: utf-8 -*-
"""Scheduling Block Instance List API resource."""
import logging
from http import HTTPStatus
from random import choice
from flask import Blueprint, request
from .utils import add_scheduling_block, get_root_url, missing_db_response
from ..db.client import ConfigDb
BP = Blueprint("scheduling-... | SKA-ScienceDataProcessor/integration-prototype | sip/examples/flask_processing_controller/app/api/scheduling_block_list.py | Python | bsd-3-clause | 2,351 |
"""United States Macroeconomic data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
Compiled by Skipper Seabold. All data are from the Federal Reserve Bank of St.
Louis [1] except the unemployment rate which was taken from the National
Bureau of... | wesm/statsmodels | scikits/statsmodels/datasets/macrodata/data.py | Python | bsd-3-clause | 3,085 |
import numpy as np
from load_binary_files import training_ims, training_labels
from init_functions import connectivity
# Select quantity of data to use
N_data_total = len(training_labels)
percentage = 0.001
N_to_use = int(percentage * N_data_total)
# Decide how much data to use
X = training_ims[0:N_to_use]
Y = t... | h-mayorquin/mnist_deep_neural_network_BPNNs | create_and_store_connectivity.py | Python | bsd-3-clause | 696 |
# -*- coding: utf-8 -*-
"""
zask.ext.sqlalchemy
~~~~~~~~~~~~~~~~~~~
Adds basic SQLAlchemy support to your application.
I have not add all the feature, bacause zask is not for web,
The other reason is i can't handle all the features right now :P
Differents between Flask-SQLAlchemy:
1. No de... | j-5/zask | zask/ext/sqlalchemy/__init__.py | Python | bsd-3-clause | 18,665 |
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from django.conf.urls.defaults import *
from gallery.feeds import GalleryFeed, AlbumFeed
urlpatterns = patterns('',
url(r'^feed/gallery/$', GalleryFeed(), name="gallery-feed"),
url(r'^feed/album/(?P<album_id>[0-9]+)/$', AlbumFeed()... | lukacu/django-gallery | gallery/urls.py | Python | bsd-3-clause | 434 |
from setuptools import setup, find_packages
version = '1.1a1'
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 in the `... | dgouldin/django-avatar | setup.py | Python | bsd-3-clause | 5,532 |
import math
import queue
import time
from common import const, plot
class HeadingPlot(plot.PlotBase):
def plot(self, hdg, elev):
try:
self._q.put_nowait((hdg, elev))
except queue.Full:
pass
@staticmethod
def _daemon(q):
from matplotlib import transforms
... | cuauv/software | hydrocode/modules/pinger/headingplot.py | Python | bsd-3-clause | 1,604 |
#-*- coding: utf-8 -*-
#!/usr/bin/env python
"""
Flask-Mysqlpool
-----------
Adds support to flask to connect to a MySQL server using
mysqldb extension and a connection pool.
"""
from setuptools import setup
setup(
name='Flask-Mysqlpool',
version='0.1',
url='',
license='BSD',
author='Giorgos Komni... | gosom/flask-mysqlpool | setup.py | Python | bsd-3-clause | 1,227 |
#
# Definitions for compiling with IBM-MPI on SuperMUC
#
def getMPIIncludes():
return ['/opt/ibmhpc/pecurrent/mpich2/intel/include64']
def getMPILibrarypaths():
return ['/opt/ibmhpc/pecurrent/mpich2/intel/lib64', '/opt/ibmhpc/pecurrent/mpich2/../pempi/intel/lib64', '/opt/ibmhpc/pecurrent/ppe.pami/intel/lib64/pam... | unterweg/peanoclaw | supermucIBMMPIConfiguration.py | Python | bsd-3-clause | 431 |
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _, ugettext
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.contrib.redirects.models import Redirect
from django.core.validators import ... | petrlosa/ella | ella/core/models/publishable.py | Python | bsd-3-clause | 11,751 |
# Datatrans registry
from datatrans.utils import register
from press_links.models import Entry, Link
class PressEntryTranslation(object):
fields = ('title', 'excerpt', 'source')
register(Entry, PressEntryTranslation)
class LinkTranslation(object):
fields = ('link', 'link_text')
register(Link, LinkTranslatio... | mvpoland/django-press-links | press_links/datatranslation.py | Python | bsd-3-clause | 323 |
#!/usr/bin/env python
# Copyright 2017 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.
"""Runs telemetry benchmarks and gtest perf tests.
This script attempts to emulate the contract of gtest-style tests
invoked via recip... | endlessm/chromium-browser | testing/scripts/run_performance_tests.py | Python | bsd-3-clause | 27,620 |
"""
This module holds all of the regular expression patterns that pykol uses. It makes sense
to store them all in the same place since many patterns are used by multiple requests.
The 'patterns' data object is a dictionary mapping patternId to pattern. If pattern is a tuple,
then the first element of the tuple should b... | ijzer/cwbot-ndy | kol/data/Patterns.py | Python | bsd-3-clause | 28,912 |
##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | appleseedhq/gaffer | startup/GafferDispatch/requirementsCompatibility.py | Python | bsd-3-clause | 3,463 |
from django.conf.urls.defaults import *
from staste.charts.views import PieChart, TimeserieChart, LatestCountAndAverageChart
from staste.middleware import response_time_metrica
from .views import IndexView
from .metrics import gender_age_metrica
urlpatterns = patterns('',
url(r'^$', IndexView... | MechanisM/djangodash2011 | test_project/test_app/urls.py | Python | bsd-3-clause | 1,313 |
from datetime import timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import (
Index,
NaT,
Series,
Timedelta,
TimedeltaIndex,
timedelta_range,
)
import pandas._testing as tm
from pandas.core.indexes.api import Int64Index
from pandas.tests.indexes.datetimelike import D... | pandas-dev/pandas | pandas/tests/indexes/timedeltas/test_timedelta.py | Python | bsd-3-clause | 4,517 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.anjos@idiap.ch>
# Wed 11 Dec 15:14:08 2013 CET
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
"""Basic tests for the error measuring system of bob
"""
import os
import numpy
import nose.tools
import bob.io.base
de... | tiagofrepereira2012/bob.measure | bob/measure/test_error.py | Python | bsd-3-clause | 13,944 |
"""
Data processing for VisualWordLSTM happens here; this creates a class that
acts as a data generator/feed for model training.
"""
from __future__ import print_function
from collections import defaultdict
import cPickle
import h5py
import logging
import numpy as np
np.set_printoptions(threshold='nan')
import os
impo... | elliottd/GroundedTranslation | data_generator.py | Python | bsd-3-clause | 36,237 |
# -*- coding: utf-8 -*-
import requests
import urlparse
class TV(object):
def __init__(self, url):
self.url = url
self.chan = None
self.stream = None
def _post(self, endpoint, json):
url = urlparse.urljoin(self.url, endpoint)
try:
requests.post(url, json=j... | tschaefer/remote | remote/tv.py | Python | bsd-3-clause | 1,157 |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... | DLR-SC/DataFinder | src/datafinder/core/configuration/properties/domain.py | Python | bsd-3-clause | 6,707 |
# -*- coding: utf-8 -*-
"""
conpaas.core.ganglia
====================
ConPaaS core: performance monitoring with Ganglia.
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
import os
from shutil import copyfile, copy
from Cheetah.Template import Template
from conpaas.core.misc import run_cmd
c... | ema/conpaas | conpaas-services/src/conpaas/core/ganglia.py | Python | bsd-3-clause | 5,129 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import util
from telemetry.testing import run_tests
class MockArgs(object):
def __init__(self):
self.positional_... | catapult-project/catapult-csm | telemetry/telemetry/testing/run_tests_unittest.py | Python | bsd-3-clause | 3,839 |
"""About models."""
from slugify import slugify
from sqlalchemy_utils import observes
from pygotham.core import db
from pygotham.events.query import EventQuery
__all__ = ('AboutPage',)
class AboutPage(db.Model):
"""About page."""
__tablename__ = 'about_pages'
query_class = EventQuery
id = db.Colu... | djds23/pygotham-1 | pygotham/about/models.py | Python | bsd-3-clause | 1,974 |
import tests.missing_data.test_missing_data_ozone_generic as gen
gen.test_ozone_missing_data('DiscardRow', 'Constant')
| antoinecarme/pyaf | tests/missing_data/test_missing_data_ozone_DiscardRow_Constant.py | Python | bsd-3-clause | 120 |
from __future__ import unicode_literals
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'^markitup/', include('markitup.urls')),
)
| WimpyAnalytics/django-markitup | tests/urls.py | Python | bsd-3-clause | 177 |
#!/usr/bin/env python
# -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*-
# vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8
import argparse
import sys
import clusto
from clusto import drivers
from clusto import script_helper
from pprint import pprint
import sys
impo... | sanyaade-mobiledev/clusto | src/clusto/commands/attr.py | Python | bsd-3-clause | 5,122 |
# -*- coding: utf-8 -*-
"""
tests.appctx
~~~~~~~~~~~~
Tests the application context.
:copyright: (c) 2016 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
def test_basic_url_generation():
app = flask.Flask(__name__)
app.config['SERVER_NAME'... | Parkayun/flask | tests/test_appctx.py | Python | bsd-3-clause | 4,034 |
class Printer(object):
"""
"""
def __init__(self):
self._depth = -1
self._str = str
self.emptyPrinter = str
def doprint(self, expr):
"""Returns the pretty representation for expr (as a string)"""
return self._str(self._print(expr))
def _print(self, expr):
... | certik/sympy-oldcore | sympy/printing/printer.py | Python | bsd-3-clause | 847 |
#! /usr/bin/env python
#
# Copyright (C) 2016 Rich Lewis <rl403@cam.ac.uk>
# License: 3-clause BSD
import pytest
import numpy as np
from ...core import Mol, Atom
@pytest.fixture
def m():
return Mol.from_smiles('CC')
@pytest.fixture
def mk(m):
m.props['test'] = 'value'
return m
@pytest.fixture
def ma(m... | richlewis42/scikit-chem | skchem/test/test_core/test_base.py | Python | bsd-3-clause | 2,637 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('fruit', '0002_fruit_cover_image'),
]
operations = [
migrations.AlterField(
model_na... | jsmesami/naovoce | src/fruit/migrations/0003_added_indexes.py | Python | bsd-3-clause | 702 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tortuga documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 9 16:36:12 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | asweigart/tortuga | docs/conf.py | Python | bsd-3-clause | 8,154 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008, Stephen Hansen
# Copyright (c) 2009, Robert Corsaro
# Copyright (c) 2010, Steffen Hoffmann
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | dokipen/trac-announcer-plugin | announcer/resolvers/specified.py | Python | bsd-3-clause | 3,186 |
import MySQLdb
import csv
import cStringIO
import codecs
import pprint
from datetime import datetime
from decimal import *
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getre... | emCOMP/twitter-mysql | bin/simple_import.py | Python | bsd-3-clause | 6,719 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-05-01 23:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import sentry.db.models.fields.bounded
import sentry.db.models.fields.foreignkey
class Migration(mig... | beeftornado/sentry | src/sentry/migrations/0072_alert_rules_query_changes.py | Python | bsd-3-clause | 4,530 |
import datetime
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
import reversion
from users.models import Lageruser
from devicetypes.models import Type
from devicegroups.models import Devicegroup
from locations.models... | vIiRuS/Lagerregal | devices/models.py | Python | bsd-3-clause | 10,243 |
import networkx as nx
import numpy as np
def bipartite_region_tracking(partition, optical_flow, reliability,
matching_th=0.1, reliability_th=0.2):
"""
Parameters
----------
partition: numpy array
A 3D label array where each label represents a region
optical_flow: numpy arra... | guillempalou/scikit-cv | skcv/video/segmentation/region_tracking.py | Python | bsd-3-clause | 3,595 |
# proxy module
from __future__ import absolute_import
from apptools.preferences.i_preferences import *
| enthought/etsproxy | enthought/preferences/i_preferences.py | Python | bsd-3-clause | 103 |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | yugang/crosswalk-test-suite | stability/wrt-stablonglast3d-tizen-tests/inst.wgt.py | Python | bsd-3-clause | 7,390 |
from django.contrib.auth.models import User
from django.contrib.contenttypes import models
from django.core import exceptions
from rest_framework import viewsets, generics
from rest_framework.views import APIView
from rest_framework.authtoken.models import Token
from rest_framework import authentication
from rest_fram... | praekelt/django-admin-api | adminapi/api/views.py | Python | bsd-3-clause | 3,675 |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... | DLR-SC/DataFinder | src/datafinder/gui/admin/datastore_configuration_wizard/gridftp/__init__.py | Python | bsd-3-clause | 1,999 |
import sys
import json
import itertools
import sympy
from sympy.core.function import FunctionClass
import docutils.core
import diffsteps
import intsteps
class ResultCard(object):
"""
Operations to generate a result card.
title -- Title of the card
result_statement -- Statement evaluated to get resul... | debugger22/sympy_gamma | app/logic/resultsets.py | Python | bsd-3-clause | 34,531 |
"""
Extend or modify the navigation with custom entries.
This extension allows the website administrator to select an extension
which processes, modifies or adds subnavigation entries. The bundled
``feincms_nav`` template tag knows how to collect navigation entries,
be they real Page instances or extended navigation e... | feincms/feincms | feincms/module/page/extensions/navigation.py | Python | bsd-3-clause | 5,296 |
"""This module provides utility classes and functions to load spike sorting
data sets."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
import os.path
import re
from collections import ... | klusta-team/kwiklib | kwiklib/dataio/loader.py | Python | bsd-3-clause | 17,513 |
#!/usr/bin/env python
#-*-coding:utf-8-*-
from evaluator import Evaluator
from loader import Loader
import matplotlib.pyplot as plt
from confidence_weighted import ConfidenceWeighted
def graph_plot(plt_obj, show=False):
plt_obj.ylim(0, 1)
plt_obj.xlabel("Number of trials")
plt_obj.ylabel("Accuracy")
... | smrmkt/online_learning_algorithms | exec_cw.py | Python | bsd-3-clause | 1,188 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="Test_project",
version="0.1.0",
author="John Smith",
author_email="wykop@wykop.pl",
packages=[
"... | ad-m/cookiecutter-demo | setup.py | Python | bsd-3-clause | 489 |
__author__ = 'lisa_stillwell'
from unittest import TestCase
from hs_core.hydroshare import resource
from hs_core.hydroshare import users
from hs_core.models import GenericResource
from django.contrib.auth.models import User
import datetime as dt
class TestSetAccessRules(TestCase):
def setUp(self):
# cre... | hydroshare/hydroshare_temp | hs_core/tests/api/native/test_set_access_rules.py | Python | bsd-3-clause | 5,046 |
from django.apps import AppConfig
class VesperConfig(AppConfig):
name = 'vesper' | Merino/poc-cbb | vesper/apps.py | Python | bsd-3-clause | 86 |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.ConfFiles import ConfFile, ConfFiles
from PLC.Auth import Auth
can_update = lambda field_value: field_value[0] not in \
['conf_file_id', 'node_ids', 'nodegroup_ids']
class AddConfFile(Method):
"... | dreibh/planetlab-lxc-plcapi | PLC/Methods/AddConfFile.py | Python | bsd-3-clause | 1,107 |
"""
Generates list of current authors
Run the script in the main sympy repo.
Copy authors.tex in the tutorial repo.
"""
def generate_authors_list():
authors = []
with open('AUTHORS') as f:
for line in f:
if line.strip().endswith('>'):
aut = line.split('<')[0].strip() + '\\\... | leosartaj/scipy-2016-tutorial | slides/authors.py | Python | bsd-3-clause | 1,404 |
# -*- encoding: utf-8 -*-
"""
TODO:
* Fix problems with Issue 2510, ascii printing using unicode
* Address Issue 2251, printing of spin states
"""
from sympy.physics.quantum.anticommutator import AntiCommutator
from sympy.physics.quantum.cg import CG, Wigner3j
from sympy.physics.quantum.commutator import Commutator
fro... | ichuang/sympy | sympy/physics/quantum/tests/test_printing.py | Python | bsd-3-clause | 27,828 |
#coding=utf-8
import json
from django import forms
from django.contrib import admin
from django.core.exceptions import FieldError, ObjectDoesNotExist
from django.http import (HttpResponse, HttpResponseRedirect,
HttpResponseBadRequest, HttpResponseForbidden)
from django.shortcuts import render_to_response
from djan... | nickburlett/feincms_gallery | gallery/admin.py | Python | bsd-3-clause | 5,892 |
from django.conf import settings
from django.conf.urls import include, url
from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
from booth.views import HomepageView
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('allauth.ur... | uucastine/soundbooth | soundbooth/urls.py | Python | bsd-3-clause | 658 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['PolyTrend'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_PolyTrend_Seasonal_DayOfMonth_LSTM.py | Python | bsd-3-clause | 166 |
# -*- coding: utf-8 -*-
#
# Tupelo documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 9 09:29:36 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | uw-dims/tupelo | docs/source/conf.py | Python | bsd-3-clause | 10,490 |
"""
This is a custom solr_backend for haystack. It fixes a few minor issues
with the out-of-the-box version.
1. Overrides the SolrSearchBackend._process_results() method. The
out-of-the-box haystack version uses pysolr._to_python() to parse any
results for indexes that aren't managed by haystack. This method for... | unt-libraries/catalog-api | django/sierra/sierra/solr_backend.py | Python | bsd-3-clause | 11,551 |
from __future__ import absolute_import
import logging
import six
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.http import (
HttpResponse,
HttpResponseBadRequest,
HttpResponseNotFound,
HttpResponseRedirect,
)
from django.middleware.csrf import... | mvaled/sentry | src/sentry/web/frontend/base.py | Python | bsd-3-clause | 20,548 |
from django import forms
from django.utils.translation import ugettext_lazy as _
class GroundtruthRecordFormMixin(forms.ModelForm):
def clean(self):
cleaned_data = super(GroundtruthRecordFormMixin, self).clean()
contact_email = cleaned_data.get('contact_email', None)
contact_phone = clean... | 596acres/django-livinglots-groundtruth | livinglots_groundtruth/forms.py | Python | bsd-3-clause | 569 |
from chatterbot.adapters import Adapter
from chatterbot.adapters.exceptions import AdapterNotImplementedError
class IOAdapter(Adapter):
"""
This is an abstract class that represents the interface
that all input-output adapters should implement.
"""
def process_input(self):
"""
Ret... | DarkmatterVale/ChatterBot | chatterbot/adapters/io/io.py | Python | bsd-3-clause | 594 |
from recipe_engine import recipe_test_api
class BisectTesterTestApi(recipe_test_api.RecipeTestApi):
@recipe_test_api.mod_test_data
@staticmethod
def tempfile(tempfile):
return tempfile
def __call__(self, tempfile):
return self.tempfile(tempfile)
| eunchong/build | scripts/slave/recipe_modules/bisect_tester/test_api.py | Python | bsd-3-clause | 266 |
"""
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: Simplified BSD
import os
import csv
import shutil
from os import environ
from os.... | sgenoud/scikit-learn | sklearn/datasets/base.py | Python | bsd-3-clause | 17,305 |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | Kleptobismol/scikit-bio | skbio/sequence/tests/test_sequence.py | Python | bsd-3-clause | 56,349 |
from chunked_uploads.models import Upload, Chunk
def handle_upload(uploaded_file, who):
"""
Expects to handle an individual file from request.FILES[name]
Returns an Upload object
"""
u = Upload.objects.create(
user=who,
filename=uploaded_file.name,
filesize=uploaded_file.s... | eldarion/django-chunked-uploads | chunked_uploads/utils.py | Python | bsd-3-clause | 531 |
from __future__ import print_function, division, absolute_import
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import os
import sys
__all__ = ['InceptionResNetV2', 'inceptionresnetv2']
pretrained_settings = {
'inceptionresnetv2': {
'imagenet': {
'url': 'http://da... | Cadene/pretrained-models.pytorch | pretrainedmodels/models/inceptionresnetv2.py | Python | bsd-3-clause | 12,055 |
"""
Health check endpoint
"""
from flask import Blueprint
HEALTHCHECK = Blueprint('healthcheck', __name__)
@HEALTHCHECK.route('/comments/health_check')
def healthcheck():
"""
Returns 200
"""
return 'OK'
| miljkovicivan/MicroComments | app/healthcheck.py | Python | bsd-3-clause | 222 |
## -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.core.cache import cache
from django.http.cookie import SimpleCookie
from django.test import TestCase
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from django.urls i... | praekelt/django-ultracache | ultracache/tests/test_base.py | Python | bsd-3-clause | 25,296 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from catapult_build import html_checks
class MockAffectedFile(object):
def __init__(self, path, lines):
self.path = path
self.l... | SummerLW/Perf-Insight-Report | catapult_build/html_checks_unittest.py | Python | bsd-3-clause | 2,443 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, glob
import warnings
from setuptools import setup, find_packages
with open("README.rst") as f:
long_description = f.read()
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
with open('requirements_doc.txt') as f:
doc_... | JuliaSprenger/python-odmltables | setup.py | Python | bsd-3-clause | 2,563 |
"""Configuration schema(s) for Raven."""
import colander
class ConfigurationSchema(colander.Schema):
"""Configuration for Raven, the official Sentry client."""
RAVEN_CONFIG = colander.SchemaNode(
colander.Mapping(unknown='raise'),
missing=colander.required,
default=colander.null,
... | benoitbryon/django-confit | django_confit/schemas/raven/contrib/django/raven_compat.py | Python | bsd-3-clause | 713 |
import six
import json
from userjs.userjs_settings import JSON_HANDLERS
def _json_handlers(obj):
"""Extra handlers that JSON aren't able to parse.
The only built-in conversion is for datetime. User configured handlers
are tried for other types. If they all fail, raise TypeError.
"""
if hasattr... | tweekmonster/django-userjs | userjs/utils.py | Python | bsd-3-clause | 1,325 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from functools import partial
from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION
from ..utils.exceptions import AstropyUserWarning
from ..utils.console import human_file_size
from ..utils.decorators impor... | funbaker/astropy | astropy/convolution/convolve.py | Python | bsd-3-clause | 35,929 |
from bokeh.plotting import figure
from bokeh.models import Legend, LegendItem, HoverTool, ColumnDataSource
from bokeh.core.properties import value
def plot_interactive(dataframe):
observations = list(dataframe.index)
samples_or_groups = list(dataframe.columns)
transposed_df = dataframe.T
... | bassio/omicexperiment | omicexperiment/plotting/plot_bokeh.py | Python | bsd-3-clause | 2,474 |
#!/usr/bin/env python
from nipy.neurospin.register.iconic_matcher import IconicMatcher
from nipy.io.imageformats import load as load_image
from os.path import join
import numpy as np
"""
Example of running affine matching on the 'sulcal2000' database
"""
##rootpath = 'D:\\data\\sulcal2000'
rootpath = '/neurospin/l... | yarikoptic/NiPy-OLD | examples/neurospin/need_data/block_matching.py | Python | bsd-3-clause | 1,238 |
"""empty message
Revision ID: 46c97aa9285d
Revises: None
Create Date: 2015-01-20 10:34:38.095562
"""
# revision identifiers, used by Alembic.
revision = '46c97aa9285d'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | chudichudichudi/neuro-tedx-2 | migrations/versions/46c97aa9285d_.py | Python | bsd-3-clause | 1,843 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import webapp2
import webtest
... | endlessm/chromium-browser | third_party/catapult/dashboard/dashboard/edit_bug_labels_test.py | Python | bsd-3-clause | 2,381 |
#!/usr/bin/env python
# Copyright 2018 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 glob
import os
import shutil
import subprocess
import sys
netlog_viewer_root_path = os.path.abspath(
os.path.join(os.pa... | endlessm/chromium-browser | third_party/catapult/netlog_viewer/netlog_viewer_build/build_for_appengine.py | Python | bsd-3-clause | 1,450 |