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 |
|---|---|---|---|---|---|
# proxy module
from __future__ import absolute_import
from envisage.plugins.remote_editor.i_remote_editor import *
| enthought/etsproxy | enthought/plugins/remote_editor/i_remote_editor.py | Python | bsd-3-clause | 115 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("DecisionTreeClassifier" , "FourClass_500" , "sqlite")
| antoinecarme/sklearn2sql_heroku | tests/classification/FourClass_500/ws_FourClass_500_DecisionTreeClassifier_sqlite_code_gen.py | Python | bsd-3-clause | 151 |
# Standard library imports
from io import BytesIO
# Django & Tastypie imports
from django.utils.encoding import force_unicode
from tastypie.bundle import Bundle
from tastypie.serializers import Serializer, get_type_string
# External imports
import defusedxml.lxml as lxml
from lxml.etree import Element, tostring, Lxm... | gmimano/commcaretest | corehq/apps/api/serializers.py | Python | bsd-3-clause | 4,533 |
#!/usr/bin/env python
import rosunit
import unittest
import re
from flexbe_core.core.user_data import UserData
from .logger import Logger
from .test_interface import TestInterface
from .test_context import TestContext, LaunchContext
from .data_provider import DataProvider
class Tester(object):
def __init__(sel... | team-vigir/flexbe_behavior_engine | flexbe_testing/src/flexbe_testing/tester.py | Python | bsd-3-clause | 7,123 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Testing read image, wait, show image, save image.
Author: Neil Han
"""
from __future__ import absolute_import, division, \
print_function, unicode_literals
import cv2
cv2.namedWindow('WorkAroundTheCoreDump')
cv2.destroyWindow('WorkAroundTheCoreDump')
import num... | neilhan/python_cv_learning | 01-image/run_me.py | Python | bsd-3-clause | 1,033 |
from IPython.core import ipapi
from IPython.core import macro
ip = ipapi.get()
import os,pprint
def export(filename = None):
lines = ['import IPython.core.ipapi', 'ip = IPython.core.ipapi.get()','']
vars = ip.db.keys('autorestore/*')
vars.sort()
varstomove = []
get = ip.db.get
macros = ... | sodafree/backend | build/ipython/IPython/quarantine/ipy_exportdb.py | Python | bsd-3-clause | 2,037 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytak.call as call
import pytak.runners.tools as tools
from fakeapi import CreateTag
from fakeapi import GetInformationAboutYourself
from fakeapi import CreateAPost
new_request_body = {
"title" : "New Employee [XXXXX]",
"body" : "Please w... | zlatozar/pytak | pytak/tests/call_test.py | Python | bsd-3-clause | 2,316 |
# $Id$
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code f... | jandom/rdkit | rdkit/Chem/Pharm2D/UnitTestGobbi.py | Python | bsd-3-clause | 5,595 |
from pillowtop.logger import pillow_logging
from pillowtop.processors.interface import PillowProcessor
class NoopProcessor(PillowProcessor):
"""
Processor that does absolutely nothing.
"""
def process_change(self, pillow_instance, change):
pass
class LoggingProcessor(PillowProcessor):
"... | qedsoftware/commcare-hq | corehq/ex-submodules/pillowtop/processors/sample.py | Python | bsd-3-clause | 1,108 |
from diamondash.widgets.dynamic.dynamic import (
DynamicWidgetConfig,
DynamicWidget)
__all__ = [
'DynamicWidgetConfig',
'DynamicWidget']
| praekelt/diamondash | diamondash/widgets/dynamic/__init__.py | Python | bsd-3-clause | 154 |
from __future__ import absolute_import
import logbook
import logging
import threading
import datetime
import time
from appenlight_client.ext.logging import EXCLUDED_LOG_VARS
from appenlight_client.timing import get_local_storage
from appenlight_client.utils import asbool, parse_tag, PY3
log = logging.getLogger(__name... | jpwilliams/appenlight-client-python | appenlight_client/ext/logging/logbook.py | Python | bsd-3-clause | 3,050 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os
__all__ = ['init', 'deinit', 'out']
def _call_colorama(func_name, silent=True):
try:
import colorama
except ImportError:
# POSIX systems do not really require colorama (only Window... | uranusjr/palpatine | palpatine/utils.py | Python | bsd-3-clause | 2,116 |
# $HeadURL$
import sys
def test_import():
""" Test to make sure the project imports OK.
"""
import pp.testing
def test_app():
""" Test the command-line app runs OK.
"""
from pp.testing.scripts import app
sys.argv = []
app.main()
if __name__ == '__main__':
# Run this tet file th... | pythonpro-dev/pp-testing | tests/unit/test_sample.py | Python | bsd-3-clause | 415 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['RelativeDifference'] , ['MovingMedian'] , ['BestCycle'] , ['AR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_RelativeDifference/model_control_one_enabled_RelativeDifference_MovingMedian_BestCycle_AR.py | Python | bsd-3-clause | 163 |
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core import mail
from django.test import TestCase
from registration.models import RegistrationProfile
class TestRegistration(TestCase):
def test_activation_email(self):
site = Site.objects.get()
us... | django/djangoproject.com | djangoproject/test_registration.py | Python | bsd-3-clause | 1,304 |
# Imports from Django
from django.db import models
# Imports from brubeck
from brubeck.blogs.widgets import ColorPickerWidget
class ColorField(models.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 10
super(ColorField, self).__init__(*args, **kwargs)
def for... | albatrossandco/brubeck_cms | brubeck/blogs/fields.py | Python | bsd-3-clause | 588 |
from .meta import AbstractTracePublicCallsMeta, DefaultTraceAbstractMeta, DefaultTraceMeta, TraceAllPublicCallsMeta
from .trace_call import trace_call
from .tuning import limit_trace_arguments, disable_trace
assert AbstractTracePublicCallsMeta
assert DefaultTraceAbstractMeta
assert DefaultTraceMeta
assert TraceAllPubl... | ppolewicz/logfury | src/logfury/v0_1/__init__.py | Python | bsd-3-clause | 400 |
from django.db.models import Model, CharField, URLField
from django.template.loader import get_template
from django.utils.translation import ugettext as _
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore import blocks
from wagtail.wagtailembeds.blocks import EmbedBlock
from wagtail.wagtailimages.blo... | jeremy-c/unusualbusiness | unusualbusiness/utils/models.py | Python | bsd-3-clause | 7,002 |
"""
clipocr1.py
Demonstrates a technique that often improves ocr quality on screen captures.
Reads an image from the system clipboard,
and writes to stdout various versions of the text recognized in the image.
Uses tesseract OCR.
The technique is based on judicious rescaling of image dimensions.
... | cniswander/clipocr | clipocr1.py | Python | bsd-3-clause | 6,229 |
class BaseViewTest:
def login(self, user, testapp):
res = testapp.get('/')
form = res.forms['loginForm']
form['email'] = user.email
form['password'] = 'example'
return form.submit().follow()
| Rdbaker/WPI-IFC | tests/utils.py | Python | bsd-3-clause | 235 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
import:
Budżet środków europejskich w układzie tradycyjnym
flat structure (each data unit is a separate doc in the collection)
parenting is archieved through 'parent' key
bulk of files:
- this file (budgeutr.py)
- data file CSV, produced from XLS (for example, budgeutr.c... | CCLab/Raw-Salad | scripts/db/budget/budgeutr.py | Python | bsd-3-clause | 11,394 |
"""
These are a set of drivers for the XL-MaxSonar EZ series of sonar modules.
The devices have a few different ways of reading from them, and the these drivers attempt to cover
some of the methods
"""
import wpilib
from . import driver_base
from . import units
class MaxSonarEZPulseWidth(wpilib.SensorBase, driver_ba... | Twinters007/robotpy-wpilib-utilities | robotpy_ext/common_drivers/xl_max_sonar_ez.py | Python | bsd-3-clause | 2,749 |
# Authors : Denis A. Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License : BSD 3-clause
import os.path as op
import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_equal, assert_... | rkmaddox/mne-python | mne/time_frequency/tests/test_stockwell.py | Python | bsd-3-clause | 5,639 |
from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from nose.tools import assert_true
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
eigen_sol... | cdegroc/scikit-learn | sklearn/manifold/tests/test_isomap.py | Python | bsd-3-clause | 4,072 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, Calour development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------... | RNAer/Calour | calour/tests/test_amplicon_experiment.py | Python | bsd-3-clause | 7,382 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.db import models
from django.contrib.auth.models import AbstractUser
from dataloader.models import Affiliation
class User(AbstractUser):
affiliation_id = models.IntegerField(null=True) # Temporarily nullab... | ODM2/ODM2WebSDL | src/accounts/models.py | Python | bsd-3-clause | 910 |
"""Operator classes for eval.
"""
from datetime import datetime
from distutils.version import LooseVersion
from functools import partial
import operator as op
import numpy as np
from pandas._libs.tslibs import Timestamp
from pandas.compat import PY3, string_types, text_type
from pandas.core.dtypes.common import is_... | MJuddBooth/pandas | pandas/core/computation/ops.py | Python | bsd-3-clause | 16,387 |
ownerclass = 'AppDelegate'
ownerimport = 'AppDelegate.h'
# Init
result = Window(330, 110, "Tell me your name!")
nameLabel = Label(result, text="Name:")
nameLabel.width = 45
nameField = TextField(result, text="")
helloLabel = Label(result, text="")
button = Button(result, title="Say Hello", action=Action(owner, 'sayHel... | hsoft/xibless | demos/localized/MainWindow.py | Python | bsd-3-clause | 820 |
#!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2013, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------------... | wasade/qiita | setup.py | Python | bsd-3-clause | 3,898 |
from django.conf.urls.defaults import *
urlpatterns = patterns( 'databrowser.views',
( r'^$', 'app_page' ),
( r'^get_collections/$', 'get_collections' ),
( r'^get_init_data/$', 'get_init_data' ),
( r'^get_children/$', 'get_children' ),
( r'^store_state/$', 'store_state' ),
... | CCLab/RS_ref | rawsalad/databrowser/urls.py | Python | bsd-3-clause | 609 |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#
# Copyright (C) 2001,2003 greg Landrum and Rational Discovery LLC
#
""" unit tests for the QuantTree implementation """
from __future__ import print_function
import unittest
import io
from rdkit import RDConfig
from rdkit.ML.DecTree import BuildQuant... | jandom/rdkit | rdkit/ML/DecTree/UnitTestQuantTree.py | Python | bsd-3-clause | 7,485 |
from setuptools import find_packages, setup
import taggit
with open('README.rst') as f:
readme = f.read()
setup(
name='django-taggit',
version='.'.join(str(i) for i in taggit.VERSION),
description='django-taggit is a reusable Django application for simple tagging.',
long_description=readme,
... | izquierdo/django-taggit | setup.py | Python | bsd-3-clause | 1,278 |
import warnings
from pypeerassets.kutil import Kutil
from pypeerassets.protocol import Deck
from pypeerassets import pavoteproto
from hashlib import sha256
from binascii import unhexlify
from pypeerassets import transactions
from pypeerassets.pautils import read_tx_opreturn, find_tx_sender, get_block_info
from .network... | backpacker69/pypeerassets | pypeerassets/voting.py | Python | bsd-3-clause | 7,188 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bokeh/bokeh | tests/unit/bokeh/sampledata/test_gapminder.py | Python | bsd-3-clause | 2,214 |
import pycountry
from marshmallow import Schema, fields, ValidationError
def validate_currency_symbol(val):
if val not in [x.letter for x in pycountry.currencies.objects]:
raise ValidationError('Symbol is not valid')
class CategoryTypeField(fields.Field):
def _serialize(self, value, attr, obj):
... | monetario/core | monetario/serializers.py | Python | bsd-3-clause | 5,724 |
from __future__ import annotations
import itertools
import os
from collections.abc import Hashable, Iterable, Mapping, Sequence
from itertools import product
from typing import Any
import tlz as toolz
from .base import clone_key, get_name_from_key, tokenize
from .compatibility import prod
from .core import flatten, ... | blaze/dask | dask/blockwise.py | Python | bsd-3-clause | 56,476 |
# ------------------------------------------------------------------------------
# OCCAM
#
# Copyright © 2011-2012, SRI International
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redis... | Wajihulhassan/SelfContainedPrevirt | tools/occam/occam/targets/watch.py | Python | bsd-3-clause | 2,750 |
import sys
import pytest
from gmpy_cffi import (
log, log2, log10, exp, exp2, exp10, cos, sin, tan, sin_cos, sec, csc, cot,
acos, asin, atan, atan2, cosh, sinh, tanh, sinh_cosh, sech, csch, coth,
acosh, asinh, atanh, factorial, log1p, expm1, eint, li2, gamma, lngamma,
lgamma, digamma, zeta, erf, erfc,... | sn6uv/gmpy_cffi | tests/test_special_functions.py | Python | bsd-3-clause | 9,191 |
import numpy as np
from .basenode import BaseNode
from ..dataset import DataSet
from ..helpers import to_one_of_n
def _apply_sklearn(n, d, last_node=False):
if n.__module__.startswith('sklearn'):
# Use the most suitable function
if not last_node and hasattr(n, 'transform'):
X = n.transf... | wmvanvliet/psychic | psychic/nodes/chain.py | Python | bsd-3-clause | 3,338 |
"""Tests for the LTI discrete-time systems."""
from controlboros import StateSpace
import numpy as np
import pytest
def test_dynamics_single_input():
"""Test dynamics equation with single input."""
a = np.array([[1.0, 2.0], [0.0, 1.0]])
b = np.array([[1.0], [3.0]])
c = np.zeros((1, 2))
s = StateS... | mp4096/controlboros | controlboros/tests/test_state_space.py | Python | bsd-3-clause | 4,081 |
# -*- coding: utf-8 -*-
from yafowil.base import factory
def get_example():
part = factory(u'fieldset', name='yafowilwidgetautosuggest')
part['text'] = factory('field:label:error:autosuggest', props={
'label': 'Enter some text',
'source': sorted((u'Weißburgunder', u'Welschriesling',
... | bluedynamics/yafowil.widget.autosuggest | src/yafowil/widget/autosuggest/example.py | Python | bsd-3-clause | 501 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
""" Thi... | duyuan11/glumpy | examples/interpolations.py | Python | bsd-3-clause | 4,303 |
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.dev.utils import get_metadata_metrics
from . import common
@pytest.mark.e2e
def test_check_ok(dd_agent_check):
aggregator = dd_agent_check(rate=True)
metrics ... | DataDog/integrations-extras | calico/tests/test_e2e.py | Python | bsd-3-clause | 492 |
# for backward compatibility
from catkin_pkg.workspace_vcs import * # noqa
| ros/catkin | python/catkin/workspace_vcs.py | Python | bsd-3-clause | 76 |
# Part of django-hookbox
# Copyright 2011, Duane Griffin <duaneg@dghda.com>
from django.conf import settings
from django.dispatch import Signal
from django.http import HttpResponse
from django.template import loader, RequestContext
from django.views.decorators.csrf import csrf_exempt
import json
import logging
import... | duaneg/django-hookbox | djhookbox/views.py | Python | bsd-3-clause | 5,848 |
''' Script to reduce data files to create unit test fixtures.
'''
import tables as tb
def create_fixture(file_in, file_out, n_readouts, nodes):
with tb.open_file(file_in, 'r') as in_file:
with tb.open_file(file_out, 'w') as out_file:
in_file.copy_node('/configuration', out_file.root, recursiv... | SiLab-Bonn/pyBAR | pybar/testing/tools/create_fixture.py | Python | bsd-3-clause | 1,622 |
"""
A simple class to manage a piece of global science state. See
:ref:`config-developer` for more details.
"""
__all__ = ['ScienceState']
class ScienceState(object):
"""
Science state subclasses are used to manage global items that can
affect science results. Subclasses will generally override
`v... | AustereCuriosity/astropy | astropy/utils/state.py | Python | bsd-3-clause | 1,936 |
import functools
import operator
import os
import shutil
import sys
import zipfile
from click.testing import CliRunner
import py
import pytest
import numpy as np
from rasterio.crs import CRS
import rasterio
DEFAULT_SHAPE = (10, 10)
if sys.version_info > (3,):
reduce = functools.reduce
test_files = [os.path.j... | brendan-ward/rasterio | tests/conftest.py | Python | bsd-3-clause | 6,197 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-08-04 12:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('communities', '0013_auto_20160801_1241'),
]
operati... | yaniv14/OpenCommunity | src/communities/migrations/0014_auto_20160804_1517.py | Python | bsd-3-clause | 603 |
import logging
from aiohttp import web
from rororo import openapi_context, OperationTableDef
from rororo.openapi import get_validated_data, get_validated_parameters
from .data import NewPet
from .shortcuts import get_pet_or_404
logger = logging.getLogger(__name__)
# ``OperationTableDef`` is analogue of ``web.Rout... | playpauseandstop/rororo | examples/petstore/src/petstore/views.py | Python | bsd-3-clause | 1,841 |
# -*- coding: utf-8 -*-
"""
behelit
~~~~~~~~~~
Port of the behelit color scheme.
:copyright: Copyright 2011 oblique
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
... | oblique/pygments-style-behelit | pygments_style_behelit/__init__.py | Python | bsd-3-clause | 1,190 |
VERSION = '0.3.4'
import os
import sys
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ""
# Provided as an attrib... | agiliq/django-secure-login | setup.py | Python | bsd-3-clause | 4,784 |
# -*- coding: utf-8 -*-
"""
tests.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests regressions.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import gc
import sys
import threading
import pytest
from werkzeug.exceptions import NotFound
import flask
_gc_lock... | dawran6/flask | tests/test_regression.py | Python | bsd-3-clause | 2,409 |
# =============================================================================
# PROJECT CHRONO - http:#projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distri... | dariomangoni/chrono | src/demos/python/fea/demo_FEA_beams_constr.py | Python | bsd-3-clause | 10,735 |
import wx
import wx.html
from ..utils.generic_class import GenericClass
from ..utils.constants import control, dtype
from ..utils.validator import CharValidator
import pkg_resources as p
class VMHC(wx.html.HtmlWindow):
def __init__(self, parent, counter = 0):
from urllib2 import urlopen
wx.html.H... | sgiavasis/C-PAC | CPAC/GUI/interface/pages/vmhc.py | Python | bsd-3-clause | 3,737 |
"""Various miscellaneous functions to make code easier to read & write."""
import collections.abc
import copy
import functools
import inspect
import logging
import urllib.parse
import jsonpointer
import jsonschema
_logger = logging.getLogger("holocron")
def resolve_json_references(value, context, keep_unknown=True... | ikalnytskyi/holocron | src/holocron/_processors/_misc.py | Python | bsd-3-clause | 4,296 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
===============
scribus_textext
===============
:Author: Pauli Virtanen <pav@iki.fi>
:Date: 2007-06-17
:License: BSD
Scribus_textext is an extension for Scribus_ that allows adding
LaTeX-generated text objects to your SVG drawing. What's more, you can
also *edit* thes... | AidanDelaney/textext | scribus_textext.py | Python | bsd-3-clause | 8,695 |
# Copyright 2018 Google LLC.
#
# 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,
# this list of conditions and the following disclaimer.
#
#... | google/deepvariant | third_party/nucleus/io/gff.py | Python | bsd-3-clause | 5,818 |
__version_info__ = (1, 5, 5)
__version__ = '.'.join(str(v) for v in __version_info__)
__git_revno__ = "3b9cd7076b27f40eda31c1194e50801878237e90"
| rigdenlab/ample | ample/util/version.py | Python | bsd-3-clause | 145 |
from utils import *
from mpfit import *
| philrosenfield/ResolvedStellarPops | utils/__init__.py | Python | bsd-3-clause | 40 |
"""
Based on initial work from django-debug-toolbar
"""
import re
from datetime import datetime
try:
from django.db import connections
except ImportError:
# Django version < 1.2
from django.db import connection
connections = {'default': connection}
try:
from django.db.backends import utils
except... | coagulant/django-devserver | devserver/modules/sql.py | Python | bsd-3-clause | 5,755 |
# Tai Sakuma <tai.sakuma@cern.ch>
##__________________________________________________________________||
def LambdaStrFactory(lambda_str, LambdaStrClass, name = None, **kargs):
return LambdaStrClass(lambda_str = lambda_str.format(**kargs), name = name)
##___________________________________________________________... | TaiSakuma/AlphaTwirl | alphatwirl/selection/factories/LambdaStrFactory.py | Python | bsd-3-clause | 330 |
from setuptools import setup, find_packages
setup(
name="yamldown",
version="0.1.8",
packages=["yamldown"],
author="edouglass",
author_email="edouglass@lbl.gov",
url="https://github.com/dougli1sqrd/yamldown",
download_url="https://github.com/dougli1sqrd/yamldown/archive/0.1.8.tar.gz",
d... | dougli1sqrd/yamldown | setup.py | Python | bsd-3-clause | 555 |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | qiita-spots/qp-qiime2 | qp_qiime2/util.py | Python | bsd-3-clause | 1,804 |
from django.conf.urls.defaults import patterns
from qna import views
from qna.models import Question
from voting.views import xmlhttprequest_vote_on_object
urlpatterns = patterns('',
(r'^question/ask/$', views.ask),
(r'^question/(\d+)/$', views.question),
(r'^question/(\d+)/answer/$', views.answer),
(r... | fosslabs/django-qna | src/qna/urls.py | Python | bsd-3-clause | 536 |
from django.conf.urls import patterns, include, url
from django.conf.urls.defaults import handler404, handler500
from django.contrib import admin
from youtune import settings
from youtune.account import views as account_views, models as account_models
from youtune.frontend import views as frontend_views
from youtune.a... | Irrialite/YouTune | youtune/urls.py | Python | bsd-3-clause | 3,081 |
from django.forms.fields import *
from corehq.apps.sms.forms import BackendForm
from dimagi.utils.django.fields import TrimmedCharField
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
class TelerivetBackendForm(BackendForm):
api_key = TrimmedCharField()
pro... | gmimano/commcaretest | corehq/apps/telerivet/forms.py | Python | bsd-3-clause | 825 |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | tfroehlich82/picamera | picamera/camera.py | Python | bsd-3-clause | 173,859 |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Nov 7, 2011
@author: John Cornwell
@contact: JohnWCornwellV@gmail.com
@summary: File containing various fea... | grahesh/Stock-Market-Event-Analysis | qstkfeat/features.py | Python | bsd-3-clause | 19,635 |
import random
import pymel.core as pm
from impress import models, register
def randomTransform( translate=False, translateAmount=1.0, translateAxis=(False,False,False),
rotate=False, rotateAmount=1.0, rotateAxis=(False,False,False),
scale=False, scaleAmount=1.0, ... | kinetifex/maya-impress | examples/options_example.py | Python | bsd-3-clause | 2,324 |
# Copyright 2017 IoT-Lab Team
# Contributor(s) : see AUTHORS file
#
# 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,
# this list of conditions a... | pyaiot/pyaiot | pyaiot/gateway/common/node.py | Python | bsd-3-clause | 2,399 |
import os
import mock
from uuid import uuid4
from urllib.request import urlopen
import datetime
from django.test import TestCase
from django.core.files.base import ContentFile
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from boto.s3.key import Key
from storag... | peterseymour/django-storages-1.1.8 | storages/tests/s3boto.py | Python | bsd-3-clause | 8,692 |
from corehq.apps.users.models import CommCareUser
from corehq.apps.hqcase.management.commands.ptop_fast_reindexer import PtopReindexer
from corehq.pillows.user import UserPillow
CHUNK_SIZE = 500
POOL_SIZE = 15
class Command(PtopReindexer):
help = "Fast reindex of user elastic index by using the domain view and r... | gmimano/commcaretest | corehq/apps/users/management/commands/ptop_fast_reindex_users.py | Python | bsd-3-clause | 433 |
# 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.
import os
import socket
import subprocess
import sys
import urlparse
from telemetry import util
class TemporaryHTTPServer(object):
def __init__(self, ... | nacl-webkit/chrome_deps | tools/telemetry/telemetry/temporary_http_server.py | Python | bsd-3-clause | 1,660 |
from django.conf import settings
from model_bakery import baker
from rest_framework.test import APIRequestFactory, force_authenticate
class ApiTestMixin:
"""
Mixin class for API tests.
Can be used for ViewSets too. Just override :meth:`.get_as_view_kwargs` - se example in the docs
for that method.
... | devilry/devilry-django | devilry/devilry_statistics/tests/test_api/api_test_mixin.py | Python | bsd-3-clause | 2,945 |
import os
import sys
from setuptools import setup, find_packages
"A simple interface to GPIO devices with Raspberry Pi."
if sys.version_info[0] == 2:
if not sys.version_info >= (2, 7):
raise ValueError('This package requires Python 2.7 or above')
elif sys.version_info[0] == 3:
if not sys.version_info ... | lurch/python-gpiozero | setup.py | Python | bsd-3-clause | 3,407 |
#!/usr/bin/python
#
# Generic script to check how many images exist on the host
#
import sys
import json
import subprocess
# Configuration mode: return the custom metrics data should be defined
def config():
settings = {
"maxruntime": 30000, # How long the script is allowed to run
"period": 60, ... | CoScale/coscale-generic-scripts | docker/docker-images.py | Python | bsd-3-clause | 1,250 |
def first(l):
try:
return l.pop()
except Exception:
return None
| jdavisp3/TigerShark | tigershark/facade/utils.py | Python | bsd-3-clause | 88 |
# Generated by Django 2.2.17 on 2021-02-02 03:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0036_fix_reg_invoice_link'),
]
operations = [
migrations.AlterField(
model_name='regis... | django-danceschool/django-danceschool | danceschool/core/migrations/0037_remove_registration_expirationdate.py | Python | bsd-3-clause | 1,183 |
# -*- coding: utf-8 -*-
# pinched from django-moderation.
# modified to include rather than exclude, fields
import re
import difflib
def get_changes_between_models(model1, model2, include=[]):
from django.db.models import fields
changes = {}
for field_name in include:
field = type(model1)._meta.ge... | ixc/glamkit-eventtools | eventtools/utils/diff.py | Python | bsd-3-clause | 2,524 |
# 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.
"""Functions that deal with local and device ports."""
import contextlib
import fcntl
import httplib
import logging
import os
import socket
import trace... | SummerLW/Perf-Insight-Report | devil/devil/android/ports.py | Python | bsd-3-clause | 6,336 |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2016, Alex McClung
# 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 ... | clungzta/rsync_ros | src/rsync_server_node.py | Python | bsd-3-clause | 4,108 |
#!/usr/bin/env python3
#
# Copyright (c) 2004-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same direct... | neuhausler/fboss | fboss/py/fboss/cli/commands/l2.py | Python | bsd-3-clause | 1,208 |
#!/usr/bin/env python
"""\
Test the 2e integral code.
"""
from PyQuante.pyints import contr_coulomb as pycc
from PyQuante.rys import contr_coulomb as ryscc
from PyQuante.hgp import contr_coulomb as hgpcc
from PyQuante.cints import contr_coulomb as ccc
from PyQuante.crys import contr_coulomb as cryscc
from PyQuante.c... | berquist/PyQuante | Tests/integrals.py | Python | bsd-3-clause | 3,015 |
# Generated by Django 2.1.4 on 2019-02-21 01:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0087_auto_20190208_0326'),
]
operations = [
migrations.AlterField(
model_name='collection',
name='is_publ... | UITools/saleor | saleor/product/migrations/0088_auto_20190220_1928.py | Python | bsd-3-clause | 398 |
# ----------------------------------------------------------------------- #
# The OpenSim API is a toolkit for musculoskeletal modeling and #
# simulation. See http://opensim.stanford.edu and the NOTICE file #
# for more information. OpenSim is developed at Stanford University #
# and supported ... | jimmyDunne/perimysium | perimysium/modeling.py | Python | bsd-3-clause | 34,048 |
"""
Tests for contacts API cyclone server.
These tests are run against both the real implementation of the API and the
verified fake implementation in order to verify that both behave correctly.
"""
import json
import yaml
from twisted.internet.defer import inlineCallbacks, returnValue
from vumi.persist.txriak_mana... | praekelt/go-contacts-api | go_contacts/tests/test_server.py | Python | bsd-3-clause | 15,751 |
from django.contrib import admin
from courant.core.discussions.models import *
admin.site.register(CommentOptions)
admin.site.register(DefaultCommentOption)
| maxcutler/Courant-News | courant/core/discussions/admin.py | Python | bsd-3-clause | 165 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | certik/sympy-oldcore | sympy/plotting/pyglet/media/avbin.py | Python | bsd-3-clause | 16,204 |
from setuptools import setup
packages = ['multidb.' + p for p in
['replication', 'replication.management',
'replication.management.commands',
'feature', 'feature.management', 'feature.management.commands',
'backend',
]] + ['multidb']
setup(
name='mul... | woome/multidb | setup.py | Python | bsd-3-clause | 1,052 |
import numpy as np
import pytest
from astropy.table import Table
from numpy.testing import assert_allclose
import sncosmo
try:
import iminuit
HAS_IMINUIT = True
except ImportError:
HAS_IMINUIT = False
def test_bin_edges_linear():
"""Ensure that we can recover consistent bin edges for a spectrum ... | sncosmo/sncosmo | sncosmo/tests/test_spectrum.py | Python | bsd-3-clause | 6,754 |
# -*- coding: utf-8 -*-
#
# Bottle documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 18 18:09:50 2010.
#
# 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.
#
# All ... | ironexmaiden/csd_post_sw | docs/conf.py | Python | mit | 7,270 |
from openmc.mgxs.groups import EnergyGroups
from openmc.mgxs.library import Library
from openmc.mgxs.mgxs import *
from openmc.mgxs.mdgxs import *
| bhermanmit/openmc | openmc/mgxs/__init__.py | Python | mit | 147 |
# Django settings for testproj project.
import logging
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_SUPPORTS_TRANSACTIONS = True
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | webus/libthumbor | tests/testproj/settings.py | Python | mit | 2,850 |
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Simulation class
----------------
Select the simulation configuration based on a system (and its dynamic
model), environment and aircraft.
"""
import copy
import operator
import pand... | AlexS12/PyFME | src/pyfme/simulator.py | Python | mit | 6,523 |
from django.http import HttpResponseForbidden
from django.core.cache import get_cache
from uwsgi_it_api.config import UWSGI_IT_BASE_UID, UWSGI_IT_METRICS_CACHE
from uwsgi_it_api.decorators import need_basicauth
from uwsgi_it_api.utils import spit_json
import datetime
def metrics_container_do(request, container, qs, ... | Mikrobit/uwsgi.it | uwsgi_it_api/uwsgi_it_api/views_metrics.py | Python | mit | 7,226 |
# -*- coding: utf-8 -*-
"""Tests for pickle serialization and storage."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
from os.path import exists, join
from shutil import rmtree
i... | whutch/atria | tests/core/test_pickle.py | Python | mit | 3,789 |
# coding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
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(... | scibi/django-teryt | teryt/south_migrations/0002_auto__add_field_miejscowosc_aktywny__add_field_ulica_aktywny__add_fiel.py | Python | mit | 4,805 |
from pythonforandroid.recipe import NDKRecipe
from pythonforandroid.toolchain import shutil
from os.path import join
import sh
class Sqlite3Recipe(NDKRecipe):
version = '3.35.5'
# Don't forget to change the URL when changing the version
url = 'https://www.sqlite.org/2021/sqlite-amalgamation-3350500.zip'
... | kivy/python-for-android | pythonforandroid/recipes/sqlite3/__init__.py | Python | mit | 1,251 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0002_auto_20150730_2342'),
]
operations = [
migrations.CreateModel(
name='Face',
fi... | sjschmidt44/django-imager | imagersite/imager_images/migrations/0003_face.py | Python | mit | 822 |