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 |
|---|---|---|---|---|---|
OpenDMM/bitbake | lib/bb/server/xmlrpc.py | 1 | 13971 | #
# BitBake XMLRPC Server
#
# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
# Copyright (C) 2006 - 2008 Richard Purdie
#
# 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 p... | gpl-2.0 |
sergecodd/FireFox-OS | B2G/gecko/testing/tps/tps/mozhttpd.py | 2 | 3379 | #!/usr/bin/python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import BaseHTTPServer
import SimpleHTTPServer
import threading
import sys
import os
import urllib
im... | apache-2.0 |
ManiacalLabs/BiblioPixel | test/bibliopixel/colors/color_test.py | 2 | 2781 | import unittest
from bibliopixel.colors import COLORS, arithmetic, classic, names, tables
class ArithmeticTest(unittest.TestCase):
def test_color_blend(self):
self.assertEqual(arithmetic.color_blend(COLORS.Red, COLORS.Green),
(255, 255, 1))
self.assertEqual(arithmetic.col... | mit |
datawire/quark | quarkc/backend.py | 1 | 34267 | # Copyright 2015 datawire. 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 agr... | apache-2.0 |
Mozhuowen/brython | www/src/Lib/http/cookies.py | 735 | 20810 | #!/usr/bin/env python3
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in... | bsd-3-clause |
pasv/Empire | lib/modules/persistence/debugger/magnify.py | 20 | 5292 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Magnifier',
'Author': ['@harmj0y'],
'Description': ("Sets the debugger for the on-screen magnifier (Magnify.exe) to be cmd.exe, "
... | bsd-3-clause |
lzha0/gwibber-with-fanfou-protocol | gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py | 2 | 6192 | #
# Copyright (C) 2010 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 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... | gpl-2.0 |
zhuango/python | pythonLearning/dataModel/vector.py | 2 | 1471 | from math import hypot
class Vector:
def __init__(self, x = 0, y = 0):
self.x = x
self.y = y
# If you only implement one of these special methods, choose __repr__, because when
# no custom __str__ is available, Python will call __repr__ as a fallback.
# one(__repr__) used for debugging... | gpl-2.0 |
mtagle/airflow | airflow/models/dagbag.py | 4 | 21150 | #
# 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 |
tumbl3w33d/ansible | lib/ansible/modules/network/nos/nos_config.py | 42 | 14989 | #!/usr/bin/python
# Copyright: (c) 2018, Extreme 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)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
kevinlondon/sentry | src/sentry/migrations/0180_auto__add_field_release_environment__add_field_release_ref__add_field_.py | 34 | 39226 | # -*- 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):
# Removing unique constraint on 'Release', fields ['project', 'version']
... | bsd-3-clause |
gg7/sentry | src/sentry/nodestore/multi/backend.py | 13 | 2717 | """
sentry.nodestore.multi.backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import random
import six
from sentry.nodestore.base import NodeStorage
from sentry.ut... | bsd-3-clause |
heromod/migrid | mig/simulation/user.py | 1 | 2151 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# user - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the ... | gpl-2.0 |
nathania/networkx | networkx/generators/ego.py | 80 | 2265 | """
Ego graph.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Drew Conway <drew.conway@nyu.edu>',
'Aric Hagberg <hagberg@lan... | bsd-3-clause |
renard/ansible | test/lib/ansible_test/_internal/sanity/bin_symlinks.py | 55 | 3589 | """Sanity test for symlinks in the bin directory."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from .. import types as t
from ..sanity import (
SanityVersionNeutral,
SanityMessage,
SanityFailure,
SanitySuccess,
)
from ..config import (
Sani... | gpl-3.0 |
googleapis/python-pubsublite | google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py | 1 | 11672 | # -*- 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 |
rancherio/validation-tests | tests/v2_validation/cattlevalidationtest/core/test_host_api.py | 3 | 3208 | from common_fixtures import * # NOQA
import websocket as ws
import pytest
def test_host_api_token(client):
hosts = client.list_host(kind='docker', removed_null=True)
assert len(hosts) > 0
# valid token and a url to the websocket
stats = hosts[0].stats()
conn = ws.create_connection(stats.url+'?to... | apache-2.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/ToolTip.py | 149 | 2736 | # general purpose 'tooltip' routines - currently unused in idlefork
# (although the 'calltips' extension is partly based on this code)
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
from Tkinter import *
class ToolTipBase:
def __init__(self, button):
... | gpl-2.0 |
mmccombe/sp17-i524 | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/dao/stations_dao.py | 20 | 2289 | import hbase_connect as dao_parent
table_name = 'stations'
##############################################################################################################################
def get_cf():
cf = {
'station' : dict(),
'date_range' : dict() ,
'location' : dict(),
}
return c... | apache-2.0 |
leoliujie/odoo | addons/account_asset/account_asset.py | 183 | 28936 | # -*- encoding: 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 G... | agpl-3.0 |
dkentw/selenium | py/test/selenium/test_google.py | 65 | 1414 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
avr92/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | Chapter5_LossFunctions/DarkWorldsMetric.py | 92 | 20375 | """ DarkWorldsMetricMountianOsteric.py
Custom evaluation metric for the 'Observing Dark Worlds' competition.
[Description of metric, or reference to documentation.]
Update: Made for the training set only so users can check there results from the training c
@Author: David Harvey
Created: 22 August 2012
"""
import nu... | mit |
bgarrels/httpie | tests/test_uploads.py | 47 | 2820 | import os
import pytest
from httpie.input import ParseError
from utils import TestEnvironment, http, HTTP_OK
from fixtures import FILE_PATH_ARG, FILE_PATH, FILE_CONTENT
class TestMultipartFormDataFileUpload:
def test_non_existent_file_raises_parse_error(self, httpbin):
with pytest.raises(ParseError):
... | bsd-3-clause |
samthor/intellij-community | python/lib/Lib/encodings/iso2022_jp_1.py | 816 | 1061 | #
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
c72578/poedit | deps/boost/libs/python/test/calling_conventions.py | 20 | 1640 | # Copyright Nicolas Lelong, 2010. Distributed under the Boost
# Software License, Version 1.0 (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from calling_conventions_ext import *
>>> f_0__cdecl()
17041
>>> f_1__cdecl(1)
1
>>> f_2__cdecl(1, 2)
21
>>> f_3__cdecl(1, 2,... | mit |
miguelparaiso/PracticaOdoo | addons/mail/tests/test_mail_gateway.py | 126 | 44440 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
eenchev/idea-note-taking-app | env/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/mxodbc.py | 33 | 4604 | # mssql/mxodbc.py
# Copyright (C) 2005-2017 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
"""
.. dialect:: mssql+mxodbc
:name: mxODBC
:dbapi: mxodbc
:connectstrin... | mit |
bincentvaret/bsd-cloudinit | cloudbaseinit/utils/network.py | 3 | 2484 | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
mvitr/titanium_mobile | support/common/mako/codegen.py | 40 | 32857 | # codegen.py
# Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module source code."""
import time
impo... | apache-2.0 |
pbvarga1/qimage2ndarray | qimage2ndarray/__init__.py | 1 | 14973 | import sys as _sys
import numpy as _np
from .dynqt import QtGui as _qt
from .dynqt import qt as _qt_driver
if _qt_driver.name() == 'PythonQt':
from .qimageview import QImage2ndarray as _temp
_qimageview = _temp.qimageview
else:
from .qimageview_python import qimageview as _qimageview
__version__ = "1.5"
... | bsd-3-clause |
Backflipz/plugin.video.excubed | addon.py | 1 | 81609 | from whoosh.index import create_in
# from xbmcswift2 import Plugin
from kodiswift import Plugin
import os
import sys
import re
import json
import xbmc
import xbmcaddon
import xbmcplugin
import xbmcgui
import threading
import glob
import shlex
from BeautifulSoup import BeautifulSoup as BS
from whoosh.filedb.filestore im... | gpl-2.0 |
brett-patterson/pyface | pyface/workbench/action/set_active_perspective_action.py | 2 | 2020 | """ An action that sets the active perspective. """
# Enthought library imports.
from pyface.workbench.api import IPerspective
from traits.api import Delegate, Instance, on_trait_change
# Local imports.
from workbench_action import WorkbenchAction
class SetActivePerspectiveAction(WorkbenchAction):
""" An actio... | bsd-3-clause |
alkurbatov/squirrel | src/convert.py | 1 | 1073 | # This file is a part of Squirrel project
#
# Copyright (C) 2014, Alexander Kurbatov <sir.alkurbatov@yandex.ru>
#
# Squirrel 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 |
loanzen/heroku-buildpack-python | vendor/pip-pop/pip/_vendor/lockfile/sqlitelockfile.py | 487 | 5540 | from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, t... | mit |
dyermd/legos | scripts/QC/merger.py | 1 | 14082 | #! /usr/bin/env python
# Goal: Merge and run coverage analysis on the two Samples generated.
# Output: A mered bam file, and coverage analysis on the merged bam file.
from optparse import OptionParser
import os
import os.path
import sys
import re
import datetime
import json
from QC_Run import QC_Run
from tools impo... | gpl-2.0 |
zhouzhenghui/python-for-android | python-modules/twisted/twisted/python/zipstream.py | 60 | 11323 | # -*- test-case-name: twisted.python.test.test_zipstream -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An incremental approach to unzipping files. This allows you to unzip a little
bit of a file at a time, which means you can report progress as a file unzips.
"""
import wa... | apache-2.0 |
danalec/dotfiles | sublime/.config/sublime-text-3/Packages/anaconda_go/commands/enclosing.py | 2 | 2543 |
# Copyright (C) 2016 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
from anaconda_go.lib import go
from anaconda_go.lib.plugin import typing
from anaconda_go.lib.helpers import get_settings
from anaconda_go.lib.plugin import Worker, Callback, ExplorerPanel, i... | mit |
Bloomie/murano-repository | muranorepository/openstack/common/wsgi.py | 2 | 9499 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | apache-2.0 |
android-armv7a-belalang-tempur/Android_SpeedKernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
Danielhiversen/home-assistant | homeassistant/components/sensor/worldclock.py | 8 | 1841 | """
Support for showing the time in a different time zone.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.worldclock/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.cons... | mit |
okffi/booktype | lib/booktype/apps/account/tests/functest_dashboard.py | 2 | 4890 | # This file is part of Booktype.
# Copyright (c) 2014 Helmy Giacoman <helmy.giacoman@sourcefabric.org>
#
# Booktype 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
# ... | agpl-3.0 |
olegpshenichniy/Booktype | lib/booktype/convert/screenpdf/converter.py | 5 | 3563 | # This file is part of Booktype.
# Copyright (c) 2013 Borko Jandras <borko.jandras@sourcefabric.org>
#
# Booktype 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
# (a... | agpl-3.0 |
franekp/ankidict | ankidict/libdict/tests/tests_macmillan.py | 2 | 5960 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest import TestCase
import mock
import json
import urllib2
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from libdict.macmillan import models, query_site
words = [
'take-on', # multiple keys in last sense
'yours', # intr... | agpl-3.0 |
koyuawsmbrtn/eclock | windows/Python27/Lib/site-packages/pygame/examples/cursors.py | 32 | 3062 | #!/usr/bin/env python
import pygame
arrow = ( "xX ",
"X.X ",
"X..X ",
"X...X ",
"X....X ",
"X.....X ",
"X......X ",
"X...... | gpl-2.0 |
johnf/offlineimap | offlineimap/folder/Base.py | 2 | 16767 | # Base folder support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opt... | gpl-2.0 |
alvaroaleman/ansible-modules-core | windows/win_service.py | 200 | 1853 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Chris Hoffman <choffman@chathamfinancial.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 ... | gpl-3.0 |
ondra-novak/chromium.src | tools/compile_test/compile_test.py | 159 | 1781 | #!/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.
"""
Tries to compile given code, produces different output depending on success.
This is similar to checks done by ./configure scr... | bsd-3-clause |
taoistly/dec | dec.py | 1 | 11798 | import shutil
import os
import time
import suffixtree
def scan_kmer(read):
global K
offset, seq1, seq2 = read.split("\t")
ret = []
for base in seq1:
if base not in "ACGTN": return ret
for base in seq2:
if base not in "ACGTN": return ret
for idx in range(len(seq1) - K + 1):
... | mit |
Spferical/matrix-megahal | test.py | 2 | 1882 | import os
import unittest
import tempfile
import main
class TestMarkov(unittest.TestCase):
def setUp(self):
temp = tempfile.NamedTemporaryFile(delete=False)
self.tempfile_path = temp.name
temp.close()
self.markov = main.MarkovBackend(self.tempfile_path)
self.markov.learn(... | mit |
RPI-OPENEDX/edx-platform | common/djangoapps/xmodule_django/models.py | 46 | 6250 | """
Useful django models for implementing XBlock infrastructure in django.
"""
import warnings
from django.db import models
from django.core.exceptions import ValidationError
from opaque_keys.edx.keys import CourseKey, UsageKey, BlockTypeKey
class NoneToEmptyManager(models.Manager):
"""
A :class:`django.db.m... | agpl-3.0 |
HeisenbergUncertain/vitess | test/update_stream.py | 2 | 13732 | #!/usr/bin/python
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter("ignore")
import logging
import os
import time
import traceback
import threading
import unittest
import MySQLdb
import tablet
import utils
from vtdb im... | bsd-3-clause |
JDeuce/webassets | src/webassets/filter/closure_stylesheets.py | 19 | 1686 | """ Compile and Minify CSS with `Google Closure Stylesheets
<http://code.google.com/p/closure-stylesheets/>`_.
Google Closure Templates is an external tool written in Java, which needs
to be obtained separately.
You must define a ``CLOSURE_STYLESHEETS_PATH`` setting that
points to the ``.jar`` file. Otherwise, an env... | bsd-2-clause |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.91/roles/openshift_certificate_expiry/test/conftest.py | 26 | 3897 | # pylint: disable=missing-docstring,invalid-name,redefined-outer-name
import pytest
from OpenSSL import crypto
# Parameter list for valid_cert fixture
VALID_CERTIFICATE_PARAMS = [
{
'short_name': 'client',
'cn': 'client.example.com',
'serial': 4,
'uses': b'clientAuth',
'dns'... | apache-2.0 |
vaginessa/pyload | module/plugins/captcha/AdsCaptcha.py | 14 | 2119 | # -*- coding: utf-8 -*-
import random
import re
from module.plugins.internal.CaptchaService import CaptchaService
class AdsCaptcha(CaptchaService):
__name__ = "AdsCaptcha"
__type__ = "captcha"
__version__ = "0.10"
__status__ = "testing"
__description__ = """AdsCaptcha captcha service plu... | gpl-3.0 |
Shine-/xbmc | tools/EventClients/examples/python/example_button1.py | 192 | 2715 | #!/usr/bin/python
# This is a simple example showing how you can send 2 button events
# to XBMC in a queued fashion to shut it down.
# Queued button events are not repeatable.
# The basic idea is to create single packets and shoot them to XBMC
# The provided library implements some of the support commands and
# take... | gpl-2.0 |
guaq/paikkis | model.py | 1 | 3427 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
0 paikannimi
1 nimen kielikoodi
2 kielen nimi
3 paikkatyypin koodi
4 paikkatyypin selite
5 kkj/pkj pohjoinen
6 kkj/pkj itä
7 kkj/ykj pohjoinen
8 kkj/ykj itä
9 etrs/tm35fin pohjoinen
10 etrs/tm35fin itä
11 kuntakoodi
12 ku... | mit |
plasticbrain/sensu-community-plugins | plugins/openstack/neutron/check_neutron-api.py | 49 | 2449 | #!/usr/bin/env python
#
# Check OpenStack Neutron API Status
# ===
#
# Dependencies
# -----------
# - python-neutronclient and related libraries
#
# Performs API query to determine 'alive' status of the
# Neutron API.
#
# Author: Mike Dorman <mdorman@godaddy.com>
# Significantly based on neutron-agent-status.py by
# Br... | mit |
yusihao51/Minecraft | views.py | 1 | 24491 | # -*- coding: utf-8 -*-
# Imports, sorted alphabetically.
# Python packages
import os
import socket
import subprocess
import sys
import datetime
from math import sin, pi
# Third-party packages
import pyglet
from pyglet.text import Label
from pyglet.gl import *
# Modules from this project
import globals as G
from gu... | mit |
danieljabailey/inkscape_experiments | share/extensions/fractalize.py | 1 | 3762 | #!/usr/bin/env python
'''
Copyright (C) 2005 Carsten Goetze c.goetze@tu-bs.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
... | gpl-2.0 |
glaubitz/fs-uae-debian | arcade/OpenGL/raw/GL/ARB/fragment_program.py | 9 | 7721 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-2.0 |
idatux/idatuxft | engine/xml/dom/ext/reader/Sax2Lib.py | 13 | 8295 | """A Python translation of the SAX2 parser API. This file provides only
default classes with absolutely minimum functionality, from which
drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
"""
from xml.sax import saxlib
class LexicalH... | gpl-3.0 |
yusihao51/Minecraft | mods/more_tools/__init__.py | 5 | 3430 | import globals as G
from blocks import *
from items import *
class EmeraldHoe(Hoe):
material = G.IRON_TOOL
tool_type = G.HOE
max_stack_size = 1
id = 292,1
durability = 50
name = "Emerald Hoe"
class RubyHoe(Hoe):
material = G.IRON_TOOL
tool_type = G.HOE
max_stack_size = 1
id = 2... | mit |
charlesvdv/servo | tests/wpt/css-tests/tools/wptserve/wptserve/response.py | 116 | 15903 | from collections import OrderedDict
from datetime import datetime, timedelta
import Cookie
import json
import types
import uuid
import socket
from .constants import response_codes
from .logger import get_logger
missing = object()
class Response(object):
"""Object representing the response to a HTTP request
... | mpl-2.0 |
av8ramit/tensorflow | tensorflow/contrib/layers/python/layers/layers_test.py | 3 | 170927 | # 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 |
sahiljain/catapult | third_party/py_vulcanize/third_party/rjsmin/bench/main.py | 12 | 7298 | #!/usr/bin/env python
# -*- coding: ascii -*-
r"""
=================================
Benchmark jsmin implementations
=================================
Benchmark jsmin implementations.
:Copyright:
Copyright 2011 - 2014
Andr\xe9 Malo or his licensors, as applicable
:License:
Licensed under the Apache License, Ve... | bsd-3-clause |
bq/web2board | res/common/Scons/sconsFiles/SCons/Tool/rpcgen.py | 6 | 2861 | """SCons.Tool.rpcgen
Tool-specific initialization for RPCGEN tools.
Three 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 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of... | lgpl-3.0 |
DoubleNegativeVisualEffects/gaffer | python/GafferTest/FrameNode.py | 5 | 2525 | ##########################################################################
#
# Copyright (c) 2012, John Haddon. 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... | bsd-3-clause |
zenna/dreal3 | benchmarks/network/water/water-triple-ind.py | 11 | 6830 |
from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
(declare-fun x1 () Real)
(declare-fun x2 () Real)
(declare-fun x3 () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[x1] (/ (- 5 (* (* 0.5 (^ (* 2 9.80665) 0.5)) (^ x1 0.5))) 2))
(= d/dt[x2] (... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/262_test_array.py | 52 | 34625 | #! /usr/bin/env python
"""Test the arraymodule.
Roger E. Masse
"""
import unittest
from test import test_support
from weakref import proxy
import array, cStringIO
from cPickle import loads, dumps, HIGHEST_PROTOCOL
class ArraySubclass(array.array):
pass
class ArraySubclassWithKwargs(array.array):
def __ini... | gpl-3.0 |
Dhivyap/ansible | lib/ansible/modules/network/aci/aci_firmware_group_node.py | 5 | 6185 | #!/usr/bin/python
# 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'],
'supported_by': 'community'
}
DOCUM... | gpl-3.0 |
abenzbiria/clients_odoo | addons/payment_buckaroo/controllers/main.py | 325 | 1270 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class BuckarooController(http.Controller):
_return_url = '/pa... | agpl-3.0 |
ubic135/odoo-design | addons/knowledge/__init__.py | 436 | 1064 | # -*- 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 |
Octonius/boxv2 | boxv2/session.py | 1 | 18801 | from .request import BoxRestRequest
from .upload import MultipartUploadWrapper
from .exceptions import BoxError, BoxHttpResponseError
class BoxSession(object):
"""Manage files and folder from Box.
When you instanciate this class you have to provide at least the Refresh Token (found with :class:`BoxAuthentica... | mit |
phenoxim/nova | nova/tests/unit/api/openstack/compute/test_agents.py | 1 | 19278 | # Copyright 2012 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 t... | apache-2.0 |
PokemonGoF/PokemonGo-Bot-Desktop | build/pywin/Lib/fractions.py | 252 | 22390 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... | mit |
camilonova/django | tests/test_client/test_conditional_content_removal.py | 131 | 1958 | import gzip
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
from django.test import SimpleTestCase
from django.test.client import conditional_content_removal
class ConditionalContentTests(SimpleTestCase):
def test_conditional_content_removal(self):
"""
Content is removed... | bsd-3-clause |
dermute/ansible | lib/ansible/galaxy/__init__.py | 9 | 2428 | ########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.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... | gpl-3.0 |
EdgarSun/Django-Demo | django/core/management/commands/startproject.py | 322 | 1680 | from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
import os
import re
from random import choice
class Command(LabelCommand):
help = "Creates a Django project directory structure for the given project name in the current directory."
... | mit |
atmark-techno/atmark-dist | user/mosquitto/mosquitto-1.3.4/test/broker/06-bridge-reconnect-local-out.py | 18 | 2423 | #!/usr/bin/env python
# Test whether a bridge topics work correctly after reconnection.
# Important point here is that persistence is enabled.
import os
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfol... | gpl-2.0 |
yongshengwang/hue | desktop/core/ext-py/Paste-2.0.1/paste/util/dateinterval.py | 50 | 2412 | """
DateInterval.py
Convert interval strings (in the form of 1w2d, etc) to
seconds, and back again. Is not exactly about months or
years (leap years in particular).
Accepts (y)ear, (b)month, (w)eek, (d)ay, (h)our, (m)inute, (s)econd.
Exports only timeEncode and timeDecode functions.
"""
import re
__all__ = ['inte... | apache-2.0 |
manazhao/tf_recsys | tensorflow/python/layers/core_test.py | 22 | 14628 | # 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 |
gordolio/iTerm2 | tests/esctest/tests/tbc.py | 31 | 1409 | from esc import ESC, TAB
import esccmd
import escio
from escutil import AssertEQ, GetCursorPosition
from esctypes import Point
class TBCTests(object):
def test_TBC_Default(object):
"""No param clears the tab stop at the cursor."""
escio.Write(TAB)
AssertEQ(GetCursorPosition().x(), 9)
esccmd.TBC()
... | gpl-2.0 |
GrognardsFromHell/TemplePlus | tpdatasrc/co8infra/scr/Spell307 - Meteor Swarm.py | 1 | 3572 | from toee import *
from utilities import *
def OnBeginSpellCast( spell ):
print "Meteor Swarm OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-evocation-conjure", spell.caster )
def OnSpellEffect( spell )... | mit |
largelymfs/w2vtools | build/scipy/scipy/spatial/tests/test_qhull.py | 12 | 28840 | from __future__ import division, print_function, absolute_import
import os
import copy
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal, run_module_suite,\
assert_, dec, assert_allclose, assert_array_equal, assert_raises
from scipy.lib.six import xrange
import scipy.spatial.qhull a... | mit |
gg7/sentry | src/sentry/migrations/0117_auto__add_rule.py | 36 | 22953 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Rule'
db.create_table('sentry_rule', (
('id', self.gf('sentry.db.models.fields.b... | bsd-3-clause |
CDSFinance/zipline | zipline/utils/factory.py | 6 | 11228 | #
# Copyright 2013 Quantopian, 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 agreed to in wr... | apache-2.0 |
noironetworks/nova | nova/scheduler/filters/numa_topology_filter.py | 15 | 2073 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
petrus-v/odoo | openerp/models.py | 2 | 291083 | # -*- 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 |
lwiecek/django | tests/gis_tests/gis_migrations/migrations/0001_initial.py | 269 | 2465 | from django.db import connection, migrations, models
from ...models import models as gis_models
ops = [
migrations.CreateModel(
name='Neighborhood',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.C... | bsd-3-clause |
hassoon3/odoo | addons/project/tests/test_project_base.py | 197 | 4321 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
eriknyk/devcon | devcon/lib/orderColumn.py | 1 | 1133 | from tg import expose, flash, require, url, request, redirect, validate, response
from sqlalchemy import asc, desc
from tw.forms.datagrid import Column
import genshi
class SortableColumn(Column):
def __init__(self, title, name):
super(SortableColumn, self).__init__(name)
self._title_ = title
d... | lgpl-2.1 |
computationalBiology/NPLB | NPLB/savefiles.py | 1 | 14566 |
##################### NPLB #####################
# No Promoter Left Behind (NPLB) is a tool to
# find the different promoter architectures within a set of promoter
# sequences. More information can be found in the README file.
# Copyright (C) 2015 Sneha Mitra and Leelavati Narlikar
# NPLB is free so... | gpl-3.0 |
jgcaaprom/android_external_chromium_org | tools/telemetry/telemetry/core/platform/ios_platform_backend.py | 29 | 1834 | # Copyright 2014 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 logging
from telemetry.core.platform import posix_platform_backend
#TODO(baxley): Put in real values.
class IosPlatformBackend(posix_platform_backen... | bsd-3-clause |
hph86/requesocks | requesocks/packages/urllib3/connectionpool.py | 2 | 24377 | # urllib3/connectionpool.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import socket
from base64 import b64encode
from socket import error as S... | isc |
krbeverx/Firmware | Tools/px_process_module_doc.py | 5 | 4029 | #!/usr/bin/env python
############################################################################
#
# Copyright (C) 2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | bsd-3-clause |
ziadsawalha/solum | solum/objects/sqlalchemy/migration/alembic_migrations/versions/498adc6185ae_create_initial_db_schema.py | 2 | 7061 | # Copyright 2014 - Rackspace
#
# 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, ... | apache-2.0 |
lmprice/ansible | lib/ansible/plugins/action/telnet.py | 28 | 3132 | # (c) 2017, Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import telnetlib
from time import sleep
from ansible.module_utils._text import to_native
from ansible.mod... | gpl-3.0 |
RedhawkSDR/integration-gnuhawk | components/deinterleave_bb_4o/tests/test_deinterleave_bb_4o.py | 1 | 4079 | #!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... | gpl-3.0 |
mixman/djangodev | django/template/defaultfilters.py | 2 | 28093 | """Default variable filters."""
import re
import random as random_module
import unicodedata
from decimal import Decimal, InvalidOperation, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
from django.template.base import Variable, Library
from django.conf import settings
from django.utils import f... | bsd-3-clause |
mortonjt/American-Gut | scripts/mod2_pcoa.py | 1 | 14487 | #!/usr/bin/env python
import os
import click
from matplotlib import use
use('Agg') # noqa
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from skbio import read, DistanceMatrix
from skbio.stats import isubsample
from skbio.stats.ordination import OrdinationResults
from col... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.