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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
import os
import site
site.addsitedir(os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
from django.core.management import execute_manager
import settings
if __name__ == "__main__":
execute_manager(settings)
| boar/boar | boar/manage.py | Python | bsd-3-clause | 253 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import math
import uuid
import warnings
from base64 import b64decode, b64encode
from itertools import tee
from django.apps import apps
from django.db import connection
from django.db.models.lo... | runekaagaard/django-contrib-locking | django/db/models/fields/__init__.py | Python | bsd-3-clause | 88,217 |
"""
Most descriptor compounds selection
"""
# Author: Giuseppe Marco Randazzo gmrandazzo@gmail.com
# License: BSD 3 clause
from numpy import zeros, array
class MDC(object):
"""Perform Most-Descriptor-Compound object selection
Parameters
----------
dmx : array, shape(row,row)
A square distance... | zeld/scikit-optobj | optobj/mdc.py | Python | bsd-3-clause | 4,248 |
import logging
import emission.analysis.modelling.tour_model.tour_model_matrix as tm
import emission.analysis.modelling.tour_model.cluster_pipeline as eamtcp
from uuid import UUID
import random, datetime, sys
def create_tour_model(user, list_of_cluster_data):
# Highest level function, create tour model from the c... | yw374cornell/e-mission-server | emission/analysis/modelling/tour_model/create_tour_model_matrix.py | Python | bsd-3-clause | 3,536 |
# coding: utf-8
import re
from copy import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.db... | fetzig/django-csv-exporter | csvexporter/forms.py | Python | bsd-3-clause | 2,038 |
import md5
def _generate_verbose_key(prefix, klass, properties):
return "%s:%s.%s(%s)" % (prefix, klass.__module__, klass.__name__, properties)
def _generate_terse_key(prefix, klass, properties):
compressed_hash = md5.new("%s.%s(%s)" % (klass.__module__, klass.__name__, properties)).hexdigest()
return "%s... | mjpizz/stockpyle | stockpyle/_helpers.py | Python | bsd-3-clause | 5,201 |
from __future__ import with_statement
import sys
from optparse import OptionParser, make_option as Option
from pprint import pformat
from textwrap import wrap
from anyjson import deserialize
from celery import __version__
from celery.app import app_or_default, current_app
from celery.bin.base import Command as Cele... | WoLpH/celery | celery/bin/celeryctl.py | Python | bsd-3-clause | 11,318 |
import sys
sys.path.append("..")
from sympy import sqrt, symbols, eye
w, x, y, z = symbols("wxyz")
L = [x,y,z]
V = eye(len(L))
for i in range(len(L)):
for j in range(len(L)):
V[i,j] = L[i]**j
det = 1
for i in range(len(L)):
det *= L[i]-L[i-1]
print "matrix"
print V
print "det:"
print V.det().expand()
... | certik/sympy-oldcore | examples/vandermonde.py | Python | bsd-3-clause | 372 |
# DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
"""
Auto-generated class for UpdateOrganizationApiKeyReqBody
"""
from .OrganizationAPIKey import OrganizationAPIKey
from . import client_support
class UpdateOrganizationApiKeyReqBody(object):
"""
auto-generated. don't touch.
... | itsyouonline/identityserver | clients/python/itsyouonline/UpdateOrganizationApiKeyReqBody.py | Python | bsd-3-clause | 1,170 |
# ~*~ coding: utf-8 ~*~
"""
fleaker.config
~~~~~~~~~~~~~~
This module implements various utilities for configuring your Fleaker
:class:`App`.
:copyright: (c) 2016 by Croscon Consulting, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import copy
import importlib
import os
import types
... | croscon/fleaker | fleaker/config.py | Python | bsd-3-clause | 14,203 |
# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from django.conf.urls import patterns, url
urlpatterns = patterns('huxley.www.views',
# Match any URL and let the client take care of routing.
url(r'', 'index', n... | jmosky12/huxley | huxley/www/urls.py | Python | bsd-3-clause | 336 |
import font
import screenshot
import sys
if __name__ == '__main__':
f = font.Font()
s = screenshot.Screenshot(sys.argv[1], f)
print s.text
#print s.colours
#print s.get_coords_positions()
| barneygale/mcocr | mcocr/__init__.py | Python | bsd-3-clause | 209 |
"""
PlexAPI Utils
"""
from datetime import datetime
try:
from urllib import quote # Python2
except ImportError:
from urllib.parse import quote # Python3
NA = '__NA__' # Value not available
class PlexPartialObject(object):
""" Not all objects in the Plex listings return the complete list of
el... | dodegy/python-plexapi | plexapi/utils.py | Python | bsd-3-clause | 1,909 |
#!/usr/bin/env python
import warnings
import pandas as pd
from pandas_ml.core.accessor import _AccessorMethods
class CrossValidationMethods(_AccessorMethods):
"""
Deprecated. Accessor to ``sklearn.cross_validation``.
"""
_module_name = 'sklearn.cross_validation'
def Stratified... | sinhrks/pandas-ml | pandas_ml/skaccessors/cross_validation.py | Python | bsd-3-clause | 4,933 |
'''
Copyright (c) OS-Networks, http://os-networks.net
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 following... | Knygar/hwios | services/web_ui/models/signal.py | Python | bsd-3-clause | 3,723 |
import mock
from twisted.internet import defer
from twisted.trial import unittest
from OpenSSL import crypto
import oppy.connection.connectionbuildtask as connectionbuildtask
from oppy.connection.definitions import (
LINK_CERT_TYPE,
ID_CERT_TYPE,
OPENSSL_RSA_KEY_TYPE,
)
from oppy.cell.fixedlen import Ne... | nskinkel/oppy | oppy/tests/unit/connection/test_connectionbuildtask.py | Python | bsd-3-clause | 22,953 |
from django.contrib.localflavor.in_.forms import (INZipCodeField,
INStateField, INStateSelect, INPhoneNumberField)
from utils import LocalFlavorTestCase
class INLocalFlavorTests(LocalFlavorTestCase):
def test_INPhoneNumberField(self):
error_format = [u'Phone numbers must be in 02X-8X or 03X-7X or 04... | disqus/django-old | tests/regressiontests/forms/localflavor/in_.py | Python | bsd-3-clause | 5,631 |
"""Tests for the object class AntiSpam.
Uses the pyweet AntiSpam with a 1 second timeout instead of the usual 5 minutes
that you would experience if you actually ran the program.
"""
import time
import pytest
from pyweet.spam import AntiSpam
@pytest.fixture(autouse=True)
def set_test_timeout(request):
request... | a-tal/pyweet | test/test_anti_spam.py | Python | bsd-3-clause | 1,200 |
# This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
# ensure that we include all the models required to administer this app
from cmdb.models import *
from django.contrib import admin
admin.site.register(Country)
a... | proffalken/edison | cmdb/admin.py | Python | bsd-3-clause | 1,052 |
# vim:ts=4:sw=4:expandtab
"""A mongodb client library for Diesel"""
# needed to make diesel work with python 2.5
from __future__ import with_statement
import itertools
import struct
from collections import deque
from diesel import Client, call, sleep, send, receive, first, Loop, Application, ConnectionClosed
from bso... | dieseldev/diesel | diesel/protocols/mongodb.py | Python | bsd-3-clause | 11,619 |
from __future__ import division
import math
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404, render
from django.views.generic.detail import DetailView
from pontoon.base.models import Locale, Project, ProjectLocale, TranslatedResource
from pontoon.base.uti... | mastizada/pontoon | pontoon/localizations/views.py | Python | bsd-3-clause | 4,580 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-24 16:13
from __future__ import unicode_literals
from django.db import migrations, models
def add_questions(apps, schema_editor):
current_database = schema_editor.connection.alias
QuestionSubmodels = [
apps.get_model('wizard_builder.Sing... | SexualHealthInnovations/django-wizard-builder | wizard_builder/migrations/0029_populate_type.py | Python | bsd-3-clause | 983 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from tests.apidocs.util import APIDocsTestCase
class OrganizationStatsDocs(APIDocsTestCase):
def setUp(self):
self.create_event("a", message="oh no")... | beeftornado/sentry | tests/apidocs/endpoints/organizations/test-org-stats.py | Python | bsd-3-clause | 716 |
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD Style.
import sys
import warnings
import itertools
import operator
from abc import AB... | mrshu/scikit-learn | sklearn/linear_model/coordinate_descent.py | Python | bsd-3-clause | 44,980 |
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
#get_ipython().magic('matplotlib inline')
lValues = [ k for k in range(2,24, 4)];
# lValues = lValues + [ k for k in range(24, 128, 8)];
for cyc in lValues:
print("TEST_CYCLES_START", cyc)
b1 = ... | antoinecarme/pyaf | tests/perf/test_cycles_full_long.py | Python | bsd-3-clause | 1,473 |
#coding:utf-8
from PyQt4 import QtGui
#from PyQt4 import QtCore
from libblah.consts import ABOUT_MSG, ABOUT_TITLE
from ui.ui_verification_dialog import Ui_VerificationDialog
def popup_confirm(parent, msg = None):
reply = QtGui.QMessageBox.question(parent, u"提示",
msg,
QtGui.QMess... | williamyangcn/iBlah_py | libiblah/popup_dlgs.py | Python | bsd-3-clause | 1,614 |
#-----------------------------------------------------------------------------
# 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 | bokeh/embed/bundle.py | Python | bsd-3-clause | 12,481 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_BoxCox/trend_PolyTrend/cycle_5/ar_12/test_artificial_128_BoxCox_PolyTrend_5_12_0.py | Python | bsd-3-clause | 261 |
from __future__ import absolute_import
import mock
import os
from django.conf import settings
TEST_ROOT = os.path.normpath(
os.path.join(
os.path.dirname(__file__),
os.pardir,
os.pardir,
os.pardir,
os.pardir,
'tests'))
def pytest_configure(config):
# HACK: On... | ifduyue/sentry | src/sentry/utils/pytest/sentry.py | Python | bsd-3-clause | 8,317 |
from __future__ import unicode_literals
import os
import json
from functools import wraps
from datetime import datetime, date
from contextlib import contextmanager
from threading import RLock, Condition, current_thread
from collections import Sized, Iterable, Mapping, defaultdict
def is_listy(x):
"""
returns ... | RobRuana/sideboard | sideboard/lib/_utils.py | Python | bsd-3-clause | 9,665 |
# -*- coding: utf-8 -*-
__author__ = 'Michael Ingrisch'
__email__ = 'michael.ingrisch@gmail.com'
__version__ = '0.1.0' | michimichi/compartmentmodels | compartmentmodels/__init__.py | Python | bsd-3-clause | 119 |
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 = 5, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Anscombe/trend_PolyTrend/cycle_5/ar_12/test_artificial_1024_Anscombe_PolyTrend_5_12_20.py | Python | bsd-3-clause | 265 |
"""
Module parse to/from Excel
"""
# ---------------------------------------------------------------------
# ExcelFile class
import abc
from datetime import date, datetime, time, timedelta
from distutils.version import LooseVersion
from io import UnsupportedOperation
import os
from textwrap import fill
import warnings... | GuessWhoSamFoo/pandas | pandas/io/excel.py | Python | bsd-3-clause | 66,902 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs hello_world.py, through hello_world.isolate, locally in a temporary
directory.
"""
import hashlib
import os
import shutil
... | leighpauls/k2cro4 | tools/swarm_client/example/run_example_local.py | Python | bsd-3-clause | 1,893 |
import tests.periodicities.period_test as per
per.buildModel((360 , 'BH' , 25));
| antoinecarme/pyaf | tests/periodicities/Business_Hour/Cycle_Business_Hour_25_BH_360.py | Python | bsd-3-clause | 83 |
"""
byceps.blueprints.site.board.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from . import board_access_grant, last_category_view, last_topic_view
| homeworkprod/byceps | byceps/services/board/dbmodels/__init__.py | Python | bsd-3-clause | 250 |
from regulus.tree.tree import Node
from regulus.tree import *
class TestNode(Node):
def __init__(self, **kwargs):
super(TestNode, self).__init__(**kwargs)
def __str__(self):
if self.data is None:
return "<none>"
return self.data
def show(root):
for node in depth_fir... | yarden-livnat/regulus | tests/tree_test.py | Python | bsd-3-clause | 1,870 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# 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 ... | dergraaf/xpcc | tools/system_design/builder/cpp_packets.py | Python | bsd-3-clause | 6,142 |
import unittest
from prestans.provider.cache import Base
class CacheBaseUnitTest(unittest.TestCase):
def test_debug(self):
base = Base()
self.assertEqual(base.debug, False)
base.debug = True
self.assertEqual(base.debug, True)
| anomaly/prestans | tests/provider/test_cache.py | Python | bsd-3-clause | 267 |
from baseneuron import BaseNeuron
import numpy as np
import pycuda.gpuarray as garray
from pycuda.tools import dtype_to_ctype
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
class MorrisLecarCopy(BaseNeuron):
def __init__(self, n_dict, V, dt , debug=False):
self.num_neurons = len(n_... | cerrno/neurokernel | neurokernel/LPU/neurons/MorrisLecarCopy.py | Python | bsd-3-clause | 3,978 |
__author__ = 'Cam Moore'
config = {
'description': 'regexquiz is the simple shell for answering regular expression quizzes for ICS 215',
'author': 'Cam Moore',
'author_email': 'cmoore@hawaii.edu',
'version': '1.1',
'install_requires': [],
'packages': ['regexquiz'],
'name': 'regexquiz'
}
tr... | cammoore/RegExQuiz | setup.py | Python | bsd-3-clause | 627 |
#!/usr/bin/env python
__author__ = "Adam Simpkin, and Felix Simkovic"
__contributing_authors__ = "Jens Thomas, and Ronan Keegan"
__credits__ = "Daniel Rigden, William Shepard, Charles Ballard, Villi Uski, and Andrey Lebedev"
__date__ = "05 May 2017"
__email__ = "hlasimpk@liv.ac.uk"
__version__ = "0.1"
import argparse... | rigdenlab/SIMBAD | simbad/command_line/simbad_full.py | Python | bsd-3-clause | 6,513 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
handler500 = 'myapp.views.this_server_error'
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'helloworld.views.home', name='home'),
(r'^myapp/$'... | sodafree/backend | helloworld/helloworld/urls.py | Python | bsd-3-clause | 585 |
# encoding: utf8
import autoslug.fields
from django.db import migrations
from slugify import slugify
def set_initial_slug(apps, schema_editor):
Character = apps.get_model('characters', 'Character')
for character in Character.objects.all():
character.slug = slugify(character.name)
character.sav... | wengole/eveonline-assistant | eveonline-assistant/characters/migrations/0007_character_slug_populate.py | Python | bsd-3-clause | 695 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Author: Jiajie Zhang
Email: zhangjiajie043@gmail.com
"""
import logging
import os
from math import log
import cv2
import numpy as np
import numpy.linalg as la
from scipy.spatial import distance as spd
import pywt
import Tyf
import tifffile as tiff
class Image(object):
... | LoveDaisy/star_alignment | python/DataModel.py | Python | bsd-3-clause | 20,257 |
'''
A WSGI Middleware is a function or callable object similar to a
:ref:`WSGI application handlers <wsgi-handlers>`
with the only difference that it can return nothing (``None``).
Middleware can be used in conjunction with a
:ref:`WsgiHandler <wsgi-handler>` or any
other handler which iterate through a list of middle... | quantmind/pulsar | pulsar/apps/wsgi/middleware.py | Python | bsd-3-clause | 3,415 |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.template.context_processors import csrf
from django.http import HttpResponse
import cStringIO
from data.models import RadiosondeMeasurement, WeatherMeasurement, MeasuringDevice
from forms import WeatherMeasurementF... | FSavoy/visuo-server | downloads/views.py | Python | bsd-3-clause | 12,500 |
""" test with the .transform """
from io import StringIO
import numpy as np
import pytest
from pandas.core.dtypes.common import ensure_platform_int, is_timedelta64_dtype
import pandas as pd
from pandas import (
Categorical,
DataFrame,
MultiIndex,
Series,
Timestamp,
concat,
date_range,
)
i... | jreback/pandas | pandas/tests/groupby/transform/test_transform.py | Python | bsd-3-clause | 38,188 |
"""
Commands
Commands describe the input the account can do to the game.
"""
from evennia import Command as BaseCommand
from evennia import default_cmds
from evennia.commands import cmdset
class Command(BaseCommand):
"""
Inherit from this if you want to create your own command styles
from scratch. Note... | evennia/evdemo | evdemo/commands/command.py | Python | bsd-3-clause | 10,623 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('letters', '0011_auto_20150215_1830'),
]
operations = [
migrations.Dele... | garry-cairns/correspondence | api/correspondence/letters/migrations/0012_auto_20150215_2223.py | Python | bsd-3-clause | 1,825 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Softwa... | peterbe/configman | configman/tests/test_config_manager.py | Python | bsd-3-clause | 56,350 |
#!/usr/bin/env python
from amino import *
print Quat(XAngle(3.14)) * Quat(YAngle(3.14))
# print Quat((1,2,3,4))
# print Quat(RotMat(YAngle(3.14)))
# print Quat(RotMat(RotMat(YAngle(3.14))))
# print TfMat( (XAngle(3.14), (0,0,1)) ).translation()
# print aa.RotMat(aa.YAngle(3.14)).cx
# print aa.RotMat(aa.YAngle(3.... | golems/amino | demo/cpython/tf.py | Python | bsd-3-clause | 453 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("AdaBoostClassifier" , "FourClass_10" , "sqlite")
| antoinecarme/sklearn2sql_heroku | tests/classification/FourClass_10/ws_FourClass_10_AdaBoostClassifier_sqlite_code_gen.py | Python | bsd-3-clause | 146 |
import resource
import numpy as np
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.conditions import InCondition
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHype... | hmendozap/auto-sklearn | autosklearn/pipeline/components/regression/libsvm_svr.py | Python | bsd-3-clause | 5,653 |
from django.conf import settings
from paymentexpress.gateway import (
AUTH, COMPLETE, PURCHASE, REFUND, VALIDATE, Gateway
)
from paymentexpress.models import OrderTransaction
from oscar.apps.payment.exceptions import (UnableToTakePayment,
InvalidGatewayRequestError)
impor... | django-oscar/django-oscar-paymentexpress | paymentexpress/facade.py | Python | bsd-3-clause | 7,203 |
from django.apps import AppConfig
class WagtailLinkchekerAppConfig(AppConfig):
name = 'wagtaillinkchecker'
verbose_name = "Wagtail Link Checker"
| takeflight/wagtail-linkchecker | wagtaillinkchecker/apps.py | Python | bsd-3-clause | 155 |
fig, ax = plt.subplots()
count_weekday_years.median(axis=0).plot(kind='barh', ax=ax, color='#66b266')
xticks = ax.set_yticklabels(['Monday', 'Tuesday', 'Wednesday', "Thursday", "Friday", "Saturday", "Sunday"]) | jorisvandenbossche/DS-python-data-analysis | notebooks/_solutions/case2_biodiversity_analysis41.py | Python | bsd-3-clause | 209 |
# -*- coding: utf-8 -*-
"""STOMP client
.. module:: network.jms.stomp_client
:platform: Unix
:synopsis: STOMP client
.. moduleauthor:: Petr Rašek <bowman@hydratk.org>
"""
"""
Events:
-------
jms_before_connect
jms_after_connect
jms_before_send
jms_after_send
jms_before_receive
jms_after_receive
jms_before_brow... | hydratk/hydratk-lib-network | src/hydratk/lib/network/jms/stomp_client.py | Python | bsd-3-clause | 13,434 |
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | jiajiax/crosswalk-test-suite | cordova/cordova-webapp-android-tests/webapp/webapp_close.py | Python | bsd-3-clause | 2,249 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.db import transaction
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy as _
from greenmine.core.generi... | niwinz/Green-Mine | src/greenmine/base/views/export.py | Python | bsd-3-clause | 10,254 |
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime, timedelta
from urllib.parse import urlencode
from django.conf import settings
from django.core import mail
from django.core.files.storage import default_storage as storage
from django.test import RequestFactory
from django.urls import revers... | bqbn/addons-server | src/olympia/devhub/tests/test_views.py | Python | bsd-3-clause | 83,689 |
import itertools
import functools
import operator
import warnings
from distutils.version import LooseVersion
import numpy as np
from pandas import compat
from pandas._libs import tslib, algos, lib
from pandas.core.dtypes.common import (
_get_dtype,
is_float, is_scalar,
is_integer, is_complex, is_float_dtyp... | winklerand/pandas | pandas/core/nanops.py | Python | bsd-3-clause | 24,684 |
# -*- coding: utf-8 -*-
#
# malepierre documentation build configuration file, created by
# sphinx-quickstart.
#
# 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 configuration values hav... | EliotBerriot/malepierre | docs/conf.py | Python | bsd-3-clause | 7,814 |
#!/usr/bin/env python
from distutils.core import setup
with open('README.rst') as f:
readme = f.read()
with open('CHANGES.rst') as f:
changes = f.read()
setup(
name='sdict',
version='0.1.0',
description='dict subclass with slicing and insertion.',
author='Jared Suttles',
url='https://git... | jaredks/sdict | setup.py | Python | bsd-3-clause | 511 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Goal: Implement simple tasks executed during deployment with deploy.sh
#
# @authors
# Andrei Sura <sura.andrei@gmail.com>
# Taeber Rapczak <taeber@ufl.edu>
"""
Fabric deployment file.
@see
http://fabric-docs.readthedocs.org/en/latest/
... | indera/redi-dropper-client | app/deploy/fabfile.py | Python | bsd-3-clause | 19,299 |
from .factory import factorize, ArgumentError, NonExistentTypeError, NonExistentModuleError | engine-cl/ng-factory | ng_factory/__init__.py | Python | bsd-3-clause | 91 |
from . import test_invoicing
| mycodeday/crm-platform | stock_dropshipping/tests/__init__.py | Python | gpl-3.0 | 29 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-12-21 01:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('simplesite', '0003_auto_20161006_2321'),
]
operations = [
migrations.AddFiel... | marsxn/simple-site | simplesite/migrations/0004_page_alternative_url.py | Python | mit | 514 |
#!/usr/bin/env python
""" A unittest script for the WgsDnaPrep module. """
import unittest
import json
from cutlass import WgsDnaPrep
from cutlass import MIMS, MimsException
from CutlassTestConfig import CutlassTestConfig
from CutlassTestUtil import CutlassTestUtil
# pylint: disable=W0703, C1801
class WgsDnaPrepT... | ihmpdcc/cutlass | tests/test_wgs_dna_prep.py | Python | mit | 15,332 |
# -*- coding: utf-8 -*-
'''
# Copyright (c) 2015 Microsoft Corporation
#
# 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 without limitation the rights
# to us... | OneDrive/onedrive-sdk-python | src/python3/request/item_delta_collection.py | Python | mit | 2,730 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/military/shared_military_outpost_guard_house_imperial.iff"
result.a... | anhstudios/swganh | data/scripts/templates/object/building/military/shared_military_outpost_guard_house_imperial.py | Python | mit | 486 |
from __future__ import division, print_function
import myhdl
from myhdl import intbv, instance, delay
from rhea.system import Barebone
from . import SPIBus
@myhdl.block
def spi_controller_model(clock, ibus, spibus):
"""A model of an SPI controller
Arguments:
ibus (Barebone): internal bus
spibu... | cfelton/rhea | rhea/cores/spi/spi_models.py | Python | mit | 1,479 |
items_found_can_i_use = None
can_i_use_file = None
can_i_use_popup_is_showing = False
can_i_use_list_from_main_menu = False
path_to_can_i_use_data = os.path.join(H_SETTINGS_FOLDER, "can_i_use", "can_i_use_data.json")
path_to_test_can_i_use_data = os.path.join(H_SETTINGS_FOLDER, "can_i_use", "can_i_use_data2.json")
url_... | pichillilorenzo/JavaScript-Completions | helper/can_i_use/can_i_use_command.py | Python | mit | 10,624 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Minimal Flask application example for development.
SPHINX-START
Run example deve... | inveniosoftware/invenio-jsonschemas | examples/app.py | Python | mit | 1,706 |
import cnn
import numpy as np
if __name__ == '__main__':
#import input_data
import random
from PIL import Image
#mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
ocr = cnn.CNN()
ocr.build()
#ocr.predict()
show_image2 = Image.open('G:/Users/kakoi/Desktop/无标题... | kelifrisk/justforfun | python/cnn/mnist_resnet/main.py | Python | mit | 672 |
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as SsnProvider
import random
class Provider(SsnProvider):
#in order to create a valid SIN we need to provide a number that passes a simple modified Luhn Algorithmn checksum
#this function essentially reverses the checksum step... | venmo/faker | faker/providers/ssn/en_CA/__init__.py | Python | mit | 1,457 |
# -*- coding: 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):
# Changing field 'UserRole.role'
db.alter_column(u'ecg_balancing_userrole', 'role', self.gf('django.db.mode... | sinnwerkstatt/ecg-balancing | ecg_balancing/migrations/0030_auto__chg_field_userrole_role.py | Python | mit | 12,407 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_tour_aryon.iff"
result.attribute_template_id ... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_tatooine_tour_aryon.py | Python | mit | 454 |
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_model
class TimePeriodMixin(object):
'''Will add the currently active time period to the template context
or False if no active time period.
Configuration:
`time_period_model`: The model class that implements T... | Mercy-Nekesa/sokoapp | sokoapp/contests/views.py | Python | mit | 2,091 |
# -*- coding: utf-8 -*-
import sys
from influxdb import chunked_json
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class TestChunkJson(unittest.TestCase):
@classmethod
def setUpClass(cls):
super(TestChunkJson, cls).setUpClass()
def test_load(self):
... | georgijd/influxdb-python | influxdb/tests/chunked_json_test.py | Python | mit | 1,565 |
from nose.tools import raises
from tests.test_stack import TestConfig, app_from_config
from tg.util import no_warn
from tg.configuration import config
from tg.configuration import milestones
from tg.decorators import Decoration, decode_params
import tg
import json
def make_app():
base_config = TestConfig(folder = ... | lucius-feng/tg2 | tests/test_stack/rendering/test_decorators.py | Python | mit | 6,861 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from ipaddress import ip_network
from operator import itemgetter
... | mvidalgarcia/indico | indico/modules/networks/fields.py | Python | mit | 2,008 |
from ..output import outputfile, outputstr
from ..utils import multiple_index, limit_text
from ..utils import _index_function_gen, asciireplace, generate_func, generate_func_any, ROW_OBJ
from ..exceptions.messages import ApiObjectMsg as msg
from types import FunctionType
from tabulate import tabulate
from threading i... | Dolphman/PSV | psv/core/objects/selections.py | Python | mit | 15,237 |
import heapq
# Wrapper class around heapq so that we can directly pass the key and dont have to make tuples
class Heap( object ):
def __init__( self, initial = None, key = lambda x : x ):
self.key = key
if initial:
self._data = [ ( key( item ), item ) for item in initial ]
h... | cvquant/trade-analysis | cdefs/heap.py | Python | mit | 754 |
SOCIAL_AUTH_VK_LOGIN_URL = 'https://oauth.vk.com/authorize'
SOCIAL_AUTH_VK_OAUTH2_KEY = '3911688'
SOCIAL_AUTH_VK_OAUTH2_SECRET = '2Y5FYZB3cqDsPteHXBBO'
SOCIAL_AUTH_VK_OAUTH2_SCOPE = ['friends']
AUTHENTICATION_BACKENDS = (
'social.backends.vk.VKOAuth2',
'django.contrib.auth.backends.ModelBackend',
)
SOCIAL_AUT... | ox1omon/movement_fefu | movement/settings/social.py | Python | mit | 2,521 |
#!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_fun... | starwels/starwels | contrib/linearize/linearize-data.py | Python | mit | 10,077 |
import yaml
class UiMap():
def __init__(self, path=None):
self._map = {}
self.observer = None
if path: self.load(path)
def load(self, path):
with open(path, 'r') as f:
tree = yaml.load(f)
for key in tree:
if key.find('__') != 0:
s... | renorzr/uimap | src/uimap/__init__.py | Python | mit | 3,216 |
'''Operating System Task
'''
import types
from systemCall import *
class Task(object):
taskId = 0
def __init__(self, target):
self.tid = Task.taskId
Task.taskId += 1
self.target = target
self.sendVal = None
self.name = target.__name__
sel... | JShadowMan/package | python/coroutine/operatingSystem/task.py | Python | mit | 1,526 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_daclif_gallamby.iff"
result.attribute_template_id = 9
... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_daclif_gallamby.py | Python | mit | 448 |
from django.conf.urls.defaults import *
urlpatterns = patterns('budget.transactions.views',
url(r'^$', 'transaction_list', name='budget_transaction_list'),
url(r'^add/$', 'transaction_add', name='budget_transaction_add'),
url(r'^edit/(?P<transaction_id>\d+)/$', 'transaction_edit', name='budget_transaction_... | MVReddy/django-mybudget | budget/transactions/urls.py | Python | mit | 433 |
"""
Carry a Cheese
"""
if __name__ == '__main__':
while True:
x = sorted(map(int, raw_input().split()))
if sum(x) == 0:
break
n = int(raw_input())
r = [int(raw_input()) for _ in xrange(n)]
for i in xrange(n):
if (2 * r[i]) ** 2 > x[0] ** 2 + x[1] ** ... | miyazaki-tm/aoj | Volume1/0107.py | Python | mit | 397 |
#encoding=utf-8
from __future__ import unicode_literals
import sys
sys.path.append("../")
import jieba
seg_list = jieba.cut("我来到北京清华大学", cut_all=True)
print("Full Mode: " + "/ ".join(seg_list)) # 全模式
seg_list = jieba.cut("我来到北京清华大学", cut_all=False)
print("Default Mode: " + "/ ".join(seg_list)) # 默认模式
seg_list = j... | Yinzo/jieba | test/demo.py | Python | mit | 604 |
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/ebcli/controllers/deploy.py | Python | mit | 7,976 |
#!/usr/bin/env python
import time
import sys
import logging
from socketIO_client import SocketIO
APPKEY = '5697113d4407a3cd028abead'
TOPIC = 'test'
ALIAS = 'test'
logger = logging.getLogger('messenger')
class Messenger:
def __init__(self, appkey, alias, customid):
self.__logger = logging.getLogger('mes... | yunbademo/yunba-smartoffice | python/messenger.py | Python | mit | 3,266 |
"""A dummy module for testing purposes."""
import logging
import os
import uuid
import lambdautils.state as state
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def partition_key(event):
return event.get("client_id", str(uuid.uuid4()))
def input_filter(event, *args, **kwargs):
if os.environ.g... | humilis/humilis-kinesis-mapper | tests/integration/mycode/mypkg/__init__.py | Python | mit | 1,346 |
"""
Test constrained energy of a male_low_poly's texture.
Written by Zachary Ferguson
"""
from PIL import Image
import scipy.sparse
import scipy.sparse.linalg
import numpy
import includes
import obj_reader
from seam_minimizer import compute_energies
###########################
# Values for the problem. #
##########... | zfergus2/Wrapping-Textures | tests/test_constraints.py | Python | mit | 1,354 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/roba_hill/shared_lair_roba_hill.iff"
result.attribute_template... | anhstudios/swganh | data/scripts/templates/object/tangible/lair/roba_hill/shared_lair_roba_hill.py | Python | mit | 449 |
"""ldif3 - generate and parse LDIF data (see RFC 2849)."""
from __future__ import unicode_literals
import base64
import re
import logging
from collections import OrderedDict
try: # pragma: nocover
from urlparse import urlparse
from urllib import urlopen
except ImportError: # pragma: nocover
from urllib... | GluuFederation/community-edition-setup | pylib/ldif3/ldif3.py | Python | mit | 13,061 |
# -*- coding: utf-8 -*-
"""Heroku specific settings. These are used to deploy opencomparison to
Heroku's platform.
"""
from os import environ
from memcacheify import memcacheify
from postgresify import postgresify
from S3 import CallingFormat
from .base import *
########## CACHE
CACHE_TIMEOUT = 60 * 60 * 24 * 30
... | QLGu/djangopackages | settings/heroku.py | Python | mit | 4,843 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import os
import tests.fixtures.mock_data as mock_data
class MockStdout():
def __init__(self):
self.stdout = {}
class PipeMock(object):
def __init__(self):
self.stdout = MockStdout()
... | pombredanne/swidGenerator | tests/fixtures/command_manager_mock.py | Python | mit | 3,142 |