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 |
|---|---|---|---|---|---|
from devault.versions.models import Version
from rest_framework import serializers
class VersionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Version
fields = ('name', 'created', 'modified')
| opportunitynetwork/devault | devault/devault/versions/serializers.py | Python | bsd-3-clause | 238 |
#!/usr/bin/python
import os
import shutil
from trac.util.compat import close_fds
# On Windows, shutil.rmtree doesn't remove files with the read-only
# attribute set, so this function explicitly removes it on every error
# before retrying. Even on Linux, shutil.rmtree chokes on read-only
# directories, so we... | i-rabot/tractogithub | tracformatter/trac/tests/functional/compat.py | Python | bsd-3-clause | 650 |
#!/usr/bin/python2.4
# Copyright 2009, 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... | rwatson/chromium-capsicum | o3d/tests/selenium/selenium_utilities.py | Python | bsd-3-clause | 11,831 |
#!/usr/bin/env python
# encoding: utf-8
"""
update/disease.py
Update the disease terms in database
Created by Måns Magnusson on 2017-04-03.
Copyright (c) 2017 __MoonsoInc__. All rights reserved.
"""
import logging
import os
import click
from flask.cli import current_app, with_appcontext
from scout.constants import... | Clinical-Genomics/scout | scout/commands/update/disease.py | Python | bsd-3-clause | 3,712 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, url
from .views import GuideList, GuideDetail, ContentDetail
urlpatterns = patterns('cacao.views',
url(r'^$', GuideList.as_view(), name="home"),
url(r'^guia/(?P<guide_numbe... | CacaoMovil/guia-de-cacao-django | cacao_app/cacao/urls.py | Python | bsd-3-clause | 1,231 |
"""
byceps.services.global_setting.dbmodels
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from ...database import db
from ...util.instances import ReprBuilder
class Setting(db.Model):
"""A global setting."""
__t... | homeworkprod/byceps | byceps/services/global_setting/dbmodels.py | Python | bsd-3-clause | 720 |
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from msp430.models import *
from tcp_comm.client import push_config
from msp430.models import MSP430
import json
@csrf_exempt
def register(request):
"""When an MSP430 connects to the TCP server this... | zlalanne/msp430-webcontrol | msp430webcontrol/tcp_comm/views.py | Python | bsd-3-clause | 2,798 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("XGBClassifier" , "FourClass_10" , "db2")
| antoinecarme/sklearn2sql_heroku | tests/classification/FourClass_10/ws_FourClass_10_XGBClassifier_db2_code_gen.py | Python | bsd-3-clause | 138 |
import codecs
import json
import os
import shutil
import socket
import subprocess
import tempfile
from contextlib import contextmanager
from cStringIO import StringIO
from django.conf import settings
from django.core import mail
from django.core.files.storage import default_storage as storage
from django.core.urlresol... | kumar303/zamboni | mkt/developers/tests/test_tasks.py | Python | bsd-3-clause | 24,331 |
# coding=utf-8
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.translation import ugettext_lazy as _
from models import WorkflowBase, State
from utils import get_wf_dict_value
def create_transition_method(transition_name, transit... | suselrd/django-wflow | workflows/decorators.py | Python | bsd-3-clause | 6,481 |
# -*- coding: utf-8 -*-
from factory import Sequence, PostGenerationMethodCall
from factory.alchemy import SQLAlchemyModelFactory
from phonedusk.user.models import User
from phonedusk.database import db
class BaseFactory(SQLAlchemyModelFactory):
class Meta:
abstract = True
sqlalchemy_session = db... | kevana/phonedusk-server | tests/factories.py | Python | bsd-3-clause | 606 |
import unittest
from ietfparse.datastructures import ContentType
class ContentTypeCreationTests(unittest.TestCase):
def test_that_primary_type_is_normalized(self):
self.assertEqual('contenttype',
ContentType('COntentType', 'b').content_type)
def test_that_subtype_is_normaliz... | dave-shawley/ietfparse | tests/test_datastructure.py | Python | bsd-3-clause | 3,585 |
from django.db.models import fields
from django.db import connection
from django.dispatch import receiver, Signal
from psycopg2.extras import register_composite
from psycopg2.extensions import register_adapter, adapt, AsIs
from psycopg2 import ProgrammingError
_missing_types = {}
class CompositeMeta(type):
def... | wlanslovenija/django-postgres | postgres/fields/composite.py | Python | bsd-3-clause | 1,779 |
def response(context, flow):
flow.response.headers['X-Frame-Options'] = [""]
#flow.response.headers["X-Frame-Options"] = [""]
flow.response.headers['mtmprx'] = ['1']
| westurner/browenv | scripts/mtmprx/mtmprx_headers.py | Python | bsd-3-clause | 180 |
import io
import sys
import pytest
import progressbar
def test_nowrap():
# Make sure we definitely unwrap
for i in range(5):
progressbar.streams.unwrap(stderr=True, stdout=True)
stdout = sys.stdout
stderr = sys.stderr
progressbar.streams.wrap()
assert stdout == sys.stdout
assert... | WoLpH/python-progressbar | tests/test_stream.py | Python | bsd-3-clause | 2,391 |
from reportlab.lib import styles
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
from reportlab.platypus import Preformatted, Paragraph, Frame, \
Image, Table, TableStyle, Spacer
def getParagraphStyles():
""... | nickpack/reportlab | tools/pythonpoint/styles/standard.py | Python | bsd-3-clause | 4,262 |
from pyrr import Vector3
from vistas.core.bounds import BoundingBox
class Object3D:
""" Partially abstract class defining the base API for interacting with 3D objects. """
def __init__(self):
self.position = Vector3([0.] * 3)
self.scale = Vector3([1.] * 3)
self.rotation = Vector3([0.... | VISTAS-IVES/pyvistas | source/vistas/core/graphics/object.py | Python | bsd-3-clause | 1,952 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='django-ostracker',
version='0.2.0-dev',
description='Django project for tracking Open Source projects',
author='James Turk',
author_email='jturk@sunlightfoundation.com',
license='BSD',
url='http://github.com/sunligh... | pombredanne/django-ostracker | setup.py | Python | bsd-3-clause | 502 |
import wx
from PIL import Image
from vistas.core.threading import Thread
from vistas.ui.controls.static_image import StaticImage
from vistas.ui.utils import make_window_transparent
LegendRenderEvent, EVT_LEGEND_RENDERED = wx.lib.newevent.NewEvent()
class LegendWindow(wx.Frame):
""" A window for showing a render... | VISTAS-IVES/pyvistas | source/vistas/ui/windows/legend.py | Python | bsd-3-clause | 8,666 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file
# Module with some simple but useful utilities for
# - timing
# - memory
# - profiling
# - ...
# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
# @date 2013-02-10
#
# =====... | OstapHEP/ostap | ostap/utils/utils.py | Python | bsd-3-clause | 57,489 |
from django.db import models
from cms.models import CMSPlugin
CLASS_CHOICES = ['container', 'content', 'teaser']
CLASS_CHOICES = tuple((entry, entry) for entry in CLASS_CHOICES)
TAG_CHOICES = [
'div', 'article', 'section', 'header', 'footer', 'aside',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6'
]
TAG_CHOICES = tuple... | rsalmaso/django-cms | cms/test_utils/project/pluginapp/plugins/style/models.py | Python | bsd-3-clause | 1,967 |
exec(open('functional/tests/_standalone_rst_defaults.py').read())
# Source and destination file names.
test_source = "standalone_rst_latex.txt"
test_destination = "standalone_rst_latex.tex"
# Keyword parameters passed to publish_file.
writer_name = "latex"
| spreeker/democracygame | external_apps/docutils-snapshot/test/functional/tests/standalone_rst_latex.py | Python | bsd-3-clause | 259 |
"""
GREP Plugin for Cookies Attributes
NOTE: GREP plugins do NOT send traffic to the target and only grep the HTTP Transaction Log
"""
from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Searches transaction DB for Cookie attributes"
def run(PluginInfo):
title = "This plugin looks for cookie setting head... | owtf/owtf | owtf/plugins/web/grep/Cookies_attributes@OWTF-SM-002.py | Python | bsd-3-clause | 557 |
"""
This module defines the database models for all in-game objects, that
is, all objects that has an actual existence in-game.
Each database object is 'decorated' with a 'typeclass', a normal
python class that implements all the various logics needed by the game
in question. Objects created of this class transparentl... | shollen/evennia | evennia/objects/models.py | Python | bsd-3-clause | 12,067 |
from django.contrib import admin
from feincms.admin import editor
from example.models import Category
class CategoryAdmin(editor.TreeEditor):
list_display = ('name', 'slug')
list_filter = ('parent',)
prepopulated_fields = {
'slug': ('name',),
}
admin.site.register(Category, CategoryAdmi... | hgrimelid/feincms | example/admin.py | Python | bsd-3-clause | 323 |
from apgl.graph.AbstractMatrixGraph import AbstractMatrixGraph
from apgl.graph.AbstractVertexList import AbstractVertexList
from apgl.graph.GeneralVertexList import GeneralVertexList
from apgl.graph.VertexList import VertexList
from apgl.util.Util import Util
from apgl.util.SparseUtils import SparseUtils
fro... | charanpald/APGL | apgl/graph/SparseGraph.py | Python | bsd-3-clause | 19,320 |
# 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/mqtt/gateway.py | Python | bsd-3-clause | 7,515 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Registry',
fields=[
('id', models.AutoField(ver... | zacherytapp/wedding | weddingapp/apps/registry/migrations/0001_initial.py | Python | bsd-3-clause | 1,051 |
"""
Extended docstrings for functions.py
"""
pi = r"""
`\pi`, roughly equal to 3.141592654, represents the area of the unit
circle, the half-period of trigonometric functions, and many other
things in mathematics.
Mpmath can evaluate `\pi` to arbitrary precision::
>>> from mpmath import *
>>> mp.dps = 50; m... | JensGrabner/mpmath | mpmath/function_docs.py | Python | bsd-3-clause | 280,518 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Category(models.Model):
parent = models.ForeignKey('self', related_name='parent_rel', null=True, verbose_name=_('parent'))
name = models.CharField(_('name'), max_length=200)
representation = models.CharField(_('repre... | caiges/populous | populous/categories/models.py | Python | bsd-3-clause | 2,279 |
from __future__ import print_function
from __future__ import absolute_import
from builtins import str
from builtins import range
from builtins import object
import random
import string
import copy
import types
import pandas
from . import pygraphistry
from . import util
class Plotter(object):
"""Graph plotting cl... | kcompher/pygraphistry | graphistry/plotter.py | Python | bsd-3-clause | 18,526 |
# 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/util/errors_test.py | Python | bsd-3-clause | 3,169 |
# -*- coding: utf-8 -*-
"""
XML object class
Hervé Déjean
cpy Xerox 2009
a class for TEXT from a XMLDocument
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .XMLDSObjectClass import XMLDSObjectClass
from .XMLDS... | Transkribus/TranskribusDU | TranskribusDU/ObjectModel/XMLDSTEXTClass.py | Python | bsd-3-clause | 12,221 |
import argparse
from phocnet.training.phocnet_trainer import PHOCNetTrainer
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# required training parameters
parser.add_argument('--doc_img_dir', action='store', type=str, required=True,
help='The location of the document ima... | ssudholt/phocnet | tools/train_phocnet.py | Python | bsd-3-clause | 4,914 |
import re
from django.db.backends import BaseDatabaseOperations
# This DatabaseOperations class lives in here instead of base.py because it's
# used by both the 'postgresql' and 'postgresql_psycopg2' backends.
class DatabaseOperations(BaseDatabaseOperations):
def __init__(self, connection):
super(Databas... | Smarsh/django | django/db/backends/postgresql/operations.py | Python | bsd-3-clause | 8,671 |
import logging
import pyrax
try:
import swiftclient
except ImportError:
pass
from cumulus.settings import CUMULUS
class Auth(object):
connection_kwargs = {}
use_pyrax = CUMULUS["USE_PYRAX"]
use_snet = CUMULUS["SERVICENET"]
region = CUMULUS["REGION"]
username = CUMULUS["USERNAME"]
api_... | ImaginaryLandscape/django-cumulus | cumulus/authentication.py | Python | bsd-3-clause | 5,330 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['MovingMedian'] , ['Seasonal_DayOfWeek'] , ['SVR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_MovingMedian_Seasonal_DayOfWeek_SVR.py | Python | bsd-3-clause | 165 |
# -*- coding: utf-8 -*-
"""
celery.backends.database.dfd042c7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQLAlchemy 0.5.8 version of :mod:`~celery.backends.database.a805d4bd`,
see the docstring of that module for an explanation of why we need
this workaround.
"""
from __future__ import absolute_import
fro... | mozilla/firefox-flicks | vendor-local/lib/python/celery/backends/database/dfd042c7.py | Python | bsd-3-clause | 1,554 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'FilerFile.file'
db.alter_column(u'cmsplugin_filer_file... | nephila/cmsplugin-filer | cmsplugin_filer_file/south_migrations/0005_auto__chg_field_filerfile_file.py | Python | bsd-3-clause | 10,023 |
# Copyright (c) <2015> <Sergi Delgado Segura>
# Distributed under the BSD software license, see the accompanying file LICENSE
import pycurl
import stem.process
from stem.control import Controller
from stem.util import term
from StringIO import StringIO
__author__ = 'sdelgado'
SOCKS_PORT = 9050
CONTROL_PORT = 9051
... | sr-gi/paysense | utils/tor/tools.py | Python | bsd-3-clause | 2,930 |
import re
import pytest
from gmpy_cffi import version, mp_version, mpfr_version, mpc_version
class TestVersion:
def test_version(self):
s = version()
assert isinstance(s, str)
assert re.match(r'\d\.\d\.\d', s)
def test_mp_version(self):
s = mp_version()
assert isinsta... | sn6uv/gmpy_cffi | tests/test_version.py | Python | bsd-3-clause | 629 |
# -*- coding: utf8 -*-
"""
...
"""
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
import itertools
import logging
# PY2 & PY3 — compatibility
from builtins import map, zip
from shot_detector.handlers imp... | w495/python-video-shot-detector | shot_detector/charts/event/base/base_event_chart.py | Python | bsd-3-clause | 6,299 |
from contextlib import contextmanager
from collections import OrderedDict as d
import textwrap
from vertigo.graph import PlainGraphNode, plain_copy, ObjectGraphNode
from vertigo.graph import Graphable, GraphableGraphNode
from vertigo.misc_fns import subgraph, ascii_tree, map
import vertigo.zip_fns as vgz
@contextmana... | dplepage/vertigo | tests/tests.py | Python | bsd-3-clause | 7,415 |
"""Middleware used by freelancefinder."""
| ScorpionResponse/freelancefinder | freelancefinder/freelancefinder/middleware/__init__.py | Python | bsd-3-clause | 42 |
"""
The basic forms of Shannon's information measures.
"""
from .shannon import (entropy,
conditional_entropy,
mutual_information,
entropy_pmf)
| dit/dit | dit/shannon/__init__.py | Python | bsd-3-clause | 211 |
# -*- python -*-
# Copyright (c) 2012 The Native Client 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 gdb_test import AssertEquals
import gdb_test
def test(gdb):
gdb.Command('break set_global_var')
AssertEquals(gdb.ResumeC... | leighpauls/k2cro4 | native_client/tests/gdb/print_symbol.py | Python | bsd-3-clause | 694 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pygesture/ui/templates/new_session_template.ui'
#
# Created by: PyQt5 UI code generator 5.5
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_NewSessionDialog(object):
def setu... | ixjlyons/pygesture | pygesture/ui/templates/new_session_template.py | Python | bsd-3-clause | 6,242 |
"""Manage static information associated with tiles, programs and passes.
Each tile has an assigned program name. The program names
(DARK, BRIGHT) are predefined in terms of conditions on the
ephemerides, but not all programs need to be present in a tiles file.
Pass numbers are arbitrary integers and do not need to be ... | desihub/desisurvey | py/desisurvey/tiles.py | Python | bsd-3-clause | 19,547 |
# Copyright (C) 2015, University of British Columbia
# Written (originally) by Mark Greenstreet (13th March, 2014)
# Editted by Yan Peng (11th Nov. 2016)
#
# License: A 3-clause BSD license.
# See the LICENSE file distributed with this software
import collections
import ACL2_to_Z3
import z3
def prod(stuff)... | pennyan/Smtlink | z3_interface/RewriteExpt.py | Python | bsd-3-clause | 15,337 |
import math
from sqlalchemy.sql import expression
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import DateTime
from blazeutils.strings import randchars
from keg.db import db
class utcnow(expression.FunctionElement):
type = DateTime()
@compiles(utcnow, 'postgresql')
def _pg_utcnow(element... | nZac/keg-elements | keg_elements/db/utils.py | Python | bsd-3-clause | 2,393 |
# IPython log file
with open('request.txt', mode='r') as fin:
wells = [line.strip() for line in fin]
wells
plates = ['_'.join(well.split('_')[:2]) for well in wells]
plates
set.intersection(plates, os.listdir('/Volumes/King-Ecad-Screen-Tiffs2/tiffs/'))
set.intersection(set(plates), set(os.listdir('/Volumes/K... | jni/useful-histories | maree-faux-data.py | Python | bsd-3-clause | 2,032 |
from unittest import TestCase
from stockpyle._base import BaseStore
class ProcessMemoryStoreTestCase(TestCase):
def test_must_implement_storage_methods(self):
class MyStore(BaseStore):
pass
class Foo(object):
pass
... | mjpizz/stockpyle | tests/test_base_store.py | Python | bsd-3-clause | 923 |
from astropy.io import fits
from astropy.wcs import WCS
import numpy as np
import matplotlib
import os
import glob
from findSN import *
from matplotlib.ticker import AutoMinorLocator
import sys
sys.path.insert(0, '/home/afsari/')
from SNAP2.Analysis import *
current_path=os.path.dirname(os.path.abspath(__file__))
matp... | niliafsari/KSP-SN | Lbolcorr.py | Python | bsd-3-clause | 11,518 |
import unittest
import UniDomain.Classes as Classes
#---- unittest Test Classes below here
class TestConfig(unittest.TestCase):
"""Test Config Class"""
def test_Config(self):
"""Check if required config defaults are set"""
self.config = Classes.Config()
self.assertTrue('plugin_authen' ... | spahan/unixdmoain | lib/test/Classes.py | Python | bsd-3-clause | 1,575 |
import datetime, os
import operator
import six
from email.utils import parseaddr
from form_utils.forms import BetterModelForm
from django import forms
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.query import QuerySet
from django.forms.util import ErrorLi... | wpjesus/codematch | ietf/liaisons/forms.py | Python | bsd-3-clause | 26,264 |
# You can edit these settings and save them, they
# will be applied immediately and remembered for next time.
# This will reset the interpreter.
# ******************************************************************************* #
# If changing these settings makes the interpreter unrecoverable, you #
# can... | Eloff/silvershell | client/silvershell/white_on_black_prefs.py | Python | bsd-3-clause | 6,018 |
'''
Copyright (c) 2015, Salesforce.com, 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 foll... | SalesforceEng/Providence | providence.py | Python | bsd-3-clause | 10,230 |
from __future__ import absolute_import
import hdcloud.base
from .fakeserver import FakeHDCloud
from hdcloud import Store
from hdcloud.base import Resource
from nose.tools import assert_equal, assert_not_equal, assert_raises
hdcloud = FakeHDCloud()
def test_resource_repr():
r = Resource(None, dict(foo="bar", baz=... | jacobian-archive/python-hdcloud | tests/test_base.py | Python | bsd-3-clause | 1,267 |
#! /usr/bin/env python
#
# ipg.py -- Example of Ginga widget interaction with IPython.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
# CREDIT:
# Contains code from IP... | Rbeaty88/ginga | ginga/qtw/ipg.py | Python | bsd-3-clause | 12,780 |
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 = "ConstantTrend", cycle_length = 0, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_RelativeDifference/trend_ConstantTrend/cycle_0/ar_12/test_artificial_1024_RelativeDifference_ConstantTrend_0_12_20.py | Python | bsd-3-clause | 279 |
from decimal import Decimal
from dateutil import parser as date_parser
import six
def update_column(context, sheet, column, facets=None, values=None, expression=None):
assert values or expression
workbook = context['workbook']
callable_or_values = expression and expression or values
sheet = workbook... | databuild/databuild | databuild/operations/columns.py | Python | bsd-3-clause | 1,932 |
# -*- coding: utf-8 -*-
#
# django-oscar-support documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 15 16:42:43 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | snowball-one/django-oscar-support | docs/source/conf.py | Python | bsd-3-clause | 8,178 |
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from ietf.doc.models import *
def main(request):
'''
Main view for the Console
'''
latest_docevent = DocEvent... | mcr/ietfdb | ietf/secr/console/views.py | Python | bsd-3-clause | 501 |
'''
IROHA Python package.
'''
__all__ = ["iroha", "design_tool", "axi"]
| nlsynth/iroha | py/iroha/__init__.py | Python | bsd-3-clause | 73 |
# Copyright (c) 2010-2013, 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fun... | SanchayanMaity/gem5 | configs/example/fs.py | Python | bsd-3-clause | 15,347 |
from django.shortcuts import redirect
from django.views.generic import TemplateView
from django.views.generic import ListView, DetailView
from django.views.generic.edit import FormView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from django.... | futurice/futurice-ldap-user-manager | fum/servers/views.py | Python | bsd-3-clause | 3,137 |
"""
A helper class which works as a plugin to generate the test report and upload it
to the group server's dokuwiki. It inheirts from the class `HTMLReport` of
the `pytest-html` plugin. The test report contains the following details:
* The git commit hash on which test run was executed.
* The time of generation of tes... | kaushik94/tardis | tardis/tests/integration_tests/report.py | Python | bsd-3-clause | 8,984 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from django.contrib.auth.models import User
from sentry.constants import MEMBER_USER
from sentry.models import Project
from sentry.web.helpers import get_project_list
from tests.base import TestCase
class GetProjectListTEst(TestCase):
d... | chayapan/django-sentry | tests/sentry/web/helpers/tests.py | Python | bsd-3-clause | 2,132 |
#!/usr/bin/env python
#
# Copyright (c) 2009, Roboterclub Aachen e.V.
# 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
# ... | chrism333/xpcc | scons/site_tools/system_design.py | Python | bsd-3-clause | 7,787 |
# -*- coding: utf-8 -*-
"""flask blueprints"""
from .main import main_bp
from .api_1_0 import api_bp as api_1_0_bp
__all__ = ['register_blueprints']
def register_blueprints(app):
"""register blueprints"""
app.register_blueprint(main_bp)
app.register_blueprint(api_1_0_bp)
| teracyhq/flask-boilerplate | app/blueprints.py | Python | bsd-3-clause | 289 |
"""All formatters from this pacakge should be easily mixed whith default ones using this pattern:
>>> from code_formatter.base import formatters
>>> from code_formatter import extras
>>> custom_formatters = formatters.copy()
>>> custom_formatters.register(extras.UnbreakableTupleFormatter,
... | paluh/code-formatter | code_formatter/extras/__init__.py | Python | bsd-3-clause | 12,919 |
"""Script wrapper for creating a movie of survey progress.
To run this script from the command line, use the ``surveymovie`` entry point
that is created when this package is installed, and should be in your shell
command search path.
The optional matplotlib python package must be installed to use this script.
The ex... | desihub/desisurvey | py/desisurvey/scripts/surveymovie.py | Python | bsd-3-clause | 24,365 |
import unittest
import numpy as np
import latenttrees.lt_helper as lth
from scipy.stats import norm
class TestLtHelper(unittest.TestCase):
pass
def test_norm_logpdf_generator(x, mu, std):
def test(self):
scipy_d = norm(mu, std) # scipy normal distribution
logpdf_scipy = scipy_d.log... | kaltwang/latenttrees | latenttrees/test_lt_helper.py | Python | bsd-3-clause | 880 |
from time import localtime, gmtime, strftime, strptime
from os.path import expanduser, join
from pprint import pprint
from decimal import *
def scrivi_movimento(path, m):
with open(path, 'a') as f:
f.write(m['tipo'] + m['valore'])
f.write(';')
f.write(m['data'])
f.write(';')
... | scompo/money | money/money.py | Python | bsd-3-clause | 3,277 |
#! /usr/bin/python2
import re
from kchan.lyrics import Lyrics
def load(lyricsData):
"""Parse text with timestamps into a Lyrics instance
Args:
lyricsData (str): String containing text and timestamps. There may be
any number of timestamps, in any order, at any locations, but they must
... | ichung/karaoke-chan | kchan/timedtext.py | Python | mit | 2,694 |
# -*- coding: utf-8 -*-
from south.db import db, engine
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Category.slug'
db.alter_column('qa_category', 'slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=255... | sharifelguindi/qatrackplus | qatrack/qa/migrations/0003_auto__chg_field_category_slug__chg_field_category_name__chg_field_refe.py | Python | mit | 23,983 |
import os, errno
# Create build folder if it doesn't exist
def get_path(relative_path):
cur_dir = os.path.dirname(__file__)
return os.path.join(cur_dir, relative_path)
try:
os.makedirs(get_path('build'))
except OSError as e:
if e.errno != errno.EEXIST:
raise
template = open(get_path('./5xx.template... | thegazelle-ad/gazelle-server | deployment-resources/http-error-static-pages/5xx-static-html-generator.py | Python | mit | 815 |
# coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy import attrs
def test_attr_of_token(EN):
text = u'An example sentence.'
tokens = EN(text, tag=True, parse=False)
example = EN.vocab[u'example']
assert example.orth != example.shape
feats_array = tokens.to_array((att... | pombredanne/spaCy | spacy/tests/tokens/test_array.py | Python | mit | 1,141 |
'''
File: example2.py
Description: Example of importing self-defining function into autoD
calculate d/dx[ln(integral of x)] and d/dx[ln(integral of x^2)] at x=0.2, starting integration at x=0.
History:
Date Programmer SAR# - Description
---------- ---------- ----------------------------
Aut... | dwindz/autoD | example2.py | Python | mit | 954 |
"""
Random numbers for PLASTK.
$Id: rand.py,v 1.4 2005/08/20 16:46:14 jp Exp $
"""
#from RandomArray import *
import sys
def shuffle(L):
"""
Return randomly permuted version of L. (non-destructive)
"""
return [L[i] for i in permutation(len(L))]
def strseed(s):
s1 = s[::2]
s2 = s[1::2]
... | ronaldahmed/robot-navigation | neural-navigation-with-lstm/MARCO/plastk/rand.py | Python | mit | 1,050 |
# The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including wi... | CCI-Tools/cate-core | cate/core/plugin.py | Python | mit | 4,380 |
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2008 EVO Sistemas Libres <central@evosistemas.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | R3v1L/evogtk | evogtk/gui/widgetlib/dbcombobox.py | Python | mit | 4,770 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'InstagramProfile'
db.create_table('instagram_instagramprofile', (
('id', self.... | minlex/django-socialregistration | socialregistration/contrib/instagram/south_migrations/0001_initial.py | Python | mit | 6,041 |
from foundation import models
class BigS(models.Model):
s = models.SlugField(max_length=255)
class UnicodeSlugField(models.Model):
s = models.SlugField(max_length=255, allow_unicode=True)
| jdzero/foundation | tests/model_fields/models.py | Python | mit | 200 |
#!/usr/bin/env python
from __future__ import absolute_import
import logging
import os
import optparse
import warnings
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.utils import get_installed_distributions, get_prog
from pip.utils import deprecation, dist_is_editab... | nthall/pip | pip/__init__.py | Python | mit | 10,278 |
import numpy
from chainer import distributions
from chainer import testing
@testing.parameterize(*testing.product({
'shape': [(2, 3), ()],
'is_variable': [True, False],
'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestBeta(testing.distribution_unittest):
... | ktnyt/chainer | tests/chainer_tests/distributions_tests/test_beta.py | Python | mit | 1,105 |
from distutils.core import setup
from setuptools import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
extensions = [
Extension("src.cython_.angle_between", ["src/cython_/angle_between.pyx"]),
Extension("src.cython_.collide", ["src/cython_/collide.pyx"]),
Exte... | thdb-theo/Zombie-Survival | docs/assets/Tools/build_cython.py | Python | mit | 483 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | imbstack/pasquino | migrations/env.py | Python | mit | 2,643 |
from .exceptions import (
ZKWaitTimeout,
)
from .zkacid import (
cas_loop,
)
from .zkconf import (
KazooClientExt,
ZKConf,
kazoo_client_ext,
)
from .zkutil import (
PermTypeError,
close_zk,
init_hierarchy,
export_hierarchy,
is_backward_locking,
lock_id,
make_acl_entr... | sejust/pykit | zkutil/__init__.py | Python | mit | 1,117 |
#!/usr/bin/env python3
PROJ_NAME = 'you-get'
PACKAGE_NAME = 'you_get'
PROJ_METADATA = '%s.json' % PROJ_NAME
import os, json, imp
here = os.path.abspath(os.path.dirname(__file__))
proj_info = json.loads(open(os.path.join(here, PROJ_METADATA), encoding='utf-8').read())
try:
README = open(os.path.join(here, 'README... | xyuanmu/you-get | setup.py | Python | mit | 1,277 |
#!/usr/bin/python3
import argparse
import os
import sys
import configuration
import shouter
from gitFunctions import Commiter
from gitFunctions import Initializer, Differ
from rtcFunctions import ImportHandler
from rtcFunctions import RTCInitializer
from rtcFunctions import RTCLogin
from rtcFunctions import Workspace... | rtcTo/rtc2git | migration.py | Python | mit | 6,494 |
# -*- coding: utf-8 -*-
""" Resource Import Tools
@copyright: 2011-13 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
... | flavour/tldrmp | modules/s3/s3import.py | Python | mit | 156,657 |
#!/usr/bin/env python
#============================================================================
# Copyright (c) Microsoft Corporation. All rights reserved. See license.txt for license information.
#============================================================================
from __future__ import print_function
fro... | MSFTOSSMgmt/WPSDSCLinux | Providers/Scripts/2.6x-2.7x/Scripts/nxIPAddress.py | Python | mit | 30,909 |
import logging
import unittest.mock as mock
import os
import os.path
from pytest import raises, mark
import shutil
import subprocess
import tempfile
from teuthology.exceptions import BranchNotFoundError, CommitNotFoundError
from teuthology import repo_utils
from teuthology import parallel
repo_utils.log.setLevel(loggi... | SUSE/teuthology | teuthology/test/test_repo_utils.py | Python | mit | 9,075 |
#!/usr/bin/env python3
# Biligrab-Danmaku2ASS
#
# Author: Beining@ACICFG https://github.com/cnbeining
# Author: StarBrilliant https://github.com/m13253
#
# Biligrab is licensed under MIT licence
# Permission has been granted for the use of Danmaku2ASS in Biligrab
#
# Copyright (c) 2014
#
# Permission is hereby granted... | doublehou/BiliDan | bilidan.py | Python | mit | 23,014 |
from opsbro.evaluater import export_evaluater_function
from opsbro.gossip import gossiper
FUNCTION_GROUP = 'gossip'
@export_evaluater_function(function_group=FUNCTION_GROUP)
def is_in_group(group):
"""**is_in_group(group)** -> return True if the node have the group, False otherwise.
* group: (string) group to ... | naparuba/opsbro | data/core-configuration/packs/core-functions/module/node.py | Python | mit | 2,773 |
# -*- coding: utf-8 -*-
from app.common.http_methods import post_request
from app.common.target_urls import HIRE_FLIGHT_ATTENDANTS_URL, HIRE_PILOTS_URL, HIRE_MECHANICS_URL
def hire_pilots(pilots_nb):
post_request(HIRE_PILOTS_URL, {'cq': pilots_nb})
def hire_flight_attendants(flight_attendants_nb):
post_req... | egenerat/gae-django | app/airport/staff_buyer.py | Python | mit | 478 |
#!/usr/bin/env python
"""
Re-write config file and optionally convert to python
"""
__revision__ = "$Id: writeCfg.py,v 1.1 2011/09/19 21:41:44 paus Exp $"
__version__ = "$Revision: 1.1 $"
import getopt
import imp
import os
import pickle
import sys
import xml.dom.minidom
from random import SystemRandom
from ProdCom... | cpausmit/Kraken | filefi/024/writeCfg.py | Python | mit | 6,916 |
# This file is generated by Z:\Users\rgommers\Code\numpy\setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
blas_info={}
lapack_info={}
atlas_threads_info={}
blas_src_info={}
blas_opt_info={}
lapack_src_info={}
atlas_blas_threads_info={}
lapack_opt_info={}
at... | xxd3vin/spp-sdk | opt/Python27/Lib/site-packages/numpy/distutils/__config__.py | Python | mit | 912 |
#!/usr/bin/env python
"""kdtree.py: Demonstrate class KDTree of SciPy.
"""
import numpy as np
from scipy.spatial import KDTree
# pylint: disable=invalid-name
# Genrate 3D points: (0, 0, 0), (0, 0, 10), (0, 0, 20), ...
x, y, z = np.mgrid[0:100:10, 0:100:10, 0:100:10]
points = list(zip(x.ravel(), y.ravel(), z.ravel()))... | showa-yojyo/note | source/_sample/scipy/kdtree.py | Python | mit | 629 |