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 |
|---|---|---|---|---|---|
Agnishom/kabooblydoo | lib/werkzeug/__init__.py | 116 | 7211 | # -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... | mit |
novafloss/django-agnocomplete | demo/tests/test_admin_views.py | 1 | 1715 | from django.test import TestCase
from django.urls import reverse
from django.contrib.auth.models import User
from ..admin import FavoriteColorModelForm
class AdminTest(TestCase):
def setUp(self):
super(AdminTest, self).setUp()
# create a superuser to be logged in
self.admin = User.object... | mit |
argv0/cloudstack | tools/marvin/marvin/sandbox/basic/basic_env.py | 2 | 4360 | #!/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... | apache-2.0 |
ManuSchmi88/landlab | landlab/plot/imshow.py | 3 | 21050 | #! /usr/bin/env python
"""
Methods to plot data defined on Landlab grids.
Plotting functions
++++++++++++++++++
.. autosummary::
:toctree: generated/
~landlab.plot.imshow.imshow_grid
~landlab.plot.imshow.imshow_grid_at_cell
~landlab.plot.imshow.imshow_grid_at_node
"""
import numpy as np
import insp... | mit |
ToBaer94/pygame_platformer | main.py | 1 | 2485 | import sys
import pygame as pg
from states.splash_state import SplashScreen
from states.map_state import Map
from states.gameplay_state import GamePlay
from states.level_start_state import LevelOpening
from states.gameover_state import GameOver
class Game(object):
def __init__(self, screen, states, start_state):
... | lgpl-3.0 |
darkleons/odoo | addons/document/wizard/document_configuration.py | 381 | 4895 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
carlye566/IoT-POX | pox/samples/mixed_switches.py | 72 | 2085 | # Copyright 2012 James McCauley
#
# 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 writi... | apache-2.0 |
neuroelectro/neuroelectro_org | db_functions/country_codes.py | 2 | 9916 | #!/usr/bin/python
# coding: utf-8
""" This file needs to be maintained by hand.
see: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
see: http://www.iso.org/iso/iso3166_en_code_lists.txt
"""
country_code = {'AD': 'Andorra',
'AE': 'United Arab Emirates',
'AF': 'Afghanistan'... | gpl-2.0 |
denny820909/builder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_util_bbcollections.py | 4 | 2388 | # 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... | mit |
yawnosnorous/python-for-android | python3-alpha/python3-src/Tools/demo/markov.py | 107 | 3685 | #!/usr/bin/env python3
"""
Markov chain simulation of words or characters.
"""
class Markov:
def __init__(self, histsize, choice):
self.histsize = histsize
self.choice = choice
self.trans = {}
def add(self, state, next):
self.trans.setdefault(state, []).append(next)
def p... | apache-2.0 |
barnsnake351/nova | nova/pci/devspec.py | 69 | 6570 | #
# 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
# ... | apache-2.0 |
leiferikb/bitpop | src/tools/prepare-bisect-perf-regression.py | 35 | 2332 | #!/usr/bin/env python
# Copyright (c) 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.
"""Prepare Performance Test Bisect Tool
This script is used by a trybot to create a working directory and sync an
initial copy of ... | gpl-3.0 |
bdang2012/taiga-back-casting | taiga/export_import/service.py | 1 | 21533 | # Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.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
# pub... | agpl-3.0 |
ajmarks/wal-e | wal_e/worker/s3/s3_deleter.py | 14 | 1104 | from wal_e import exception
from wal_e import retries
from wal_e.worker.base import _Deleter
class Deleter(_Deleter):
@retries.retry()
def _delete_batch(self, page):
# Check that all keys are in the same bucket; this code is not
# designed to deal with fast deletion of keys from multiple
... | bsd-3-clause |
fpt-software/seniot-data-workflow | nodes/core/hardware/nrgpio.py | 38 | 6200 | #!/usr/bin/python
#
# Copyright 2014 IBM Corp.
#
# 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 |
MwanzanFelipe/rockletonfortune | mysite/settings.py | 2 | 3895 | # Copyright 2015 Google Inc. 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 applicable law or a... | bsd-3-clause |
niwinz/Green-Mine | src/greenmine/urls.py | 1 | 2396 | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
js_info_dict = {
'packages': ('greenmine',),
}
from greenmine.base.views import api
from greenmine.base.views import config
f... | bsd-3-clause |
sominn/android_kernel_samsung_golden | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
40223226/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py | 625 | 25849 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... | gpl-3.0 |
Erkan-Yilmaz/twister-core | libtorrent/tools/parse_disk_access.py | 57 | 2523 | #! /usr/bin/env python
import os, sys, time
lines = open(sys.argv[1], 'rb').readlines()
# logfile format:
# <time(us)> <key>: <value>
# example:
# 16434 read cache: 17
keys = ['read', 'write', 'head movement', 'seek per read byte', 'seek per written byte',
'read operations per second', 'write operations per second... | mit |
jlmadurga/django-telegram-bot | tests/settings.py | 1 | 1578 | # flake8: noqa
DEBUG=True,
USE_TZ=True
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
ROOT_URLCONF="tests.urls"
INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
'django.contrib.sessions',
"rest_framework",
"teleg... | bsd-3-clause |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | libs/tornado/httpserver.py | 66 | 11199 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | gpl-3.0 |
YukinoHayakawa/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/msvs/external_builder/gyptest-all.py | 260 | 1878 | #!/usr/bin/env python
# Copyright (c) 2013 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 that msvs_external_builder being set will invoke the provided
msvs_external_builder_build_cmd and msvs_external_builder_clean_c... | gpl-3.0 |
shiquanwang/caffe | python/caffe/detector.py | 25 | 3902 | #!/usr/bin/env python
"""
Do windowed detection by classifying a number of images/crops at once,
optionally using the selective search window proposal method.
This implementation follows ideas in
Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik.
Rich feature hierarchies for accurate object detection... | bsd-2-clause |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | mit |
weibocom/opendcp | octans/octans/worker/executor.py | 5 | 6833 | #!/usr/bin/env python
#
# Copyright (C) 2016 Weibo Inc.
#
# This file is part of Opendcp.
#
# Opendcp 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 of the License.
#
# Opendcp is ... | gpl-2.0 |
azoft-dev-team/imagrium | env/Lib/unittest/test/test_setups.py | 152 | 16460 | import sys
from cStringIO import StringIO
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=StringIO())
def ru... | mit |
peoplepower/composer-sdk-python | com.ppc.Bot/devices/thermostat/thermostat_sensibo_sky.py | 1 | 3433 | '''
Created on March 27, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
# Device Model
# https://presence.atlassian.net/wiki/display/devices/Thermostat
from devices.thermostat.thermostat import ThermostatDev... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-0.96/django/db/backends/sqlite3/introspection.py | 33 | 3296 | from django.db.backends.sqlite3.base import quote_name
def get_table_list(cursor):
"Returns a list of table names in the current database."
# Skip the sqlite_sequence system table used for autoincrement key
# generation.
cursor.execute("""
SELECT name FROM sqlite_master
WHERE type='tabl... | bsd-3-clause |
dev4dev-io/pynt-aws | pyntaws/services/_cloudformation.py | 1 | 11141 | import boto3, botocore
import os, uuid, json, sys
from urlparse import urlparse
from boto3.s3.transfer import S3Transfer
from pyntaws.services._session import AWSSession
import __builtin__
__builtin__.validated_templates = list()
class AWSCloudFormation(AWSSession):
def __init__(self, **kwargs):
super(self.__... | apache-2.0 |
Nick-OpusVL/odoo | openerp/addons/base/report/preview_report.py | 447 | 1457 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
ksrajkumar/openerp-6.1 | openerp/addons/base_report_designer/__openerp__.py | 9 | 1886 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
tobspr/panda3d | direct/src/leveleditor/ActionMgr.py | 6 | 14542 | from pandac.PandaModules import *
from . import ObjectGlobals as OG
class ActionMgr:
def __init__(self):
self.undoList = []
self.redoList = []
def reset(self):
while len(self.undoList) > 0:
action = self.undoList.pop()
action.destroy()
while len(self.re... | bsd-3-clause |
simonwittber/middleman | clients/py/serviceprovider.py | 1 | 5656 | #!/usr/bin/env python
import asyncio
import websockets
import io
import uuid
SERVER_KEY = "xyzzy"
class ServiceProvider:
def init(self, ws, require_uid):
self.requests = {}
self.pub_handlers = {}
self.req_handlers = {}
self.ws = ws
self.public_pub_events = []
self.... | mit |
Fireblend/chromium-crosswalk | native_client_sdk/src/build_tools/tests/verify_filelist_test.py | 132 | 3854 | #!/usr/bin/env python
# Copyright (c) 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.
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCR... | bsd-3-clause |
huiren/ece511 | configs/common/cpu2000.py | 48 | 22462 | # Copyright (c) 2006-2008 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
ridfrustum/lettuce | tests/integration/lib/Django-1.3/django/contrib/admin/widgets.py | 156 | 12061 | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | gpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.2/Lib/plat-sunos5/TYPES.py | 3 | 5807 | # Generated by h2py from /usr/include/sys/types.h
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 8
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = 16
_POINTER_ALIGNMENT = 8
_MAX_ALIGNMENT = 16
_ALIGNMENT_REQUIRED = 1
_CHAR_ALIGNMENT ... | mit |
deandunbar/bitwave | hackathon_version/venv/lib/python2.7/site-packages/PIL/_binary.py | 19 | 1575 | #
# The Python Imaging Library.
# $Id$
#
# Binary input/output support routines.
#
# Copyright (c) 1997-2003 by Secret Labs AB
# Copyright (c) 1995-2003 by Fredrik Lundh
# Copyright (c) 2012 by Brian Crowell
#
# See the README file for information on usage and redistribution.
#
if bytes is str:
def i8(c):
... | mit |
webmasterraj/GaSiProMo | flask/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py | 317 | 6189 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def _b64_decode... | gpl-2.0 |
pFernbach/hpp-rbprm-corba | script/scenarios/sandbox/dynamic/stair_bauzil_hrp2_interp_noRamp.py | 1 | 7684 | from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import omniORB.any
import stair_bauzil_hrp2_path_noRamp as tp
import time
from hpp.corbaserver.rbprm.rbprmstate import State,StateHelper
from display_tools import *
from constr... | lgpl-3.0 |
timm/timmnix | pypy3-v5.5.0-linux64/lib-python/3/idlelib/keybindingDialog.py | 60 | 12427 | """
Dialog for building Tkinter accelerator key bindings
"""
from tkinter import *
import tkinter.messagebox as tkMessageBox
import string
from idlelib import macosxSupport
class GetKeysDialog(Toplevel):
def __init__(self,parent,title,action,currentKeySequences):
"""
action - string, the name of th... | mit |
NDNUtils/NDNSIM | src/visualizer/visualizer/plugins/show_last_packets.py | 182 | 9460 | import gobject
import gtk
import ns.core
import ns.network
import ns.visualizer
from visualizer.base import InformationWindow
from visualizer.higcontainer import HIGContainer
from kiwi.ui.objectlist import ObjectList, Column
class ShowLastPackets(InformationWindow):
class PacketList(gtk.ScrolledWindow):
... | gpl-2.0 |
voidbridge/electron | script/test.py | 25 | 2679 | #!/usr/bin/env python
import os
import shutil
import subprocess
import sys
from lib.util import electron_gyp, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJECT_NAME = electron_gyp()['project_name%']
PRODUCT_NAME = electron_gyp()['product_name%']
def main():
os.chdir(SOURCE... | mit |
psav/cfme_tests | cfme/tests/openstack/cloud/test_instances.py | 2 | 8199 | """Tests for Openstack cloud instances"""
import fauxfactory
import pytest
from selenium.common.exceptions import TimeoutException
from wait_for import TimedOutError
from cfme.cloud.instance.openstack import OpenStackInstance
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.exceptions import Item... | gpl-2.0 |
NelisVerhoef/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
dkindel/ece5574team7RESTAPI | lib/werkzeug/security.py | 255 | 8971 | # -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import hmac
import hashlib
import posi... | apache-2.0 |
jayme-github/CouchPotatoServer | libs/pyutil/test/out_of_shape/test_strutil.py | 106 | 1713 | #!/usr/bin/env python
# Copyright (c) 2004-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import unittest
from pyutil.assertutil import _assert
from pyutil import strutil
class Teststrutil(unittest.TestCase):
def test_short_input(self):
self.failUnl... | gpl-3.0 |
CEG-FYP-OpenStack/scheduler | nova/api/openstack/compute/legacy_v2/consoles.py | 79 | 3328 | # Copyright 2010 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 |
phil65/script.skin.info.service | default.py | 1 | 11502 | import sys
import xbmc
import xbmcgui
import xbmcaddon
from Utils import *
ADDON = xbmcaddon.Addon()
ADDON_VERSION = ADDON.getAddonInfo('version')
WND = xbmcgui.Window(12003) # Video info dialog
HOME = xbmcgui.Window(10000) # Home Window
class Daemon:
def __init__(self):
log("version %s started" % ADD... | gpl-2.0 |
Jasoning/namebench | nb_third_party/dns/tokenizer.py | 246 | 17962 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
kapt/django-oscar | tests/unit/shipping/method_tests.py | 10 | 2641 | from decimal import Decimal as D
from django.test import TestCase
from nose.plugins.attrib import attr
import mock
from oscar.apps.shipping import methods
from oscar.apps.basket.models import Basket
@attr('shipping')
class TestFreeShipppingForEmptyBasket(TestCase):
def setUp(self):
self.method = method... | bsd-3-clause |
dyule/RandomBytes | ProgAsArt/Other Examples/bubblelace.py | 2 | 1065 | '''
Bubble Lace - Python.
cblouin@dal.ca
'''
# Import everything from Graphics
from graphics import *
# Import randint from random
from random import randint
# This function generate a random RGB color
def RandomColor():
return color_rgb(randint(0,255), randint(0,255), randint(0,255))
# This function draws ... | gpl-3.0 |
chrisbjohannsen/no-gnus | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | gpl-3.0 |
ThatOneRoadie/stratux-cosensor | cosensor-monitor.py | 1 | 1668 | import smbus
import time
import os
import RPi.GPIO as GPIO
bus = smbus.SMBus(1)
# Set PPM limit variable to whatever would be an alarm for you
# For Uncalibrated sensors, use your better judgement or get it calibrated (390 is a fresh air outdoor baseline, depending on area).
# Sensor can also be calibrated by immersi... | mit |
rue89-tech/edx-platform | common/djangoapps/student/tests/test_userstanding.py | 57 | 3823 | """
These are tests for disabling and enabling student accounts, and for making sure
that students with disabled accounts are unable to access the courseware.
"""
import unittest
from student.tests.factories import UserFactory, UserStandingFactory
from student.models import UserStanding
from django.conf import setting... | agpl-3.0 |
Safihre/cherrypy | cherrypy/_cpreqbody.py | 4 | 36382 | """Request body processing for CherryPy.
.. versionadded:: 3.2
Application authors have complete control over the parsing of HTTP request
entities. In short,
:attr:`cherrypy.request.body<cherrypy._cprequest.Request.body>`
is now always set to an instance of
:class:`RequestBody<cherrypy._cpreqbody.RequestBody>`,
and *... | bsd-3-clause |
Kazade/NeHe-Website | google_appengine/lib/django-1.4/django/contrib/gis/gdal/datasource.py | 92 | 4724 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | bsd-3-clause |
squisher/llvmlite | setup.py | 3 | 3756 | try:
from setuptools import setup, Extension
from setuptools.command.build_py import build_py as build
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
except ImportError:
from distutils.core import setup, Extension
from distutils.command.build im... | bsd-2-clause |
mgoffin/osquery | tools/tests/utils.py | 1 | 5567 | #!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from... | bsd-3-clause |
sstrigger/Sick-Beard | sickbeard/metadata/xbmc_12plus.py | 8 | 14618 | # URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 v... | gpl-3.0 |
vivekananda/fbeats | django/contrib/webdesign/templatetags/webdesign.py | 91 | 2167 | from django.contrib.webdesign.lorem_ipsum import words, paragraphs
from django import template
register = template.Library()
class LoremNode(template.Node):
def __init__(self, count, method, common):
self.count, self.method, self.common = count, method, common
def render(self, context):
try:
... | bsd-3-clause |
mikewiebe-ansible/ansible | lib/ansible/modules/network/fortios/fortios_firewall_address6_template.py | 13 | 13356 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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, either version 3 of the Lic... | gpl-3.0 |
alqfahad/odoo | addons/stock_picking_wave/wizard/picking_to_wave.py | 382 | 1624 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
paran0ids0ul/infernal-twin | build/reportlab/tests/test_paragraphs.py | 13 | 32361 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
# tests some paragraph styles
__version__='''$Id$'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import unittest
from reportlab.platypus import Paragraph, SimpleDocTemplat... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/irc/scripts/servermap.py | 14 | 4670 | #! /usr/bin/env python
#
# Example program using irc.client.
#
# Copyright (C) 1999-2002 Joel Rosdahl
#
# 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 Licens... | agpl-3.0 |
Befera/portfolio | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
callmealien/wazimap_zambia | census/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
niijv/webvita | wsgi/webvita/blogposts.py | 2 | 5828 | # -*-coding: utf-8 -*-
from webvita import app, db
from flask import request, session, redirect, url_for, abort,\
render_template, flash
from flask.ext.sqlalchemy import SQLAlchemy
from models import Blogpost, Tag, User
from datetime import datetime
from helpers import is_blogpost_unique, is_blo... | mit |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/KhanAcademy/Exercises/GetExercise.py | 5 | 2915 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetExercise
# Retrieves the specified exercise.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... | apache-2.0 |
andyraib/data-storage | python_scripts/env/lib/python3.6/site-packages/pandas/io/tests/parser/quoting.py | 7 | 5796 | # -*- coding: utf-8 -*-
"""
Tests that quoting specifications are properly handled
during parsing for all of the parsers defined in parsers.py
"""
import csv
import pandas.util.testing as tm
from pandas import DataFrame
from pandas.compat import PY3, StringIO, u
class QuotingTests(object):
def test_bad_quote_... | apache-2.0 |
jellyshen/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 |
kristopher-h/vim-lsp | tools/create_portable_pyls.py | 2 | 4830 | #!/usr/bin/env python3
# Copyright 2017 Kristopher Heijari
#
# This file is part of vim-liq.
#
# vim-liq 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) a... | gpl-3.0 |
vishnuprasadb/ResumeParser.py | code.py | 1 | 33299 | class ResumeXmlHandler(xml.sax.ContentHandler):
def __init__(self):
self.node = ''
self.params = {}
self.error = None
def startElement(self, name, attrs):
self.node = name
def endElement(self, name):
self.node = ''
... | mit |
aristanetworks/neutron | neutron/api/v2/attributes.py | 5 | 33476 | # Copyright (c) 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... | apache-2.0 |
clawpack/clawpack-4.x | book/chap23/acoustics/1drad/setplot.py | 2 | 2339 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to b... | bsd-3-clause |
grembo/buildbot | master/buildbot/db/masters.py | 11 | 3882 | # 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... | gpl-2.0 |
oesteban/dipy | dipy/align/tests/test_sumsqdiff.py | 5 | 25515 | import numpy as np
from dipy.align import floating
from numpy.testing import (assert_equal,
assert_almost_equal,
assert_array_almost_equal,
assert_allclose)
import dipy.align.sumsqdiff as ssd
def iterate_residual_field_ssd_2d(delta_field,... | bsd-3-clause |
zentralopensource/zentral | zentral/conf/config.py | 1 | 9328 | import base64
import itertools
import json
import logging
import os
import re
import time
from .buckets import get_bucket_client
from .params import get_param_client
from .secrets import get_secret_client
logger = logging.getLogger("zentral.conf.config")
class Proxy:
pass
class EnvProxy(Proxy):
def __init... | apache-2.0 |
andmos/ansible | lib/ansible/modules/network/f5/bigip_dns_nameserver.py | 14 | 14792 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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',
... | gpl-3.0 |
runningwolf666/you-get | src/you_get/extractors/kugou.py | 19 | 1978 | #!/usr/bin/env python
__all__ = ['kugou_download']
from ..common import *
from json import loads
from base64 import b64decode
import re
import hashlib
def kugou_download(url, output_dir=".", merge=True, info_only=False):
if url.lower().find("5sing")!=-1:
#for 5sing.kugou.com
html=get_html(url)
... | mit |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/template/response.py | 45 | 8917 | import warnings
from django.http import HttpResponse
from django.template import Context, RequestContext, Template, loader
from django.template.backends.django import Template as BackendTemplate
from django.template.context import _current_app_undefined
from django.utils import six
from django.utils.deprecation import... | apache-2.0 |
sanuj/shogun | examples/undocumented/python_modular/kernel_top_modular.py | 26 | 2583 | #!/usr/bin/env python
from tools.load import LoadMatrix
from numpy import where
lm=LoadMatrix()
traindat = lm.load_dna('../data/fm_train_dna.dat')
testdat = lm.load_dna('../data/fm_test_dna.dat')
label_traindat = lm.load_labels('../data/label_train_dna.dat')
fm_hmm_pos=[traindat[i] for i in where([label_traindat==1])... | gpl-3.0 |
bchess/pushmanager | tests/test_servlet_delayrequest.py | 5 | 2707 | from contextlib import nested
import mock
from core import db
from core.util import get_servlet_urlspec
from servlets.delayrequest import DelayRequestServlet
import testing as T
import types
class DelayRequestServletTest(T.TestCase, T.ServletTestMixin):
@T.class_setup_teardown
def mock_servlet_env(self):
... | apache-2.0 |
l10n-tw/systemd | test/create-sys-script.py | 14 | 5080 | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
OUTFILE_HEADER = """#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# create-sys-script.py
#
# © 2017 Canonical Ltd.
# Author: Dan Streetman <dan.streetman@canonical.com>
"""
# Use this only to (re-)create the test/sys-script.py... | gpl-2.0 |
erikhvatum/RisWidget | ris_widget/qwidgets/layer_table.py | 1 | 21314 | # The MIT License (MIT)
#
# Copyright (c) 2015 WUSTL ZPLAB
#
# 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, modif... | mit |
rosmo/ansible | lib/ansible/modules/cloud/docker/docker_login.py | 12 | 10470 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@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_func... | gpl-3.0 |
chrismeyersfsu/ansible | test/units/module_utils/test_facts.py | 24 | 24159 | # 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 in the hope that ... | gpl-3.0 |
sanjuro/RCJK | vendor/gdata/blogger/service.py | 264 | 5309 | #!/usr/bin/python
#
# Copyright (C) 2007 Google 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 ... | apache-2.0 |
krzysztof-magosa/ansible-modules-extras | monitoring/zabbix_group.py | 18 | 7427 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013-2014, Epic Games, 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
# ... | gpl-3.0 |
suhussai/youtube-dl | youtube_dl/extractor/eporner.py | 129 | 2307 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
str_to_int,
)
class EpornerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\d+)/(?P<display_id>[\w-]+)'
_TEST = {
'url': ... | unlicense |
theguardian/CherryStrap | mako/ext/beaker_cache.py | 100 | 2365 | """Provide a :class:`.CacheImpl` for the Beaker caching system."""
from mako import exceptions
from mako.cache import CacheImpl
try:
from beaker import cache as beaker_cache
except:
has_beaker = False
else:
has_beaker = True
_beaker_cache = None
class BeakerCacheImpl(CacheImpl):
"""A :class:`.Cac... | gpl-2.0 |
eastbanctech/kubernetes-contrib | service-loadbalancer/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
pawpro/spa | spa/static/hashed.py | 2 | 8271 | import hashlib
import mimetypes
import os
import posixpath
import re
from time import time
from urlparse import urlsplit, urlunsplit
from werkzeug.exceptions import NotFound
from werkzeug.http import is_resource_modified, http_date
from spa.static.handlers import StaticHandler
from spa.utils import clean_path
class... | bsd-3-clause |
ncoghlan/pip | pip/_vendor/requests/models.py | 410 | 29176 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | mit |
Tomographer/tomographer | test/py_gen_pickle_data.py | 1 | 4414 | #
# Generate pickled data for current tomographer version and store to data files (which are
# to be included in the git repo).
#
# These pickle files are loaded by pytest_pickle.py to make sure that data pickled by
# earlier versions of Tomographer can be successfully loaded, with full backwards
# compatibility.
#
fr... | mit |
openiitbombayx/edx-platform | lms/djangoapps/django_comment_client/management/commands/assign_role.py | 251 | 1144 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Role
from django.contrib.auth.models import User
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--remove',
ac... | agpl-3.0 |
ronniehedrick/scapeshift | client/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 1366 | 120842 | # Copyright (c) 2012 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | apache-2.0 |
linfuzki/autokey | src/lib/service.py | 47 | 17056 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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 late... | gpl-3.0 |
itkovian/sqlalchemy | test/sql/test_text.py | 23 | 25927 | """Test the TextClause and related constructs."""
from sqlalchemy.testing import fixtures, AssertsCompiledSQL, eq_, \
assert_raises_message, expect_warnings, assert_warnings
from sqlalchemy import text, select, Integer, String, Float, \
bindparam, and_, func, literal_column, exc, MetaData, Table, Column,\
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.