repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
2015fallproject/2015fallcase2 | static/Brython3.2.0-20150701-214155/Lib/unittest/test/test_discovery.py | 785 | 13838 | import os
import re
import sys
import unittest
class TestableTestProgram(unittest.TestProgram):
module = '__main__'
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
progName = ''
testRunner = testLoader = None
def __init__(self):
pass
class TestDisc... | agpl-3.0 |
sriprasanna/django-1.3.1 | docs/conf.py | 22 | 8709 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | bsd-3-clause |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/httputil.py | 33 | 11181 | import hashlib
import hmac
import logging
import time
import cgi
from urllib import quote
from urlparse import parse_qs
from Cookie import SimpleCookie
from saml2 import BINDING_HTTP_ARTIFACT, SAMLError
from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_URI
from saml... | apache-2.0 |
jtrobec/pants | tests/python/pants_test/backend/codegen/targets/test_java_antlr_library.py | 14 | 1496 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... | apache-2.0 |
jiajiechen/mxnet | example/reinforcement-learning/a3c/a3c.py | 13 | 9725 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
saintdragon2/python-3-lecture-2015 | sinsojael_final/1st_presentation/2조/2.py | 1 | 2152 | from tkinter import *
tk = Tk()
canvas = Canvas(tk,width = 340,height = 620)
canvas.pack()
canvas.create_rectangle(0,0,4000,6500, fill = '#EAEAEA')
#검정 배경색
canvas.create_rectangle(0,0,4000,200,fill = '#FFF612')
#주황?노랑? 배경색
def Circle(x1,y1,n,c):
x2 = x1 + 60
y2 = y1 + 60
canvas.create_oval(x1, y1, x2, y... | mit |
agacek/camkes-tool | camkes/internal/cache.py | 1 | 1360 | #
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
'''Compilation caching infrastructure for the code generator. Nothing in here
is actually CAmk... | bsd-2-clause |
jimcunderwood/MissionPlanner | Lib/site-packages/scipy/special/_testutils.py | 62 | 8599 | import os
import warnings
import numpy as np
from numpy.testing import assert_
from numpy.testing.noseclasses import KnownFailureTest
import scipy.special as sc
__all__ = ['with_special_errors', 'assert_tol_equal', 'assert_func_equal',
'FuncData']
#--------------------------------------------------------... | gpl-3.0 |
sbalde/edx-platform | common/djangoapps/embargo/api.py | 20 | 6736 | """
The Python API layer of the country access settings. Essentially the middle tier of the project, responsible for all
business logic that is not directly tied to the data itself.
This API is exposed via the middleware(emabargo/middileware.py) layer but may be used directly in-process.
"""
import logging
import pyg... | agpl-3.0 |
dawran6/zulip | contrib_bots/bots/github_issues/github_issues.py | 16 | 4249 | from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from . import github
import json
import os
import requests
import six.moves.configparser
import urllib.error
import urllib.parse
import urllib.request
class IssueHandler(object):
'''
This plugin facili... | apache-2.0 |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/matplotlib/tests/test_colorbar.py | 6 | 11086 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import numpy as np
from numpy import ma
import matplotlib
from matplotlib import rc_context
from matplotlib.testing.decorators import image_comparison, cleanup
import matpl... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-62/files/myenv/lib/python2.7/site-packages/xlrd/biffh.py | 77 | 17511 | # -*- coding: cp1252 -*-
##
# Support module for the xlrd package.
#
# <p>Portions copyright © 2005-2010 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p>
##
# 2010-03-01 SJM Reading SCL record
# 2010-03-01 SJM Added more record IDs ... | gpl-3.0 |
thientu/scikit-learn | sklearn/neighbors/approximate.py | 71 | 22357 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
sarantapichos/faircoop-market | addons/account/edi/__init__.py | 450 | 1062 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
agry/NGECore2 | scripts/mobiles/dantooine/bol_pack_runner.py | 2 | 1657 | 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()
mobil... | lgpl-3.0 |
killswitch-GUI/SimplyEmail | Modules/GitHubGistSearch.py | 1 | 3603 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configparser
from BeautifulSoup import BeautifulSoup
from Helpers import Download
from Helpers import Parser
from Helpers import helpers
# Class will have the following properties:
# 1) name / description
# 2) main name called "ClassName"
# 3) execute function (call... | gpl-3.0 |
wschuell/experiment_manager | experiment_manager/job/template_job.py | 1 | 4993 | from .job import Job # or from outside: from experiment_manager.job import Job
import path as pathpy #not mandatory. Dependency installed via pip if you install the experiment_manager library
"""
Folders: each function either runs in the folder local to the job, or at the top level folder. Specified just after the f... | agpl-3.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/site-packages/gevent/backdoor.py | 26 | 3679 | # @author Bob Ippolito
#
# Copyright (c) 2005-2006, Bob Ippolito
# Copyright (c) 2007, Linden Research, Inc.
# Copyright (c) 2008, Donovan Preston
# Copyright (c) 2009-2010, Denis Bilenko
# Copyright (c) 2011, gevent contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this... | gpl-2.0 |
BrotherPhil/django | tests/utils_tests/test_timesince.py | 293 | 6089 | from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... | bsd-3-clause |
signed/intellij-community | python/lib/Lib/site-packages/django/core/management/commands/runserver.py | 71 | 5424 | from optparse import make_option
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException
from django.utils import autoreload
nai... | apache-2.0 |
pombredanne/numba | numba/typing/arraydecl.py | 1 | 14869 | from __future__ import print_function, division, absolute_import
from collections import namedtuple
from numba import types
from numba.typing.templates import (AttributeTemplate, AbstractTemplate,
builtin, builtin_attr, signature,
bound_function)... | bsd-2-clause |
bop/rango | lib/python2.7/site-packages/django/core/cache/backends/dummy.py | 209 | 1229 | "Dummy cache backend"
from django.core.cache.backends.base import BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=None, version=None):
key = self.make_key(key, version=version)
... | gpl-2.0 |
fw1121/zulip | zerver/middleware.py | 115 | 15597 | from __future__ import absolute_import
from django.conf import settings
from zerver.lib.response import json_error
from django.db import connection
from zerver.lib.utils import statsd
from zerver.lib.queue import queue_json_publish
from zerver.lib.cache import get_memcached_time, get_memcached_requests
from zerver.lib... | apache-2.0 |
sk413025/thug | src/AST/AST.py | 7 | 10154 | #!/usr/bin/env python
#
# AST.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; witho... | gpl-2.0 |
rctk/rctk | rctk/odict.py | 29 | 46544 | # odict.py
# An Ordered Dictionary object
# Copyright (C) 2005 Nicola Larosa, Michael Foord
# E-mail: nico AT tekNico DOT net, fuzzyman AT voidspace DOT org DOT uk
# This software is licensed under the terms of the BSD license.
# http://www.voidspace.org.uk/python/license.shtml
# Basically you're free to copy, modify,... | bsd-2-clause |
IronLanguages/ironpython2 | Src/StdLib/Lib/site-packages/win32/test/test_win32inet.py | 17 | 2457 | from win32inet import *
from win32inetcon import *
import winerror
from pywin32_testutil import str2bytes # py3k-friendly helper
import unittest
class CookieTests(unittest.TestCase):
def testCookies(self):
data = "TestData=Test"
InternetSetCookie("http://www.python.org", None, data)
got = ... | apache-2.0 |
finncatling/synomed | app/views.py | 1 | 2009 | from flask import render_template, flash, redirect, request
from app import app
from .forms import LoginForm
from app.vec_model.funcs import find_codes
import shlex
@app.route('/', methods=['GET', 'POST'])
@app.route('/index', methods=['GET', 'POST'])
def index():
form = LoginForm()
list_of_codes = []
if ... | gpl-3.0 |
digibyte/digibyte | test/functional/wallet_txn_clone.py | 1 | 6623 | #!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are... | mit |
chiefspace/udemy-rest-api | udemy_rest_flask1/env/lib/python3.4/site-packages/pip/basecommand.py | 392 | 6578 | """Base Command class, and related routines"""
import os
import sys
import tempfile
import traceback
import time
import optparse
from pip import cmdoptions
from pip.locations import running_under_virtualenv
from pip.log import logger
from pip.download import PipSession
from pip.exceptions import (BadCommand, Installa... | gpl-2.0 |
mainconceptx/DAS | qa/rpc-tests/getblocktemplate_proposals.py | 26 | 6333 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from bi... | mit |
brandond/ansible | lib/ansible/plugins/lookup/nios_next_network.py | 77 | 4174 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# A... | gpl-3.0 |
nguyentu1602/numpy | numpy/core/tests/test_scalarmath.py | 66 | 12206 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.testing.utils import _gen_alignment_data
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert_almost_equal
)
types = [np.bool_, np.byte, np.ubyte, np.short... | bsd-3-clause |
jalexvig/tensorflow | tensorflow/python/framework/sparse_tensor_test.py | 31 | 3805 | # Copyright 2015 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 |
endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py | 8 | 2446 | """
Test that the debugger handles loops in std::list (which can appear as a result of e.g. memory
corruption).
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.co... | bsd-3-clause |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/version.py | 2 | 1488 | # Copyright 2013 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 ag... | apache-2.0 |
savoirfairelinux/OpenUpgrade | openerp/addons/base/module/wizard/base_language_install.py | 447 | 2738 | # -*- 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 |
fivejjs/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/utf_8.py | 103 | 1047 | """ Python 'utf-8' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_8_encode
def decode(input, errors='strict'):
return codecs.utf_8_decode(input, errors, True)
class Incremental... | apache-2.0 |
zhaochl/python-utils | verify_code/Imaging-1.1.7/PIL/ImageGrab.py | 40 | 1877 | #
# The Python Imaging Library
# $Id$
#
# screen grabber (windows only)
#
# History:
# 2001-04-26 fl created
# 2001-09-17 fl use builtin driver, if present
# 2002-11-19 fl added grabclipboard support
#
# Copyright (c) 2001-2002 by Secret Labs AB
# Copyright (c) 2001-2002 by Fredrik Lundh
#
# See the README file for ... | apache-2.0 |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/python/saved_model/simple_save.py | 27 | 3962 | # 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... | mit |
gdooper/scipy | scipy/optimize/linesearch.py | 45 | 24201 | """
Functions
---------
.. autosummary::
:toctree: generated/
line_search_armijo
line_search_wolfe1
line_search_wolfe2
scalar_search_wolfe1
scalar_search_wolfe2
"""
from __future__ import division, print_function, absolute_import
from warnings import warn
from scipy.optimize import minpack2
i... | bsd-3-clause |
rjschof/gem5 | src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_test.py | 89 | 10961 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | bsd-3-clause |
jiangzhonghui/viewfinder | backend/db/followed.py | 13 | 3397 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Followed relation.
The Followed relation is basically a secondary index over the
"last_updated" attribute of the Viewpoint table. Viewpoints are
ordered according to the time of last update, rather than by
viewpoint id. However, the ordering is not perfectly ma... | apache-2.0 |
nicobustillos/odoo | addons/membership/__init__.py | 441 | 1101 | # -*- 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 |
jlegendary/youtube-dl | youtube_dl/extractor/thisamericanlife.py | 135 | 1549 | from __future__ import unicode_literals
from .common import InfoExtractor
class ThisAmericanLifeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/(?:radio-archives/episode/|play_full\.php\?play=)(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.thisamericanlife.org/radio-archives/e... | unlicense |
miipl-naveen/optibizz | addons/website_membership/models/product.py | 338 | 1264 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
nupha/nodewox-pything | setup.py | 1 | 1763 | from setuptools import setup
from setuptools.command.install import install
import subprocess
import os
NODEWOX_HOME = "/var/lib/nodewox"
'''
class NXInstallCommand(install):
def run(self):
# make NODEWOX_HOME
if not os.path.exists(NODEWOX_HOME):
print("make dir %s" % NODEWOX_HOME)
... | mit |
w1ll1am23/home-assistant | homeassistant/components/netatmo/webhook.py | 5 | 2489 | """The Netatmo integration."""
import logging
from homeassistant.const import ATTR_DEVICE_ID, ATTR_ID, ATTR_NAME
from homeassistant.helpers.dispatcher import async_dispatcher_send
from .const import (
ATTR_EVENT_TYPE,
ATTR_FACE_URL,
ATTR_IS_KNOWN,
ATTR_PERSONS,
DATA_DEVICE_IDS,
DATA_PERSONS,
... | apache-2.0 |
Nepherhotep/django | django/contrib/gis/feeds.py | 336 | 5978 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | bsd-3-clause |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtCore/QTemporaryFile.py | 1 | 1946 | # encoding: utf-8
# module PyQt4.QtCore
# from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import sip as __sip
from .QFile import QFile
class QTemporaryFile(QFile):
"""
QTemporaryFile()
QTemporaryFile(str)
QTemporaryFile(QObject... | gpl-2.0 |
mastizada/kuma | vendor/packages/sqlalchemy/examples/inheritance/single.py | 7 | 3265 | from sqlalchemy import MetaData, Table, Column, Integer, String, \
ForeignKey, create_engine
from sqlalchemy.orm import mapper, relationship, sessionmaker
metadata = MetaData()
# a table to store companies
companies = Table('companies', metadata,
Column('company_id', Integer, primary_key=True),
Column('nam... | mpl-2.0 |
shushen/ansible | v2/ansible/template/vars.py | 34 | 3140 | # (c) 2012, 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) any lat... | gpl-3.0 |
trishnaguha/ansible | lib/ansible/modules/source_control/git.py | 4 | 48139 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
openstack/murano | murano/api/middleware/ext_context.py | 1 | 4166 | # Copyright (c) 2015 Mirantis, 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 |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_json/test_separators.py | 20 | 1319 | import textwrap
from test.test_json import PyTest, CTest
class TestSeparators:
def test_separators(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield': False} ]
expect = textwrap.dedent("""\
[
... | gpl-2.0 |
bregman-arie/ansible | lib/ansible/modules/network/onyx/onyx_config.py | 23 | 8198 | #!/usr/bin/python
#
# Copyright: 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__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
ComputerScienceHouse/conditional | conditional/util/housing.py | 1 | 1976 | from datetime import datetime
from conditional.models.models import InHousingQueue
from conditional.models.models import OnFloorStatusAssigned
from conditional.util.ldap import ldap_get_current_students
from conditional.util.ldap import ldap_is_onfloor
def get_housing_queue(is_eval_director=False):
# Generate a... | mit |
repotvsupertuga/tvsupertuga.repository | script.module.resolveurl/lib/resolveurl/plugins/debrid_link.py | 3 | 5624 | """
resolveurl XBMC Addon
Copyright (C) 2013 Bstrdsmkr
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 |
trezorg/django | django/contrib/gis/gdal/prototypes/srs.py | 321 | 3378 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, int_output, \
srs_output, string_output, void_output
## Shortcut generation for routines with known p... | bsd-3-clause |
Lujeni/ansible | lib/ansible/modules/packaging/os/openbsd_pkg.py | 79 | 25947 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrik Lundin <patrik@sigterm.se>
#
# 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 |
anistark/mozillians | vendor-local/lib/python/celery/security/__init__.py | 14 | 2610 | from __future__ import absolute_import
from __future__ import with_statement
from kombu.serialization import registry
from .. import current_app
from ..exceptions import ImproperlyConfigured
from .serialization import register_auth
SSL_NOT_INSTALLED = """\
You need to install the pyOpenSSL library to use the auth s... | bsd-3-clause |
ltilve/ChromiumGStreamerBackend | third_party/protobuf/python/google/protobuf/internal/decoder.py | 223 | 26136 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
ccpgames/pypicloud-tools | test/test_init.py | 1 | 14119 | """Test the common functions found in the __init__ module."""
import os
import mock
import pytest
import pypicloud_tools
DEFAULT_CONFIG = os.path.join(os.path.expanduser("~"), ".pypirc")
def test_get_bucket_conn():
"""Tests the calls to boto to get our bucket object."""
mock_config = mock.MagicMock(spec... | mit |
weinstein/FastMaxFlow | tree_congestion_approx.py | 1 | 2240 | from congestion_approx import CongestionApprox
from graph_util import EDGE_CAPACITY_ATTR
class TreeCongestionApprox(CongestionApprox):
def __init__(s, tree, tree_root, alpha):
# TODO: node to index
s.tree = tree.copy()
s.root = tree_root
s.cached_dfs_edges = list(s.recursive_dfs_edges(s.root, set(), Fal... | mit |
Wingless-Archangel/OWASP-ZSC | lib/encoder/windows_x86/add_random.py | 4 | 2175 | #!/usr/bin/env python
'''
OWASP ZSC
https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project
https://github.com/zscproject/OWASP-ZSC
http://api.z3r0d4y.com/
https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ]
'''
import random
import binascii
import string
from core.compatible import version... | gpl-3.0 |
serialdoom/ansible | test/units/module_utils/test_distribution_version.py | 1 | 27612 | # -*- coding: utf-8 -*-
# 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 distr... | gpl-3.0 |
kim42083/webm.webminspector | webminspector.py | 15 | 3620 | #!/usr/bin/env python
##
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PAT... | bsd-3-clause |
ogajduse/spacewalk | client/debian/packages-already-in-debian/rhn-client-tools/src/up2date_client/messageWindow.py | 4 | 4912 |
import gtk
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
# wrap a long line...
def wrap_line(line, max_line_size = 100):
if len(line) < max_line_size:
return line
ret = []
l = ""
for w in line.split():
if not len(l):
l = w
... | gpl-2.0 |
drzoidberg33/plexpy | lib/requests/_internal_utils.py | 414 | 1096 | # -*- coding: utf-8 -*-
"""
requests._internal_utils
~~~~~~~~~~~~~~
Provides utility functions that are consumed internally by Requests
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a str... | gpl-3.0 |
umlfri/umlfri2 | umlfri2/ufl/types/enum/stringenum.py | 1 | 1096 | from .enum import UflEnumType
from .enumpossibility import UflEnumPossibility
from ..basic.string import UflStringType
class UflStringEnumType(UflEnumType):
def __init__(self, possibilities, default=None):
super().__init__((UflEnumPossibility(self, name, name) for name in possibilities), default)... | gpl-3.0 |
piffey/ansible | lib/ansible/plugins/terminal/ironware.py | 76 | 2697 | #
# (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 |
stelligent/ansible-modules-core | cloud/amazon/ec2_scaling_policy.py | 35 | 6892 | #!/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 |
cmdblock/pmip6ns3.13new | src/internet/bindings/modulegen__gcc_ILP32.py | 27 | 866073 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
ramith/andes | modules/python/mllib/transforms.py | 41 | 3592 | #
# 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... | apache-2.0 |
repotvsupertuga/tvsupertuga.repository | script.video.F4mProxy/lib/f4mUtils/datefuncs.py | 206 | 2278 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
import os
#Functions for manipulating datetime objects
#CCYY-MM-DDThh:mm:ssZ
def parseDateClass(s):
year, month, day = s.split("-")
day, tail = day[:2], day[2:]
hour, minute, second = tail[1:].split(":")
s... | gpl-2.0 |
pwoodworth/intellij-community | python/lib/Lib/site-packages/django/db/models/query.py | 71 | 53653 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
from itertools import izip
from django.db import connections, router, transaction, IntegrityError
from django.db.models.aggregates import Aggregate
from django.db.models.fields import DateField
from django.db.models.query_utils import... | apache-2.0 |
songmonit/CTTMSONLINE_V8 | addons/point_of_sale/wizard/pos_box.py | 381 | 2211 |
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.addons.account.wizard.pos_box import CashBox
class PosBox(CashBox):
_register = False
def run(self, cr, uid, ids, context=None):
if not context:
context = dict()
active_model = context.get('active_mod... | agpl-3.0 |
cntnboys/cmput410-project | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py | 805 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | apache-2.0 |
freedomtan/tensorflow | tensorflow/python/keras/combinations_test.py | 11 | 5741 | # Copyright 2020 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 |
google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/optparse.py | 5 | 62909 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionPa... | apache-2.0 |
12AngryMen/votca-scripts | xtp/xtp_energielevels.py | 2 | 3385 | #!/usr/bin/env python
import sys
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv)==2:
infile=sys.argv[1]
export=False
elif len(sys.argv)==3:
infile=sys.argv[1]
gnufile=sys.argv[2]
export=True
else:
print "Wrong number of arguments simply specify first... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_isinstance.py | 90 | 10171 | # Tests some corner cases with isinstance() and issubclass(). While these
# tests use new style classes and properties, they actually do whitebox
# testing of error conditions uncovered when using extension types.
import unittest
from test import support
import sys
class TestIsInstanceExceptions(unittest.TestCase... | gpl-2.0 |
marscher/mdtraj | MDTraj/utils/test.py | 1 | 5510 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | lgpl-2.1 |
kwikadi/orange3 | Orange/tests/test_classification.py | 1 | 11865 | import inspect
import pickle
import pkgutil
import unittest
import numpy as np
import traceback
from Orange.base import SklLearner
import Orange.classification
from Orange.classification import (Learner, Model, NaiveBayesLearner,
LogisticRegressionLearner, NuSVMLearner)
from Orange.... | bsd-2-clause |
durandj/hord | tests/core/command/test_decorator.py | 1 | 3180 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for the command decorators
"""
import unittest
import hord.core.command
# pylint: disable=blacklisted-name
@hord.core.command.command()
async def foo():
"""
Foo command
"""
@hord.core.command.command(name='bar', description='Bar command')
async de... | mit |
mzl9039/spark | examples/src/main/python/ml/elementwise_product_example.py | 128 | 1632 | #
# 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 |
nizox/circuits | circuits/core/workers.py | 1 | 2554 | """Workers
Worker components used to perform "work" in independent threads or
processes. Worker(s) are typically used by a Pool (circuits.core.pools)
to create a pool of workers. Worker(s) are not registered with a Manager
or another Component - instead they are managed by the Pool. If a Worker
is used independently i... | mit |
vveerava/Openstack | neutron/plugins/cisco/l3/plugging_drivers/n1kv_plugging_constants.py | 20 | 1105 | # Copyright 2014 Cisco Systems, 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 requir... | apache-2.0 |
kivy/plyer | examples/orientation/main.py | 6 | 1170 |
from kivy.base import runTouchApp
from kivy.lang import Builder
interface = Builder.load_string('''
#:import orientation plyer.orientation
<WrapButton@Button>:
text_size: self.size
valign: 'middle'
halign: 'center'
BoxLayout:
orientation: 'horizontal'
GridLayout:
size_hint_x: 2
... | mit |
ifkite/tiny_demon | app.py | 1 | 1184 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
from tornado.options import options
from tornado.web import URLSpec
from handlers.file import UploadHandler
from handlers.file import DownloadHandler
class Application(tornado.web.Application):
... | mit |
yawnosnorous/python-for-android | python3-alpha/python3-src/Lib/test/script_helper.py | 49 | 5285 | # Common utility functions used by various script execution tests
# e.g. test_cmd_line, test_cmd_line_script and test_runpy
import sys
import os
import re
import os.path
import tempfile
import subprocess
import py_compile
import contextlib
import shutil
import zipfile
from imp import source_from_cache
from test.supp... | apache-2.0 |
openlabs/pyes | pyes/utils/imports.py | 3 | 4453 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
"""
pyes.utils.imports
~~~~~~~~~~~~~~~~~~
Taken from celery.utils.imports
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import ... | bsd-3-clause |
openclimatedata/pymagicc | pymagicc/_version.py | 1 | 18455 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | agpl-3.0 |
legalsylvain/OpenUpgrade | openerp/addons/base/module/wizard/base_module_upgrade.py | 40 | 4914 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
lberruti/ansible | test/units/TestPlayVarsFiles.py | 95 | 12363 | #!/usr/bin/env python
import os
import shutil
from tempfile import mkstemp
from tempfile import mkdtemp
from ansible.playbook.play import Play
import ansible
import unittest
from nose.plugins.skip import SkipTest
class FakeCallBacks(object):
def __init__(self):
pass
def on_vars_prompt(self):
... | gpl-3.0 |
bnprk/django-oscar | src/oscar/apps/dashboard/app.py | 34 | 2262 | from django.conf.urls import url, include
from oscar.core.application import Application
from oscar.core.loading import get_class
class DashboardApplication(Application):
name = 'dashboard'
permissions_map = {
'index': (['is_staff'], ['partner.dashboard_access']),
}
index_view = get_class('d... | bsd-3-clause |
paekwy/support-tools | googlecode-issues-exporter/issues_test.py | 90 | 9573 | # 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... | apache-2.0 |
zetacoin/zetacoin | contrib/devtools/update-translations.py | 91 | 7580 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | mit |
chunywang/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_script-src_self_unsafe-line.py | 30 | 3012 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "script-src 'self' 'un... | bsd-3-clause |
kiyoto/statsmodels | statsmodels/examples/ex_multivar_kde.py | 34 | 1504 |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
import statsmodels.api as sm
"""
This example illustrates the nonparametric estimation of a
bivariate bi-modal distribution that is a mixture of two normal
distri... | bsd-3-clause |
demianw/dipy | scratch/very_scratch/get_vertices.py | 18 | 2759 | sphere_dic = {'fy362': {'filepath' : '/home/ian/Devel/dipy/dipy/data/evenly_distributed_sphere_362.npz', 'object': 'npz', 'vertices': 'vertices', 'omit': 0, 'hemi': False},
'fy642': {'filepath' : '/home/ian/Devel/dipy/dipy/data/evenly_distributed_sphere_642.npz', 'object': 'npz', 'vertices': 'odf_vertices... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.