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
freeworldxbmc/pluging.video.TV-Raptor
addon_debug.py
5
8821
import sys import os import json import urllib import urlparse import xbmcaddon import xbmcgui import xbmcplugin import load_channels import hashlib import re import time import server import config addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') addondir = xbmc.translatePath( addon.getAdd...
gpl-2.0
czchen/cppman
cppman/environ.py
1
1563
# -*- coding: utf-8 -*- # # environ.py # # Copyright (C) 2010 - 2015 Wei-Ning Huang (AZ) <aitjcize@gmail.com> # All Rights reserved. # # This file is part of cppman. # # 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 Fre...
gpl-3.0
tboyce021/home-assistant
homeassistant/components/doorbird/logbook.py
9
1053
"""Describe logbook events.""" from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import callback from .const import DOMAIN, DOOR_STATION, DOOR_STATION_EVENT_ENTITY_IDS @callback def async_describe_events(hass, async_describe_event): """Describe logbook events.""" @callback def asyn...
apache-2.0
niknow/geolocation-python
geolocation/geocode/parsers.py
4
3031
# -*- coding: utf-8 -*- from geolocation.parser import Parser class GeocodeParser(Parser): def search_address_components(self, type_, shortcut=False): """Method searches address components in google maps json data.""" data = None for address_component in self.json_data.get('address_compon...
bsd-3-clause
jfsantos/neon
tests/recurrent_ref.py
17
2621
""" This is a minimal single layer RNN implementation adapted from Andrej Karpathy's code -- Minimal character-level Vanilla RNN model. BSD License https://gist.github.com/karpathy/d4dee566867f8291f086 The adaptation includes - remove the file I/O - remove the recurrent to output affine layer - remove the sampli...
apache-2.0
jesus-a-martinez-v/awesome-cubes
application.py
1
6568
""" RESTful API methods. """ from flask import Flask, request, make_response, jsonify from data.cube import Cube, instantiate_from_raw_data from persistence.cube import delete, delete_all, get, get_all, store, update app = Flask(__name__) # Status codes constants _SUCCESS = 200 _BAD_REQUEST = 400 _NOT_FOUND = 404 _I...
gpl-3.0
JosmanPS/scikit-learn
sklearn/linear_model/tests/test_perceptron.py
378
1815
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_raises from sklearn.utils import check_random_state from sklearn.datasets import load_iris from sklearn.linear_model import Pe...
bsd-3-clause
OldShatterhand77/Portofino
oneclick/oneclick.py
1
3377
#! /usr/bin/env python ''' You must create a "local.py" using the following template: #! /usr/bin/env python portofino_version = "4.2" tomcat_dir = "apache-tomcat-8.0.26" portofino_path = "~/projects/portofino4" tomcat_url = "http://it.apache.contactlab.it/tomcat/tomcat-8/v8.0.26/bin/apache-tomcat-8.0.26.zip" driver...
lgpl-3.0
pferrel/PredictionIO
examples/scala-parallel-similarproduct/no-set-user/data/import_eventserver.py
3
2456
# # 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
markllama/origin
vendor/k8s.io/kubernetes/hack/update_owners.py
149
9054
#!/usr/bin/env python # Copyright 2016 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
f-santos/elasticsearch-dsl-py
elasticsearch_dsl/aggs.py
1
6614
import collections from .utils import DslBase from .response.aggs import BucketData, AggResponse, TopHitsData def A(name_or_agg, filter=None, **params): if filter is not None: if name_or_agg != 'filter': raise ValueError("Aggregation %r doesn't accept positional argument 'filter'." % name_or_a...
apache-2.0
loco-odoo/localizacion_co
openerp/addons-extra/asset_stock/asset.py
4
1390
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 CodUP (<http://codup.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
agpl-3.0
apanda/phantomjs-intercept
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment.py
154
1973
# Copyright (C) 2011 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
swapnilxd/android_kernel_xiaomi_msm8956
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
Flamacue/pretix
src/pretix/base/migrations/0038_auto_20160924_1448.py
5
1147
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-09-24 14:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pretixbase', '0037_invoice_payment_provider_text'), ] operations = [ migrati...
apache-2.0
leonzhu/shooter-player
Thirdparty/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 ...
gpl-2.0
juniwang/open-hackathon
open-hackathon-client/src/client/config_docker.py
2
7716
# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ import os # "javascript" section for javascript. see @app.route('/config.js') in app/views.py # NOTE: all following key/secrets for test purpose. ENDPOINT_WEB = os.getenv("ENDPOINT_WEB", "http://localhost") # host ...
mit
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/OpenGL/raw/GL/ATI/vertex_streams.py
3
16548
'''OpenGL extension ATI.vertex_streams Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ATI_vertex_streams' _DEPRECATED = False GL_MAX_VERTEX_ST...
mit
huyinghuan/shadowsocks
shadowsocks/common.py
945
8921
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # 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 requi...
apache-2.0
Thraxis/SickRage
lib/hachoir_parser/misc/file_3ds.py
95
5305
""" 3D Studio Max file (.3ds) parser. Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (StaticFieldSet, FieldSet, UInt16, UInt32, RawBytes, Enum, CString) from hachoir_parser.image.common import RGB from hachoir_core.endian import LITTLE_ENDIAN from hachoir_core.text_hand...
gpl-3.0
losywee/rethinkdb
external/v8_3.30.33.16/testing/gmock/gtest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 2009, 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...
agpl-3.0
dominickhera/PosaRepo
cis3250labs/cis3250lab9.py
1
6687
#!/usr/bin/python from Tkinter import * import tkMessageBox playerTurn = 0 boxCount = [0,0,0,0,0,0,0,0,0] def changeCaption(a): global playerTurn if playerTurn == 0: playerTurn = 1 playerTurnString.set("Player 2's Turn") if a == 0: bTxt0.set("X") b1.config(state="disabled") ...
apache-2.0
CBE544/CBE544.github.io
ASE/Getting_Started/setup_surf.py
2
1455
from ase import * from ase.lattice.surface import * from ase.lattice.surface import surface from ase.optimize import * from ase.constraints import * from ase import io #create a (111) or (110) surface slab of 2x2x4 #(2x2) surface area; 3 layers along surface normal) #7 angstrom vacuum layer added on each side # run t...
gpl-2.0
coxmediagroup/googleads-python-lib
examples/dfp/v201408/creative_wrapper_service/create_creative_wrappers.py
4
2382
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
ChinaQuants/bokeh
bokeh/charts/builders/line_builder.py
2
8084
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Line class which lets you build your Line charts just passing the arguments to the Chart class and calling the proper functions. """ # ----------------------------------------------------------------...
bsd-3-clause
MoritzS/django
django/contrib/auth/middleware.py
82
5399
from django.conf import settings from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.deprecation import MiddlewareMixin from django.utils.functional import Simple...
bsd-3-clause
eduNEXT/edunext-platform
common/djangoapps/student/auth.py
4
6458
""" The application interface to roles which checks whether any user trying to change authorization has authorization to do so, which infers authorization via role hierarchy (GlobalStaff is superset of auths of course instructor, ...), which consults the config to decide whether to check course creator role, and other ...
agpl-3.0
goyalankit/po-compiler
object_files/networkx-1.8.1/networkx/algorithms/centrality/communicability_alg.py
32
14321
""" Communicability and centrality measures. """ # Copyright (C) 2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx from networkx.utils import * __author__ = "\n".join(['Aric Hagberg (...
apache-2.0
dcamposliz/youtube-dl
youtube_dl/extractor/udemy.py
33
7277
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class UdemyIE(InfoExtractor): IE_NAME = 'udemy' _VALID_URL = r'https?://www\.udemy\.com/(?:[^#]+#/lectu...
unlicense
ewbankkit/cloud-custodian
tools/c7n_gcp/c7n_gcp/handler.py
6
2069
# Copyright 2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
albertrdixon/CouchPotatoServer
libs/guessit/transfo/guess_episodes_rexps.py
94
2416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
leture/Misago
misago/threads/posting/floodprotection.py
8
1590
from datetime import timedelta from django.conf import settings from django.utils import timezone from django.utils.translation import ugettext as _ from misago.threads.posting import PostingMiddleware, PostingInterrupt MIN_POSTING_PAUSE = 3 class FloodProtectionMiddleware(PostingMiddleware): def interrupt_po...
gpl-2.0
willwray/dash
contrib/devtools/fix-copyright-headers.py
80
1348
#!/usr/bin/env python ''' Run this script to update all the copyright headers of files that were changed this year. For example: // Copyright (c) 2009-2012 The Bitcoin Core developers it will change it to // Copyright (c) 2009-2015 The Bitcoin Core developers ''' import os import time import re year = time.gmtime(...
mit
garbas/pelican
pelican/paginator.py
24
4896
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals import functools import logging import os from collections import namedtuple from math import ceil import six logger = logging.getLogger(__name__) PaginationRule = namedtuple( 'PaginationRule', 'min_page URL SAVE_AS', ) class P...
agpl-3.0
rossburton/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/insults/helper.py
29
13625
# -*- test-case-name: twisted.conch.test.test_helper -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Partial in-memory terminal emulator @author: Jp Calderone """ import re, string from zope.interface import implements from twisted.internet import defer, protocol, reactor from twist...
gpl-2.0
mattnenterprise/servo
tests/wpt/web-platform-tests/webdriver/tests/actions/modifier_click.py
7
3396
# META: timeout=long import pytest from tests.actions.support.refine import filter_dict, get_events from tests.actions.support.keys import Keys # Using local fixtures because we want to start a new session between # each test, otherwise the clicks in each test interfere with each other. @pytest.fixture(autouse=True...
mpl-2.0
zaccoz/odoo
openerp/addons/base/res/res_users.py
23
48155
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
RPGOne/Skynet
node-master/deps/v8/tools/testrunner/local/progress.py
5
13799
# Copyright 2012 the V8 project authors. 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 conditi...
bsd-3-clause
balinbob/scenic
libscenic/editablecell.py
1
4694
import gtk, pygtk import gobject import os from os.path import join, isdir, basename, expanduser, dirname import sys class EditableCell(gtk.HBox): _label = None _ebox = None _autotext = None _custom = None _entry = None _combo = None _entry_handler_id = None __gsignals__ = { 'e...
gpl-3.0
eckucukoglu/arm-linux-gnueabihf
arm-linux-gnueabihf/libc/usr/lib/python2.7/ctypes/test/test_funcptr.py
81
3902
import os, unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
gpl-2.0
hgrif/incubator-airflow
airflow/contrib/sensors/jira_sensor.py
14
5763
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
marissazhou/django
tests/introspection/tests.py
108
8561
from __future__ import unicode_literals from unittest import skipUnless from django.db import connection from django.db.utils import DatabaseError from django.test import TransactionTestCase, mock, skipUnlessDBFeature from .models import Article, Reporter class IntrospectionTests(TransactionTestCase): availab...
bsd-3-clause
googleapis/python-aiplatform
samples/snippets/create_dataset_tabular_gcs_sample_test.py
1
1372
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
rldhont/Quantum-GIS
python/plugins/processing/preconfigured/PreconfiguredAlgorithm.py
30
2392
# -*- coding: utf-8 -*- """ *************************************************************************** PreconfiguredAlgorithm.py --------------------- Date : April 2016 Copyright : (C) 2016 by Victor Olaya Email : volayaf at gmail dot com *****************...
gpl-2.0
OpenHero/cuda-convnet2
convdata.py
3
10322
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
tipabu/swift
test/unit/container/test_sync_store.py
5
15735
# Copyright (c) 2010-2016 OpenStack Foundation # # 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 agree...
apache-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.5/tests/regressiontests/generic_inline_admin/admin.py
150
1100
from __future__ import absolute_import from django.contrib import admin from django.contrib.contenttypes import generic from .models import (Media, PhoneNumber, Episode, EpisodeExtra, Contact, Category, EpisodePermanent, EpisodeMaxNum) site = admin.AdminSite(name="admin") class MediaInline(generic.GenericTabul...
mit
gangadhar-kadam/laganfrappe
frappe/core/doctype/workflow/workflow.py
32
2524
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class Workflow(Document): def validate(self): self.set_active() self.create_custom_field_f...
mit
mkraemer67/pylearn2
pylearn2/datasets/cache.py
8
14417
""" Dataset preloading tool This file provides the ability to make a local cache of a dataset or part of it. It is meant to help in the case where multiple jobs are reading the same dataset from ${PYLEARN2_DATA_PATH}, which may cause a great burden on the network. With this file, it is possible to make a local copy (...
bsd-3-clause
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/lib_utils/library/openshift_container_binary_sync.py
12
7320
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring,invalid-name import random import tempfile import shutil import os.path # pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import from ansible.module_utils.basic import * # noqa: F403 DOCUMENTATION = ''' --- module: open...
apache-2.0
msebire/intellij-community
python/helpers/pydev/tests_pydevd_mainloop/gui-qt.py
100
1074
#!/usr/bin/env python """Simple Qt4 example to manually test event loop integration. To run this: 1) Enable the PyDev GUI event loop integration for qt 2) do an execfile on this script 3) ensure you have a working GUI simultaneously with an interactive console Ref: Modified from http://zetcode.com/tutorials/pyqt4/...
apache-2.0
hsuchie4/TACTIC
src/tactic/ui/app/diagnostics_wdg.py
6
8530
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
Sorsly/subtle
google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/request_helper.py
1
7895
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
mit
tanmay987/deepLearning
transfer-learning/tensorflow_vgg/vgg19.py
153
4616
import os import tensorflow as tf import numpy as np import time import inspect VGG_MEAN = [103.939, 116.779, 123.68] class Vgg19: def __init__(self, vgg19_npy_path=None): if vgg19_npy_path is None: path = inspect.getfile(Vgg19) path = os.path.abspath(os.path.join(path, os.pardir...
mit
theheros/kbengine
kbe/res/scripts/common/Lib/test/test_pep352.py
3
7333
import unittest import builtins import warnings from test.support import run_unittest import os from platform import system as platform_system class ExceptionClassTests(unittest.TestCase): """Tests for anything relating to exception objects themselves (e.g., inheritance hierarchy)""" def te...
lgpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/manhole/_inspectro.py
33
10104
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """An input/output window for the glade reactor inspector. """ import time import gtk import gobject import gtk.glade from twisted.python.util import sibpath from twisted.python import reflect from twisted.manhole.ui import gtk2manhole from twi...
mit
linusw/linux-bfq
scripts/gdb/linux/modules.py
1029
2597
# # 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, lists module_type = utils.CachedTy...
gpl-2.0
oasiswork/odoo
addons/auth_openid/res_users.py
175
3602
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
ssieb/FreeRDP
resources/conv_to_ewm_prop.py
80
1430
#!/usr/bin/python # Copyright 2011 Anthony Tong <atong@trustedcs.com> # 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
cdsteinkuehler/linuxcnc
lib/python/bitfile.py
38
4050
# Copyright 2007 Jeff Epler <jepler@unpythonic.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 # (at your option) any later version. # #...
lgpl-2.1
jymannob/CouchPotatoServer
libs/requests/packages/charade/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
Varriount/Colliberation
libs/twisted/internet/_newtls.py
6
9297
# -*- test-case-name: twisted.test.test_ssl -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module implements memory BIO based TLS support. It is the preferred implementation and will be used whenever pyOpenSSL 0.10 or newer is installed (whenever L{twisted.protocols.tls} is impor...
mit
crosswalk-project/chromium-crosswalk-efl
third_party/closure_linter/closure_linter/javascriptstatetracker.py
107
5171
#!/usr/bin/env python # Copyright 2008 The Closure Linter 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 # #...
bsd-3-clause
gpailler/Android2Wp_SMSConverter
thirdparty/pkcs7.py
1
2540
""" Python implementation of PKCS #7 padding. RFC 2315: PKCS#7 page 21 Some content-encryption algorithms assume the input length is a multiple of k octets, where k > 1, and let the application define a method for handling inputs whose lengths are not a multiple of k octets. For such algorithms, the method shall be to...
mit
xuxiao19910803/edx
common/lib/xmodule/xmodule/tests/xml/__init__.py
110
2464
""" Xml parsing tests for XModules """ import pprint from lxml import etree from mock import Mock from unittest import TestCase from xmodule.x_module import XMLParsingSystem, policy_key from xmodule.mako_module import MakoDescriptorSystem from xmodule.modulestore.xml import CourseLocationManager from opaque_keys.edx.l...
agpl-3.0
mapnik/python-mapnik
test/run_tests.py
5
2926
#!/usr/bin/env python import getopt import os import sys from python_tests.utilities import TodoPlugin try: import nose except ImportError as e: sys.stderr.write( "Unable to run python tests: the third party 'nose' module is required" "\nTo install 'nose' do:" "\n\tsudo pip install n...
lgpl-2.1
jjmiranda/edx-platform
common/lib/xmodule/xmodule/video_module/video_utils.py
49
3958
# -*- coding: utf-8 -*- """ Module contains utils specific for video_module but not for transcripts. """ from collections import OrderedDict import logging from urllib import urlencode from urlparse import parse_qs, urlsplit, urlunsplit, urlparse from django.conf import settings from django.core.validators import URL...
agpl-3.0
CEG-FYP-OpenStack/scheduler
nova/api/openstack/compute/legacy_v2/contrib/floating_ip_pools.py
79
2131
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 req...
apache-2.0
don-systems/management-system
document_page_environmental_aspect/migrations/7.0.1.0/pre-migration.py
8
2640
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or m...
agpl-3.0
doismellburning/django
django/contrib/auth/tests/test_models.py
4
7829
from django.contrib.auth import get_user_model from django.contrib.auth.models import AbstractUser, Group, Permission, User, UserManager from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.contenttypes.models import ContentType from django.core import mail from django.db.models.signals impo...
bsd-3-clause
dobrosketchkun/GA-circles
Game.py
1
2470
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: GA-cricles/Game class # Purpose: educational # # Author: Wisketchy Dobrov # # Copyright: (c)2015 # Licence: The BSD 3-Clause License #---------------------------------------------------...
bsd-3-clause
SUSE-Cloud/glance
glance/common/client.py
4
23465
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 OpenStack, LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
apache-2.0
sabi0/intellij-community
python/lib/Lib/UserList.py
104
3539
"""A more or less complete user-defined wrapper around list objects.""" class UserList: def __init__(self, initlist=None): self.data = [] if initlist is not None: # XXX should this accept an arbitrary sequence? if type(initlist) == type(self.data): self.data[...
apache-2.0
golismero/golismero
thirdparty_libs/nltk/tokenize/util.py
12
3165
# Natural Language Toolkit: Tokenizer Utilities # # Copyright (C) 2001-2012 NLTK Project # Author: Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT from re import finditer def string_span_tokenize(s, sep): r""" Return the offsets of the token...
gpl-2.0
alvin319/CarnotKE
jyhton/lib-python/2.7/test/test_ioctl.py
133
3311
import array import unittest from test.test_support import run_unittest, import_module, get_attribute import os, struct fcntl = import_module('fcntl') termios = import_module('termios') get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature try: tty = open("/dev/tty", "r") except IOError: ra...
apache-2.0
tempbottle/pycapnp
test/test_serialization.py
2
4005
import pytest import capnp import os import platform import test_regression import tempfile import pickle this_dir = os.path.dirname(__file__) @pytest.fixture def all_types(): return capnp.load(os.path.join(this_dir, 'all_types.capnp')) def test_roundtrip_file(all_types): f = tempfile.TemporaryFile() msg...
bsd-2-clause
stggh/PyAbel
setup.py
2
5214
import sys import re import os import os.path from setuptools import setup, find_packages, Extension from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError # change behaviour of the setup.py on readthedocs.io # https://read-the-docs.readthedocs.io/en/latest/faq.html#how-do-i-change-beh...
mit
lebabouin/CouchPotatoServer-develop
libs/pyasn1/codec/cer/encoder.py
226
3161
# CER encoder from pyasn1.type import univ from pyasn1.codec.ber import encoder from pyasn1.compat.octets import int2oct, null class BooleanEncoder(encoder.IntegerEncoder): def encodeValue(self, encodeFun, client, defMode, maxChunkSize): if client == 0: substrate = int2oct(0) else: ...
gpl-3.0
kastnerkyle/pylearn2
pylearn2/sandbox/cuda_convnet/debug.py
8
2642
__authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import logging import numpy as ...
bsd-3-clause
chrisnatali/networkx
networkx/algorithms/assortativity/tests/test_neighbor_degree.py
99
2454
#!/usr/bin/env python from nose.tools import * import networkx as nx class TestAverageNeighbor(object): def test_degree_p4(self): G=nx.path_graph(4) answer={0:2,1:1.5,2:1.5,3:2} nd = nx.average_neighbor_degree(G) assert_equal(nd,answer) D=G.to_directed() nd...
bsd-3-clause
VishvajitP/django-tastypie
tests/core/tests/utils.py
18
3409
from django.http import HttpRequest from django.test import TestCase from tastypie.serializers import Serializer from tastypie.utils.mime import determine_format, build_content_type class MimeTestCase(TestCase): def test_build_content_type(self): self.assertEqual(build_content_type('application/json'), 'a...
bsd-3-clause
CG-F16-16-Rutgers/steersuite-rutgers
steerstats/unit_tests/PPRTester.py
8
2509
import random import unittest import sys sys.path.append("../") from steerstats.SteerStats import SteerStats from steersuite.SteerStatsOptions import getOptions class PPRTester(unittest.TestCase): def setUp(self): self.seq = list(range(10)) @unittest.skip("demonstrating skipping") def test_skipp...
gpl-3.0
getredash/redash
tests/models/test_data_sources.py
3
6079
import mock from mock import patch from tests import BaseTestCase from redash.models import DataSource, Query, QueryResult from redash.utils.configuration import ConfigurationContainer class DataSourceTest(BaseTestCase): def test_get_schema(self): return_value = [{"name": "table", "columns": []}] ...
bsd-2-clause
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_capi.py
26
1519
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. import sys from test import test_support import _testcapi def test_main(): for name in dir(_testcapi): if name.startswith('test_'): test = getat...
gpl-2.0
ParthGanatra/mitmproxy
pathod/language/generators.py
5
2131
import string import random import mmap DATATYPES = dict( ascii_letters=string.ascii_letters, ascii_lowercase=string.ascii_lowercase, ascii_uppercase=string.ascii_uppercase, digits=string.digits, hexdigits=string.hexdigits, octdigits=string.octdigits, punctuation=string.punctuation, whi...
mit
bkaradzic/SwiftShader
src/commit_id.py
4
2125
#!/usr/bin/env python # Copyright 2019 The SwiftShader 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 # # Unle...
apache-2.0
broferek/ansible
lib/ansible/plugins/doc_fragments/shell_windows.py
32
1357
# Copyright (c) 2019 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Windows shell documentation fragment # FIXME: set_module_language don't belong here but must be set so they don't fail when someone # get_o...
gpl-3.0
defance/edx-platform
pavelib/quality.py
30
18588
""" Check code quality using pep8, pylint, and diff_quality. """ from paver.easy import sh, task, cmdopts, needs, BuildFailure import os import re from .utils.envs import Env ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib' def top_python_dirs(dirname): """ Find the directories to start from in order to find ...
agpl-3.0
tangyiyong/odoo
addons/sale_crm/wizard/crm_make_sale.py
223
7199
# -*- 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
Kirmaniarslan/xaak_sense_kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
adminq80/Interactive_estimation
game/interactive/migrations/0006_auto_20160925_0201.py
2
1315
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-25 02:01 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('interactive', '0005_auto_20160925_0132'), ] operat...
mit
oliciv/youtube-dl
youtube_dl/extractor/hornbunny.py
169
1813
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, ) class HornBunnyIE(InfoExtractor): _VALID_URL = r'http?://(?:www\.)?hornbunny\.com/videos/(?P<title_dash>[a-z-]+)-(?P<id>\d+)\.html' _TEST = { ...
unlicense
bram85/topydo
test/test_colors.py
1
9378
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
iksaif/biggraphite
tests/cli/test_command_test.py
3
1854
#!/usr/bin/env python # Copyright 2018 Criteo # # 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 agree...
apache-2.0
datenbetrieb/odoo
doc/conf.py
184
8222
# -*- coding: utf-8 -*- import sys, os import sphinx # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. DIR = os.path.dirname(__file...
agpl-3.0
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/pygments/lexers/textedit.py
31
6057
# -*- coding: utf-8 -*- """ pygments.lexers.textedit ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for languages related to text processing. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer im...
mit
lordappsec/ooni-probe
ooni/nettests/experimental/dns_injection.py
6
1990
# -*- encoding: utf-8 -*- from twisted.python import usage from twisted.internet import defer from ooni.templates import dnst from ooni.utils import log class UsageOptions(usage.Options): optParameters = [ ['resolver', 'r', '8.8.8.1', 'an invalid DNS resolver'], ['timeout', 't', 3, 'timeou...
bsd-2-clause
platinumpixs/google-closure-library
closure/bin/build/closurebuilder.py
20
9935
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
apache-2.0
mattupstate/flask-environments
docs/conf.py
2
9931
# -*- coding: utf-8 -*- # # Flask-Environments documentation build configuration file, created by # sphinx-quickstart on Mon Mar 12 15:35:21 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
mit
Improvist/fullstack-nanodegree-project-4
models.py
1
5382
#!/usr/bin/env python """models.py Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import httplib import endpoints from protor...
apache-2.0