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 |
|---|---|---|---|---|---|
Zorro666/renderdoc | util/test/tests/Vulkan/VK_Shader_Editing.py | 2 | 7781 | import copy
import rdtest
import renderdoc as rd
from typing import Tuple
class VK_Shader_Editing(rdtest.TestCase):
demos_test_name = 'VK_Shader_Editing'
def check_capture(self):
eid = self.find_action("Draw 1").next.eventId
self.controller.SetFrameEvent(eid, False)
pipe: rd.PipeStat... | mit |
SeeSpotRun/rmlint | tests/test_options/test_mtime_window.py | 2 | 3692 | #!/usr/bin/env python3
# encoding: utf-8
from nose.plugins.attrib import attr
from nose import with_setup
from tests.utils import *
import os
import subprocess
def set_mtime(path, mtime):
full_path = os.path.join(TESTDIR_NAME, path)
subprocess.call(['touch', '-m', '-d', str(mtime), full_path])
@with_setup(... | gpl-3.0 |
kbehafarin/newfies-dialer | newfies/runtests.py | 8 | 3394 | #!/usr/bin/env python
#
# Usage : python manage.py test --with-xtraceback --with-color
# Run on shell test coverage : python manage.py test --progressive-with-bar --with-coverage --cover-html --cover-package=newfies
#
#
import sys
import logging
from optparse import OptionParser
from coverage import coverage
import s... | mpl-2.0 |
jjyycchh/phantomjs | src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py | 118 | 19205 | #! /usr/bin/python
import sys
import os
import StringIO
import unittest
# Show DepricationWarnings come from buildbot - it isn't default with Python 2.7 or newer.
# See https://bugs.webkit.org/show_bug.cgi?id=90161 for details.
import warnings
warnings.simplefilter('default')
class BuildBotConfigLoader(object):
... | bsd-3-clause |
pavlova-marina/QGIS | python/plugins/processing/algs/otb/OTBAlgorithmProvider.py | 5 | 4094 | # -*- coding: utf-8 -*-
"""
***************************************************************************
OTBAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
(C) 2013 by CS Systemes d'information
E... | gpl-2.0 |
JulianEberius/SublimeRope | rope/refactor/functionutils.py | 79 | 8500 | import rope.base.exceptions
import rope.base.pyobjects
from rope.base.builtins import Lambda
from rope.base import worder
class DefinitionInfo(object):
def __init__(self, function_name, is_method, args_with_defaults,
args_arg, keywords_arg):
self.function_name = function_name
sel... | gpl-2.0 |
WinterNis/sqlalchemy | test/orm/test_versioning.py | 21 | 31479 | import datetime
import sqlalchemy as sa
from sqlalchemy.testing import engines, config
from sqlalchemy import testing
from sqlalchemy.testing.mock import patch
from sqlalchemy import (
Integer, String, Date, ForeignKey, orm, exc, select, TypeDecorator)
from sqlalchemy.testing.schema import Table, Column
from sqlalc... | mit |
rschnapka/odoo | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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 |
ciber96/mtasa-blue | vendor/google-breakpad/src/testing/gtest/test/gtest_xml_test_utils.py | 356 | 8722 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-3.0 |
ScreamingUdder/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSBeamSpreaderTransmission.py | 1 | 13137 | #pylint: disable=no-init,invalid-name
from __future__ import (absolute_import, division, print_function)
import mantid.simpleapi as api
from mantid.api import *
from mantid.kernel import *
import os
from reduction_workflow.find_data import find_data
class SANSBeamSpreaderTransmission(PythonAlgorithm):
def categ... | gpl-3.0 |
gauravbose/digital-menu | tests/queryset_pickle/models.py | 68 | 2088 | import datetime
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.utils.translation import ugettext_lazy as _
def standalone_number():
return 1
class Numbers(object):
@staticmethod
def get_static_number():
return 2
@classmethod
def get_class_number(cls):
retur... | bsd-3-clause |
Infusion-OS/android_external_skia | platform_tools/android/tests/var_dict_tests.py | 146 | 2613 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test the VarsDict.
"""
import sys
import test_variables
import unittest
sys.path.append(test_variables.GYP_GEN_DIR)
import vars_dict_lib
from vars_dict_lib impo... | bsd-3-clause |
iansf/sky_engine | sky/tools/webkitpy/common/system/path.py | 191 | 5046 | # 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 |
marioaugustorama/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_add.py | 61 | 1089 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity
class AddParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}">
<add>
<participant j... | gpl-3.0 |
deflaux/mvp_aaa_codelabs | bin/annovar-transform.py | 2 | 2165 | import argparse
import os
START = 1
END = 2
class AnnotationConversion(object):
def __init__(self, input, one_to_zero=False):
# open file
with open(input) as f:
for line in f:
# remove newline
line = line.rstrip()
# remove existing commas... | apache-2.0 |
AOKP/external_chromium_org | chrome/test/functional/ispy/ispy_core/tools/rendering_test_manager.py | 23 | 6525 | # Copyright 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.
"""Utilities for managing files in Google Cloud Storage."""
from tools import image_tools
import collections
import posixpath
import itertools
class Rende... | bsd-3-clause |
somehume/namebench | nb_third_party/dns/reversename.py | 248 | 2931 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
mikebd/splunk-elasticsearch | search-elasticsearch/bin/urllib3/connectionpool.py | 197 | 30371 | import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
try: # Python 3
from queue import LifoQueue, Empty, Full
except ImportError:
from Queue import LifoQueue, Empty, Full
import Queue as _ # Platform-specific: Windows
fr... | apache-2.0 |
jpflori/mpir | yasm/tools/python-yasm/pyxelator/wrap_yasm.py | 40 | 1294 | #!/usr/bin/env python
"""
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
"""
import sys
import os
from work_unit import WorkUnit, get_syms
import ir
def mk_tao(CPPFLAGS = "", CPP = "gcc -E", modname = '_yasm', oname = None, YASM_DIR = ".", **optio... | gpl-3.0 |
cybermatatu/bitcoin | qa/rpc-tests/getblocktemplate_longpoll.py | 133 | 3618 | #!/usr/bin/env python2
# Copyright (c) 2014 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 *
def check_a... | mit |
manasapte/pants | tests/python/pants_test/backend/docgen/targets/test_wiki_page.py | 15 | 3738 | # coding=utf-8
# Copyright 2014 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 |
larsoner/mne-python | mne/tests/test_morph.py | 3 | 42274 | # -*- coding: utf-8 -*-
# Author: Tommy Clausner <Tommy.Clausner@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import pytest
import numpy as np
from numpy.testing import (assert_array_less, assert_allclose,
assert_array_equal)
from scipy.spatial.distance import cdist
from scipy... | bsd-3-clause |
sebleier/python-redis | pyredis/hash.py | 1 | 2365 | from collections import defaultdict
class Hash(object):
def __init__(self):
self._data = defaultdict(int)
def hset(self, key, value):
"""
Set ``key`` to ``value`` within hash ``name``
Returns 1 if HSET created a new field, otherwise 0
"""
if key in self._data:... | bsd-3-clause |
chaitanyaT99/irRemoteServer | node_modules/node-ninja/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
Serg09/socorro | alembic/versions/131b277f5ef7_bug_958595_removed_emails_table.py | 14 | 1087 | """Bug 958595 - Removed emails table.
Revision ID: 131b277f5ef7
Revises: 6ef54091228
Create Date: 2014-02-10 17:05:16.106061
"""
# revision identifiers, used by Alembic.
revision = '131b277f5ef7'
down_revision = '6ef54091228'
from alembic import op
from socorro.lib import citexttype, jsontype, buildtype
from socorr... | mpl-2.0 |
datachand/h2o-3 | h2o-py/tests/testdir_jira/pyunit_hexdev_296_confusion_matrices.py | 5 | 1200 | import sys
sys.path.insert(1, "../../")
import h2o, tests
def confusion_matrices_check():
local_data = [[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[0, 'b'],
[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b']]
h... | apache-2.0 |
theanalyst/cinder | cinder/tests/brick/test_brick_remotefs.py | 4 | 7089 | # (c) Copyright 2013 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
eerwitt/tensorflow | tensorflow/contrib/bayesflow/python/ops/entropy.py | 85 | 1246 | # 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 |
asm666/sympy | sympy/printing/tests/test_theanocode.py | 42 | 9405 | from sympy.external import import_module
from sympy.utilities.pytest import raises, SKIP
from sympy.core.compatibility import range
theano = import_module('theano')
if theano:
import numpy as np
ts = theano.scalar
tt = theano.tensor
xt, yt, zt = [tt.scalar(name, 'floatX') for name in 'xyz']
else:
#... | bsd-3-clause |
colbyga/pychess | lib/pychess/widgets/newGameDialog.py | 20 | 27779 | import os.path
import gettext
import locale
from operator import attrgetter
from itertools import groupby
from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import Gtk
from cairo import ImageSurface
from gi.repository import GtkSource
from gi.repository import GdkPixbuf
from pychess... | gpl-3.0 |
dcrosta/ansible | lib/ansible/utils/color.py | 167 | 3134 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
kmod/icbd | stdlib/python2.5/pstats.py | 94 | 25940 | """Class for printing reports on profiled python code."""
# Class for printing reports on profiled python code. rev 1.0 4/1/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# see profile.doc and profile.py for more info.
# Copyright 1994, by InfoSeek Co... | mit |
rjaguar3/wesnoth-old | scons/python_devel.py | 49 | 1381 | # vi: syntax=python:et:ts=4
import sys, os
from config_check_utils import backup_env, restore_env
import distutils.sysconfig
def exists():
return True
def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), ... | gpl-2.0 |
theartstart/ArtStart | Login!/Profile/css/flask-image-upload-thing-master/tests/test_save.py | 3 | 4945 | from StringIO import StringIO
from flexmock import flexmock
import flask_uploads.functions as funcs
from flask_uploads import save, save_file, save_images, init
from . import TestCase
save, save_file, save_images
class FakeImage(object):
def __init__(self, name, ext):
self.name = name
self.ext = ... | apache-2.0 |
hbrunn/OCB | addons/account_payment/wizard/account_payment_order.py | 338 | 5906 | # -*- 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 |
stepanovsh/project_template | {{cookiecutter.repo_name}}/config/settings/local.py | 1 | 2101 | # -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default... | bsd-3-clause |
wskplho/sl4a | python/src/Lib/plat-mac/Carbon/Sound.py | 81 | 13258 | # Generated from 'Sound.h'
def FOUR_CHAR_CODE(x): return x
soundListRsrc = FOUR_CHAR_CODE('snd ')
kSimpleBeepID = 1
# rate48khz = (long)0xBB800000
# rate44khz = (long)0xAC440000
rate32khz = 0x7D000000
rate22050hz = 0x56220000
rate22khz = 0x56EE8BA3
rate16khz = 0x3E800000
rate11khz = 0x2B7745D1
rate11025hz = 0x2B110000... | apache-2.0 |
TuckermanGroup/PINY | python/setup.py | 2 | 1560 | import sys
import glob
# PINY directories
dir_piny = '..'
dir_piny_include = dir_piny + '/include'
dir_libpiny = dir_piny + '/lib'
# global Cython directives
cython_directives = {
'wraparound':False,
'boundscheck': False,
'cdivision': True,
'profile': False,
'embedsignature': True
}
#
# check r... | epl-1.0 |
phazel/pixelated-user-agent | service/pixelated/extensions/keymanager_fetch_key.py | 7 | 2192 | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated is distrib... | agpl-3.0 |
Eureka22/ASM_xf | PythonD/lib/python2.4/webbrowser.py | 11 | 11304 | """Interfaces for launching and remotely controlling Web browsers."""
import os
import sys
__all__ = ["Error", "open", "get", "register"]
class Error(Exception):
pass
_browsers = {} # Dictionary of available browser controllers
_tryorder = [] # Preference order of available browsers
def regis... | gpl-2.0 |
andmos/ansible | lib/ansible/modules/cloud/openstack/os_server_facts.py | 38 | 3309 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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 |
Wapaul1/ray | python/ray/tune/trial.py | 1 | 5216 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import traceback
import ray
from collections import namedtuple
from ray.rllib.agents import get_agent_class
# Ray resources required to schedule a Trial
Resources = namedtuple("Resources", ["cpu",... | apache-2.0 |
meganbkratz/acq4 | acq4/pyqtgraph/parametertree/ParameterTree.py | 47 | 5662 | from ..Qt import QtCore, QtGui
from ..widgets.TreeWidget import TreeWidget
import os, weakref, re
from .ParameterItem import ParameterItem
#import functions as fn
class ParameterTree(TreeWidget):
"""Widget used to display or control data from a hierarchy of Parameters"""
def __init__... | mit |
benchisell/photostream-bc | flask/lib/python2.7/site-packages/sqlalchemy/orm/session.py | 17 | 83215 | # orm/session.py
# Copyright (C) 2005-2012 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
"""Provides the Session class and related utilities."""
import weakref
from itertools ... | bsd-3-clause |
jmeppley/py-metagenomics | sample_records.py | 1 | 3684 | #!/usr/bin/env python
"""
This script takes any file that can be divided into records and
returns N randomly selected records
Records can be fasta, fastq, genbank, or something described by a
simple RegExp
"""
from os import path
from edl.util import *
from edl.batch import *
import re
import sys
import argparse
... | mit |
Salat-Cx65/python-for-android | python3-alpha/python3-src/Lib/sndhdr.py | 57 | 6219 | """Routines to help recognizing sound files.
Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.
The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- nu... | apache-2.0 |
enkiv2/popcorn_maker | vendor-local/lib/python/south/utils/datetime_utils.py | 154 | 1027 | from datetime import *
import django
from django.conf import settings
if django.VERSION[:2] >= (1, 4) and getattr(settings, 'USE_TZ', False):
from django.utils import timezone
from datetime import datetime as _datetime
class datetime(_datetime):
"""
A custom datetime.datetime class which ... | bsd-3-clause |
jshufelt/volatility | volatility/plugins/gui/vtypes/xp.py | 8 | 16283 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | gpl-2.0 |
shinate/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/model/datastorefile.py | 144 | 5172 | # 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 |
ramanajee/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/patchreader_unittest.py | 124 | 4135 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2009 Torch Mobile Inc.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | bsd-3-clause |
aagusti/o-sipkd | osipkd/views/eis/eis_item.py | 1 | 10134 | import os
import uuid
from osipkd.tools import row2dict, xls_reader
from datetime import datetime
from sqlalchemy import not_, func
from pyramid.view import (view_config,)
from pyramid.httpexceptions import ( HTTPFound, )
import colander
from deform import (Form, widget, ValidationFailure, )
from osipkd.models import D... | mit |
paolodedios/tensorflow | tensorflow/python/keras/optimizer_v2/optimizer_v2.py | 4 | 58900 | # Copyright 2018 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 |
orgito/ansible | lib/ansible/modules/network/aci/aci_interface_policy_port_security.py | 12 | 6440 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 |
gberl001/PCV | PCV/geometry/homography.py | 12 | 4621 | from numpy import *
from scipy import ndimage
class RansacModel(object):
""" Class for testing homography fit with ransac.py from
http://www.scipy.org/Cookbook/RANSAC"""
def __init__(self,debug=False):
self.debug = debug
def fit(self, data):
""" Fit homography to ... | bsd-2-clause |
40223232/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/colordict.py | 621 | 24077 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
Nichol4s/PyHead | tests/unreader.py | 1 | 1888 |
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# Classes that can undo reading data from
# a given type of data source.
class Unreader(object):
def __init__(self):
self.buf = StringIO()
def chunk(self):
raise NotImplementedError()... | mit |
nanolearningllc/edx-platform-cypress | common/djangoapps/lang_pref/api.py | 116 | 1465 | # -*- coding: utf-8 -*-
""" Python API for language and translation management. """
from collections import namedtuple
from django.conf import settings
from dark_lang.models import DarkLangConfig
# Named tuples can be referenced using object-like variable
# deferencing, making the use of tuples more readable by
# e... | agpl-3.0 |
hzxuzhonghu/kubernetes | cluster/juju/layers/kubernetes-master/lib/charms/kubernetes/common.py | 359 | 2002 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
UTAlan/ginniBeam.net | gin/paste/lint.py | 14 | 14999 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... | gpl-2.0 |
sonaht/ansible | lib/ansible/modules/network/avi/avi_serviceenginegroup.py | 19 | 26084 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
jzitelli/poolvr.py | poolvr/billboards.py | 1 | 4370 | import pkgutil
import os.path
from ctypes import c_void_p
import numpy as np
import OpenGL.GL as gl
import OpenGL.error
from .gl_rendering import Node, Technique, Material, Program, DTYPE_COMPONENT_TYPE, Texture
from .gl_primitives import PlanePrimitive
NULL_PTR = c_void_p(0)
# TODO: pkgutils way
TEXTURES_DIR = o... | mit |
lanen/youtube-dl | youtube_dl/extractor/mailru.py | 65 | 3216 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MailRuIE(InfoExtractor):
IE_NAME = 'mailru'
IE_DESC = 'Видео@Mail.Ru'
_VALID_URL = r'http://(?:www\.)?my\.mail\.ru/(?:video/.*#video=/?(?P<idv1>(?:[^/]+/){3}\d+)|(?:(?P<idv2prefix>(?:[^/]+/){2})vi... | unlicense |
kybriainfotech/iSocioCRM | addons/google_drive/google_drive.py | 98 | 14693 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | agpl-3.0 |
akumar21NCSU/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | 2323 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.0/Lib/httplib.py | 4 | 27306 | """HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection go through a number of "states", which defines when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection()
... | mit |
bcorbet/SickRage | tests/scene_helpers_tests.py | 5 | 6515 | import unittest
import test_lib as test
import sys, os.path
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
from sickbeard import show_name_helpers, scene_exceptions, common, name_cache
import sickbeard
from sickbeard import db
from sickbeard.databases import cache_db
from sickbear... | gpl-3.0 |
geekboxzone/lollipop_prebuilts_gcc_linux-x86_mips_mips64el-linux-android-4.9 | share/gdb/python/gdb/__init__.py | 83 | 3452 | # Copyright (C) 2010-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
tgerla/ansible | lib/ansible/parsing/yaml/dumper.py | 61 | 1322 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
JioCloud/glance | glance/api/middleware/cache.py | 1 | 12967 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
zseder/hunmisc | hunmisc/corpustools/20ng_to_conll.py | 1 | 4033 | """
Copyright 2011-13 Attila Zseder
Email: zseder@gmail.com
This file is part of hunmisc project
url: https://github.com/zseder/hunmisc
hunmisc 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
versi... | gpl-3.0 |
timothsp/where2ate | venv/lib/python3.3/site-packages/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | cc0-1.0 |
OneDrive/onedrive-sdk-python | src/python2/request/item_copy.py | 1 | 3729 | # -*- coding: utf-8 -*-
'''
# Copyright (c) 2015 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | mit |
qbuat/rootpy | rootpy/extern/progressbar/compat.py | 13 | 1476 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; ei... | gpl-3.0 |
fotinakis/sentry | src/sentry/south_migrations/0249_auto__add_index_eventtag_project_id_key_id_value_id.py | 7 | 51345 | # -*- 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
from sentry.utils.db import is_postgres
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'EventTag', fields ['pr... | bsd-3-clause |
bottompawn/kbengine | kbe/src/lib/python/Tools/scripts/ifdef.py | 64 | 3720 | #! /usr/bin/env python3
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
# ifdef [-Dname] ... [-Uname] ... [file] ...
#
# This scans the file(s), looking for #ifdef and #ifndef preprocessor
# commands that test for one of the names mentioned in the -D and -U
# options. On standard output it writes a cop... | lgpl-3.0 |
CenterForOpenScience/osf.io | osf/management/commands/add_egap_registration_schema.py | 6 | 1123 | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from osf.models import RegistrationSchema
from website.project.metadata.schemas import ensure_schema_structure, from_json
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""Add egap-registration schema to... | apache-2.0 |
dariemp/odoo | addons/hr_timesheet/wizard/__init__.py | 381 | 1079 | # -*- 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 |
savioabuga/lipame | config/settings/base.py | 1 | 10781 | """
Django settings for lipame project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (lipame/config/sett... | mit |
thehackercat/aha-memo | serverApp/common/aha.py | 1 | 13263 | # -*- coding:utf-8 -*-
__author__ = 'LexusLee'
import time
import json
import tornado
import tornado.gen
from tornado.web import HTTPError
from tornado.escape import json_decode
from foundation.log import logger
from foundation import const
from serverAppConfig import DEVICE_TYPE
from serverAppConfig import TOKEN_... | gpl-3.0 |
julianschweizer/kernel_23.0.1.A.0.xxx | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/340_test_types.py | 78 | 43209 | # Python test set -- part 6, built-in types
from test.support import run_unittest, run_with_locale
import collections
import pickle
import locale
import sys
import types
import unittest
class TypesTests(unittest.TestCase):
def test_truth_values(self):
if None: self.fail('None is true instead of false')
... | gpl-3.0 |
thaumos/ansible | lib/ansible/plugins/netconf/ce.py | 10 | 7483 | #
# (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 d... | gpl-3.0 |
integricho/heroku-buildpack-python-ffmpeg2-lame | vendor/pip-1.2.1/contrib/get-pip.py | 17 | 85929 | #! /usr/bin/env python
sources = """
eNrsvVt7HEmWGDaSba1VuqyllSX704NzwMFmJlmVbHIusjBTzeGQ4DQ17CZFkD2aBTA1iaoEkIuq
ykJmFsDq2fbn3+AnP/hX+E/5we/+7DefS9wjMqtAcnalT5r9tonKjDwRceLEiXNOnMv/+ve/v/5B
8v6frMpVNq+meVtWy+b67737d3/2gx/s7e29ko+i28uiLqLbIppX1VV0XtXRtFqelxfNMCqXTZvP
51HTrs/Ph1HRTuHLwaBcrKq6jZpNI/+smsF5XS0i7Owsn17d5vV... | mit |
chrys87/orca-beep | src/orca/scripts/web/tutorial_generator.py | 3 | 1699 | # Orca
#
# Copyright 2014 Orca Team.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is dist... | lgpl-2.1 |
nuagenetworks/vspk-python | vspk/v6/fetchers/nuipv6filterprofiles_fetcher.py | 2 | 2170 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
changev/RackHD | test/tests/rackhd20/test_rackhd20_api_tags.py | 13 | 2375 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Local methods
MON_NODES = fit_common.node_select()
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, ... | apache-2.0 |
willmitchell/django-guardian | guardian/migrations/0002_auto__add_field_groupobjectpermission_object_pk__add_field_userobjectp.py | 85 | 5650 | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
from guardian.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GroupObjectPermission.object_pk'
db.add_column('guardian_groupobjectpermission', 'object_pk', se... | bsd-2-clause |
markllama/openshift-ansible | roles/openshift_health_checker/test/curator_test.py | 55 | 1497 | import pytest
from openshift_checks.logging.curator import Curator, OpenShiftCheckException
plain_curator_pod = {
"metadata": {
"labels": {"component": "curator", "deploymentconfig": "logging-curator"},
"name": "logging-curator-1",
},
"status": {
"containerStatuses": [{"ready": Tr... | apache-2.0 |
leighpauls/k2cro4 | third_party/pymox/src/mox_test.py | 1 | 76281 | #!/usr/bin/python2.4
#
# Unit tests for Mox.
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | bsd-3-clause |
vaginessa/Googy-Max3-Kernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
alonisser/Open-Knesset | agendas/migrations/0014_auto__add_field_agenda_category_id__add_field_agenda_number_knesset.py | 10 | 32074 | # -*- 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 'Agenda.category_id'
db.add_column(u'agendas_agenda', 'cat... | bsd-3-clause |
rcgee/oq-hazardlib | openquake/hazardlib/gsim/bradley_2013.py | 2 | 18198 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake 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 Licen... | agpl-3.0 |
code4bones/capstone | suite/fuzz.py | 32 | 3850 | #!/usr/bin/python
# Simple fuzzing tool by disassembling random code. By Nguyen Anh Quynh, 2014
# Syntax:
# ./suite/fuzz.py --> Fuzz all archs
# ./suite/fuzz.py x86 --> Fuzz all X86 (all 16bit, 32bit, 64bit)
# ./suite/fuzz.py x86-16 --> Fuzz X86-32 arch only
# ./suite/fuzz.py x86-32 --> Fuzz X86-32 a... | bsd-3-clause |
sfepy/sfepy | script/gen_term_table.py | 3 | 8129 | #!/usr/bin/env python
"""
Generate the table of all terms for the sphinx documentation.
"""
from __future__ import absolute_import
import os
from sfepy.base.base import dict_from_keys_init
from sfepy.discrete.equations import parse_definition
from sfepy.base.conf import ProblemConf, get_standard_keywords
from sfepy.bas... | bsd-3-clause |
stratton-oakcoin/oakcoin | test/functional/wallet-accounts.py | 1 | 5091 | #!/usr/bin/env python3
# Copyright (c) 2016 The Oakcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test account RPCs.
RPCs tested are:
- getaccountaddress
- getaddressesbyaccount
- listaddressgr... | mit |
larrybradley/photutils | photutils/isophote/tests/test_isophote.py | 2 | 9888 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the isophote module.
"""
from astropy.io import fits
import numpy as np
from numpy.testing import assert_allclose
import pytest
from .make_test_data import make_test_image
from ..ellipse import Ellipse
from ..fitter import EllipseFitter
fro... | bsd-3-clause |
uclouvain/osis | education_group/tests/api/serializers/test_group.py | 1 | 3566 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/pandas/tests/test_common.py | 9 | 44081 | # -*- coding: utf-8 -*-
import collections
from datetime import datetime
import re
import nose
from nose.tools import assert_equal, assert_true
import numpy as np
import pandas as pd
from pandas.tslib import iNaT, NaT
from pandas import Series, DataFrame, date_range, DatetimeIndex, Timestamp, Float64Index
from pandas ... | gpl-2.0 |
vedujoshi/os_tempest | tempest/api/compute/v3/admin/test_hypervisor_negative.py | 4 | 4759 | # Copyright 2013 Huawei Technologies Co.,LTD.
# 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
#
# Unl... | apache-2.0 |
SeaFalcon/Musicool_Pr | lib/werkzeug/debug/console.py | 74 | 5465 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.local... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.