repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
lmazuel/ansible | lib/ansible/modules/cloud/rackspace/rax_clb_ssl.py | 70 | 9636 | #!/usr/bin/python
# 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
jolyonb/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py | 87 | 2147 | """
Tests for the fix_not_found management command
"""
from django.core.management import CommandError, call_command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
class ... | agpl-3.0 |
eayunstack/nova | nova/tests/console/test_console.py | 11 | 7615 | # Copyright (c) 2010 OpenStack Foundation
# Administrator of the National Aeronautics and Space Administration.
# 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... | apache-2.0 |
EraYaN/CouchPotatoServer | libs/pyutil/mathutil.py | 92 | 2257 | # Copyright (c) 2005-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
A few commonly needed functions.
"""
import math
def div_ceil(n, d):
"""
The smallest integer k such that k*d >= n.
"""
return int((n//d) + (n%d != 0))
def next_multiple(n, k):
... | gpl-3.0 |
agry/NGECore2 | scripts/mobiles/endor/deranged_ravisher.py | 2 | 1387 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
kevinmel2000/sl4a | python/src/Lib/encodings/shift_jis_2004.py | 816 | 1059 | #
# shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jis_2004')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | apache-2.0 |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/plat-mac/bundlebuilder.py | 40 | 33754 | #! /usr/bin/env python
"""\
bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
This module contains two classes to build so called "bundles" for
MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass
specialized in building application bundles.
[Bundle|App]Builder objects are instantiat... | gpl-3.0 |
neerja28/Tempest | tempest/api/identity/admin/v3/test_tokens.py | 10 | 6798 | # Copyright 2012 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... | apache-2.0 |
rouge8/moto | tests/test_ec2/test_vpc_peering.py | 23 | 3117 | from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises
from nose.tools import assert_raises
import boto
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2
from tests.helpers import requires_boto... | apache-2.0 |
jamesmunns/wate_backend | prototyping/create_schema.py | 1 | 1046 | import psycopg2
import getpass
username = getpass.getuser()
password = getpass.getpass("Database password for {}: ".format(username))
database = "wate"
def create_user_table(cursor):
user_schema = """
CREATE TABLE users (
id serial PRIMARY KEY,
name text NOT NULL,
use... | mit |
SrNetoChan/Quantum-GIS | python/plugins/db_manager/info_viewer.py | 67 | 5508 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
jpwhite3/wilmu-linux-toolkit | lab_toolkit/includes/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
skycucumber/xuemc | python/venv/lib/python2.7/site-packages/migrate/tests/versioning/test_schemadiff.py | 78 | 6755 | # -*- coding: utf-8 -*-
import os
from sqlalchemy import *
from migrate.versioning import schemadiff
from migrate.tests import fixture
class SchemaDiffBase(fixture.DB):
level = fixture.DB.CONNECT
def _make_table(self,*cols,**kw):
self.table = Table('xtable', self.meta,
Column('id',Inte... | gpl-2.0 |
Wilo/barcampMilagro2015 | pushfeed/pushfeed/pipelines.py | 1 | 1083 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import logging
from scrapy.conf import settings
from scrapy.exceptions import DropItem
import rethinkdb as r
#class Pushfeed... | mit |
trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/test/test_select.py | 9 | 1647 | # Testing select module
from test.test_support import verbose
import select
import os
# test some known error conditions
try:
rfd, wfd, xfd = select.select(1, 2, 3)
except TypeError:
pass
else:
print 'expected TypeError exception not raised'
class Nope:
pass
class Almost:
def fileno(self):
... | gpl-2.0 |
martonw/phantomjs | src/breakpad/src/tools/gyp/test/configurations/inheritance/gyptest-inheritance.py | 430 | 1047 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('configur... | bsd-3-clause |
ask/kamqp | kamqp/client_0_8/__init__.py | 1 | 1253 | """AMQP Client implementing the 0-8 spec."""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library 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... | lgpl-2.1 |
FireBladeNooT/Medusa_1_6 | lib/unidecode/x0c6.py | 253 | 4490 | data = (
'yeoss', # 0x00
'yeong', # 0x01
'yeoj', # 0x02
'yeoc', # 0x03
'yeok', # 0x04
'yeot', # 0x05
'yeop', # 0x06
'yeoh', # 0x07
'ye', # 0x08
'yeg', # 0x09
'yegg', # 0x0a
'yegs', # 0x0b
'yen', # 0x0c
'yenj', # 0x0d
'yenh', # 0x0e
'yed', # 0x0f
'yel', # 0x10
'yelg', ... | gpl-3.0 |
hmpf/nav | python/nav/web/portadmin/urls.py | 1 | 1470 | #
# Copyright (C) 2011, 2013-2015 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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 ... | gpl-3.0 |
shangwuhencc/shogun | examples/undocumented/python_modular/classifier_svmlight_batch_linadd_modular.py | 24 | 1587 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
train_dna=lm.load_dna('../data/fm_train_dna.dat')
test_dna=lm.load_dna('../data/fm_test_dna.dat')
label=lm.load_labels('../data/label_train_dna.dat')
parameter_list=[[train_dna, test_dna, label, 20, 0.9, 1e-7, 1],
[train_dna, test_dna, label, 2... | gpl-3.0 |
virneo/opencog | opencog/python/blending/src/connector/connect_conflict_viable.py | 4 | 6602 | import itertools
from opencog.atomspace import *
from blending.src.connector.base_connector import BaseConnector
from blending.src.connector.connect_util import *
import blending.src.connector.equal_link_key as eq_link
from blending.util.blending_config import BlendConfig
from blending.util.blending_error import blen... | agpl-3.0 |
bmcage/centrifuge-1d | centrifuge1d/modules/direct_consolidation_saturated/options.py | 1 | 7263 | from __future__ import division, print_function
import sys
from ..shared.functions import lagrangian_derivative_coefs
from numpy import linspace, power, empty, array, log
from ..shared.consolidation import (create_CON, CON_SLURRY, CON_GOMPERTZ,
CON_FREEFORM, CON_SLURRY_CC, CON_SLURR... | gpl-2.0 |
Elettronik/SickRage | lib/unidecode/x0d0.py | 253 | 4706 | data = (
'kweon', # 0x00
'kweonj', # 0x01
'kweonh', # 0x02
'kweod', # 0x03
'kweol', # 0x04
'kweolg', # 0x05
'kweolm', # 0x06
'kweolb', # 0x07
'kweols', # 0x08
'kweolt', # 0x09
'kweolp', # 0x0a
'kweolh', # 0x0b
'kweom', # 0x0c
'kweob', # 0x0d
'kweobs', # 0x0e
'kweos', # 0x... | gpl-3.0 |
Notxor/Neuronal | neuronal/neuromotor.py | 1 | 3081 | # -*- coding: utf-8 -*-
# Neuronal - Framework for Neural Networks and Artificial Intelligence
#
# Copyright (C) 2012 dddddd <dddddd@pyphiverses.org>
# Copyright (C) 2012 Notxor <gnotxor@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | agpl-3.0 |
thiagoveras/implicit-mf | mf.py | 2 | 3154 | import numpy as np
import scipy.sparse as sparse
from scipy.sparse.linalg import spsolve
import time
def load_matrix(filename, num_users, num_items):
t0 = time.time()
counts = np.zeros((num_users, num_items))
total = 0.0
num_zeros = num_users * num_items
for i, line in enumerate(open(filename, 'r')... | bsd-2-clause |
Ali-aqrabawi/ezclinic | lib/django/conf/locale/cy/formats.py | 504 | 1822 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '25 Hy... | mit |
Medigate/cutiuta-server | cutiuta-server/env/lib/python3.4/site-packages/pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | gpl-3.0 |
dlenski/stravacli | stravacli/QueryGrabber.py | 1 | 1046 | from http.server import HTTPServer, BaseHTTPRequestHandler
import socket
from urllib.parse import parse_qs
class handler(BaseHTTPRequestHandler):
def do_GET(self):
self.server.received = parse_qs(self.path.split('?',1)[1])
self.send_response(200)
self.end_headers()
self.wfile.write(... | gpl-3.0 |
jarshwah/django | django/contrib/gis/serializers/geojson.py | 31 | 2876 | from __future__ import unicode_literals
from django.contrib.gis.gdal import HAS_GDAL
from django.core.serializers.base import SerializerDoesNotExist
from django.core.serializers.json import Serializer as JSONSerializer
if HAS_GDAL:
from django.contrib.gis.gdal import CoordTransform, SpatialReference
class Seria... | bsd-3-clause |
hanlind/nova | nova/tests/functional/db/test_aggregate.py | 1 | 28761 | # 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 writing, software
# d... | apache-2.0 |
EntityFXCode/arsenalsuite | python/scripts/joberror_handler.py | 10 | 2441 | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtSql import *
from blur.Stone import *
from blur.Classes import *
import blur.email, blur.jabber
import sys, time, re, os
from math import ceil
import traceback
if sys.argv.count('-daemonize'):
from blur.daemonize import createDaemon
createDaemon()
app = QCo... | gpl-2.0 |
failys/CAIRIS | cairis/tools/PseudoClasses.py | 1 | 16629 | # 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... | apache-2.0 |
ZoranPavlovic/kombu | kombu/utils/objects.py | 1 | 1945 | """Object Utilities."""
class cached_property:
"""Cached property descriptor.
Caches the return value of the get method on first call.
Examples:
.. code-block:: python
@cached_property
def connection(self):
return Connection()
@connection.set... | bsd-3-clause |
tecan/xchat-rt | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/build/lib/supybot/plugins/Factoids/test.py | 7 | 8060 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... | gpl-2.0 |
Fuzen-py/BladeAndSoulAPI | BladeAndSoul/bns.py | 1 | 21211 | import asyncio
import json
import aiohttp
from bs4 import BeautifulSoup
from .errors import (CharacterNotFound, FailedToParse, InvalidData,
ServiceUnavialable)
try:
import lxml
parser = 'lxml'
except ImportError:
parser = 'html.parser'
# types of weapons in game
VALID_WEAPONS = ['d... | mit |
damonkohler/sl4a | python/gdata/src/gdata/tlslite/utils/compat.py | 361 | 4060 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... | apache-2.0 |
programadorjc/django | django/contrib/messages/storage/cookie.py | 471 | 6545 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.safestring import SafeData, mark_safe
class Message... | bsd-3-clause |
noironetworks/python-neutronclient | neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py | 2 | 25882 | # Copyright 2016 ZTE Corporation.
# 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 ... | apache-2.0 |
andyliuliming/azure-linux-extensions | VMEncryption/main/DecryptionMarkConfig.py | 8 | 2300 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... | apache-2.0 |
jinnawat/laradock | jupyterhub/jupyterhub_config.py | 10 | 5035 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Configuration file for JupyterHub
import os
c = get_config()
# create system users that don't exist yet
c.LocalAuthenticator.create_system_users = True
def create_dir_hook(spawner):
username = spawner.user.nam... | mit |
atmark-techno/atmark-dist | user/python/Lib/posixpath.py | 8 | 10563 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | gpl-2.0 |
Llamatech/sis-fibo | model/vos/cuenta.py | 1 | 2245 | #-*- coding:iso-8859-1 -*-
"""
Clase que modela la información de una cuenta en el sistema
"""
# NUMERO.SALDO.TIPO_CUENTA,CERRADA,CLIENTE,OFICINA
class Cuenta(object):
def __init__(self, numero, saldo, tipo_cuenta, cerrada, cliente, oficina):
self.numero = numero
self.saldo = saldo
... | gpl-2.0 |
kjung/scikit-learn | sklearn/pipeline.py | 12 | 21283 | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# Licence: BSD
from collections import defaultdict... | bsd-3-clause |
calfonso/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 8 | 79001 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
redhat-cip/tempest | tempest/api/identity/admin/v3/test_projects.py | 9 | 7335 | # Copyright 2013 OpenStack, LLC
# 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 b... | apache-2.0 |
UManPychron/pychron | pychron/lasers/stage_managers/video_stage_manager.py | 2 | 36670 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
michaelkirk/QGIS | python/plugins/processing/gui/NumberInputDialog.py | 4 | 6245 | # -*- coding: utf-8 -*-
"""
***************************************************************************
NumberInputDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
99cloud/keystone_register | openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py | 1 | 12028 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/vimeo.py | 1 | 46584 | # coding: utf-8
from __future__ import unicode_literals
import base64
import functools
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_kwargs,
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
clean_html,
determine_ext... | gpl-3.0 |
IanDoarn/zbsmsa | tests/loans.py | 1 | 15622 | """
loans.py
Final working version of the mutation automation
Mutates items from special excel file from inventory type
CI - Centralized Inventory to type
ZDI - Zimmer Distributor Inventory
Written by: Ian Doarn
Maintained by: Ian Doarn
"""
from zbsmsa.site import Site
from zbsmsa.inventory.stock import Stock, Produ... | apache-2.0 |
LAIRLAB/qr_trees | src/python/run_ilqr_diffdrive.py | 1 | 2328 | #!/usr/bin/env python
#
# Arun Venkatraman (arunvenk@cs.cmu.edu)
# December 2016
#
# If we are not running from the build directory, then add lib to path from
# build assuming we are running from the python folder
import os
full_path = os.path.realpath(__file__)
if full_path.count("src/python") > 0:
import sys
... | bsd-3-clause |
drcapulet/sentry | src/sentry/db/models/fields/gzippeddict.py | 29 | 1600 | """
sentry.db.models.fields.gzippeddict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from django.db import models
from ... | bsd-3-clause |
lucach/spellcorrect | appengine/lib/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | agpl-3.0 |
Mic92/ansible | lib/ansible/playbook/handler.py | 237 | 1957 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 3 of the License, or
# (at your option) an... | gpl-3.0 |
xen0l/ansible | lib/ansible/plugins/terminal/nxos.py | 3 | 3853 | #
# (c) 2016 Red Hat Inc.
#
# 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 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
michaelkuty/django-oscar | src/oscar/apps/search/app.py | 25 | 1040 | from django.conf.urls import url
from haystack.views import search_view_factory
from oscar.apps.search import facets
from oscar.core.application import Application
from oscar.core.loading import get_class
class SearchApplication(Application):
name = 'search'
search_view = get_class('search.views', 'FacetedSe... | bsd-3-clause |
40223220/2015cb | static/Brython3.1.1-20150328-091302/Lib/platform.py | 620 | 51006 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-3.0 |
jbonofre/incubator-beam | sdks/python/apache_beam/runners/direct/watermark_manager.py | 2 | 10737 | #
# 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 us... | apache-2.0 |
baditaflorin/osm-tasking-manager2 | osmtm/tests/__init__.py | 3 | 3772 | # coding: utf8
import ConfigParser
import unittest
import transaction
from sqlalchemy import create_engine
from osmtm.models import (
Base,
User,
License,
Area,
Project,
DBSession,
)
from sqlalchemy_i18n.manager import translation_manager
local_settings_path = 'local.test.ini'
# raise an erro... | bsd-2-clause |
myarjunar/inasafe | safe/common/exceptions.py | 3 | 9919 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Exception Classes.**
Custom exception classes for the SAFE library
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public L... | gpl-3.0 |
wolfgangz2013/rt-thread | bsp/stm32f40x/rtconfig.py | 6 | 3672 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_... | apache-2.0 |
EntropyFactory/creativechain-core | contrib/devtools/github-merge.py | 46 | 10860 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This script will locally construct a merge commit for a pull request on a
# github repository, inspect it, s... | mit |
hansent/kivy | kivy/adapters/dictadapter.py | 7 | 5763 | '''
DictAdapter
===========
.. versionadded:: 1.5
.. warning::
This code is still experimental, and its API is subject to change in a
future version.
A :class:`~kivy.adapters.dictadapter.DictAdapter` is an adapter around a
python dictionary of records. It extends the list-like capabilities of the
:class:`~k... | mit |
gyglim/Recipes | modelzoo/vgg_cnn_s.py | 4 | 2898 | # VGG_CNN_S, model from the paper:
# "Return of the Devil in the Details: Delving Deep into Convolutional Nets"
# 13.1% top-5 error on ILSVRC-2012-val
# Original source: https://gist.github.com/ksimonyan/fd8800eeb36e276cd6f9
# License: non-commercial use only
# Download pretrained weights from:
# https://s3.amazonaws.... | mit |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/gdk/__init__/DisplayManager.py | 1 | 1186 | # encoding: utf-8
# module gtk.gdk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so
# by generator 1.135
# no doc
# imports
from exceptions import Warning
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
import pango as __pango
import pangocairo as __p... | gpl-2.0 |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/reverbnation.py | 64 | 1627 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
qualities,
str_or_none,
)
class ReverbNationIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?reverbnation\.com/.*?/song/(?P<id>\d+).*?$'
_TESTS = [{
'url': 'http://www.reverbnation.com/alkilad... | gpl-3.0 |
bcui6611/healthchecker | Cheetah/DirectiveAnalyzer.py | 15 | 2467 | #!/usr/bin/env python
import os
import pprint
try:
from functools import reduce
except ImportError:
# Assume we have reduce
pass
from Cheetah import Parser
from Cheetah import Compiler
from Cheetah import Template
class Analyzer(Parser.Parser):
def __init__(self, *args, **kwargs):
self.calls... | apache-2.0 |
mcvidomi/poim2motif | run_svm_real.py | 1 | 1483 | '''
Created on 08.06.2015
@author: marinavidovic
'''
import os
import pdb
import utils_svm
import pickle
import numpy as np
import copy
import genQ
import makePOIM
import view
import matplotlib
matplotlib.use('Agg')
if __name__ == '__main__':
read_data = 1
datapath = "/home/mvidovic/POIM... | mit |
larsbergstrom/servo | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_complex_logic.py | 39 | 21420 | # -*- coding: utf-8 -*-
"""
test_complex_logic
~~~~~~~~~~~~~~~~
More complex tests that try to do more.
Certain tests don't really eliminate incorrect behaviour unless they do quite
a bit. These tests should live here, to keep the pain in once place rather than
hide it in the other parts of the test suite.
"""
import... | mpl-2.0 |
SevereOverfl0w/MCDirectory | migrations/versions/10723b632a87_.py | 1 | 1036 | """empty message
Revision ID: 10723b632a87
Revises: 3d7ce850941c
Create Date: 2013-11-12 22:18:26.482191
"""
# revision identifiers, used by Alembic.
revision = '10723b632a87'
down_revision = '3d7ce850941c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | mit |
Thapelo-Tsotetsi/rapidpro | temba/values/tests.py | 2 | 18321 | from __future__ import unicode_literals
from datetime import timedelta
from mock import patch
import json
from django.core.urlresolvers import reverse
from django.utils import timezone
from temba.contacts.models import ContactField
from temba.flows.models import RuleSet
from temba.tests import FlowFileTest
from temba.... | agpl-3.0 |
Meriipu/quodlibet | quodlibet/util/logging.py | 2 | 2096 | # Copyright 2014 Christoph Reiter
#
# 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 your option) any later version.
from __future__ import absolute_imp... | gpl-2.0 |
madrang/pyTSon-AudioBot | requests/packages/chardet/sbcsgroupprober.py | 273 | 3546 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/litv.py | 64 | 6254 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
smuggle_url,
unsmuggle_url,
)
class LiTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?litv\.tv/(?:vod|promo)/[^/]+/(?:content\.do)?\?.*?... | gpl-3.0 |
kmike/scikit-learn | sklearn/linear_model/logistic.py | 2 | 5309 | import numpy as np
from .base import LinearClassifierMixin, SparseCoefMixin
from ..feature_selection.selector_mixin import SelectorMixin
from ..svm.base import BaseLibLinear
class LogisticRegression(BaseLibLinear, LinearClassifierMixin, SelectorMixin,
SparseCoefMixin):
"""Logistic Regres... | bsd-3-clause |
sgraham/nope | third_party/cython/src/Cython/Compiler/Pipeline.py | 90 | 13171 | import itertools
from time import time
import Errors
import DebugFlags
import Options
from Visitor import CythonTransform
from Errors import CompileError, InternalError, AbortError
import Naming
#
# Really small pipeline stages
#
def dumptree(t):
# For quick debugging in pipelines
print t.dump()
return t
... | bsd-3-clause |
klmitch/python-keystoneclient | keystoneclient/tests/unit/v3/test_users.py | 2 | 11616 | # Copyright 2012 OpenStack Foundation
#
# 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... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | agpl-3.0 |
idjaw/horizon | openstack_dashboard/dashboards/project/containers/views.py | 48 | 13326 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
oculusstorystudio/kraken | Python/kraken/ui/GraphView/pyflowgraph/node.py | 1 | 13604 |
#
# Copyright 2015-2017 Eric Thivierge
#
import math
import json
from kraken.ui.Qt import QtWidgets, QtGui, QtCore
from port import InputPort, OutputPort, IOPort
class NodeTitle(QtWidgets.QGraphicsWidget):
__color = QtGui.QColor(25, 25, 25)
__font = QtGui.QFont('Roboto', 14)
__font.setLetterSpacing(QtG... | bsd-3-clause |
edx/edx-platform | lms/djangoapps/program_enrollments/api/tests/test_linking.py | 3 | 20400 | """
Tests for account linking Python API.
"""
from unittest.mock import patch
from uuid import uuid4
from django.test import TestCase
from edx_django_utils.cache import RequestCache
from opaque_keys.edx.keys import CourseKey
from testfixtures import LogCapture
from common.djangoapps.student.api import get_course_ac... | agpl-3.0 |
simplyguru-dot/ansible-modules-extras | notification/pushover.py | 47 | 3403 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com>
# All rights reserved.
#
# 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 F... | gpl-3.0 |
VarnaSuresh/oneanddone | oneanddone/users/migrations/0001_initial.py | 7 | 1130 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | mpl-2.0 |
thaumos/ansible | lib/ansible/modules/storage/zfs/zfs.py | 33 | 7963 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Johan Wiren <johan.wiren.se@gmail.com>
# Copyright: (c) 2017, Ansible Project
# 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__ = t... | gpl-3.0 |
hexxter/home-assistant | homeassistant/components/sensor/worldclock.py | 5 | 1805 | """
Support for showing the time in a different time zone.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.worldclock/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.cons... | mit |
sbellem/django | tests/utils_tests/test_text.py | 243 | 9471 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import override
lazystr = lazy(force_text, six.text... | bsd-3-clause |
martin-mann/bioconda-recipes | recipes/spectra-cluster-cli/spectra-cluster-cli.py | 26 | 2622 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | mit |
orbitfp7/nova | nova/network/__init__.py | 63 | 1418 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
michaelbausor/api-client-staging | generated/python/grpc-google-bigtable-v2/google/bigtable/v2/bigtable_pb2.py | 9 | 49225 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/bigtable/v2/bigtable.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ... | bsd-3-clause |
odahoda/noisicaa | noisidev/runvmtests.py | 1 | 17693 | #!/usr/bin/env python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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
# (... | gpl-2.0 |
kisoku/ansible | lib/ansible/plugins/action/async.py | 13 | 3133 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 3 of the License, or
# (at your option) an... | gpl-3.0 |
pwmarcz/django | tests/admin_widgets/models.py | 36 | 4488 | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
class MyFileField(models.FileField):
pass
@python_2_unicode_compatible
class Member(models.Model):
name = models.CharField(max_lengt... | bsd-3-clause |
Simage/shinken | test/test_service_without_host.py | 14 | 1580 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... | agpl-3.0 |
ZLLab-Mooc/edx-platform | lms/djangoapps/course_wiki/tests/test_tab.py | 158 | 2454 | """
Tests for wiki views.
"""
from django.conf import settings
from django.test.client import RequestFactory
from courseware.tabs import get_course_tab_list
from student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tes... | agpl-3.0 |
knehez/edx-platform | cms/djangoapps/contentstore/views/tests/test_assets.py | 21 | 21518 | """
Unit tests for the asset upload endpoint.
"""
from datetime import datetime
from io import BytesIO
from pytz import UTC
from PIL import Image
import json
from django.conf import settings
from contentstore.tests.utils import CourseTestCase
from contentstore.views import assets
from contentstore.utils import revers... | agpl-3.0 |
akumar21NCSU/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_sanitizer.py | 430 | 4645 | from __future__ import absolute_import, division, unicode_literals
try:
import json
except ImportError:
import simplejson as json
from html5lib import html5parser, sanitizer, constants, treebuilders
def toxmlFactory():
tree = treebuilders.getTreeBuilder("etree")
def toxml(element):
# encode... | mpl-2.0 |
beni55/sympy | sympy/mpmath/tests/test_elliptic.py | 19 | 23954 | """
Limited tests of the elliptic functions module. A full suite of
extensive testing can be found in elliptic_torture_tests.py
Author of the first version: M.T. Taschuk
References:
[1] Abramowitz & Stegun. 'Handbook of Mathematical Functions, 9th Ed.',
(Dover duplicate of 1972 edition)
[2] Whittaker 'A Course ... | bsd-3-clause |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/encodings/cp857.py | 593 | 34164 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | gpl-3.0 |
sebmolinari/los-kpos | app/mod_auth/controllers.py | 1 | 4029 | #Flask imports
from flask import Blueprint, render_template, flash, redirect, url_for, abort
from flask.ext.login import LoginManager, login_required, logout_user, login_user
#App imports
from app import app
from app.mod_auth.forms import LoginForm, UserForm, EmailForm, PasswordForm
from app.mod_auth.models import Use... | gpl-3.0 |
SRI-CSL/ETB | demos/allsatlive/yices_parse.py | 1 | 2665 | #Defines grammar for reading yices files; used in the include <file> api for yices.
from pyparsing import *
#Grammar for s-expressions which is used to parse Yices expressions
token = Word(alphanums + "-./_:*+=!<>")
LPAR = "("
RPAR = ")"
#Yices comments are ignored; parentheses are retained since Yices expressions a... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.