code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Thailand - Accounting',
'version': '2.0',
'category': 'Accounting/Localizations',
'description': """
Chart of Accounts for Thailand.
===============================
Thai accounting chart and l... | ddico/odoo | addons/l10n_th/__manifest__.py | Python | agpl-3.0 | 859 |
from django.conf.urls import patterns, url
from judge import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^register/$', views.register_user, name='register'),
url(r'^logout/$', views.loguserout, name = 'loguserout'),
url(r'^login/$', views.loguserin, name = 'loguse... | paramsingh/poj | judge/urls.py | Python | mit | 724 |
"""Core admin."""
# Copyright 2015 Solinea, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Solinea/goldstone-server | goldstone/core/admin.py | Python | apache-2.0 | 1,743 |
# -*- coding: utf-8 -*-
# Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
#
# You may assume that the intervals were initially sorted according to their start times.
#
# Example 1:
# Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9].
#
# Examp... | ddu7/PyLC | 057Insert Interval.py | Python | mit | 1,347 |
#!/usr/bin/env python
"""
Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source co... | CSSIP-AIR/PatentsProcessor | parse.py | Python | bsd-2-clause | 8,571 |
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import ss, toSafeString, \
toUnicode, sp
from couchpotato.core.helpers.variable import getExt, md5, isLocalIP
from couchpotato.core.logger import CPLog
from couchpotato.environment import Env
import requests
from requests.... | hamiltont/CouchPotatoServer | couchpotato/core/plugins/base.py | Python | gpl-3.0 | 10,383 |
'''This is a toy reinforcement learning problem. The state space has three
locations on a line, the agent starts in the middle one. Either on the left
or the right, there is a reward. Reaching this, the game terminates. The agent
has complete access to the state space of the game. The action space of the
agent is left ... | jdnz/qml-rg | Meeting 4/Quantum_solution_Grover.py | Python | gpl-3.0 | 1,365 |
agenda = []
def pedenome():
return input("Nome: ").replace("#", "$")
def pedetelefone():
return input("Telefone: ").replace("#", "$")
def pedearquivo():
return input("Nome do arquivo: ")
def mostra(nome, telefone):
print(f"Nome: {nome} Telefone: {telefone}")
def pesquisa(nome):
mnome = nom... | laenderoliveira/exerclivropy | cap09/exercicio-09-21.py | Python | mit | 2,962 |
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import numpy as np
impo... | ouening/python-code | common/BubbleAnimation.py | Python | mit | 2,339 |
#!/usr/bin/env python
import sys
import time
import exceptions
sys.path.append('../management')
import mc_bin_client
EXPIRY = 2
VERBOSE = False
def log(*s):
if VERBOSE:
print ' '.join(s)
def store(mc, kprefix):
k = kprefix + '.set'
log(">> ", k)
mc.set(k, EXPIRY, 0, k)
k = kprefix + '.a... | teligent-ru/ep-engine | tests/module_tests/expiry_test.py | Python | apache-2.0 | 923 |
#coding=utf-8
'''
Created on 2015-4-3
@author: 张天得
'''
class MethodInvoker(object):
'''
动态调用方法
'''
@staticmethod
def get_instance(moudelname,classname,packagelist):
moudel= __import__(moudelname,fromlist=packagelist)
print(moudel)
klass=getattr(moudel,classname)
pri... | skyzhang2006/PyGAT | PyGAT/gateside/autotesting/Gat/util/methodinvoker.py | Python | gpl-2.0 | 747 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os, subprocess, time, struct, sys, errno
from threading import Thread
... | sharad/calibre | src/calibre/gui2/splash.py | Python | gpl-3.0 | 5,189 |
# (void)walker CPU architecture support
# Copyright (C) 2013 David Holm <dholmster@gmail.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 Free Software Foundation; either version 3 of the License, or
# (at your opti... | dholm/voidwalker | voidwalker/application/cpus/generic.py | Python | gpl-3.0 | 1,397 |
# -*- coding: UTF-8
from django.urls import reverse
from django.test import TestCase, override_settings
from mock import patch
from astrobin.tests.generators import Generators
from astrobin_apps_equipment.tests.equipment_generators import EquipmentGenerators
class ImageRetailerAffiliatesWhenOwnerIsPremium2020AndDoe... | astrobin/astrobin | astrobin/tests/test_image_retailer_affiliate_when_owner_is_premium_2020_and_does_not_allow.py | Python | agpl-3.0 | 7,966 |
from PyObjCTools import AppHelper
# Specialized reactor for integrating with arbitrary foreign event loop, such as those you find in GUI toolkits.
from twisted.internet._threadedselect import install
reactor = install()
import XierpaAppDelegate #@UnusedImport
AppHelper.runEventLoop()
| petrvanblokland/Xierpa3App | Xierpa3App/main.py | Python | mit | 288 |
#!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
... | ks156/RIOT | tests/gnrc_ndp2/tests/01-run.py | Python | lgpl-2.1 | 593 |
import mock
from django.test import SimpleTestCase
from base.tests.factories.user import UserFactory
from osis_role.templatetags import osis_role
class TestATagHasPerm(SimpleTestCase):
def setUp(self):
self.url = "https://dummy-url.com"
self.text = "Redirect to dummy"
self.user = UserFact... | uclouvain/osis | osis_role/tests/templatetags/test_osis_role.py | Python | agpl-3.0 | 6,575 |
#!/usr/bin/env python2
'''
You should normally never use this! Use emcc instead.
This is a small wrapper script around the core JS compiler. This calls that
compiler with the settings given to it. It can also read data from C/C++
header files (so that the JS compiler can see the constants in those
headers, for the li... | hanxi/HXGame | libs/external/emscripten/emscripten.py | Python | mit | 33,727 |
##
#This file is part of MegBot.
#
# MegBot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# MegBot is distributed in the ... | xray7224/MegBot | megbot/plugins/8ball.py | Python | gpl-3.0 | 983 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Dhaval Patel (dhpatel82 at gmail.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole ... | odoousers2014/LibrERP | material_asset/report/__init__.py | Python | agpl-3.0 | 1,477 |
# -*- coding: utf-8 -*-
#
# GeoScript.scala documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 23 16:29:57 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.... | dwins/geoscript.scala | geoscript/src/main/sphinx/conf.py | Python | mit | 6,458 |
from telegram.ext import Updater
import io
class FulautBot():
def __init__(self):
self._updater = Updater("604496013:AAEbRwxlcL2L6S7F_oTk1k25iZSAJ4plgDY",
request_kwargs={'proxy_url':'socks5://127.0.0.1:9050',
'urllib3_proxy_kwargs': {"username":"", "password":""}})
... | vdrhtc/Measurement-automation | lib2/fulaut/FulautBot.py | Python | gpl-3.0 | 659 |
# coding: utf-8
from flask.ext import wtf
from flask.ext.babel import gettext as __
from flask.ext.babel import lazy_gettext as _
import flask
import wtforms
import auth
import config
import i18n
import task
import util
from main import app
class FeedbackForm(i18n.Form):
message = wtforms.TextAreaField(
_(... | lipis/life-line | main/control/feedback.py | Python | mit | 1,388 |
import os
from django.core.wsgi import get_wsgi_application
"""
WSGI config for tastytaps project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
os.environ.setdefault("DJANGO_SETTI... | tastybrew/tastytaps | tastytaps/wsgi.py | Python | bsd-3-clause | 392 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals, absolute_import
from collections import namedtuple
import json
import logging
import... | projectatomic/osbs-client | osbs/api.py | Python | bsd-3-clause | 57,765 |
from cradmin_legacy import css_icon_map
#: Font-awesome icon map for the ``cradmin_icon`` template tag.
# NOTE this is font-awesome v4 syntax, this is because cradmin uses font-awesome 4
css_icon_map.FONT_AWESOME.update({'arrow-up': 'fa fa-arrow-up',
'database': 'fa fa-database',
... | devilry/trix2 | trix/trix_admin/css_icon_map.py | Python | bsd-3-clause | 652 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.pair.tuntap}.
"""
from __future__ import division, absolute_import
import os
import struct
import socket
from errno import EPERM, EBADF, EINVAL, EAGAIN, EWOULDBLOCK, ENOENT, ENODEV
from random import randrang... | hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/pair/test/test_tuntap.py | Python | bsd-3-clause | 47,896 |
try:
from ucollections import namedtuple
except:
from collections import namedtuple
# test http request for parameters required by rfc6455
# indicating request is request to create websocket
def is_websocket_request(request):
opts = request.options
if "Sec-WebSocket-Key" in opts \
... | PinkInk/upylib | http.bak/http/parse.py | Python | mit | 1,792 |
"""
Do all subclasses of Parameter supply a valid default?
"""
from param.parameterized import add_metaclass
from param import concrete_descendents, Parameter
# import all parameter types
from param import * # noqa
from param import ClassSelector
from . import API1TestCase
positional_args = {
ClassSelector: (obj... | ceball/param | tests/API1/testdefaults.py | Python | bsd-3-clause | 1,315 |
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Wiktor Lawski <wiktor.lawski@gmail.com>
#
# 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 th... | wlawski/libmots | tests/monkeyrunner-tests/t0031-shared-elem-move-in-place.py | Python | mit | 2,054 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .widget import Widget
class Grid(Widget):
"""
Widget that automatically sets the position and size of child... | hronoses/vispy | vispy/scene/widgets/grid.py | Python | bsd-3-clause | 7,691 |
# coding: utf-8
#
# Copyright © 2010—2014 Andrey Mikhaylenko and contributors
#
# This file is part of Argh.
#
# Argh is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README.rst for copying conditions.
#
import a... | eschleicher/flask_shopping_list | venv/lib/python3.4/site-packages/argh/constants.py | Python | mit | 3,436 |
# coding=utf-8
from kg.lang.affixing import apply_affix
from kg.lang.lang import KyrgyzWord
from kg.tests import KGTestCase
class JondomoAfterGanMuchoTest(KGTestCase):
def test_jondomo_after_gan(self):
data = self.get_data()
for word, expected_forms in data.items():
word_object = Kyrg... | MasterAlish/kyrgyz_tili | kg/tests/levels/test_gan.py | Python | gpl-3.0 | 2,121 |
import decimal
import uuid
from datetime import date, datetime
__version__ = "1.12.0"
__all__ = ["__version__", "encoder"]
def encoder(o: object) -> str:
"""
Perform some additional encoding for types JSON doesn't support natively.
We don't try to respect any ECMA specification here as we want to retain... | chaostoolkit/chaostoolkit | chaostoolkit/__init__.py | Python | apache-2.0 | 766 |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | mzdaniel/django-selenium-test-runner | tests/manage.py | Python | bsd-3-clause | 665 |
import os
import socket
import time
from unittest import mock
import pytest
import mitmproxy.net.http
from mitmproxy import certs
from mitmproxy import exceptions
from mitmproxy import http
from mitmproxy import options
from mitmproxy.addons import proxyauth
from mitmproxy.addons import script
from mitmproxy.net impo... | StevenVanAcker/mitmproxy | test/mitmproxy/proxy/test_server.py | Python | mit | 40,418 |
# coding: utf-8
from django.conf import settings
def basic(request):
# admin
if request.META["PATH_INFO"] in ("admin",):
return {}
data = {
"version": settings.VERSION,
"footer": settings.TEMPLATE_FOOTER,
"conf": {
"BEAKER_SERVER": settings.BEAKER_SERVER,
... | alda519/GreenTea | tttt/context_processors.py | Python | gpl-2.0 | 349 |
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
| jozefg/solar-system | src/attrdict.py | Python | mit | 148 |
"""
samba logs - files matching ``/var/log/samba/*.log``
====================================================
"""
from insights import parser, LogFileOutput
from datetime import datetime
from insights.specs import Specs
def strip_surrounds(s):
start = 0
end = len(s) - 1
while (s[start] == '[' and s[end] ... | RedHatInsights/insights-core | insights/parsers/samba_logs.py | Python | apache-2.0 | 2,817 |
import json
import datetime
import time
import uuid
from hashlib import sha256
from collections import defaultdict
from urllib3.exceptions import ConnectTimeoutError
import twisted.internet.base
from autobahn.twisted.util import sleep
from autobahn.websocket.protocol import ConnectionRequest
from botocore.exceptions i... | mozilla-services/autopush | autopush/tests/test_websocket.py | Python | mpl-2.0 | 61,412 |
from survey import AnonSurvey
# Define a question, and make a survey.
question = 'What was your first language?'
my_survey = AnonSurvey(question)
# Show the question, and store a response.
my_survey.show_question()
print("Enter 'q' at any time to quit.\n")
while True:
response = input('Language: ')
if respons... | v00d00dem0n/PyCrashCourse | work/test_anon.py | Python | gpl-3.0 | 507 |
# django imports
from django.db import models
from django.db.models.query import QuerySet
from django.conf import settings
from django.core.cache import cache
from django.http import Http404
from django.shortcuts import _get_queryset
def key_from_instance(instance):
opts = instance._meta
return '%s.%s:%s' % (... | lichong012245/django-lfs-0.7.8 | lfs/caching/utils.py | Python | bsd-3-clause | 3,159 |
CATKIN_PACKAGE_PREFIX=""
PROJECT_ABSOLUTE_INCLUDE_DIRS="/home/jgrizou/workspace/code/lego/catkin_ws/devel/include;/home/jgrizou/workspace/code/lego/catkin_ws/src/roslego/include"
PROJECT_CATKIN_DEPENDS=""
PKG_CONFIG_LIBRARIES_WITH_PREFIX=""
PROJECT_NAME="roslego"
PROJECT_SPACE_DIR="/home/jgrizou/workspace/code/lego/cat... | jgrizou/robot_omniwheel | catkin_ws/build/roslego/catkin_generated/pkg.develspace.context.pc.py | Python | gpl-3.0 | 358 |
def extractWwwAdamhillsNet(item):
'''
Parser for 'www.adamhills.net'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loit... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwAdamhillsNet.py | Python | bsd-3-clause | 546 |
try:
import unittest2 as unittest
except ImportError:
import unittest
import pymongo
# In order to skip tests on Python 2.6 must use @unittest.skipIf(...) so tests
# to see if the DB is running need to happen at global scope. Tests will skip
# if the connection error message is "connection closed", and error ... | aherlihy/Monary | test/__init__.py | Python | apache-2.0 | 722 |
from typing import AbstractSet, Any, Dict, List, Optional, Set, Tuple, Type, Union
from classical.fields.base import ClassField
from classical.fields.generic import GenericFieldInspector
# typing.Collection is not supported by Python 3.5
StrCollection = Union[AbstractSet[str], List[str], Tuple[str, ...]]
def get_f... | altvod/classical | classical/fields/functions.py | Python | mit | 3,828 |
# Copyright 2011 Jeffrey Finkelstein
#
# This file is part of Ophot.
#
# Ophot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | jfinkels/ophot | ophot/views.py | Python | agpl-3.0 | 13,246 |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | sassoftware/restlib | restlib/http/handler.py | Python | apache-2.0 | 8,069 |
from __future__ import print_function
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.PyMol import MolViewer
from rdkit.Chem.Subshape import SubshapeBuilder,SubshapeObjects,SubshapeAligner
from rdkit.six.moves import cPickle
import copy
m1 = Chem.MolFromMolFile('test_data/square1.mol')
m2 = Chem.... | soerendip42/rdkit | rdkit/Chem/Subshape/testCombined.py | Python | bsd-3-clause | 1,702 |
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*(
testing.product({
'shape': [(3, 2, ... | kashif/chainer | tests/chainer_tests/functions_tests/math_tests/test_average.py | Python | mit | 4,903 |
from ns_portal.core.resources import (
MetaEmptyResource
)
from .v1 import (
VersionResource
)
class OAuth2Resource(MetaEmptyResource):
__ROUTES__ = {
'v1': VersionResource
}
| NaturalSolutions/NsPortal | Back/ns_portal/resources/root/security/oauth2/oauth2_resource.py | Python | mit | 201 |
# coding: utf-8
# Third-party
import astropy.units as u
from astropy.constants import G as _G
import numpy as np
import pytest
# Project
from gala._cconfig import GSL_ENABLED
from gala.units import galactic
import gala.potential as gp
from gala.potential.potential.tests.helpers import PotentialTestBase
from gala.pote... | adrn/gala | gala/potential/scf/tests/test_class.py | Python | mit | 3,357 |
from __future__ import print_function, division
from hotspotter.algo.imalgos import adapt_histeq
from hotspotter.algo.imalgos import contrast_stretch
from hotspotter.algo.imalgos import histeq
from hotspotter.other.logger import logmsg, logdbg, logerr, logio, logwarn, func_log
#from hotspotter.tpl.other.shiftableBF imp... | Erotemic/hotspotter | _graveyard/oldhotspotter/ChipFunctions.py | Python | apache-2.0 | 10,737 |
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import get_object_or_404, render
from .models import Comment
from .forms import UpdateCommentForm
from django.http.response import JsonResponse
from django.views.decorators.http import require_http_methods
def update_comment(request, cid):
... | Resmin/Resmin | resmin/apps/comment/views.py | Python | gpl-3.0 | 1,460 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/operations/_network_watchers_operations.py | Python | mit | 107,104 |
"""Unit test for treadmill.appcfg.configure.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shutil
import sys
import tempfile
import unittest
import mock
import treadmill
from treadmill.appcfg... | Morgan-Stanley/treadmill | lib/python/treadmill/tests/appcfg/configure_test.py | Python | apache-2.0 | 7,613 |
"""Defines a scanner that scans an S3 bucket backed workspace for files"""
from __future__ import unicode_literals
import logging
from ingest.scan.scanners.exceptions import (InvalidScannerConfiguration)
from ingest.scan.scanners.scanner import Scanner
logger = logging.getLogger(__name__)
class DirScanner(Scanner)... | ngageoint/scale | scale/ingest/scan/scanners/dir_scanner.py | Python | apache-2.0 | 2,268 |
import functools
import inspect
def singleton(cls):
"""
Override class constructor to enforce singleton
"""
class Singleton:
def __init__(self):
self.cls = cls
self.instance = None
def __call__(self, *args, **kwargs):
if not self.instance:
... | dbjohnson/spanner | spanner/decorators.py | Python | mit | 3,368 |
# Copying from
# https://github.com/webermarcolivier/statannot/tree/master/statannot
# on 2019-03-19 at 17:46:27
from matplotlib.text import Text
import matplotlib.pyplot as plt
from matplotlib import transforms, lines
import matplotlib.transforms as mtransforms
from matplotlib.font_manager import FontProperties
impor... | edjuaro/cuzcatlan | cuzcatlan/statannot.py | Python | mit | 10,929 |
# -*- coding: utf-8 -*-
# Asymmetric Base Framework :: Jinja utils
# Copyright (C) 2013-2014 Asymmetric Ventures Inc.
#
# 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 Free Software Foundation; version 2 o... | AsymmetricVentures/asym-jinja | run_tests.py | Python | gpl-2.0 | 2,089 |
from shared import *
# Classroom Material
class Material(db.Model):
id = db.Column(db.Integer, primary_key=True)
classroom_id = db.Column(db.Integer, nullable=False)
name = db.Column(db.String, nullable=False)
lesson_id = db.Column(db.Integer, nullable=True)
def __init__(self, classroom_id, name, ... | WildflowerSchools/sensei | app/models/material.py | Python | mit | 604 |
#! /usr/bin/env python
#TODO: remove all implicit type casting
#
#TODO: fix the gt/lt operators
# isinstance((A > [1,2,3]) == [True,False,True],float)
# isinstance((A > [1,2,3]).any(),float)
# isinstance((A > [1,2,3]).all(),float)
#
#TODO: better interoperability with scipy.stats
#TODO:... | MarkDaoust/mvn | mvn/__init__.py | Python | bsd-2-clause | 91,756 |
"""
Repository for the basic Projection types, without any special
dependencies or requirements.
$Id$
"""
__version__ = "$Revision$"
from copy import copy
from numpy import exp,ones,zeros,array,nonzero
import param
# So all Projections are present in this package
from topo.base.projection import Projection
from t... | jesuscript/topo-mpi | topo/projection/basic.py | Python | bsd-3-clause | 15,525 |
# Tai Sakuma <tai.sakuma@gmail.com>
import itertools
import numbers
##__________________________________________________________________||
class BackrefMultipleArrayReader:
def __init__(self, arrays, idxs_conf, backref_idxs=None):
# e.g.,
# arrays = [[ ], [ ], [ ], [ ], [ ], [ ], [ ], [ ]]
... | alphatwirl/alphatwirl | alphatwirl/summary/BackrefMultipleArrayReader.py | Python | bsd-3-clause | 7,759 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Cody Kochmann
# @Date: 2015-10-16 10:06:16
# @Last Modified by: codykochmann
# @Last Modified time: 2015-10-16 11:53:14
bashrc_file="~/.bashrc"
bash_aliases_file="~/.bash_aliases"
remote_alias_link="http://bit.ly/codys-aliases"
def append_to_file(filename,... | CodyKochmann/alias | installer.py | Python | mit | 929 |
"""
BinaryTree inter-engine communication class
use from bintree_script.py
Provides parallel [all]reduce functionality
"""
import cPickle as pickle
import re
import socket
import uuid
import zmq
from IPython.parallel.util import disambiguate_url
#-----------------------------------------------------------------... | cloud9ers/gurumate | environment/share/doc/ipython/examples/parallel/interengine/bintree.py | Python | lgpl-3.0 | 7,132 |
from django.contrib.admin.views.decorators import staff_member_required
from django.http import *
from django.shortcuts import *
from gamesoup.matches.models import *
@staff_member_required
def play_match(request, match_id):
match = get_object_or_404(Match, pk=match_id)
context = {
'title': 'Play %s' ... | ktonon/GameSoup | gamesoup/matches/views.py | Python | mit | 459 |
# Copyright (c) 2010, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | danakj/chromium | third_party/WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py | Python | bsd-3-clause | 5,195 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | anryko/ansible | lib/ansible/modules/storage/purestorage/purefa_dns.py | Python | gpl-3.0 | 3,762 |
"""Examine and query coverage in sequencing experiments.
Provides estimates of coverage intervals based on callable regions and
stores coverage per regions in a database using Chanjo
(https://github.com/robinandeer/chanjo)
"""
import collections
import os
import sys
import shutil
import glob
import toolz as tz
import... | elkingtonmcb/bcbio-nextgen | bcbio/variation/coverage.py | Python | mit | 11,542 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBO... | cria/microSICol | py/simplejson/scanner.py | Python | gpl-2.0 | 2,296 |
# Generic Filament Sensor Module
#
# Copyright (C) 2019 Eric Callahan <arksine.code@gmail.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging
class RunoutHelper:
def __init__(self, config):
self.name = config.get_name().split()[-1]
self.printer = config.g... | KevinOConnor/klipper | klippy/extras/filament_switch_sensor.py | Python | gpl-3.0 | 5,649 |
def predict_pecies(sepal_width=None,
petal_length=None,
petal_width=None):
""" Predictor for species from model/52952081035d07727e01d836
Predictive model by BigML - Machine Learning Made Easy
"""
if (petal_width is None):
return u'Iris-virginica'
if... | mariusvniekerk/impyla | examples/iris_model/src/model.py | Python | apache-2.0 | 1,576 |
from django.db import models
from dnd.constants.database import STND_CHAR_LIMIT, STND_ID_CHAR_LIMIT
from dnd.models.library_entities.abstract import AbstractDnDEntity
class ItemCategory(AbstractDnDEntity):
"""
Item Category for the sake of purchases
"""
#TODO: Item Kits
| Saevon/webdnd | dnd/models/library_entities/items/item_groups.py | Python | mit | 286 |
from toee import *
def OnBeginSpellCast(spell):
print "Slashing Darkness OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
def OnSpellEffect(spell):
print "Slashing Darkness OnSpellEffect"
def OnBeginRound(spell)... | GrognardsFromHell/TemplePlus | tpdatasrc/tpgamefiles/scr/Spell1167 - Slashing Darkness.py | Python | mit | 1,837 |
#!/usr/bin/env python
# encoding: utf-8
# edgelist2pairs.py
# Jim Bagrow
# Last Modified: 2008-12-29
"""
Copyright 2008,2009,2010 James Bagrow
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 Free Software Foundation, eithe... | rabbanyk/CommunityEvaluation | execs/CM-Overlapping-LinkClus/cpp/edgelist2pairs.py | Python | mit | 5,446 |
'''
Created on 17-Feb-2015
@author: Asawari.Vaidya
'''
from PythonNetBanxSDK.common.DomainObject import DomainObject
class Pagination(DomainObject):
'''
classdocs
'''
def __init__(self,obj):
'''
Constructor
'''
# Handler dictionary
handler = dict()
han... | OptimalPayments/Python_SDK | src/PythonNetBanxSDK/CardPayments/Pagination.py | Python | mit | 1,081 |
################################################################################################################
# #
# Copyright (C) {2014} {Ambuj Kumar, Kimball-Brain lab group, Biology Department, University ... | Ambuj-UF/ConCat-1.0 | src/handler.py | Python | gpl-2.0 | 49,023 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/network/channel_interface_binding.py | Python | apache-2.0 | 8,905 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Capnproto(AutotoolsPackage):
"""Cap'n Proto is an insanely fast data interchange
forma... | iulian787/spack | var/spack/repos/builtin/packages/capnproto/package.py | Python | lgpl-2.1 | 691 |
import csv
import os
import copy
import re
from decimal import Decimal
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse, FormRequest
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy.http.c... | 0--key/lib | portfolio/Python/scrapy/bosch_russian_diy/220-volt.py | Python | apache-2.0 | 1,550 |
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from boto.exception import S3ResponseError, BotoClientError, S3CreateError
from website.addons.s3.api import create_bucket
from website.project.decorators import must_have_addon
from website.addons.s3.utils import validate_bucket_name
from webs... | himanshuo/osf.io | website/addons/s3/views/crud.py | Python | apache-2.0 | 1,462 |
"""numsweeper.pygame"""
| sframe/numsweeper | numsweeper/gui_pygame/__init__.py | Python | mit | 24 |
# Created by Adam Streck, 2013-2015, adam.streck@fu-berlin.de
#
# This file is part of the Toolkit for Reverse Engineering of Molecular Pathways
# via Parameter Identification (TREMPPI)
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as pub... | xstreck1/TREMPPI | python/server.py | Python | gpl-3.0 | 1,921 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Flexiblas(CMakePackage):
"""A BLAS and LAPACK wrapper library with runtime exchangable bac... | iulian787/spack | var/spack/repos/builtin/packages/flexiblas/package.py | Python | lgpl-2.1 | 669 |
'''
Dts_TranslucentSort.py
Portions Copyright (c) 2004 - 2006 James Urquhart(j_urquhart@btinternet.com)
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 limi... | pchan126/Blender_DTS_30 | DTSPython/Dts_TranslucentSort.py | Python | mit | 39,971 |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
'''
Abstract views to simplify printing with action, model or label in Lucterios
@author: Laurent GAY
@organization: sd-libre.fr
@contact: info@sd-libre.fr
@copyright: 2015 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistr... | Lucterios2/core | lucterios/CORE/xferprint.py | Python | gpl-3.0 | 4,882 |
import sys
# Available error handling:
#'strict'(not recommended, raises an error),
#'ignore'(not recommended, info loss),
#'replace'(recommended only when string-size matters, f.ex. table borders),
# No info loss:
#'xmlcharrefreplace',
#'backslashreplace'(preferred as it is shorter)
def shrink_to_encoding(string, e... | juanchodepisa/sbtk | SBTK_League_Helper/src/tools/strings.py | Python | mit | 596 |
import datetime
import re
import unittest
from unittest import mock
from ctf_gameserver.submission.flagserver import FlagHandler
from ctf_gameserver.lib import flag
class UserInputTestCase(unittest.TestCase):
def setUp(self):
self._handler = FlagHandler(None, ("203.0.113.42", 1337), None, 'c2VjcmV0', 'Tes... | fausecteam/ctf-gameserver | tests/test_submission.py | Python | isc | 2,559 |
from django.conf import settings
from kombu import Connection, Exchange
from sfmutils.consumer import EXCHANGE
import logging
import json
log = logging.getLogger(__name__)
class RabbitWorker:
def __init__(self):
self.exchange = Exchange(name=EXCHANGE,
type="topic",
... | gwu-libraries/sfm | sfm/ui/rabbit.py | Python | mit | 1,594 |
def includeme(config):
config.scan()
| ENCODE-DCC/snovault | src/snowflakes/audit/__init__.py | Python | mit | 41 |
import unittest
from programy.processors.post.formatnumbers import FormatNumbersPostProcessor
from programy.bot import Bot
from programy.brain import Brain
from programy.config.brain import BrainConfiguration
from programy.config.bot import BotConfiguration
class FormatNmbersTests(unittest.TestCase):
def setUp(se... | dkamotsky/program-y | src/test/processors/post/test_formatnumbers.py | Python | mit | 1,511 |
#!/usr/bin/python
# This file is part of Morse.
#
# Morse is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Morse ... | retooth/morse | morse/plugins/defaultratings/ratings.py | Python | gpl-3.0 | 1,154 |
#
# Copyright (C) 2015, Martin Owens <doctormo@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# T... | doctormo/django-cats | cats/views.py | Python | agpl-3.0 | 7,814 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | szha/mxnet | benchmark/opperf/custom_operations/custom_operations.py | Python | apache-2.0 | 2,253 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | keedio/kafka-hue | kafka/src/kafka/urls.py | Python | apache-2.0 | 1,718 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Programa cliente UDP que abre un socket a un servidor."""
import socket
import sys
import hashlib as HL
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
from os import system
from time import time, gmtime, strftime
RESP_COD = {100: 'SIP/2.0 100 Tr... | robernom/ptavi-pfinal | uaclient.py | Python | gpl-2.0 | 5,716 |
import pytest
pytestmark = pytest.mark.page('forms_with_input_elements.html')
class TestLabels(object):
def test_with_selectors_returns_the_matching_elements(self, browser):
assert list(browser.labels('for', 'new_user_first_name')) == \
[browser.label('for', 'new_user_first_name')]
def t... | lmtierney/watir-snake | tests/browser/elements/labels_tests.py | Python | mit | 801 |
"""
jikji/utils
----------------
Utils of jikji
:author: Prev(prevdev@gmail.com)
"""
import re, os, shutil
import json
from urllib.parse import quote_plus, unquote_plus
def load_module(file_path, basepath=None) :
""" Load python module by file path
:param file_path: Location of loading file
:param basepath... | Prev/jikji | jikji/utils.py | Python | mit | 6,788 |
import os
import zipfile
import sys
import tempfile
import unittest
import shutil
import stat
import unicodedata
from subprocess import Popen as _Popen, PIPE as _PIPE
def _extract(self, member, path=None, pwd=None):
"""for zipfile py2.5 borrowed from cpython"""
if not isinstance(member, zipfile... | Orav/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/environment.py | Python | lgpl-3.0 | 4,823 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.