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
100star/h2o
py/testdir_release/sh2junit.py
31
16028
import sys, psutil, os, stat, tempfile, argparse, time, datetime sys.path.extend(['.','..','../..','py']) import h2o_sandbox # Stripped down, similar to h2o.py has for these functions # Possible to do this in bash, but the code becomes cryptic. # You can execute this as sh2junit.py <bash command string> # sh2junit ru...
apache-2.0
nicolaoun/NS3-AM-Proto-Simulation
src/lr-wpan/bindings/callbacks_list.py
42
2037
callback_classes = [ ['void', 'ns3::LrWpanPhyEnumeration', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::LrWpanPhyEnumeration', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', '...
gpl-2.0
soumyanishan/azure-linux-extensions
OSPatching/azure/storage/storageclient.py
51
5800
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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
yatinkumbhare/openstack-nova
nova/tests/functional/v3/api_paste_fixture.py
25
1543
# Copyright 2015 NEC 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 applicable l...
apache-2.0
rbprogrammer/advanced_python_topics
course-material/py2/solutions/07 XML Processing/Ex7.1.py
1
1036
#!/usr/local/bin/python2 # Ex7.1.py Python 2 version # Script to parse an XML file and enumerate tags import sys from xml.parsers import expat # Allow user to provide a filename, or default to books.xml filename = sys.argv[1] if sys.argv[1:] else 'books.xml' Tags = 0 tags = {} class ExpatError(Exception): pass...
apache-2.0
marcellfischbach/CobaltSKY
Scripts/Blender/valkyrie/geometry.py
1
1365
import valkyrie import struct class GeometryWriter: GT_GeometryMesh = 0 GT_GeometryCollection = 1 GT_GeometryLOD = 2 DM_Internal = 0 DM_Exteral = 1 def __init__(self): self.stream = [] self.material_map = {} def write(self, multi_mesh): self.stream += struct.pack('<I', GeometryWriter.GT_Geometry...
gpl-2.0
LIKAIMO/MissionPlanner
LogAnalyzer/tests/TestIMUMatch.py
61
3781
from LogAnalyzer import Test,TestResult import DataflashLog from math import sqrt class TestIMUMatch(Test): '''test for empty or near-empty logs''' def __init__(self): Test.__init__(self) self.name = "IMU Mismatch" def run(self, logdata, verbose): #tuning parameters: war...
gpl-3.0
lwahlmeier/python-threadly
threadly/Futures.py
2
4445
""" Futures tools for threadly """ import threading import time class ListenableFuture(object): """ This class i used to make a Future that can have listeners and callbacks added to it. Once setter(object) is called all listeners/callbacks are also called. Callbacks will be given the set object, an...
unlicense
ftrader-bitcoinabc/bitcoin-abc
test/functional/abc-finalize-block.py
1
13578
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the finalizeblock RPC calls.""" import time from test_framework.test_framework import BitcoinTestFramework...
mit
jcoady9/python-for-android
python-modules/twisted/twisted/words/protocols/jabber/jid.py
54
7167
# -*- test-case-name: twisted.words.test.test_jabberjid -*- # # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Jabber Identifier support. This module provides an object to represent Jabber Identifiers (JIDs) and parse string representations into them with proper checking for illeg...
apache-2.0
HyperBaton/ansible
lib/ansible/plugins/doc_fragments/nxos.py
44
5396
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: descriptio...
gpl-3.0
intervigilium/android_kernel_htc_msm8660
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
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/progress.py
4
11969
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
dxj19831029/keras
tests/manual/check_constraints.py
86
2841
from __future__ import absolute_import from __future__ import print_function import keras from keras.datasets import mnist import keras.models from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.regularizers import l2, l1 from keras.constraints import maxnorm, nonneg ...
mit
archesproject/arches
arches/app/models/migrations/0001_initial.py
1
36390
# -*- coding: utf-8 -*- import os import uuid import codecs import django.contrib.gis.db.models.fields from django.core import management from django.contrib.postgres.fields import JSONField from django.db import migrations, models from arches.db.migration_operations.extras import CreateExtension, CreateAutoPopulateU...
agpl-3.0
Dave667/service
plugin.video.cScVOD/resources/lib/jsunpack.py
2
6023
""" urlresolver XBMC Addon Copyright (C) 2013 Bstrdsmkr This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later v...
gpl-2.0
stuart-c/pgu
data/themes/default/generate.py
28
3502
import pygame from pygame.locals import * pygame.display.init() pygame.display.set_mode((80,80),32) def prep(name): fname = name+".png" img = pygame.image.load(fname) w,h = img.get_width()/2,img.get_height()/2 out = pygame.Surface((w*3,h*3),SWSURFACE|SRCALPHA,32) out.fill((0,0,0,0)) out.bl...
lgpl-2.1
eparis/contrib
hack/verify-flags-underscore.py
34
8924
#!/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
noelbk/neutron-juniper
neutron/agent/securitygroups_rpc.py
8
8254
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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://ww...
apache-2.0
linked67/p2pool-exclusivecoin
p2pool/bitcoin/height_tracker.py
227
4678
from twisted.internet import defer from twisted.python import log import p2pool from p2pool.bitcoin import data as bitcoin_data from p2pool.util import deferral, forest, jsonrpc, variable class HeaderWrapper(object): __slots__ = 'hash previous_hash'.split(' ') @classmethod def from_header(cls, header...
gpl-3.0
benschulz/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_stash.py
299
1231
import os import unittest import urllib2 import json import uuid import wptserve from wptserve.router import any_method from base import TestUsingServer, doc_root class TestResponseSetCookie(TestUsingServer): def test_put_take(self): @wptserve.handlers.handler def handler(request, response): ...
mpl-2.0
Juniper/neutron
neutron/common/test_lib.py
13
2136
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 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.ap...
apache-2.0
cmbiwer/pycbc
pycbc/distributions/power_law.py
6
9306
# Copyright (C) 2016 Christopher M. Biwer # 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 program is distribute...
gpl-3.0
iabdalkader/openmv
scripts/examples/16-Codes/find_barcodes.py
3
2316
# Barcode Example # # This example shows off how easy it is to detect bar codes using the # OpenMV Cam M7. Barcode detection does not work on the M4 Camera. import sensor, image, time, math sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) # High Res! sensor.set_windowing((640, 80...
mit
andreamerello/linux-stm32
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
ramsateesh/designate
designate/objects/blacklist.py
6
1438
# Copyright (c) 2014 Rackspace Hosting # 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 req...
apache-2.0
Distrotech/qemu
scripts/tracetool/transform.py
78
4238
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Type-transformation rules. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnocz...
gpl-2.0
miqui/python-hpOneView
hpOneView/security.py
2
5456
# -*- coding: utf-8 -*- """ security.py ~~~~~~~~~~~~ This module implements Settings HP OneView REST API """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
mit
duncanhawthorne/robot-robot
libs/future/backports/urllib/error.py
81
2715
"""Exception classes raised by urllib. The base exception class is URLError, which inherits from IOError. It doesn't define any behavior of its own, but is the base class for all exceptions defined in this package. HTTPError is an exception class that is also a valid HTTP response instance. It behaves this way beca...
mit
TiVoMaker/boto
boto/file/bucket.py
153
4085
# Copyright 2010 Google Inc. # Copyright (c) 2011, Nexenta Systems Inc. # # 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 use...
mit
nickromano/django-slow-tests
_examples/django18/mysite/settings.py
2
2798
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths...
mit
qgis/QGIS-Django
qgis-app/plugins/tests/HelloWorld/1.8-author-slashes-error/HelloWorld/HelloWorld.py
20
1094
# -*- coding: utf-8 -*- # Import the PyQt and QGIS libraries from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * class HelloWorld: def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface self.canvas = iface.mapCanvas() def initGui...
gpl-2.0
mxm/incubator-beam
sdks/python/apache_beam/runners/direct/direct_metrics_test.py
7
9689
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
ScoutAlarm/node-sodium-linux
node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
778
65880
#!/usr/bin/env python # 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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
mit
ppanczyk/ansible
lib/ansible/module_utils/avi.py
20
3790
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
hesam-setareh/nest-simulator
pynest/nest/tests/test_connect_pairwise_bernoulli.py
4
3399
# -*- coding: utf-8 -*- # # test_connect_pairwise_bernoulli.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
gpl-2.0
Liyier/learning_log
env/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
clubcapra/ngv_dev
CALIBRATION_0/camera_calibration/gui_cam_calibration.py
1
6603
from PySide.QtGui import * import timeit #import camera import cv2 import os import sys import numpy as np def generate_crop_indexes_3d(width, height, crop_width, crop_height): idxs = [] for row in xrange(0, height, crop_height): for col in xrange(0, width / crop_width): indexes = [] ...
gpl-3.0
jsxc/xmpp-cloud-auth
xclib/tests/30_isuser_stub_test.py
1
2149
# Checks whether the isuser() function works as it should # Stubs the cloud_request() functions for these tests from xclib.sigcloud import sigcloud from xclib import xcauth from xclib.check import assertEqual def setup_module(): global xc, sc xc = xcauth(domain_db={ b'xdomain': b'99999\thttps://rem...
mit
agdsn/sipa
sipa.py
2
1632
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ sipa.py ~~~~~~~~~~~~~~ This file shall be used to start the Flask app. Specific things are handled in the `sipa` package. """ import argparse import logging from sipa import create_app from sipa.utils import support_hotline_available logger = loggi...
mit
EliotBerriot/django
tests/postgres_tests/test_array.py
89
19906
import decimal import json import unittest import uuid from django import forms from django.core import exceptions, serializers, validators from django.core.management import call_command from django.db import IntegrityError, connection, models from django.test import TransactionTestCase, override_settings from django...
bsd-3-clause
MatthieuBizien/scikit-learn
sklearn/model_selection/__init__.py
53
1587
from ._split import BaseCrossValidator from ._split import KFold from ._split import LabelKFold from ._split import StratifiedKFold from ._split import LeaveOneLabelOut from ._split import LeaveOneOut from ._split import LeavePLabelOut from ._split import LeavePOut from ._split import ShuffleSplit from ._split import L...
bsd-3-clause
xNovax/SickRage
lib/unidecode/x023.py
174
4346
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]'...
gpl-3.0
Ichag/odoo
openerp/tools/amount_to_text.py
393
7719
# -*- 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...
agpl-3.0
jonathanslenders/pyvim
pyvim/welcome_message.py
1
1246
""" The welcome message. This is displayed when the editor opens without any files. """ from __future__ import unicode_literals from prompt_toolkit.formatted_text.utils import fragment_list_len import prompt_toolkit import pyvim import platform import sys version = sys.version_info pyvim_version = pyvim.__version__ _...
bsd-3-clause
channing/gyp
test/ninja/action_dependencies/gyptest-action-dependencies.py
246
1850
#!/usr/bin/env python # 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. """ Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ impo...
bsd-3-clause
kumar303/olympia
src/olympia/devhub/tests/test_forms.py
2
35137
# -*- coding: utf-8 -*- import os import shutil import tempfile from datetime import timedelta from django.conf import settings from django.core.files.storage import default_storage as storage from django.utils import translation import pytest import six from freezegun import freeze_time from unittest import mock fr...
bsd-3-clause
Intel-tensorflow/tensorflow
tensorflow/python/tools/saved_model_utils_test.py
6
5038
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
infobloxopen/neutron
neutron/tests/unit/api/test_extensions.py
11
33104
# Copyright (c) 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...
apache-2.0
ravibhure/ansible
lib/ansible/utils/module_docs_fragments/dellos9.py
75
2591
# # (c) 2015, Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2016 Dell 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 Licens...
gpl-3.0
adedayo/intellij-community
python/lib/Lib/site-packages/django/contrib/messages/storage/cookie.py
89
5873
from django.conf import settings from django.contrib.messages import constants from django.contrib.messages.storage.base import BaseStorage, Message from django.http import CompatCookie from django.utils import simplejson as json from django.utils.crypto import salted_hmac, constant_time_compare class MessageEncoder(...
apache-2.0
rahul67/hue
desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/connection.py
371
8967
import datetime import sys import socket from socket import timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection, HTTPException except ImportError: from httplib import HTTPConnection as _HTTPConnection, HTTPException cla...
apache-2.0
ansible/ansible
lib/ansible/module_utils/facts/hardware/hpux.py
159
8351
# 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 in the hope that ...
gpl-3.0
carlosdiazsuarez/movierecommender
MovieRecommender/connectors/imdb/imdb_connector.py
1
2413
''' Google Movie Showtimes parser class for Python. This script provides a Python class that can be used to parse Google Movie Showtimes (www.google.com/movies) pages into dictionary objects. @author Vaidik Kapoor @version 0.1 ''' import httplib, urllib, BeautifulSoup, re from copy import deepcopy from BeautifulSoup...
gpl-2.0
guewen/OpenUpgrade
addons/crm_project_issue/project_issue.py
380
2373
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
agpl-3.0
gingerswede/ITSecCardGame
src/View/Game.py
1
2031
''' IDE: Eclipse (PyDev) Python version: 2.7 Operating system: Windows 8.1 @author: Emil Carlsson @copyright: 2015 Emil Carlsson @license: This program is distributed under the terms of the GNU General Public License ''' from View import GlobalFunc from View.Board import Board class GameView(object): __root ...
gpl-3.0
jimarnold/gomatic
gomatic/go_cd_configurator.py
1
10148
#!/usr/bin/env python import json import time import xml.etree.ElementTree as ET import argparse import sys import subprocess import requests from decimal import Decimal from gomatic.gocd.pipelines import Pipeline, PipelineGroup from gomatic.gocd.agents import Agent from gomatic.xml_operations import Ensurance, Possi...
mit
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/test/test_base64.py
113
8195
import unittest from test import test_support import base64 class LegacyBase64TestCase(unittest.TestCase): def test_encodestring(self): eq = self.assertEqual eq(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") eq(base64.encodestring("a"), "YQ==\n") eq(base64.encod...
gpl-2.0
uzh/msregistry
app/main/views.py
1
1040
# Copyright (C) 2016 University of Zurich. All rights reserved. # # This file is part of MSRegistry Backend. # # MSRegistry Backend is free software: you can redistribute it and/or # modify it under the terms of the version 3 of the GNU Affero General # Public License as published by the Free Software Foundation, or a...
agpl-3.0
suyashphadtare/sajil-final-erp
erpnext/erpnext/projects/utils.py
37
1205
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe @frappe.whitelist() def get_time_log_list(doctype, txt, searchfield, start, page_le...
agpl-3.0
romain-li/edx-platform
lms/envs/test_static_optimized.py
26
2169
""" Settings used when generating static assets for use in tests. For example, Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running CMS and LMS Note: it isn't possible to have a single settings file, because Django doesn't support bo...
agpl-3.0
thaumos/ansible
lib/ansible/modules/cloud/azure/azure_rm_hdinsightcluster.py
12
20099
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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
edxzw/edx-platform
cms/djangoapps/contentstore/views/tests/test_programs.py
19
6364
"""Tests covering the Programs listing on the Studio home.""" import json from django.conf import settings from django.core.urlresolvers import reverse import httpretty import mock from oauth2_provider.tests.factories import ClientFactory from provider.constants import CONFIDENTIAL from openedx.core.djangoapps.progra...
agpl-3.0
2mny/mylar
lib/js2py/prototypes/jsarray.py
27
14886
import six if six.PY3: xrange = range import functools def to_arr(this): """Returns Python array from Js array""" return [this.get(str(e)) for e in xrange(len(this))] ARR_STACK = set({}) class ArrayPrototype: def toString(): # this function is wrong but I will leave it here fore debuggi...
gpl-3.0
JackWoot/E2E-Messenger
Server/passlib/apache.py
21
39058
"""passlib.apache - apache password support""" # XXX: relocate this to passlib.ext.apache? #============================================================================= # imports #============================================================================= from __future__ import with_statement # core from hashlib imp...
gpl-2.0
guorendong/iridium-browser-ubuntu
tools/json_schema_compiler/js_externs_generator.py
12
11188
# Copyright 2015 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. """ Generator that produces an externs file for the Closure Compiler. Note: This is a work in progress, and generated externs may require tweaking. See https...
bsd-3-clause
qk4l/Flexget
flexget/tests/test_input_sites.py
5
1359
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest @pytest.mark.online class TestInputSites(object): config = (""" templates: global: headers: User-Agent: "Moz...
mit
ChanChiChoi/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause
jmiserez/pox
pox/forwarding/l2_ofcommand_learning.py
2
5028
# Copyright 2011 Kyriakos Zarifis # Copyright 2008 (C) Nicira, Inc. # # 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) ...
gpl-3.0
iledarn/addons-yelizariev
mail_wall_widgets/models.py
16
12363
from openerp.osv import osv,fields as old_fields from openerp import api, models, fields, tools from openerp.tools.safe_eval import safe_eval try: from openerp.addons.email_template.email_template import mako_template_env except ImportError: try: from openerp.addons.mail.mail_template import mako_templa...
lgpl-3.0
tickbh/tdengine_cocos2dx_demo
tdengine_ddz/third_part/jsoncpp/test/pyjsontestrunner.py
257
2137
# Simple implementation of a json test runner to run the test against json-py. import sys import os.path import json import types if len(sys.argv) != 2: print "Usage: %s input-json-file", sys.argv[0] sys.exit(3) input_path = sys.argv[1] base_path = os.path.splitext(input_path)[0] actual_path = base_path ...
apache-2.0
rickhurst/Django-non-rel-blog
django/utils/unittest/suite.py
353
9293
"""TestSuite""" import sys import unittest from django.utils.unittest import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests...
bsd-3-clause
yuanagain/seniorthesis
venv/lib/python2.7/site-packages/pip/req/req_uninstall.py
510
6897
from __future__ import absolute_import import logging import os import tempfile from pip.compat import uses_pycache, WINDOWS, cache_from_source from pip.exceptions import UninstallationError from pip.utils import rmtree, ask, is_local, renames, normalize_path from pip.utils.logging import indent_log logger = loggin...
mit
Autonomi/limn
Printrun/pronsole.py
15
1106
#!/usr/bin/env python # This file is part of the Printrun suite. # # Printrun 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. # # Prin...
mit
rvalyi/OpenUpgrade
addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py
40
9518
# -*- 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
mozillazg/redis-py-doc
tests/conftest.py
2
6783
import pytest import random import redis from distutils.version import StrictVersion from redis.connection import parse_url from unittest.mock import Mock from urllib.parse import urlparse # redis 6 release candidates report a version number of 5.9.x. Use this # constant for skip_if decorators as a placeholder until ...
mit
fhartwig/adhocracy3.mercator
src/adhocracy_mercator/adhocracy_mercator/catalog/adhocracy.py
2
3435
""" Adhocracy catalog extensions.""" from substanced.catalog import Keyword from adhocracy_core.catalog.adhocracy import AdhocracyCatalogIndexes from adhocracy_core.interfaces import IResource from adhocracy_core.utils import get_sheet_field from adhocracy_mercator.sheets.mercator import IMercatorSubResources from adh...
agpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python/src/Demo/sockets/rpythond.py
47
1214
#! /usr/bin/env python # Remote python server. # Execute Python commands remotely and send output back. # WARNING: This version has a gaping security hole -- it accepts requests # from any host on the Internet! import sys from socket import * import StringIO import traceback PORT = 4127 BUFSIZE = 1024 def main(): ...
apache-2.0
ddy88958620/lib
Python/scrapy/getinthemix/dv247.py
2
2212
import re from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, FormRequest, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from productloader import load_product from scrapy.http import FormRequest cl...
apache-2.0
CityGrid/arsenal
server/arsenalweb/views/login.py
1
4340
'''Arsenal login page.''' # Copyright 2015 CityGrid Media, 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 ...
apache-2.0
gribozavr/swift
utils/swift_build_support/tests/test_host.py
48
2433
# test_host.py - Unit tests for swift_build_support.cmake -*-- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for...
apache-2.0
knorrium/selenium
py/selenium/webdriver/firefox/extension_connection.py
66
2846
# 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
arichar6/veusz
veusz/widgets/nonorthpoint.py
1
10913
# Copyright (C) 2010 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
Sumith1896/sympy
sympy/polys/heuristicgcd.py
86
3818
"""Heuristic polynomial GCD algorithm (HEUGCD). """ from __future__ import print_function, division from sympy.core.compatibility import range from .polyerrors import HeuristicGCDFailed HEU_GCD_MAX = 6 def heugcd(f, g): """ Heuristic polynomial GCD in ``Z[X]``. Given univariate polynomials ``f`` and ``g...
bsd-3-clause
CarlosCondor/pelisalacarta-xbmc-plus
lib/atom/auth.py
26
1123
#!/usr/bin/env python # # Copyright (C) 2009 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 required by...
gpl-3.0
Thraxis/SickRage
lib/unidecode/x081.py
252
4673
data = ( 'Cheng ', # 0x00 'Tiao ', # 0x01 'Zhi ', # 0x02 'Cui ', # 0x03 'Mei ', # 0x04 'Xie ', # 0x05 'Cui ', # 0x06 'Xie ', # 0x07 'Mo ', # 0x08 'Mai ', # 0x09 'Ji ', # 0x0a 'Obiyaakasu ', # 0x0b '[?] ', # 0x0c 'Kuai ', # 0x0d 'Sa ', # 0x0e 'Zang ', # 0x0f 'Qi ', # 0x...
gpl-3.0
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/email/test/test_email_torture.py
150
3669
# Copyright (C) 2002-2004 Python Software Foundation # # A torture test of the email package. This should not be run as part of the # standard Python test suite since it requires several meg of email messages # collected in the wild. These source messages are not checked into the # Python distro, but are available as...
apache-2.0
nickhdamico/py
lib/cherrypy/wsgiserver/ssl_builtin.py
56
3242
"""A library for integrating Python's builtin ``ssl`` library with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of ``BuiltinSSLAdapter``. """ try: import ssl except ImportError: ssl = None try: from _pyio imp...
gpl-3.0
appapantula/scikit-learn
sklearn/neighbors/graph.py
208
7031
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
bsd-3-clause
andreaso/ansible
test/runner/lib/cover.py
26
7465
"""Code coverage utilities.""" from __future__ import absolute_import, print_function import os import re from lib.target import ( walk_module_targets, walk_compile_targets, ) from lib.util import ( display, ApplicationError, EnvironmentConfig, run_command, common_environment, ) from li...
gpl-3.0
redhat-openstack/neutron
neutron/tests/unit/ryu/test_ryu_db.py
9
2313
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp> # 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/LI...
apache-2.0
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/twisted/python/urlpath.py
3
9084
# -*- test-case-name: twisted.python.test.test_urlpath -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ L{URLPath}, a representation of a URL. """ from __future__ import division, absolute_import from twisted.python.compat import ( nativeString, unicode, urllib_parse as urlparse, u...
mit
dpac-vlsi/SynchroTrace
src/dev/x86/Cmos.py
11
2041
# Copyright (c) 2008 The Regents of The University of Michigan # 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 ...
bsd-3-clause
awkspace/ansible
test/runner/lib/integration/__init__.py
11
7030
"""Ansible integration test infrastructure.""" from __future__ import absolute_import, print_function import contextlib import os import shutil import tempfile from lib.target import ( analyze_integration_target_dependencies, walk_integration_targets, ) from lib.config import ( NetworkIntegrationConfig,...
gpl-3.0
cocrawler/cocrawler
scripts/aiohttp-fetch.py
1
2534
''' Fetches some urls using aiohttp. Also serves as a minimum example of using aiohttp. Good examples: https://www.enterprisecarshare.com/robots.txt -- 302 redir lacking Location: raises RuntimeError ''' import sys from traceback import print_exc import asyncio import aiohttp import aiohttp.connector async def m...
apache-2.0
nysan/yocto-autobuilder
lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/internet/base.py
18
41263
# -*- test-case-name: twisted.test.test_internet -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Very basic functionality for a Reactor implementation. """ import socket # needed only for sync-dns from zope.interface import implements, classImplements import sys import warnings from h...
gpl-2.0
ryansnowboarder/zulip
zerver/lib/test_runner.py
2
3482
from __future__ import print_function from django.test.runner import DiscoverRunner from zerver.lib.cache import bounce_key_prefix_for_testing from zerver.views.messages import get_sqlalchemy_connection import os import time import traceback import unittest def slow(expected_run_time, slowness_reason): ''' T...
apache-2.0
rvalyi/OpenUpgrade
openerp/addons/base/tests/test_misc.py
393
1111
import unittest2 from openerp.tools import misc class test_countingstream(unittest2.TestCase): def test_empty_stream(self): s = misc.CountingStream(iter([])) self.assertEqual(s.index, -1) self.assertIsNone(next(s, None)) self.assertEqual(s.index, 0) def test_single(self): ...
agpl-3.0
caveman-dick/ansible
lib/ansible/modules/packaging/os/dpkg_selections.py
29
2142
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
adamkh/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/__init__.py
309
1692
# urllib3/__init__.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 """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
lgpl-2.1