repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
welex91/ansible-modules-core | cloud/amazon/s3.py | 11 | 26913 | #!/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 |
brian-yang/mozillians | vendor-local/lib/python/celery/worker/mediator.py | 12 | 2613 | # -*- coding: utf-8 -*-
"""
celery.worker.mediator
~~~~~~~~~~~~~~~~~~~~~~
The mediator is an internal thread that moves tasks
from an internal :class:`Queue` to the worker pool.
This is only used if rate limits are enabled, as it moves
messages from the rate limited queue (which holds tasks
... | bsd-3-clause |
berkmancenter/spectacle | node_modules/bbb/node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/deflate.py | 177 | 2329 | import os
from colorama import Fore
from helpers import deflate, inflate, run_cmd
outDirDefault = 'test-outs'
testDirDefault = 'test-files'
"""
Run a single test
@param tFile- required; the full path to the file to run
@param level- optional (default: all); the compression level [1-9]
@param delete- optional (defaul... | gpl-2.0 |
cmbclh/vnpy1.7 | archive/vn.strategy/strategydemo/demoEngine.py | 46 | 6897 | # encoding: UTF-8
"""
该文件中包含的是交易平台的中间层,
将API和事件引擎包装到一个主引擎类中,便于管理。
当客户想采用服务器-客户机模式,实现交易功能放在托管机房,
而图形控制功能在本地电脑时,该主引擎负责实现远程通讯。
"""
import sys
from datetime import date
from time import sleep
import shelve
from PyQt4 import QtCore
from demoApi import *
from eventEngine import EventEngine
############################... | mit |
tntnatbry/tensorflow | tensorflow/python/kernel_tests/save_restore_ops_test.py | 77 | 1477 | # 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 |
Karaage-Cluster/karaage-debian | karaage/legacy/people/south_migrations/0004_auto__add_field_person_is_systemuser.py | 3 | 7580 | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Person.is_systemuser'
db.add_column('person', 'is_systemuser', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep... | gpl-3.0 |
azumimuo/family-xbmc-addon | plugin.video.exodus/resources/lib/sources/tinydl.py | 8 | 5845 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
130265/Galaxy-S4-Value-Edition-I9515L-Kernel | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_3/django/contrib/admin/views/decorators.py | 151 | 1381 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.translation import ugettext as _
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.views import login
from django.contrib.auth import RE... | mit |
pcabido/socorro | socorro/processor/mozilla_transform_rules.py | 9 | 36051 | # 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 datetime
import time
import ujson
import re
from sys import maxint
from gzip import open as gzip_open
from ujso... | mpl-2.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/test/test_reprlib.py | 56 | 12336 | """
Test cases for the repr module
Nick Mathewson
"""
import sys
import os
import shutil
import unittest
from test.support import run_unittest
from reprlib import repr as r # Don't shadow builtin repr
from reprlib import Repr
from reprlib import recursive_repr
def nestedTuple(nesting):
t = ()
for i in r... | apache-2.0 |
EDUlib/edx-platform | lms/djangoapps/discussion/rest_api/tests/test_forms.py | 5 | 7043 | """
Tests for Discussion API forms
"""
import itertools
from unittest import TestCase
import ddt
from django.http import QueryDict
from opaque_keys.edx.locator import CourseLocator
from six.moves.urllib.parse import urlencode
from lms.djangoapps.discussion.rest_api.forms import CommentListGetForm, ThreadListGetForm... | agpl-3.0 |
alsrgv/tensorflow | tensorflow/contrib/recurrent/python/recurrent_api.py | 39 | 1204 | # 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 |
dmlc/mxnet | ci/docker/qemu/vmcontrol.py | 6 | 12402 | #!/usr/bin/env python3
# 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
# "... | apache-2.0 |
mlperf/inference_results_v0.7 | closed/Cisco/code/bert/tensorrt/int8_builder_var_seqlen.py | 18 | 10254 | # Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... | apache-2.0 |
iDTLabssl/hr | hr_unported/hr_public_holidays/__openerp__.py | 1 | 1365 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation... | agpl-3.0 |
minhphung171093/GreenERP_V9 | openerp/addons/payment_buckaroo/controllers/main.py | 10 | 1210 | # -*- coding: utf-8 -*-
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 = '/payment/buckaroo/return'
_cancel_url = '/payment/buckaroo/... | gpl-3.0 |
DepthDeluxe/ansible | lib/ansible/plugins/action/ce_config.py | 89 | 4192 | #
# Copyright 2015 Peter Sprygada <psprygada@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, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/pip/commands/freeze.py | 342 | 2835 | from __future__ import absolute_import
import sys
import pip
from pip.compat import stdlib_pkgs
from pip.basecommand import Command
from pip.operations.freeze import freeze
from pip.wheel import WheelCache
DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
class FreezeCommand(Command):
"""
Output ins... | gpl-3.0 |
coberger/DIRAC | Interfaces/scripts/dirac-admin-sync-users-from-file.py | 10 | 1861 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-admin-sync-users-from-file
# Author : Adrian Casajus
########################################################################
"""
Sync users in Configuration with the cfg contents.
"""
__RCSID... | gpl-3.0 |
WSDC-NITWarangal/django | tests/view_tests/tests/py3_test_debug.py | 335 | 1849 | """
Since this file contains Python 3 specific syntax, it's named without a test_
prefix so the test runner won't try to import it. Instead, the test class is
imported in test_debug.py, but only on Python 3.
This filename is also in setup.cfg flake8 exclude since the Python 2 syntax
error (raise ... from ...) can't be... | bsd-3-clause |
Gitden/pdf-plugin | scripts/glyphdump.py | 126 | 1435 | #!/usr/bin/python
import sys
agl = []
agltab = []
aglmap = {}
print "/*"
f = open("glyphlist.txt", "r")
for line in f.readlines():
if line[0] == '#':
print line.strip()
continue
line = line[:-1]
name, list = line.split(';')
list = map(lambda x: int(x, 16), list.split(' '))
agl.append((name, list))
for nam... | agpl-3.0 |
adamhooper/quebec-municipal-elections-2013 | data/gen-csvs/make_montreal_txt.py | 1 | 5005 | #!/usr/bin/env python3
import csv
import os.path
import json
from xml.etree import ElementTree
XML_FILE = os.path.join(os.path.dirname(__file__), '..', 'raw', 'media.xml')
OUT_FILE = os.path.join(os.path.dirname(__file__), 'montreal-data.txt')
# Returns a dict with { id, name, party, nVotes }
def parseCandidateNode(... | unlicense |
rajsadho/django | tests/utils_tests/test_timezone.py | 149 | 7857 | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
requires_pytz = unittest.skipIf(pytz is None, "this test requires pytz")
if pytz is not None:
CET = pytz.timezone("Europe... | bsd-3-clause |
paulrouget/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/pastebin.py | 34 | 3631 | """ submit failure or test session information to a pastebin service. """
from __future__ import absolute_import, division, print_function
import pytest
import six
import sys
import tempfile
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting")
group._addoption(
"--pastebin",
... | mpl-2.0 |
netscaler/neutron | neutron/extensions/l3.py | 7 | 9764 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apac... | apache-2.0 |
sergiopasra/numina | numina/tests/plugins.py | 3 | 4762 | #
# Copyright 2014-2019 Universidad Complutense de Madrid
#
# This file is part of Numina
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
from __future__ import print_function
import os
import tarfile
import warnings
import sys
import pytest
if "pytest_benchmark" in sys.modules:
HAS_BENC... | gpl-3.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/encodings/iso8859_11.py | 93 | 12898 | """ Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self... | mit |
srivassumit/servo | tests/wpt/css-tests/tools/pytest/doc/en/example/multipython.py | 171 | 1735 | """
module containing a parametrized tests testing cross-python
serialization via the pickle module.
"""
import py
import pytest
import _pytest._code
pythonlist = ['python2.6', 'python2.7', 'python3.3']
@pytest.fixture(params=pythonlist)
def python1(request, tmpdir):
picklefile = tmpdir.join("data.pickle")
ret... | mpl-2.0 |
40223222/40223222 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/expatreader.py | 870 | 14659 | """
SAX driver for the pyexpat C module. This driver works with
pyexpat.__version__ == '2.22'.
"""
version = "0.20"
from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_... | gpl-3.0 |
RNAer/qiita | qiita_pet/handlers/study_handlers/listing_handlers.py | 1 | 11653 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
maxwell-demon/grpc | src/python/grpcio/tests/unit/framework/interfaces/face/_future_invocation_asynchronous_event_service.py | 2 | 18353 | # Copyright 2015, 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 f... | bsd-3-clause |
storborg/livetest | ez_setup.py | 358 | 9716 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | mit |
javier3407/Plugin.Video.ElJavi.tv | resources/lib/chardet/sjisprober.py | 1182 | 3734 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
minhlongdo/scipy | scipy/ndimage/tests/test_regression.py | 123 | 1429 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal, run_module_suite
import scipy.ndimage as ndimage
def test_byte_order_median():
"""Regression test for #413: median_filter does not handle bytes orders."""
a = np.arange(9,... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/network/check_point/cp_mgmt_administrator_facts.py | 20 | 3990 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
javiermarcon/gui2py | gui/controls/button.py | 14 | 3397 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py's Button control (uses wx.Button and wx.BitmapButton)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart" # where applicable
# Initial implementation was based on PythonCard's Button component,
# but... | lgpl-3.0 |
gqwest-erp/server | openerp/addons/base/ir/ir_fields.py | 13 | 18163 | # -*- coding: utf-8 -*-
import datetime
import functools
import operator
import itertools
import time
import psycopg2
import pytz
from openerp.osv import orm
from openerp.tools.translate import _
from openerp.tools.misc import DEFAULT_SERVER_DATE_FORMAT,\
DEFAULT_SERVER_DATETIME_FORMAT
... | agpl-3.0 |
jblomer/ramcloud | scripts/cluster.py | 1 | 35327 | #!/usr/bin/env python
# Copyright (c) 2010-2016 Stanford University
#
# Permission to use, copy, modify, and distribute this software 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 "AS IS"... | isc |
andcor02/mbed-os | targets/TARGET_NORDIC/TARGET_NRF5/porting_tools/sdk_update.py | 40 | 10384 | #!python3
import os, shutil, json, pprint, sys, string, json, argparse
from collections import OrderedDict
from shutil import copyfile, copytree
def rename_sdk_old_dirs(path, dry_run = False):
# I make assumption that all old sdk dirs have "sdk" names.
sdk_dir_name = "sdk"
path = "."
for root, dir... | apache-2.0 |
alzeih/ava | ava_core/abstract/decorators.py | 5 | 2393 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.decorators import available_attrs
from django.utils.six.moves.urllib.parse import urlparse
from django.shortcuts import resolve_url
def access_check(test_func, view_func=None, login_url=N... | gpl-3.0 |
crepererum/invenio | invenio/utils/pagination.py | 18 | 1931 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio 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... | gpl-2.0 |
job/exscript | src/Exscript/protocols/drivers/ace.py | 4 | 1940 | # Copyright (C) 2007-2010 Samuel Abels.
#
# 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 WARRANT... | gpl-2.0 |
keithroe/vtkoptix | ThirdParty/Twisted/twisted/internet/test/_win32ifaces.py | 41 | 3844 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Windows implementation of local network interface enumeration.
"""
from socket import socket, AF_INET6, SOCK_STREAM
from ctypes import (
WinDLL, byref, create_string_buffer, c_int, c_void_p,
POINTER, Structure, cast, string_at)
WS2_3... | bsd-3-clause |
Shanec132006/Lab4 | lib/werkzeug/testsuite/wsgi.py | 99 | 14961 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.wsgi
~~~~~~~~~~~~~~~~~~~~~~~
Tests the WSGI utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from os import path
from contextlib import closing
from werkzeug.testsuite import Werkzeug... | apache-2.0 |
aldian/tensorflow | tensorflow/contrib/gan/python/features/python/random_tensor_pool_test.py | 20 | 4462 | # 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 |
nnakamot/ncclient | ncclient/operations/third_party/h3c/rpc.py | 10 | 2286 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# by yangxufeng.zhao
from ncclient.xml_ import *
from ncclient.operations import util
from ncclient.operations.rpc import RPC
class GetBulk(RPC):
"The *get-bulk* RPC."
def request(self, filter=None):
"""Retrieve running configuration and device state in... | apache-2.0 |
AICP/external_chromium_org | tools/deep_memory_profiler/lib/bucket.py | 59 | 5674 | # 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.
import logging
import os
from lib.symbol import FUNCTION_SYMBOLS, SOURCEFILE_SYMBOLS, TYPEINFO_SYMBOLS
LOGGER = logging.getLogger('dmprof')
# Indexes in ... | bsd-3-clause |
D4wN/brickv | src/build_data/windows/OpenGL/GL/NV/register_combiners.py | 4 | 3899 | '''OpenGL extension NV.register_combiners
This module customises the behaviour of the
OpenGL.raw.GL.NV.register_combiners to provide a more
Python-friendly API
Overview (from the spec)
NVIDIA's next-generation graphics processor and its derivative
designs support an extremely configurable mechanism know as "reg... | gpl-2.0 |
leonardr/botfriend | bots.sample/junkmail/__init__.py | 1 | 1402 | import json
import random
import requests
from olipy.ia import Text
from botfriend.bot import BasicBot
from botfriend.model import Post
class JunkMailBot(BasicBot):
COLLECTION = "tednelsonjunkmail"
def update_state(self):
cutoff = self.model.last_state_update_time
old_state = self.model.json... | mit |
jindongh/boto | tests/unit/s3/test_website.py | 114 | 9219 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
mushyshah/ELEC490G11 | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | gpl-2.0 |
timchenxiaoyu/Diamond | src/collectors/rabbitmq/test/testrabbitmq.py | 15 | 5563 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from rabbitmq import Rabbi... | mit |
xujun10110/AIL-framework | bin/Categ.py | 2 | 3272 | #!/usr/bin/env python2
# -*-coding:UTF-8 -*
"""
The ZMQ_PubSub_Categ Module
============================
This module is consuming the Redis-list created by the ZMQ_PubSub_Tokenize_Q
Module.
Each words files created under /files/ are representing categories.
This modules take these files and compare them to
the stream... | agpl-3.0 |
andiwand/tmobile-scripts | pool.py | 1 | 1566 | import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def parse_resource(s):
s = s.strip();
end = s.rfind(" ")
limit = None
if end > 0:
limit = s[end+1:]
s = s[:end]
limit = limit.replace(".", "")
if s.find(",") > 0:
limit = limit.replace(",", ".")
limit = float(lim... | gpl-3.0 |
ros-infrastructure/ros_buildfarm | scripts/misc/generate_check_agents_job.py | 1 | 1849 | #!/usr/bin/env python3
# Copyright 2015-2016 Open Source Robotics Foundation, 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
#
# Unle... | apache-2.0 |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/reprlib.py | 923 | 5110 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... | lgpl-3.0 |
bmbouter/python-bugzilla | tests/createbug.py | 5 | 2897 | #
# Copyright Red Hat, Inc. 2013
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
#
'''
Unit tests for building createbug dictionaries with bin/bugzilla
'''
import unittest
from bugzilla.bugzilla4 import Bugzilla4
import tests
bz4 = B... | gpl-2.0 |
brainstorm/bcbio-nextgen | bcbio/install.py | 1 | 32947 | """Handle installation and updates of bcbio-nextgen, third party software and data.
Enables automated installation tool and in-place updates to install additional
data and software.
"""
from __future__ import print_function
import argparse
import collections
import contextlib
import datetime
import dateutil
from distu... | mit |
plumgrid/plumgrid-nova | nova/openstack/common/db/exception.py | 17 | 1634 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
angad/libjingle-mac | scons-2.2.0/build/lib/SCons/Variables/EnumVariable.py | 14 | 3872 | """engine.SCons.Variables.EnumVariable
This file defines the option type for SCons allowing only specified
input-values.
Usage example:
opts = Variables()
opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
allowed_values=('yes', 'no', 'full'),
map={}, ign... | bsd-3-clause |
Carreau/readthedocs.org | readthedocs/projects/migrations/0039_add_mirror.py | 12 | 12667 | # -*- 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 field 'Project.mirror'
db.add_column('projects_project', 'mirror',
self.gf('d... | mit |
davipeterlini/routeflow_tcc_ha | pox/pox/lib/util.py | 21 | 12304 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... | apache-2.0 |
olemis/brython | www/src/Lib/bisect.py | 1261 | 2595 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | bsd-3-clause |
takluyver/readthedocs.org | readthedocs/rtd_tests/tests/test_project.py | 9 | 1911 | from bamboo_boy.utils import with_canopy
import json
from django.test import TestCase
from projects.models import Project
from rtd_tests.factories.projects_factories import OneProjectWithTranslationsOneWithout,\
ProjectFactory
from rest_framework.reverse import reverse
from restapi.serializers import ProjectSeriali... | mit |
kaedroho/wagtail | wagtail/admin/views/pages/create.py | 2 | 11989 | from urllib.parse import urlencode
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateRespon... | bsd-3-clause |
maleficarium/youtube-dl | youtube_dl/extractor/npo.py | 19 | 18401 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
parse_duration,
qualities,
strip_jsonp,
unified_strdate,
)
class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_webpage... | unlicense |
etataurov/pytest | _pytest/helpconfig.py | 16 | 5289 | """ version info, help messages, tracing configuration. """
import py
import pytest
import os, sys
def pytest_addoption(parser):
group = parser.getgroup('debugconfig')
group.addoption('--version', action="store_true",
help="display pytest lib version and import information.")
group._addoption(... | mit |
sandeepkrjha/pgmpy | pgmpy/tests/test_estimators/test_BicScore.py | 6 | 1432 | import unittest
import pandas as pd
from pgmpy.models import BayesianModel
from pgmpy.estimators import BicScore
class TestBicScore(unittest.TestCase):
def setUp(self):
self.d1 = pd.DataFrame(data={'A': [0, 0, 1], 'B': [0, 1, 0], 'C': [1, 1, 0], 'D': ['X', 'Y', 'Z']})
self.m1 = BayesianModel([('... | mit |
toprahmin/NDMobileApp | node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | 1283 | 65086 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... | mit |
2014c2g4/2015cda_g7 | static/Brython3.1.1-20150328-091302/Lib/_sysconfigdata.py | 731 | 18167 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | gpl-3.0 |
rvraghav93/scikit-learn | examples/svm/plot_svm_nonlinear.py | 62 | 1119 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... | bsd-3-clause |
klmitch/neutron | neutron/tests/unit/objects/qos/test_policy.py | 3 | 15568 | # 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 |
jrha/aquilon | lib/python2.6/aquilon/worker/templates/base.py | 2 | 19094 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
meisterkleister/erpnext | erpnext/hr/report/monthly_salary_register/monthly_salary_register.py | 52 | 4104 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr
from frappe import msgprint, _
def execute(filters=None):
if not filters: filters = {}
salary_slip... | agpl-3.0 |
keinstein/mopidy-tunein | tests/test_playlists.py | 1 | 1780 | from __future__ import unicode_literals
import io
import unittest
from mopidy_tunein import tunein
ASX = b"""<ASX version="3.0">
<TITLE>Example</TITLE>
<ENTRY>
<TITLE>Sample Title</TITLE>
<REF href="file:///tmp/foo" />
</ENTRY>
<ENTRY>
<TITLE>Example title</TITLE>
<REF href="file:///tmp/bar" ... | apache-2.0 |
gsmcmullin/libsbp | python/sbp/client/drivers/base_driver.py | 9 | 1367 | # Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
#... | lgpl-3.0 |
andreparames/odoo | addons/auth_openid/__init__.py | 443 | 1090 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 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 |
ndardenne/pymatgen | pymatgen/analysis/pourbaix/maker.py | 2 | 12786 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import logging
import numpy as np
import itertools
from itertools import chain
from scipy.spatial import ConvexHull
from pymatgen.analysis.pourbaix.entry impor... | mit |
cgrebeld/pymel | pymel/util/enum.py | 1 | 16042 | # -*- coding: utf-8 -*-
# enum.py
# Part of enum, a package providing enumerated types for Python.
#
# Copyright © 2007 Ben Finney
# This is free software; you may copy, modify and/or distribute this work
# under the terms of the GNU General Public License, version 2 or later
# or, at your option, the terms of the Pyt... | bsd-3-clause |
fhaoquan/kbengine | kbe/src/lib/python/Lib/encodings/ptcp154.py | 219 | 14015 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,err... | lgpl-3.0 |
frodopwns/Flask-User-starter-app | app/core/models.py | 5 | 2664 | # Copyright 2014 SolidBuilds.com. All rights reserved
#
# Authors: Ling Thio <ling.thio@gmail.com>
from flask_user import UserMixin
from flask_user.forms import RegisterForm
from flask_wtf import Form
from wtforms import StringField, SubmitField, validators
from app import db
# Define the User data model. Make sure ... | bsd-2-clause |
hamish2014/FreeCAD_drawing_dimensioning | drawingDimensioning/textAdd.py | 1 | 3008 | # This Python file uses the following encoding: utf-8
from drawingDimensioning.py3_helpers import unicode, encode_if_py2
from drawingDimensioning.command import *
d = DimensioningCommand()
def textSVG( x, y, text='text', rotation=0.0, textRenderer_addText= defaultTextRenderer):
return '<g> %s </g>' % textRenderer... | lgpl-2.1 |
AlexStarov/Shop | applications/delivery/management/commands/processing_delivery_send_general.py | 1 | 15632 | # -*- coding: utf-8 -*-
__author__ = 'AlexStarov'
from django.core.management.base import BaseCommand
class Command(BaseCommand, ):
from optparse import make_option
option_list = BaseCommand.option_list + (
make_option('--id', '--pk', '--delivery_id', '--delivery_pk',
action='stor... | apache-2.0 |
kybriainfotech/iSocioCRM | addons/product_extended/__init__.py | 374 | 1068 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_urllibnet.py | 75 | 8933 | import unittest
from test import support
import contextlib
import socket
import urllib.request
import sys
import os
import email.message
import time
support.requires('network')
class URLTimeoutTest(unittest.TestCase):
# XXX this test doesn't seem to test anything useful.
TIMEOUT = 30.0
def setUp(self)... | lgpl-3.0 |
szezso/T.E.S.C.O-kernel_vivo | 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 |
petosegan/scikit-learn | sklearn/datasets/olivetti_faces.py | 198 | 4688 | """Modified Olivetti faces dataset.
The original database was available from (now defunct)
http://www.uk.research.att.com/facedatabase.html
The version retrieved here comes in MATLAB format from the personal
web page of Sam Roweis:
http://www.cs.nyu.edu/~roweis/
There are ten different images of each of 40... | bsd-3-clause |
harshilasu/LinkurApp | y/google-cloud-sdk/lib/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
vishwa91/ewaste_printer | tools/arm/arm-none-eabi/share/gdb/python/gdb/prompt.py | 137 | 4210 | # Extended prompt utilities.
# Copyright (C) 2011-2013 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 ... | mit |
edx/xqueue-watcher | xqueue_watcher/jailedgrader.py | 1 | 11710 | """
An implementation of a grader that uses codejail to sandbox submission execution.
"""
import codecs
import os
import sys
import imp
import json
import random
import gettext
from path import Path
import six
import codejail
from grader_support.gradelib import EndTest
from grader_support.graderutil import LANGUAGE
i... | agpl-3.0 |
df-5/skybot | plugins/util/timesince.py | 33 | 4117 | # Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notic... | unlicense |
barachka/odoo | addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py | 374 | 2830 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
dana-i2cat/felix | expedient/src/python/plugins/vt_plugin/controller/dispatchers/ProvisioningResponseDispatcher.py | 3 | 9357 | from django.http import *
from django.core.urlresolvers import reverse
import os
import sys
from vt_plugin.models import *
from vt_manager.communication.utils.XmlHelper import *
from vt_plugin.utils.ServiceThread import *
from vt_plugin.utils.Translator import *
from vt_plugin.controller.dispatchers.ProvisioningDispatc... | apache-2.0 |
victorzhao/miniblink49 | third_party/WebKit/Source/devtools/scripts/modular_build.py | 32 | 6644 | #!/usr/bin/env python
#
# 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.
"""
Utilities for the modular DevTools build.
"""
from os import path
import os
try:
import simplejson as json
except ImportErr... | gpl-3.0 |
ibotty/ansible | lib/ansible/executor/playbook_executor.py | 21 | 11974 | # (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 |
BorgERP/borg-erp-6of3 | addons/point_of_sale/wizard/__init__.py | 9 | 1354 | # -*- 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 |
lz1988/company-site | build/lib/django/db/models/loading.py | 104 | 10633 | "Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
fro... | bsd-3-clause |
yongwen/teletraan | deploy-board/deploy_board/webapp/helpers/agents_helper.py | 8 | 2479 | # Copyright 2016 Pinterest, 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... | apache-2.0 |
wareash/linux-xylon | scripts/gdb/linux/modules.py | 182 | 2953 | #
# gdb helper commands and functions for Linux kernel debugging
#
# module tools
#
# Copyright (c) Siemens AG, 2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import cpus, utils
module_type = utils.CachedType("str... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.