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 |
|---|---|---|---|---|---|
# encoding: utf-8
"""
menu.py
Created by Thomas Mangin on 2012-02-25.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
import sys
import time
from .img import png
from .images import logo
python = '%s %s' % ('Pypy' if 'PyPy' in sys.version else 'Python', sys.version.split()[0])
def html (title,header... | david-farrar/exaproxy | lib/exaproxy/html/menu.py | Python | bsd-2-clause | 3,102 |
import re
from rest_framework import serializers
from .models import Collection, CollectionIcon
class CollectionSerializer(serializers.ModelSerializer):
"""Collections's serializer"""
class Meta:
model = Collection
read_only = ('token', )
class CollectionIconSerializer(serializers.ModelSe... | hackoose/myicons | iconcollections/serializers.py | Python | bsd-2-clause | 1,272 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | morelab/weblabdeusto | server/src/test/unit/weblab/lab/test_status_handler.py | Python | bsd-2-clause | 3,023 |
import datetime
import decimal
from time import time
from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger
logger = getLogger('django.db.backends')
class CursorDebugWrapper(object):
def __init__(self, cursor, db):
self.cursor = cursor
self.db = db ... | rimbalinux/MSISDNArea | django/db/backends/util.py | Python | bsd-3-clause | 4,684 |
#!/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... | wanghongjuan/crosswalk-test-suite | apptools/apptools-android-tests/apptools/manifest_multiple_icons.py | Python | bsd-3-clause | 7,176 |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry import filters
from sentry.api.bases.project import ProjectEndpoint
class ProjectFiltersEndpoint(ProjectEndpoint):
def get(self, request, project):
"""
List a project's filters
Retrieve a lis... | JackDanger/sentry | src/sentry/api/endpoints/project_filters.py | Python | bsd-3-clause | 923 |
# -*- coding: utf-8 -*-
"""
lantz.drivers.aa.aotf
~~~~~~~~~~~~~~~~~~~~~
Implements the drivers for an AOTF Controller
Implementation Notes
--------------------
There are currently two (disconnected) ways of setting the power for each
line: powerdb and power.
Sources::
- MDS... | varses/awsch | lantz/drivers/aa/aotf.py | Python | bsd-3-clause | 2,531 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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 applica... | realms-team/solmanager | libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/notification.py | Python | bsd-3-clause | 4,320 |
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
from ..forest import Forest
def simple_forest():
""" generate a simple forest
"""
parents = np.array([2, 2, 4, 4, 4])
F = Forest(5, parents)
return F
def test_forest():
""" test creation of forest... | alexis-roche/nipy | nipy/algorithms/graph/tests/test_forest.py | Python | bsd-3-clause | 3,578 |
# Django settings for firsty project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'N... | theicfire/djangofun | src/firsty/settings.py | Python | bsd-3-clause | 5,085 |
# Generated by Django 1.11.13 on 2018-06-01 09:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("events", "0011_auto_20180416_0138")]
operations = [
migrations.AlterField(
model_name="event",
name="deadline",
fiel... | watchdogpolska/poradnia.siecobywatelska.pl | poradnia/events/migrations/0012_auto_20180601_1104.py | Python | bsd-3-clause | 556 |
#!/usr/bin/env python
# coding=utf-8
import re
import os
from cgi import escape
EMOJIS = [
':Aquarius:', ':two_women_in_love:', ':bus_stop:', ':speak_no_evil_monkey:',
':chicken:', ':heart_eyes:', ':Scorpius:', ':smiley_confused:',
':cat_face_with_wry_smile:', ':GAKUEngine:', ':pistol:', ':relieved:',
... | xtao/code | vilya/libs/emoji.py | Python | bsd-3-clause | 8,756 |
# encoding: UTF-8
from vnpy.trader import vtConstant
from .tkproGateway import TkproGateway
gatewayClass = TkproGateway
gatewayName = 'TKPRO'
gatewayDisplayName = 'TKPRO'
gatewayType = vtConstant.GATEWAYTYPE_EQUITY
gatewayQryEnabled = True
| harveywwu/vnpy | vnpy/trader/gateway/tkproGateway/__init__.py | Python | mit | 242 |
#from opengmcore import _opengmcore.adder as adder
from opengmcore import *
from __version__ import version
from functionhelper import *
from _inf_param import _MetaInfParam , InfParam
from _visu import visualizeGm
from _misc ... | joergkappes/opengm | src/interfaces/python/opengm/__init__.py | Python | mit | 10,979 |
'''Doc build constants'''
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DOCKER_SOCKET = getattr(settings, 'DOCKER_SOCKET', 'unix:///var/run/docker.sock')
DOCKER_VERSION = getattr(settings, 'DOCKER_VERSION', 'auto')
DOCKER_IMAGE = getattr(settings, 'DOCKER_IMAGE', 'rtfd-buil... | titiushko/readthedocs.org | readthedocs/doc_builder/constants.py | Python | mit | 491 |
# 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 ... | sharadagarwal/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/resource_collection.py | Python | mit | 1,520 |
# -*- coding: utf-8 -*-
"""
The rrule module offers a small, complete, and very fast, implementation of
the recurrence rules documented in the
`iCalendar RFC <http://www.ietf.org/rfc/rfc2445.txt>`_,
including support for caching of results.
"""
import itertools
import datetime
import calendar
import sys
from six impor... | drpaneas/linuxed.gr | lib/python2.7/site-packages/dateutil/rrule.py | Python | mit | 47,634 |
import unittest
import lockserver_daemon as lockserver
class TheTestCase(unittest.TestCase):
def setUp(self):
# Reset the lockserver's global variables between each test.
lockserver.init_globals()
def testUserAndNodeLockContention_one(self):
# Start three sessions.
sess = []
sess.append(lo... | sburnett/seattle | seattlegeni/lockserver/tests/unit/ut_lockserverunit_user_and_node_locks.py | Python | mit | 6,231 |
#
# The Python Imaging Library.
# $Id$
#
# transform wrappers
#
# History:
# 2002-04-08 fl Created
#
# Copyright (c) 2002 by Secret Labs AB
# Copyright (c) 2002 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from . import Image
class Transform(Image.ImageTransformHandler):
... | ryfeus/lambda-packs | pytorch/source/PIL/ImageTransform.py | Python | mit | 2,839 |
# This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | denny820909/builder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_config.py | Python | mit | 43,114 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import subprocess
import sys
import os.path as p
import glob
PY_MAJOR, PY_MINOR = sys.version_info[ 0 : 2 ]
if not ( ( PY_MAJOR == 2 and... | sunchuanleihit/vimrc | sources_non_forked/YouCompleteMe/install.py | Python | mit | 1,500 |
# This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | denny820909/builder | lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/test/__init__.py | Python | mit | 2,076 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 use, copy, modify, merge, publish,
... | Distrotech/scons | test/Script-import.py | Python | mit | 2,878 |
#!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet group functionality."""
from test_framework.test_framework import BitcoinTestFramework
fro... | OmniLayer/omnicore | test/functional/wallet_groups.py | Python | mit | 3,669 |
import dis
import sys
from cStringIO import StringIO
import unittest
def disassemble(func):
f = StringIO()
tmp = sys.stdout
sys.stdout = f
dis.dis(func)
sys.stdout = tmp
result = f.getvalue()
f.close()
return result
def dis_single(line):
return disassemble(compile(l... | j5shi/Thruster | pylibs/test/test_peepholer.py | Python | gpl-2.0 | 9,096 |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'win32service.pyd')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32service.py | Python | gpl-2.0 | 283 |
# -*- coding: utf-8 -*-
from kivy.uix.listview import ListView
from kivy.uix.floatlayout import FloatLayout
from kivy.clock import Clock
from kivy.adapters.listadapter import ListAdapter
from kivy.adapters.models import SelectableDataItem
from kivy.uix.listview import ListItemButton
from random import choice
from str... | danstoner/python_experiments | playing_with_kivy/kivi-examples/widgets/lists/list_reset_data.py | Python | gpl-2.0 | 2,398 |
#!/usr/bin/env python
#
# HPFeeds.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... | amohanta/thug | src/Logging/modules/HPFeeds.py | Python | gpl-2.0 | 6,225 |
#
# namcap rules - fileownership
# Copyright (C) 2003-2009 Jason Chu <jason@archlinux.org>
#
# 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 2 of the License, or
# (at y... | keenerd/namcap | Namcap/rules/fileownership.py | Python | gpl-2.0 | 1,345 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(seriali... | joshsmith2/superlists | lists/migrations/0001_initial.py | Python | gpl-2.0 | 492 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | stgraber/snapcraft | snapcraft/tests/test_plugin_qmake.py | Python | gpl-3.0 | 13,085 |
#!/usr/bin/env python
#
# Copyright 2008 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | jonnyhtw/cylc | lib/xdot.py | Python | gpl-3.0 | 97,799 |
r"""An implementation of the Web Site Process Bus.
This module is completely standalone, depending only on the stdlib.
Web Site Process Bus
--------------------
A Bus object is used to contain and manage site-wide behavior:
daemonization, HTTP server start/stop, process reload, signal handling,
drop privileges, PID ... | rembo10/headphones | lib/cherrypy/process/wspbus.py | Python | gpl-3.0 | 21,460 |
# -*- coding: utf-8 -*-
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 ap... | FedeMPouzols/Savu | doc/source/files_and_images/example_test.py | Python | gpl-3.0 | 1,241 |
"""
Copyright 2007 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from os import path
from gi.repository import Gtk
from . import Constants, Utils, Dialogs
class FileDialogHelper(Gtk.FileChooserDialog, object):
"""
A wrapper class for the gtk ... | mrjacobagilbert/gnuradio | grc/gui/FileDialogs.py | Python | gpl-3.0 | 6,524 |
# 05_rna_ghosts.py
# Copyright 2008 by The University of York
# Author: Bernhard Lohkamp
# Copyright 2007, 2008 by The University of Oxford
# Author: Paul Emsley
# 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 Soft... | jlec/coot | python-tests/05_rna_ghosts.py | Python | gpl-3.0 | 4,736 |
from django.core.management.base import BaseCommand
from south.db import db
class Command(BaseCommand):
help = "Adds indexes that have to be defined with raw SQL commands"
def handle(self, **options):
db.execute('alter table videos_videourl add unique url_type (url(255), type);')
| ofer43211/unisubs | apps/videos/management/commands/setup_indexes.py | Python | agpl-3.0 | 298 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import date
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
from odoo.osv import expression
class Contract(models.Mode... | rven/odoo | addons/hr_contract/models/hr_contract.py | Python | agpl-3.0 | 11,699 |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import logging
import re
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
from kamaki.clients import astakos, cyclades
from kamaki.clients import ClientError
from kamaki.cli.config ... | themiszamani/okeanos-LoD | core/fokia/provisioner.py | Python | agpl-3.0 | 21,373 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | proyectos-analizo-info/pybossa-analizo-info | pybossa/auth/__init__.py | Python | agpl-3.0 | 1,618 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA
# Author: Arnaud WÃŒst
#
#
# This file is part of the c2c_report_tools module.
#
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the w... | VitalPet/c2c-rd-addons | c2c_reporting_tools_chricar/core/__init__.py | Python | agpl-3.0 | 1,404 |
# Copyright 2013-2021 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 PerlInline(PerlPackage):
"""Write Perl Subroutines in Other Programming Languages"""
... | LLNL/spack | var/spack/repos/builtin/packages/perl-inline/package.py | Python | lgpl-2.1 | 603 |
# Copyright (c) 2013 eBay Software Foundation
# 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. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | CMSS-BCRDB/RDS | trove/guestagent/datastore/experimental/couchbase/system.py | Python | apache-2.0 | 2,404 |
from nose.tools import assert_raises, eq_, ok_
from mockredis.tests.fixtures import setup, teardown
class TestRedisZset(object):
"""zset tests"""
def setup(self):
setup(self)
def teardown(self):
teardown(self)
def test_zadd(self):
key = "zset"
values = [("one", 1), ... | yossigo/mockredis | mockredis/tests/test_zset.py | Python | apache-2.0 | 20,160 |
from __future__ import unicode_literals
import base64
import botocore.client
import boto3
import hashlib
import io
import json
import zipfile
import sure # noqa
from freezegun import freeze_time
from moto import mock_lambda, mock_s3, mock_ec2, settings
def _process_lamda(pfunc):
zip_output = io.BytesIO()
z... | heddle317/moto | tests/test_awslambda/test_lambda.py | Python | apache-2.0 | 14,853 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MULTI_TENANT = True
AUTH_USER_MODEL = 'account.EWSUser'
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
# import Celery config
import djcelery
djcelery.setup_loader()
BROKER_URL = 'amqp://guest:guest@localhost:5672/'
ALLOWED_HOSTS = ['*',]
from datetime import time... | nyrocron/eve-wspace | evewspace/evewspace/settings.py | Python | apache-2.0 | 8,416 |
# pylint: skip-file
from __future__ import print_function
import mxnet as mx
from mxnet import gluon
from mxnet.gluon import nn
import numpy as np
import logging
from common import get_data
from mxnet import autograd
logging.basicConfig(level=logging.DEBUG)
# define network
def get_net():
net = nn.Sequential()
... | hotpxl/mxnet | tests/python/train/test_autograd.py | Python | apache-2.0 | 2,949 |
#!/usr/bin/env python
# ===--- generate_harness.py ---------------------------------------------===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See ... | IngmarStein/swift | benchmark/scripts/generate_harness/generate_harness.py | Python | apache-2.0 | 3,411 |
# Copyright 2014 LinkedIn Corp.
#
# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later
# version.
#
# This file is distr... | pubnub/Zopkio | zopkio/remote_host_helper.py | Python | apache-2.0 | 6,888 |
#
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–14 martin f. krafft <madduck@madduck.net>
# Released under the terms of the Artistic Licence 2.0
#
class _Constant(object):
def __init__(self, displayname):
self._repr = displayname
__s... | madduck/reclass | reclass/constants.py | Python | artistic-2.0 | 444 |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
import warnings
from . import AWSHelperFn, AWSObject, AWSProperty
warnings.warn("This module is outdated and will be replaced with "
"troposphere.dynamodb2. Please see the README for "
... | Yipit/troposphere | troposphere/dynamodb.py | Python | bsd-2-clause | 2,797 |
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings, skipUnlessDBFeature
from django.test.utils import requires_tz_support
from django.utils import timezone
from .models import Artist, Author, Book, BookSigning, Page
def _make_books(n, base_dat... | tysonclugg/django | tests/generic_views/test_dates.py | Python | bsd-3-clause | 35,527 |
"""
Command for dumping soft schema definitions
"""
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
from django.core import serializers
from optparse import make_option
from tardis.tardis_portal import models
class Command(BaseCommand):
help... | eresearchrmit/hpctardis | tardis/tardis_portal/management/commands/dumpschemas.py | Python | bsd-3-clause | 1,683 |
from django.db import transaction
from django.test import TestCase
from .models import FloatModel
class TestFloatField(TestCase):
def test_float_validates_object(self):
instance = FloatModel(size=2.5)
# Try setting float field to unsaved object
instance.size = instance
with trans... | etos/django | tests/model_fields/test_floatfield.py | Python | bsd-3-clause | 1,149 |
###################################################################
# Numexpr - Fast numerical array expression evaluator for NumPy.
#
# License: MIT
# Author: See AUTHORS.txt
#
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
# rights to use.
##########################################... | Alwnikrotikz/numexpr | bench/vml_timing.py | Python | mit | 5,758 |
from typing import List, Optional
from .base import BaseDistribution, BaseEnvironment, FilesystemWheel, MemoryWheel, Wheel
__all__ = [
"BaseDistribution",
"BaseEnvironment",
"FilesystemWheel",
"MemoryWheel",
"Wheel",
"get_default_environment",
"get_environment",
"get_wheel_distribution... | sbidoul/pip | src/pip/_internal/metadata/__init__.py | Python | mit | 2,036 |
#!/usr/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.web
from tornado.options import options
from settings import settings
from urls import url_patterns
class TornadoBoilerplate(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(self, url_patter... | listen1/listen1 | listen1/app.py | Python | mit | 555 |
import logging
import re
from datafeeds.parser_base import ParserBase
class TbaVideosParser(ParserBase):
"""
Facilitates building TBAVideos store from TBA.
"""
@classmethod
def parse(self, html):
"""
Parse the directory listing on TBA to extract relevant TBAVideo
informati... | the-blue-alliance/the-blue-alliance | old_py2/datafeeds/parsers/tba/tba_videos_parser.py | Python | mit | 860 |
'''
3D Rotating Monkey Head
========================
This example demonstrates using OpenGL to display a rotating monkey head. This
includes loading a Blender OBJ file, shaders written in OpenGL's Shading
Language (GLSL), and using scheduled callbacks.
The monkey.obj file is an OBJ file output from the Blender free 3... | Cheaterman/kivy | examples/3Drendering/main.py | Python | mit | 2,405 |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template settings for American Red Cross
Demo only, not in Production
"""
T = current.T
# ==============================================... | flavour/eden | modules/templates/historic/ARC/config.py | Python | mit | 84,335 |
"""optparse - a powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik; see http://optik.sourceforge.net/ .
If you have problems with this module, please do not file bugs,
patches, or feature requests with Python; instead, use Optik's
SourceForge project ... | pombreda/django-hotclub | libs/external_libs/docutils-0.4/extras/optparse.py | Python | mit | 51,584 |
from . import keyboards
| chancegrissom/qmk_firmware | lib/python/qmk/cli/list/__init__.py | Python | gpl-2.0 | 24 |
# -*- coding: utf-8 -*-
import pytest
import env # noqa: F401
from pybind11_tests import kwargs_and_defaults as m
def test_function_signatures(doc):
assert doc(m.kw_func0) == "kw_func0(arg0: int, arg1: int) -> str"
assert doc(m.kw_func1) == "kw_func1(x: int, y: int) -> str"
assert doc(m.kw_func2) == "k... | YannickJadoul/Parselmouth | pybind11/tests/test_kwargs_and_defaults.py | Python | gpl-3.0 | 10,048 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chris Hoffman <christopher.hoffman@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 ... | chepazzo/ansible-modules-extras | packaging/language/npm.py | Python | gpl-3.0 | 8,565 |
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
from ..helpers.translators import verify_translate
from grenade.translators.sequence import SequenceTranslator
from probe.fixtures.mock_shotgun import MockShotgun
class TestSequenceTranslator(objec... | xxxIsaacPeralxxx/anim-studio-tools | grenade/tests/unit/test_translators/test_sequence.py | Python | gpl-3.0 | 3,110 |
"""
Script for exporting all courseware from Mongo to a directory
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.contentstore.django import contentstore
class Command(BaseC... | geekaia/edx-platform | cms/djangoapps/contentstore/management/commands/export_all_courses.py | Python | agpl-3.0 | 1,450 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | jmesteve/saas3 | openerp/addons/crm_claim/crm_claim.py | Python | agpl-3.0 | 9,712 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/r-rngtools/package.py | Python | lgpl-2.1 | 2,067 |
class I18N(object):
def example(self):
return "This is an example"
def another_example(self):
return "This is another example"
i18n = I18N()
locale = 'en'
domains = []
import domain
domains.append('domain')
import domain.subdomain
domains.append('domain.subdomain')
def set_locale(loc):
... | certik/pyjamas | examples/libtest/I18N/__init__.py | Python | apache-2.0 | 680 |
import csv
import logging
import json
import sys
import urllib2
from django.conf import settings
from django.core.management.base import BaseCommand
from machine.models import Machine
logger = logging.getLogger(__name__)
XMAN_URL = "http://10.180.2.243/api/hostinfo.php?sql=hostname+=+'%s'"
IDC_ABBR = {
'shangdi... | zxl200406/minos | owl/machine/management/commands/import_xman.py | Python | apache-2.0 | 2,543 |
import json
from .oauth import OAuth2Test
class CourseraOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.coursera.CourseraOAuth2'
user_data_url = \
'https://api.coursera.org/api/externalBasicProfiles.v1?q=me'
expected_username = '560e7ed2076e0d589e88bd74b6aad4b7'
access_token_body... | tobias47n9e/social-core | social_core/tests/backends/test_coursera.py | Python | bsd-3-clause | 1,107 |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | geggo/pyface | pyface/wx/image.py | Python | bsd-3-clause | 981 |
# Authors: Robert Luke <mail@robertluke.net>
# Frank Fishburn
#
# License: BSD (3-clause)
import numpy as np
from ... import pick_types
from ...io import BaseRaw
from ...utils import _validate_type
from ...io.pick import _picks_to_idx
def temporal_derivative_distribution_repair(raw):
"""Apply temporal... | olafhauk/mne-python | mne/preprocessing/nirs/_tddr.py | Python | bsd-3-clause | 4,673 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from django.conf import settings
from haystack.backends import BaseEngine
from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend, ElasticsearchSearchQuery
from haystack.c... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/haystack/backends/elasticsearch2_backend.py | Python | mit | 14,291 |
# -*- coding: UTF-8 -*-
"""
Copyright (C) 2014 smokdpi
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 option) any later version.
... | dannyperry571/theapprentice | script.module.urlresolver/lib/urlresolver/plugins/uptobox.py | Python | gpl-2.0 | 3,054 |
# coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%... | LispyAriaro/instant-press | languages/pl.py | Python | gpl-2.0 | 9,384 |
"""
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats,
integers, bools etc. However, it is possible for elements to be combinations
of these using structured types, such as::
>>> a = np.array([(1, 2... | valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/numpy/core/records.py | Python | gpl-2.0 | 29,422 |
#!/usr/bin/env python
from egfrd import *
from logger import *
import sys
import math
model='mapk3-c'
V_str = sys.argv[1]
D_ratio_str = sys.argv[2]
D_mode = sys.argv[3]
ti_str = sys.argv[4]
mode = sys.argv[5]
T_str = sys.argv[6]
V = float(V_str)
D_ratio = float(D_ratio_str)
ti = float(ti_str)
T = float(T_str)
# ... | Seynen/egfrd | samples/mapk/model3-conc.py | Python | gpl-2.0 | 4,745 |
"""Set of Mocks and stubs for network utilities unit tests.
Implement a set of mocks and stubs use to implement unit tests
for the network libraries.
"""
import socket
from autotest.client.shared.test_utils import mock
from autotest.client.net import net_utils
def os_open(*args, **kwarg):
return os_stub('open')... | nacc/autotest | client/net/net_utils_mock.py | Python | gpl-2.0 | 2,952 |
from nupic.encoders import (LogEncoder, DateEncoder, MultiEncoder, ScalarEncoder)
from nupic.data import FunctionSource
from nupic.frameworks.prediction.callbacks import displaySPCoincidences, printSPCoincidences
from nupic.data.dictutils import DictObj
nCoincidences = 30
iterationCount = 10000
nRandomFields = 1
ra... | chetan51/nupic | examples/prediction/experiments/generated_data/description.py | Python | gpl-3.0 | 4,064 |
"""Test overloaded method resolution in VTK-Python
The wrappers should call overloaded C++ methods using similar
overload resolution rules as C++. Python itself does not have
method overloading.
Created on Feb 15, 2015 by David Gobbi
"""
import sys
import vtk
from vtk.test import Testing
class TestOverloads(Testi... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Common/Core/Testing/Python/TestOverloads.py | Python | gpl-3.0 | 2,562 |
import unittest
from helper import UsesQApplication
from PySide.QtCore import QTimer
from PySide.QtGui import QPainter, QFont, QFontInfo, QWidget, qApp
class MyWidget(QWidget):
def paintEvent(self, e):
p = QPainter(self)
self._info = p.fontInfo()
self._app.quit()
class TestQPainter(Uses... | M4rtinK/pyside-android | tests/QtGui/bug_750.py | Python | lgpl-2.1 | 577 |
'''OpenGL extension ARB.robustness_application_isolation
This module customises the behaviour of the
OpenGL.raw.WGL.ARB.robustness_application_isolation to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/robustness_application_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/WGL/ARB/robustness_application_isolation.py | Python | lgpl-3.0 | 867 |
# Copyright 2015-present Scikit Flow Authors. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | shareactorIO/pipeline | source.ml/jupyterhub.ml/notebooks/zz_old/TensorFlow/SkFlow_DEPRECATED/iris.py | Python | apache-2.0 | 1,182 |
# -*- coding: utf-8 -*-
"""
test utils for logbook
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import functools
import os
import sys
from contextlib import contextmanager
import logbook
from logbook.helpers import String... | RazerM/logbook | tests/utils.py | Python | bsd-3-clause | 2,507 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.internal.actions import loop
from telemetry.testing import tab_test_case
import py_utils
AUDIO_1_LOOP_CHEC... | benschmaus/catapult | telemetry/telemetry/internal/actions/loop_unittest.py | Python | bsd-3-clause | 2,356 |
#! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# 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 copy... | matthewalbani/scipy | scipy/spatial/tests/test_distance.py | Python | bsd-3-clause | 56,454 |
"""
Task sequencer - full
"""
import sys
import logging
from teuthology import run_tasks
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Run a set of tasks to completion in order. __exit__ is called on a task
before __enter__ on the next
example:
- full_sequential:
- taskte... | robbat2/teuthology | teuthology/task/full_sequential.py | Python | mit | 986 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
from jnius.reflect import autoclass
class SimpleEnum(unittest.TestCase):
def test_enum(self):
SimpleEnum = autoclass('org.jnius.SimpleEnum')
self.assertTrue(SimpleEnum)
... | PortfolioEffect/jniusx | tests/test_enum.py | Python | mit | 522 |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from .._ffi import FFIEngineError, register_ffi
from .._types import str_cls
from ..errors import LibraryNotFoundError
try:
import cffi
except (ImportError):
raise FFIEngineError('Error importing cffi')
__all... | igor-rangel7l/igorrangel.repository | plugin.video.SportsDevil/service/oscrypto/_win/_kernel32_cffi.py | Python | gpl-2.0 | 1,029 |
import networkx as nx
#from networkx.generators.smax import li_smax_graph
def s_metric(G, normalized=True):
"""Return the s-metric of graph.
The s-metric is defined as the sum of the products deg(u)*deg(v)
for every edge (u,v) in G. If norm is provided construct the
s-max graph and compute it's s_met... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/smetric.py | Python | gpl-3.0 | 1,194 |
# -*- coding: utf-8 -*-
from ..internal.DeadHoster import DeadHoster
class FiredriveCom(DeadHoster):
__name__ = "FiredriveCom"
__type__ = "hoster"
__version__ = "0.11"
__status__ = "stable"
__pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
__co... | Arno-Nymous/pyload | module/plugins/hoster/FiredriveCom.py | Python | gpl-3.0 | 502 |
"""Support for Transport NSW (AU) to query next leave event."""
from datetime import timedelta
import logging
from TransportNSW import TransportNSW
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_MODE,
CONF_API_K... | nkgilley/home-assistant | homeassistant/components/transport_nsw/sensor.py | Python | apache-2.0 | 4,543 |
# Copyright 2011 OpenStack Foundation
# 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. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | tlakshman26/cinder-https-changes | cinder/api/v2/limits.py | Python | apache-2.0 | 15,147 |
# How long should we wait on EACH commit() checkpoint: for ipaddr,
# ports etc. That's not total commit() timeout.
SYNC_TIMEOUT = 5
class DeprecationException(Exception):
pass
class CommitException(Exception):
pass
class CreateException(Exception):
pass
| tomislacker/python-iproute2 | pyroute2/ipdb/common.py | Python | apache-2.0 | 272 |
import mixedcase
encoders = mixedcase.encoders
for encoder in encoders:
encoder["character encoding"] = "latin-1"
| zachriggle/alpha3 | x86/latin_1/__init__.py | Python | bsd-3-clause | 122 |
from django import forms
class APIUploadForm(forms.Form):
epub_data = forms.FileField()
api_key = forms.CharField(max_length=255)
| erochest/threepress-rdfa | bookworm/api/forms.py | Python | bsd-3-clause | 139 |
import datetime
import decimal
from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import ... | lzw120/django | django/contrib/admin/util.py | Python | bsd-3-clause | 15,005 |
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponse
from wagtail.contrib.wagtailroutablepage.models import RoutablePage, route
def routable_page_external_view(request, arg="ARG NOT SET"):
return HttpResponse("EXTERNAL VIEW: " + arg)
class RoutablePageTest(RoutablePage... | chrxr/wagtail | wagtail/tests/routablepage/models.py | Python | bsd-3-clause | 1,231 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import os
from setuptools import setup, find_packages
from wiki import VERSION
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have ... | PolyLAN/django-wiki | setup.py | Python | gpl-3.0 | 3,883 |