repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
thefinn93/CouchPotatoServer
libs/sqlalchemy/processors.py
17
4224
# sqlalchemy/processors.py # Copyright (C) 2010-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """defines generic ...
gpl-3.0
firebase/grpc-SwiftPM
tools/debug/core/chttp2_ref_leak.py
29
1350
#!/usr/bin/env python2.7 # Copyright 2017 gRPC authors. # # 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 la...
apache-2.0
thomann/plotVR
plotAR-py/plotar/jupyter_server_extension.py
1
1483
from . import server from notebook.notebookapp import * # Jupyter Extension points def _jupyter_server_extension_paths(): return [{ 'module': 'plotar.jupyter_server_extension', }] def load_jupyter_server_extension(nbapp: NotebookApp): from notebook.base.handlers import AuthenticatedHandler, IPyth...
agpl-3.0
mistakes-consortium/Supybot-Titler
__init__.py
3
1166
### # Copyright (c) 2013, spline # All rights reserved. # # ### """ Add a description of the plugin (to be presented to the user inside the wizard) here. This should describe *what* the plugin does. """ import supybot import supybot.world as world # Use this for the version of this plugin. You may wish to put a CV...
mit
tumbl3w33d/ansible
lib/ansible/modules/cloud/azure/azure_rm_networkinterface_info.py
20
13778
#!/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 ANSI...
gpl-3.0
simontakite/sysadmin
pythonscripts/pythonnetworkingcoookbook/chapter3/3_6_find_network_interface_status.py
2
1026
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 3 # This program is optimized for Python 2.7. # It may run on any other version with/without modifications. import argparse import socket import struct import fcntl import nmap SAMPLE_PORTS = '21-23' def get_interface_status(ifname): sock...
gpl-2.0
Kraxi/YTplaylist
venv/Lib/encodings/punycode.py
586
6813
# -*- coding: iso-8859-1 -*- """ Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} for c in st...
gpl-2.0
talishte/ctigre
env/lib/python2.7/site-packages/oauthlib/oauth1/rfc5849/errors.py
87
2543
# coding=utf-8 """ oauthlib.oauth1.rfc5849.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error used both by OAuth 1 clients and provicers to represent the spec defined error responses for all four core grant types. """ from __future__ import unicode_literals from oauthlib.common import urlencode, add_params_to_uri class O...
bsd-2-clause
JulyKikuAkita/PythonPrac
cs15211/PeakIndexinaMountainArray.py
1
2657
__source__ = 'https://leetcode.com/problems/peak-index-in-a-mountain-array/' # Time: O() # Space: O() # # Description: Leetcode # 852. Peak Index in a Mountain Array # # Let's call an array A a mountain if the following properties hold: # # A.length >= 3 # There exists some 0 < i < A.length - 1 such that A[0] < A[1] <...
apache-2.0
cloudn/cf-php-build-pack
extensions/newrelic/extension.py
4
7072
# 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 use ...
apache-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/scons-2.3.1/SCons/Tool/MSCommon/sdk.py
7
14073
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation # # 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...
gpl-2.0
sixam/dw6824
src/protocol/DeleteOperation.py
1
2235
""" Represents a delete operation that removes a value from a linear collection. Copyright (c) The Dojo Foundation 2011. All Rights Reserved. Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved. """ from .Operation import Operation from .ContextVector import ContextVector from .factory import factory clas...
bsd-3-clause
hugs/selenium
selenium/src/py/lib/docutils/parsers/rst/__init__.py
5
6660
# Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 4445 $ # Date: $Date: 2006-03-23 15:28:36 +0100 (Thu, 23 Mar 2006) $ # Copyright: This module has been placed in the public domain. """ This is ``docutils.parsers.rst`` package. It exports a single class, `Parser`, the reSt...
apache-2.0
blindroot/django
tests/gis_tests/layermap/models.py
34
2488
from django.utils.encoding import python_2_unicode_compatible from ..models import models @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=25) class Meta: abstract = True required_db_features = ['gis_enabled'] def __str__(self): ret...
bsd-3-clause
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/boto/mashups/interactive.py
119
2737
# Copyright (C) 2003-2007 Robey Pointer <robey@lag.net> # # This file is part of paramiko. # # Paramiko 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 op...
mit
webostin/django-btc
tests/absolute_url_overrides/tests.py
76
1995
from django.db import models from django.test import TestCase class AbsoluteUrlOverrideTests(TestCase): def test_get_absolute_url(self): """ get_absolute_url() functions as a normal method. """ get_absolute_url = lambda o: '/test-a/%s/' % o.pk TestA = self._create_model_cl...
bsd-3-clause
Intel-Corporation/tensorflow
tensorflow/python/keras/utils/multi_gpu_utils.py
2
9462
# Copyright 2017 The TensorFlow 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 applica...
apache-2.0
clembou/rasterio
tests/test_read.py
4
11349
import logging import sys import unittest import numpy from hashlib import md5 import rasterio logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) class ReaderContextTest(unittest.TestCase): def test_context(self): with rasterio.open('tests/data/RGB.byte.tif') as s: self.assertEqu...
bsd-3-clause
bwrsandman/openerp-hr
hr_wage_increment/wizard/wage_increment.py
3
2472
#-*- coding:utf-8 -*- # # # Copyright (C) 2011 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eith...
agpl-3.0
mpeaton/binutils
gdb/copyright.py
22
11540
#! /usr/bin/env python # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is part of GDB. # # 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, ...
gpl-2.0
ubuntu-core/snapcraft
snapcraft/internal/pluginhandler/_patchelf.py
1
7460
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2019 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 ...
gpl-3.0
TechBK/horizon-dev
openstack_dashboard/dashboards/project/volumes/volumes/views.py
25
18427
# 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
Nitaco/ansible
lib/ansible/module_utils/oneandone.py
109
10662
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
Jailander/COSMOS
penetrometer_tools/scripts/data_drawer.py
1
1948
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import String import time from auto_soil_probe.msg import Controller import matplotlib.pyplot as plt import numpy as np class get_penetromter_data(object): def __init__(self) : self.n60s=0 self.wpn=0 ...
mit
bop/bauhaus
lib/python2.7/site-packages/django_extensions/jobs/daily/cache_cleanup.py
4
1770
""" Daily cleanup job. Can be run as a cronjob to clean out old data from the database (only expired sessions at the moment). """ from django_extensions.management.jobs import DailyJob class Job(DailyJob): help = "Cache (db) cleanup Job" def execute(self): from django.conf import settings f...
mit
sparkslabs/kamaelia_
Sketches/MPS/Old/SoC/SimplePaint.py
3
6531
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ve...
apache-2.0
kutenai/django
tests/forms_tests/models.py
261
3805
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import itertools import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.utils.encoding import python_2_unicode_compatible callable_default_counter = itertools.count() def callab...
bsd-3-clause
tommo/gii
lib/mock/asset/tools/ml2story.py
1
3801
from util.YEd import * import os.path import re import json import logging _ROOT_ML = '_root.graphml' _DataTypeMatch = re.compile('type\s*=\s*(\w+)') def saveJSON( data, path, **option ): outputString = json.dumps( data , indent = option.get( 'indent' ,2 ), sort_keys = option.get( 'sort_keys', True ), ...
mit
klausman/scion
python/lib/packet/ext/path_probe.py
3
2859
# Copyright 2016 ETH Zurich # # 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, sof...
apache-2.0
derekjamescurtis/veritranspay
tests/response_indomaret_charge_tests.py
1
1171
from unittest import TestCase from veritranspay.response import IndomaretChargeResponse class IndomaretChargeResponseTests(TestCase): def setUp(self): # example response data from # http://docs.veritrans.co.id/en/vtdirect/integration_indomrt.html#response-transaction-indomrt self.respons...
bsd-3-clause
savi-dev/heat
heat/tests/test_nova_keypair.py
1
5952
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
neilsh/flask-login
docs/conf.py
3
7725
# -*- coding: utf-8 -*- # # Flask-Login documentation build configuration file, created by # sphinx-quickstart on Tue Mar 15 18:40:10 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
mit
daisychainme/daisychain
daisychain/recipes/tests/test_RecipeCreateBaseView.py
1
2335
from django.core.urlresolvers import NoReverseMatch from mock import MagicMock, patch from recipes.views import RecipeCreateBaseView from .test_utils import TestDataProvider, RecipeTestCase class RecipeCreateBaseViewTest(RecipeTestCase): def setUp(self): TestDataProvider.create_channels() TestDat...
mit
inveniosoftware/invenio-oauth2server
tests/test_admin.py
1
3619
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2017-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. from flask import Flask, url_for from flask_admin import Admin from invenio_db import...
mit
sbinet/cxx-root
interpreter/llvm/src/utils/shuffle_fuzz.py
20
10076
#!/usr/bin/env python """A shuffle vector fuzz tester. This is a python program to fuzz test the LLVM shufflevector instruction. It generates a function with a random sequnece of shufflevectors, maintaining the element mapping accumulated across the function. It then generates a main function which calls it with a di...
lgpl-2.1
csparpa/last.fm-stats
lastfm_stats/userstats.py
1
4049
from lastfm_stats import HttpClient, Datastore, Aggregator, trackparser from sqlalchemy import create_engine class UserStats(): def __init__(self, username, api_key): """ Drives updates and storage of Last.fm user data and reports statistics. :param username: the Last.fm user you want s...
mit
trondhindenes/ansible
test/units/modules/network/junos/test_junos_rpc.py
45
4325
# (c) 2017 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 dis...
gpl-3.0
emedinaa/contentbox
third_party/django/templatetags/l10n.py
232
1759
from django.template import Node from django.template import TemplateSyntaxError, Library from django.utils import formats from django.utils.encoding import force_text register = Library() @register.filter(is_safe=False) def localize(value): """ Forces a value to be rendered as a localized value, regardle...
apache-2.0
felixma/nova
nova/tests/unit/virt/vmwareapi/test_configdrive.py
17
7371
# Copyright 2013 IBM Corp. # Copyright 2011 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 ...
apache-2.0
medit74/DeepLearning
MyTensorflow/MyMnist/mnist_rnn_bidirectional.py
1
3507
''' Created on 2017. 6. 14. @author: Byoungho Kang ''' import tensorflow as tf from tensorflow.contrib import rnn from tensorflow.examples.tutorials.mnist import input_data ''' Training Set To classify images using a recurrent neural network, we consider every image row as a sequence of pixels. Becau...
apache-2.0
sebadiaz/rethinkdb
test/rql_test/connections/http_support/markupsafe/_constants.py
1535
4795
# -*- coding: utf-8 -*- """ markupsafe._constants ~~~~~~~~~~~~~~~~~~~~~ Highlevel implementation of the Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ HTML_ENTITIES = { 'AElig': 198, 'Aacute': 193, 'Acirc': 194, 'Agrave': 1...
agpl-3.0
kleetus/bitcoin
qa/rpc-tests/maxblocksinflight.py
11
4010
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework fro...
mit
vosi/django-xtags
xtags/managers.py
1
9511
from django.contrib.contenttypes.generic import GenericRelation from django.contrib.contenttypes.models import ContentType from django.db.models.related import RelatedObject from django.utils.translation import ugettext_lazy as _ from django.db import models from django.db.models.fields.related import RelatedField, Man...
bsd-3-clause
xuewei4d/scikit-learn
benchmarks/bench_plot_nmf.py
19
15492
""" Benchmarks of Non-Negative Matrix Factorization """ # Authors: Tom Dupre la Tour (benchmark) # Chih-Jen Linn (original projected gradient NMF implementation) # Anthony Di Franco (projected gradient, Python and NumPy port) # License: BSD 3 clause from time import time import sys import warnings im...
bsd-3-clause
jiangwei1221/django-virtualenv-demo
env/lib/python2.7/site-packages/django/contrib/auth/middleware.py
158
4108
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
unlicense
i5o/triples
trip.py
1
8423
# trip.py """ Copyright (C) 2011 Peter Hewitt 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. ""...
gpl-2.0
s-gv/rnicu-webapp
ecg/ecg_visualizer_ble_PC/CC2540ble.py
3
7077
import serial import os import binascii import time class BTDongle(): def __init__(self, port=None, readResponseTimeOut=20): ''' Example port='/dev/ttyACM0'. notifyCB is called when a notification arrives. readResponseTimeOut in seconds ''' self.readResponseTimeOut = readResponseTimeOut ...
agpl-3.0
stewartsmith/bzr
bzrlib/tests/blackbox/test_testament.py
2
2229
# Copyright (C) 2006 Canonical Ltd # # 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 is distributed in ...
gpl-2.0
Stackato-Apps/bottle-currency
wsgi.py
2
2926
#!/usr/bin/env python import re import os import sys import time import redis import bottle import logging import urllib2 import urlparse import contextlib from bottle import route STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static') SERVICE_URL = "http://www.sann-gmbh.com/currencyapi/" # Mirrors: # stat...
mit
tillschumann/nest-simulator
examples/nest/plot_tsodyks_depr_fac.py
17
1135
# -*- coding: utf-8 -*- # # plot_tsodyks_depr_fac.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 L...
gpl-2.0
tinkerthaler/odoo
addons/point_of_sale/__init__.py
378
1189
# -*- 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...
agpl-3.0
DeadBugEngineering/myHDL_shenanigans
ssd1306_8x64bit_driver/myhdl_10dev/lib/python2.7/site-packages/wheel/test/test_signatures.py
565
1120
from wheel import signatures from wheel.signatures import djbec, ed25519py from wheel.util import binary def test_getlib(): signatures.get_ed25519ll() def test_djbec(): djbec.dsa_test() djbec.dh_test() def test_ed25519py(): kp0 = ed25519py.crypto_sign_keypair(binary(' '*32)) kp = ed25519p...
lgpl-2.1
marc-sensenich/ansible
lib/ansible/modules/web_infrastructure/jboss.py
55
4642
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # 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
paukenba/youtube-dl
youtube_dl/extractor/southpark.py
99
2895
# encoding: utf-8 from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor class SouthParkIE(MTVServicesInfoExtractor): IE_NAME = 'southpark.cc.com' _VALID_URL = r'https?://(?:www\.)?(?P<url>southpark\.cc\.com/(?:clips|full-episodes)/(?P<id>.+?)(\?|#|$))' _FEED_URL = 'http://www...
unlicense
SaptakS/open-event-orga-server
app/views/super_admin/debug.py
8
1359
import json import os from datetime import datetime, timedelta import flask_login from flask import Blueprint from flask import render_template from flask import request, current_app from app.helpers.flask_ext.helpers import get_real_ip from app.views.super_admin import check_accessible, list_navbar, BASE sadmin_deb...
gpl-3.0
msfernandes/busine.me
busineme/authentication/forms.py
1
1489
from django import forms from django.core.validators import validate_email, ValidationError from django.utils.translation import ugettext as _ from defaults.forms import BusinemeForm from .models import BusinemeUser class BusinemeUserForm(forms.ModelForm): class Meta: model = BusinemeUser fields ...
gpl-3.0
scenarios/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn.py
190
1972
# Copyright 2016 The TensorFlow 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 applica...
apache-2.0
s-silva/roadhouse
Server/initialize.py
1
3453
#!/usr/bin/python import sys import pymongo import db import core.people import core.rooms def main(args): print "started initialization" db.connect() people = core.people.People(0) rooms = core.rooms.Rooms(0) if db.roadhouse is not None: """ John Doe Jane Roe 石戸谷 貞子 """ print "db foun...
lgpl-2.1
indictranstech/focal-erpnext
erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
38
2619
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe class TestPricingRule(unittest.TestCase): def test_pricing_rule_for_discount(self): from erpnext.stock.get_item_de...
agpl-3.0
chylli/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/queuestatus.py
122
5100
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
eugenejen/AutobahnPython
examples/twisted/websocket/echo_compressed/client_advanced.py
18
4393
############################################################################### ## ## Copyright (C) 2011-2013 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
jcherqui/searx
searx/engines/__init__.py
1
9606
''' searx is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. searx is distributed in the hope that it will be useful, but WITHOUT ANY W...
agpl-3.0
tejasmanohar/gunicorn
gunicorn/http/wsgi.py
9
13490
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import io import logging import os import re import sys from gunicorn._compat import unquote_to_wsgi_str from gunicorn.six import string_types, binary_type, reraise from gunicorn import SERVE...
mit
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/pip/vendor/six.py
153
12415
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2013 Benjamin Peterson # # 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 with...
gpl-3.0
ssokolow/snakebyte
snakebyte/shell_lexers.py
1
5011
#!/usr/bin/env python # -*- coding: utf-8 -*- """A selection of lexers for tokenizing shell command lines :todo: Figure out how to remove shlex from the coverage report """ __author__ = "Stephan Sokolow (deitarion/SSokolow)" __license__ = "GNU GPL 3.0 or later" __docformat__ = "restructuredtext en" import logging, ...
gpl-3.0
mekanix/geonode
geonode/settings.py
1
35202
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
j-faria/OPEN
scons/scons-local-2.3.4/SCons/Tool/default.py
9
1711
"""SCons.Tool.default Initialization with a default tool list. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of cha...
mit
RajaS/Eepee
src/customrubberband.py
2
11423
#!/usr/bin/env python #Modified from wxPython.lib.mixins.rubberband #to allow mouse events to be redirected from outside #Original author 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net) """ Implements a 'rubberband' to select the zoomframe """ import wx def isNegative(aNumber): """ x < 0: 1 els...
gpl-3.0
xinjiguaike/edx-platform
openedx/core/djangoapps/credit/tests/test_tasks.py
62
13643
""" Tests for credit course tasks. """ import mock from datetime import datetime, timedelta from pytz import UTC from openedx.core.djangoapps.credit.api import get_credit_requirements from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements from openedx.core.djangoapps.credit.models import Cred...
agpl-3.0
mcdaniel67/sympy
sympy/ntheory/egyptian_fraction.py
63
6082
from __future__ import print_function, division import sympy.polys from sympy import Integer from sympy.core.compatibility import range from fractions import gcd def egyptian_fraction(r, algorithm="Greedy"): """ Return the list of denominators of an Egyptian fraction expansion [1]_ of the said rational `...
bsd-3-clause
brayden2544/Mystuff-final
static_files/manage/cached_templates/templates/index.html.py
1
1769
# -*- coding:ascii -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 9 _modified_time = 1396975206.5121 _enable_loop = True _template_filename = 'C:\\app\\manage\\templates/index.html' _template_uri = 'index.html' _source_encod...
apache-2.0
tiagofrepereira2012/bob.extension
bob/extension/__init__.py
1
27987
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # Andre Anjos <andre.anjos@idiap.ch> # Mon 28 Jan 2013 16:40:27 CET """A custom build class for Pkg-config based extensions """ import os import sys import platform import pkg_resources from setuptools.extension import Extension as DistutilsExtension from setuptoo...
bsd-3-clause
fhe-odoo/odoo
openerp/report/preprocess.py
443
4700
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
Ayub-Khan/edx-platform
common/djangoapps/third_party_auth/pipeline.py
25
28304
"""Auth pipeline definitions. Auth pipelines handle the process of authenticating a user. They involve a consumer system and a provider service. The general pattern is: 1. The consumer system exposes a URL endpoint that starts the process. 2. When a user visits that URL, the client system redirects the user t...
agpl-3.0
googleads/google-ads-python
google/ads/googleads/v8/services/services/customer_user_access_service/transports/base.py
1
4242
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0
jonathan-beard/edx-platform
openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py
57
13027
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CreditProvider.thumbnail_url' db.add_column('credit_credi...
agpl-3.0
fsahli/fractal-tree
Mesh.py
1
6397
# -*- coding: utf-8 -*- """ This module contains the mesh class. This class is the triangular surface where the fractal tree is grown. """ import numpy as np from scipy.spatial import cKDTree import collections class Mesh: """Class that contains the mesh where fractal tree is grown. It must be Wavefront .obj file...
mit
jumpojoy/neutron
neutron/plugins/ml2/drivers/openvswitch/agent/common/constants.py
13
2995
# Copyright (c) 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...
apache-2.0
auntieNeo/asterisk-testsuite
tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/driver.py
3
3193
#!/usr/bin/env python import logging LOGGER = logging.getLogger(__name__) # These are the states that are moved through during the tests. They are listed # here in the order that they occur throughout the test. # Initial state before subscription establishment. UNESTABLISHED = 1 # This state is entered after initi...
gpl-2.0
britcey/ansible
lib/ansible/modules/monitoring/boundary_meter.py
66
8559
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add boundary meters. (c) 2013, curtis <curtis@serverascode.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 Foundati...
gpl-3.0
evilhero/mylar
lib/requests/packages/chardet/latin1prober.py
1778
5232
######################## 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
campenberger/boto
tests/unit/glacier/test_job.py
114
3711
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
Immortalin/python-for-android
python3-alpha/python3-src/Tools/msi/msi.py
45
62636
# Python MSI Generator # (C) 2003 Martin v. Loewis # See "FOO" in comments refers to MSDN sections with the title FOO. import msilib, schema, sequence, os, glob, time, re, shutil, zipfile from msilib import Feature, CAB, Directory, Dialog, Binary, add_data import uisample from win32com.client import constants from dist...
apache-2.0
Wikia/sparrow
apps/testrunner/tasks/http_get.py
1
2478
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from celery.utils.log import get_task_logger import requests from common.utils import collect_results from .base_task import BaseTask from testrunner.api_client import ApiClient logger = get_task_logger(__name__) class HttpGet(BaseTask): ...
mit
pidydx/grr
grr/tools/export_plugins/collection_files_plugin_test.py
1
2578
#!/usr/bin/env python """Tests for the collection_files export tool plugin.""" import argparse import os from grr.lib import access_control from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib import utils from grr.li...
apache-2.0
Anonymouslemming/ansible
lib/ansible/plugins/lookup/etcd.py
34
3787
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
felipebetancur/metagoofil
hachoir_parser/audio/flac.py
95
5626
""" FLAC (audio) parser Documentation: * http://flac.sourceforge.net/format.html Author: Esteban Loiseau <baal AT tuxfamily.org> Creation date: 2008-04-09 """ from hachoir_parser import Parser from hachoir_core.field import FieldSet, String, Bit, Bits, UInt16, UInt24, RawBytes, Enum, NullBytes from hachoir_core.st...
gpl-2.0
dbckz/ansible
lib/ansible/modules/cloud/amazon/ec2_eip.py
78
15830
#!/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
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter10-Inheritance/P10_24.py
1
2688
# Improve the appointment book program of Exercise P10.22 and P10.23 by letting # the user save the appointment data to a file and reload the data from a file. The saving # part is straightforward: Make a method save . Save the type, description, and date to # a file. The loading part is not so easy. First determine th...
mit
Maikflow/django_test
lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/serializers/python.py
66
6259
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.core.serialize...
gpl-2.0
itiboi/multilevel-backup
tests/test_level_backup_needed.py
1
4671
from multilevelbackup.helpers import level_backup_needed from datetime import datetime, timedelta import os import pytest # # Test data # example_deltas = [ timedelta(days=1), timedelta(days=5), timedelta(days=20) ] # # Test helper # @pytest.fixture(scope='function') def lower_folder(tmpdir): retu...
gpl-3.0
nfunato/scrapy
scrapy/linkextractors/htmlparser.py
90
2883
""" HTMLParser-based link extractor """ import warnings from six.moves.html_parser import HTMLParser from six.moves.urllib.parse import urljoin from w3lib.url import safe_url_string from scrapy.link import Link from scrapy.utils.python import unique as unique_list from scrapy.exceptions import ScrapyDeprecationWarni...
bsd-3-clause
repotvsupertuga/tvsupertuga.repository
script.module.bildscommunity/plugintools.py
2
16072
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Plugin Tools v1.0.8 #--------------------------------------------------------------------------- # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Based on code from youtube, parsedom and pelisalacarta addon...
gpl-2.0
egoid/baytree
lib/python2.7/site-packages/django/contrib/admindocs/tests/test_fields.py
638
1172
from __future__ import unicode_literals import unittest from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field type" class DescriptionLackingFi...
mit
javierTerry/odoo
openerp/osv/osv.py
337
1384
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
jaruba/chromium.src
chrome/third_party/chromevox/third_party/closure-library/closure/bin/build/depstree.py
455
6375
# Copyright 2009 The Closure Library 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 a...
bsd-3-clause
jameshicks/pydigree
scripts/frequencies.py
1
1422
"A script that calculates allele frequencies from plink data" import argparse import pydigree as pyd parser = argparse.ArgumentParser() parser.add_argument('--ped', required=True, help='Plink formatted PED file') parser.add_argument('--map', required=True, help='Plink formatted MAP file') parser.add_argument('--snps...
apache-2.0
ccellis/WHACK2016
flask/lib/python2.7/site-packages/sqlalchemy/testing/config.py
38
2469
# testing/config.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import collections requirements = None db = None db_url = None db_opts = None fil...
bsd-3-clause
dlopes-samba/dlopes-maps-sambatech
django/contrib/comments/signals.py
425
1079
""" Signals relating to comments. """ from django.dispatch import Signal # Sent just before a comment will be posted (after it's been approved and # moderated; this can be used to modify the comment (in place) with posting # details or other such actions. If any receiver returns False the comment will be # discarded a...
bsd-3-clause
todaychi/hue
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Part.py
37
19486
#._cv_part guppy.heapy.Part class Format(object): __slots__ = 'impl', 'mod' def __init__(self, impl): self.impl = impl self.mod = impl.mod def get_formatted_row(self, row): fr = self.get_stat_data(row) rows = [] rs = row.name.split('\n') subsequent_indent = len(fr)*' ' rows.extend(self.mod.wrap( ...
apache-2.0