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 |
|---|---|---|---|---|---|
umitanuki/chainer | chainer/functions/caffe/caffe_pb2.py | 27 | 209364 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: caffe.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import... | mit |
rachitrawat/taoshan | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
V155/qutebrowser | tests/end2end/test_hints_html.py | 1 | 5183 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
LaunchlabAU/dj-stripe | djstripe/decorators.py | 14 | 1730 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from functools import wraps
from django.utils.decorators import available_attrs
from django.shortcuts import redirect
from .utils import subscriber_has_active_subscription
from .settings import subscriber_request_callback
def user_pass... | bsd-3-clause |
awslabs/chalice | chalice/deploy/swagger.py | 1 | 11252 | import copy
import inspect
from typing import Any, List, Dict, Optional, Union # noqa
from chalice.app import Chalice, RouteEntry, Authorizer, CORSConfig # noqa
from chalice.app import ChaliceAuthorizer
from chalice.deploy.planner import StringFormat
from chalice.deploy.models import RestAPI # noqa
from chalice.ut... | apache-2.0 |
houchj/selenium | py/test/selenium/webdriver/common/repr_tests.py | 34 | 1749 | # 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 |
tlatzko/spmcluster | .tox/2.7-cover/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py | 223 | 50347 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | bsd-2-clause |
dga4654dan/UTM-Demo | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/test/test_subclasses.py | 5 | 4956 | import test_support, unittest
import pickle
#myint and its test taken from pickletester, the other "my" classes and tests
# are based on it.
class myint(int):
def __init__(self, x):
self.str = str(x)
class mystr(str):
def __init__(self, x):
self.str = str(x)
class mytuple(tuple):
... | gpl-2.0 |
zeroshift/wemo-standby | wemo-standby.py | 1 | 2621 | #!/usr/bin/env python
import argparse
import sys
import logging
import time
from ouimeaux.environment import Environment
from ouimeaux.utils import matcher
from ouimeaux.signals import receiver, statechange, devicefound
def _get_args():
"""Get arguments and options."""
parser = argparse.ArgumentParser(descr... | bsd-3-clause |
zofuthan/edx-platform | lms/djangoapps/courseware/management/commands/clean_history.py | 84 | 7312 | """A command to clean the StudentModuleHistory table.
When we added XBlock storage, each field modification wrote a new history row
to the db. Now that we have bulk saves to avoid that database hammering, we
need to clean out the unnecessary rows from the database.
This command that does that.
"""
import datetime
... | agpl-3.0 |
github4ry/python-goose | tests/extractors/title.py | 13 | 1268 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
StevenBlack/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher.py | 165 | 2420 | # 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 |
coursera-dl/coursera | coursera/extractors.py | 2 | 9215 | """
This module contains implementation for extractors. Extractors know how
to parse site of MOOC platform and return a list of modules to download.
Usually they do not download heavy content, except when necessary
to parse course syllabus.
"""
import abc
import json
import logging
from .api import (CourseraOnDemand,... | lgpl-3.0 |
AICP/external_chromium_org | chrome/common/extensions/docs/server2/file_system.py | 10 | 6424 | # Copyright (c) 2012 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 posixpath
import traceback
from future import Future
from path_util import (
AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitPar... | bsd-3-clause |
MjAbuz/tornado | tornado/wsgi.py | 30 | 13386 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 |
GcsSloop/PythonNote | PythonCode/Python进阶/函数编程/偏函数.py | 1 | 1437 | #coding=utf-8
#author: sloop
'''
ÈÎÎñ
ÔÚµÚ7½ÚÖУ¬ÎÒÃÇÔÚsortedÕâ¸ö¸ß½×º¯ÊýÖд«Èë×Ô¶¨ÒåÅÅÐòº¯Êý¾Í¿ÉÒÔʵÏÖºöÂÔ´óСдÅÅÐò¡£ÇëÓÃfunctools.partial°ÑÕâ¸ö¸´ÔÓµ÷Óñä³ÉÒ»¸ö¼òµ¥µÄº¯Êý£º
sorted_ignore_case(iterable)
Æ«º¯ÊýÖеIJÎÊý˵Ã÷£ºµÚÒ»¸ö²ÎÊýʱ±»¸Ä±äº¯ÊýÃû£¬µÚ¶þ¸ö²ÎÊýÊǺ¯Êý²ÎÊýµÄĬÈÏÖµ
'''
import functools
sorted_ignore_ca... | apache-2.0 |
lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/examples/api/histogram_path_demo.py | 6 | 1464 | """
This example shows how to use a path patch to draw a bunch of
rectangles. The technique of using lots of Rectangle instances, or
the faster method of using PolyCollections, were implemented before we
had proper paths with moveto/lineto, closepoly etc in mpl. Now that
we have them, we can draw collections of regul... | mit |
PirateLearner/pi | PirateLearner/meta_tags/views.py | 1 | 6790 | # Create your views here.
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from . import settings
class Meta(object):
""" Helper for building context meta object
Information to be provided are:
1. description.
2. title
3. Author link (None=True)
... | gpl-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/Queue.py | 188 | 8561 | """A multi-producer, multi-consumer queue."""
from time import time as _time
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
from collections import deque
import heapq
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
class Empty(Exception):
"... | mit |
muchu1983/104_cameo | test/unit/test_spiderForCROWDCUBE.py | 1 | 1400 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
from cameo.spiderForCROWDCUBE import SpiderForCROWDCUBE
"""
測試 抓取 CROWDCUBE
"""
class SpiderForCRO... | bsd-3-clause |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/test/test_httplib.py | 40 | 19698 | import httplib
import array
import httplib
import StringIO
import socket
import errno
import unittest
TestCase = unittest.TestCase
from test import test_support
HOST = test_support.HOST
class FakeSocket:
def __init__(self, text, fileclass=StringIO.StringIO):
self.text = text
self.fileclass = fil... | apache-2.0 |
endlessm/chromium-browser | tools/swarming_client/third_party/pyasn1_modules/pyasn1_modules/rfc3852.py | 11 | 20119 | # coding: utf-8
#
# This file is part of pyasn1-modules software.
#
# Created by Stanisław Pitucha with asn1ate tool.
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# Cryptographic Message Syntax (CMS)
#
# ASN.1 source from:
# http://www.ietf.org/rfc/rfc... | bsd-3-clause |
dariocorral/panoanda | panoanda/tickers.py | 1 | 2954 | """
Created on Sat Sep 16 18:32:01 2017
@author: dariocorral
"""
import os
import oandapy
import pandas as pd
class Tickers(object):
"""
Basic info about tickers available for OANDA trading
"""
#oanda_api private attribute
_oanda_api = oandapy.API(environment = os.environ['ENV'],
... | mit |
d40223223/608 | static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | gpl-3.0 |
vincentpc/yagra | handlers/user.py | 1 | 1283 | #!/usr/bin/env python
# coding=utf-8
import hashlib
import os
from webapp.web import BaseHandler
from model import dbapi
class UserHandler(BaseHandler):
def check(self):
email = self.get_secure_cookie("email")
user = dbapi.User()
if email and user.get_user(email) == 0:
profi... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/examples/demos/textedit/textedit_rc2.py | 5 | 237715 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 12:29:00 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x0a\x15\
\x00\
\x00\x38\x1d\x78\x9c\xdd\x5b\x5b\x73\xdb\xb8\x15\x... | gpl-3.0 |
debugger87/spark | examples/src/main/python/ml/fpgrowth_example.py | 79 | 1733 | #
# 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 |
sbrunner/QGIS | tests/src/python/test_qgscoordinatetransformcontext.py | 11 | 28706 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsCoordinateTransformContext
.. note:: 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 v... | gpl-2.0 |
arjunbm13/youtube-dl | youtube_dl/extractor/gamestar.py | 123 | 2627 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
str_to_int,
unified_strdate,
)
class GameStarIE(InfoExtractor):
_VALID_URL = r'http://www\.gamestar\.de/videos/.*,(?P<id>[0-9]+)\.html'
_TEST... | unlicense |
skurochkin/selenium | py/test/selenium/webdriver/common/network.py | 65 | 1680 | # 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 |
mancoast/CPythonPyc_test | crash/260_test_struct.py | 3 | 23954 | import array
import unittest
import struct
import warnings
from functools import wraps
from test.test_support import TestFailed, verbose, run_unittest
import sys
ISBIGENDIAN = sys.byteorder == "big"
IS32BIT = sys.maxsize == 0x7fffffff
del sys
try:
import _struct
except ImportError:
PY_STRUCT_RANGE_CHECKING =... | gpl-3.0 |
klusark/android_external_chromium_org | chrome/common/extensions/docs/server2/template_data_source_test.py | 23 | 5507 | #!/usr/bin/env python
# Copyright (c) 2012 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 json
import os
import sys
import unittest
from api_data_source import APIDataSource
from compiled_file_system import Compil... | bsd-3-clause |
qedi-r/home-assistant | tests/components/tplink/test_init.py | 3 | 9003 | """Tests for the TP-Link component."""
from typing import Any, Dict
from unittest.mock import MagicMock, patch
from pyHS100 import SmartBulb, SmartDevice, SmartDeviceException, SmartPlug
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import tplink
from homeassist... | apache-2.0 |
yograterol/django | django/forms/fields.py | 157 | 48936 | """
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import uuid
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
# Provide th... | bsd-3-clause |
heeraj123/oh-mainline | vendor/packages/Django/tests/regressiontests/templates/parser.py | 58 | 3218 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from __future__ import unicode_literals
from django.template import (TokenParser, FilterExpression, Parser, Variable,
TemplateSyntaxError)
from django.utils.unittest import TestCase
class ParserTests(Te... | agpl-3.0 |
normtown/SickRage | lib/github/tests/Issue54.py | 39 | 2356 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
mrunalk/crosswalk | build/android/adb_profile_xwalk.py | 46 | 1650 | #!/usr/bin/env python
#
# 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.
#
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can b... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/233_test_xmlrpc.py | 8 | 1324 | import sys
import unittest
import xmlrpclib
from test import test_support
alist = [{'astring': 'foo@bar.baz.spam',
'afloat': 7283.43,
'anint': 2**20,
'ashortlong': 2L,
'anotherlist': ['.zyx.41'],
'abase64': xmlrpclib.Binary("my dog has fleas"),
'boolean': xml... | gpl-3.0 |
afaheem88/tempest | tempest/thirdparty/boto/test_ec2_security_groups.py | 14 | 3470 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
orzzzl/open-reservation | lib/werkzeug/serving.py | 309 | 27668 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | apache-2.0 |
cosme12/cheatsheet-maker | sheetmaker/language_strings.py | 1 | 6596 | """Language selector handler
Todo:
* Use internacionalization
* Add more languages
"""
english = {
"INTRO_MESSAGE" : "Welcome to CheatSheet Maker",
"MAIN_MENU_OPTIONS" : { 1: "Create sheet",
2: "Export (NOT CODED YET)",
3: "Help (NOT CODED YET)"... | mit |
rfines/PythonKoans | python2/koans/about_sets.py | 86 | 1510 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutSets(Koan):
def test_sets_make_keep_lists_unique(self):
highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas',
'MacLeod', 'Malcolm', 'MacLeod']
there_can_only_be_only_one = set(highlanders)
... | mit |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/ctypes/test/test_functions.py | 43 | 12658 | """
Here is probably the place to write the docs, since the test-cases
show how the type behave.
Later...
"""
from ctypes import *
import sys, unittest
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
if ... | gpl-2.0 |
noelevans/sandpit | boston/categorise_with_scalers.py | 1 | 1162 | import numpy as np
from scipy import stats
from sklearn import datasets
from sklearn.naive_bayes import GaussianNB
from sklearn.cross_validation import train_test_split
def main():
boston = datasets.load_boston()
y = boston.target # House prices
mean = np.mean(y)
y = y > mean ... | mit |
abstract-open-solutions/OCB | addons/account/wizard/account_report_general_journal.py | 378 | 1697 | # -*- 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 |
Dark-Hacker/horizon | openstack_dashboard/dashboards/admin/hypervisors/views.py | 48 | 2811 | # Copyright 2013 B1 Systems GmbH
#
# 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... | apache-2.0 |
Xeralux/tensorflow | tensorflow/contrib/kfac/python/ops/fisher_factors.py | 1 | 54531 | # 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 |
pwoodworth/intellij-community | python/helpers/profiler/thriftpy3/transport/TZlibTransport.py | 44 | 8075 | #
# 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 u... | apache-2.0 |
EunBongSong/TizenRT | tools/ttrace_parser/scripts/ttrace.py | 14 | 19465 | #!/usr/bin/env python
###########################################################################
#
# Copyright 2017 Samsung Electronics 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 ... | apache-2.0 |
pap/rethinkdb | scripts/compile-web-assets.py | 34 | 3323 | #!/usr/bin/env python
from __future__ import print_function, division
import os
import sys
import itertools
def main():
try:
assets_root = sys.argv[1]
assert os.path.isdir(assets_root)
except:
print("Error: First argument must be a directory", file=sys.stderr)
sys.exit(1)
... | agpl-3.0 |
AndrewPeelMV/Blender2.78c | 2.78/scripts/freestyle/styles/long_anisotropically_dense.py | 7 | 3125 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 is distrib... | gpl-2.0 |
frangucc/gamify | www/sandbox/pals/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 106 | 44050 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
sujithshankar/anaconda | pyanaconda/rescue.py | 1 | 16703 | #
# rescue.py - anaconda rescue mode setup
#
# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
#
# 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 ... | gpl-2.0 |
cms-dev/tws | Langs2Teams.py | 1 | 2418 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Translation Web Server
# Copyright © 2012 Luca Wehrstedt <luca.wehrstedt@gmail.com>
#
# 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, either v... | agpl-3.0 |
kjc88/sl4a | python/src/Lib/test/test_urlparse.py | 55 | 16540 | #! /usr/bin/env python
from test import test_support
import unittest
import urlparse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
RFC3986_BASE = "http://a/b/c/d;p?q"
# A list of test cases. Each test case is a a two-tuple that contains
# a string with the query and a dictionary with the... | apache-2.0 |
avadacatavra/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_runner.py | 13 | 25655 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import _pytest._code
import os
import py
import pytest
import sys
from _pytest import runner, main, outcomes
class TestSetupState(object):
def test_setup(self, testdir):
ss = runner.SetupState()
item = testdi... | mpl-2.0 |
uniumwifi/wireless-testing | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
bgyori/indra | indra/tests/test_hgnc_client.py | 4 | 2672 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import hgnc_client
from indra.util import unicode_strs
from nose.plugins.attrib import attr
def test_get_uniprot_id():
hgnc_id = '6840'
uniprot_id = hgnc_client.get_uniprot_id(hgnc_id)
... | bsd-2-clause |
wlamond/scikit-learn | sklearn/preprocessing/data.py | 8 | 68191 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# Giorgio Patrini <giorgio.patrini@anu.edu.au>
# Lic... | bsd-3-clause |
JorisE/xhtml2pdf | xhtml2pdf/tables.py | 37 | 13584 | # -*- coding: utf-8 -*-
from reportlab.platypus.tables import TableStyle
from xhtml2pdf.util import getSize, getBorderStyle, getAlign
from xhtml2pdf.tags import pisaTag
from xhtml2pdf.xhtml2pdf_reportlab import PmlTable, PmlKeepInFrame
import copy
import logging
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# Licensed... | apache-2.0 |
wainersm/buildbot | master/buildbot/test/unit/test_db_changesources.py | 10 | 12004 | # 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 |
liuzhe02/libyuv | PRESUBMIT.py | 148 | 1296 | # Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors... | bsd-3-clause |
x-alp/Oksamultisnake | Server.py | 1 | 5816 | # -*- coding: utf-8 -*-
################################################################
## Server.py
################################################################
# A lancer : python Server.py :> utilisation des paramètres par defaut
# ip =127.0.0.1 port = 8000
# sinon : python Server.py [-p port] [-ip ip]
#
#... | gpl-3.0 |
BigRefT/bionic_cms | public/javascripts/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 44 | 6491 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | mit |
kalburgimanjunath/elasticsearch | dev-tools/create_bwc_index_with_some_ancient_segments.py | 217 | 4414 | import create_bwc_index
import logging
import os
import random
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ... | apache-2.0 |
crwilcox/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/_abcoll.py | 24 | 18536 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
boots... | apache-2.0 |
CG-F16-16-Rutgers/steersuite-rutgers | steerstats/steersuitedb/CcAI.py | 8 | 24515 | import psycopg2
from steersuitedb.AlgorithmData import AlgorithmData
from steersuitedb.BaseAI import BaseAI
class CcAI(BaseAI):
"""A simple example class"""
_id_name = "cc_ai_id"
_algorithm_reff = "ccAI"
_table_name = "cc_ai_data"
_insert_order = """(
cc_ai_id,
compute_density_field_number_of_... | gpl-3.0 |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/noco.py | 19 | 8460 | # encoding: utf-8
from __future__ import unicode_literals
import re
import time
import hashlib
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
float_or_none,
parse_iso8601,
sanitized_... | gpl-2.0 |
shoyer/xray | xarray/core/indexing.py | 1 | 47782 | import functools
import operator
from collections import defaultdict
from contextlib import suppress
from datetime import timedelta
from typing import Sequence
import numpy as np
import pandas as pd
from . import duck_array_ops, nputils, utils
from .pycompat import dask_array_type, integer_types
from .utils import is... | apache-2.0 |
imply/chuu | chrome/test/pyautolib/remote_host.py | 80 | 3108 | #!/usr/bin/env python
# Copyright (c) 2011 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 cStringIO
import os
import pickle
import socket
import sys
import pyauto
class RemoteHost(object):
"""Class used as a ho... | bsd-3-clause |
density215/d215-miniblog | django/core/serializers/pyyaml.py | 204 | 1948 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from django.db import models
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as... | bsd-3-clause |
will-Do/avocado | avocado/core/plugins/exec_path.py | 2 | 2462 | # 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 is distributed in the hope that it will be useful,
# bu... | gpl-2.0 |
endolith/pyeq2 | Models_3D/UserDefinedFunction.py | 3 | 8845 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# pyeq2 is a collection of equations expressed as Python classes
#
# Copyright (C) 2013 James R. Phillips
# 2548 Vera Cruz Drive
# Birmingham, AL 35235 USA
#
# email: zunzun@zunzun.com
#
... | bsd-2-clause |
stackforge/python-openstacksdk | openstack/tests/unit/cloud/test_recordset.py | 2 | 14767 | # 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
# distributed under t... | apache-2.0 |
clebergnu/avocado-vt | virttest/libvirt_xml/devices/address.py | 8 | 1968 | """
Address device / device descriptor class
http://libvirt.org/formatdomain.html#elementsAddress
"""
from virttest.libvirt_xml import accessors, xcepts
from virttest.libvirt_xml.devices import base
class Address(base.TypedDeviceBase):
__slots__ = ('attrs',)
def __init__(self, type_name, virsh_instance=ba... | gpl-2.0 |
longmen21/edx-platform | lms/djangoapps/grades/scores.py | 2 | 3444 | """
Functionality for problem scores.
"""
from openedx.core.lib.cache_utils import memoized
from xblock.core import XBlock
from .transformer import GradesTransformer
@memoized
def block_types_possibly_scored():
"""
Returns the block types that could have a score.
Something might be a scored item if it is... | agpl-3.0 |
chongtianfeiyu/kbengine | kbe/src/lib/python/Lib/pkgutil.py | 77 | 21215 | """Utilities to support packages."""
from functools import singledispatch as simplegeneric
import importlib
import importlib.util
import importlib.machinery
import os
import os.path
import sys
from types import ModuleType
import warnings
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_loader',
... | lgpl-3.0 |
Agent007/deepchem | deepchem/models/tests/test_reload.py | 2 | 1376 | """
Test reload for trained models.
"""
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import unittest
import tempfile
import numpy as np
import deepchem as dc
import tensorflow as tf
fr... | mit |
Vixionar/django | django/contrib/gis/forms/widgets.py | 422 | 3659 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six, translation
logger = log... | bsd-3-clause |
cathywu/Sentiment-Analysis | PyML-0.7.9/PyML/classifiers/ext/cgist.py | 2 | 9759 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2... | gpl-2.0 |
coolbombom/CouchPotatoServer | libs/subliminal/api.py | 106 | 5646 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
tealover/nova | nova/openstack/common/report/generators/threading.py | 33 | 3105 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
Yong-Lee/django | tests/template_tests/filter_tests/test_truncatechars_html.py | 390 | 1229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import truncatechars_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatechars_html('<p>one <a href="#">two - three <br>... | bsd-3-clause |
Shengs/ghostchat | node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | gpl-2.0 |
Tiotao/morpherpy | env/Lib/site-packages/sqlalchemy/dialects/postgresql/__init__.py | 15 | 1138 | # postgresql/__init__.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, psycopg2, pg8000, pypostgresql, zxjdbc
base.dialect = psyc... | mit |
bitcity/django | tests/absolute_url_overrides/tests.py | 284 | 2007 | from django.db import models
from django.test import SimpleTestCase
class AbsoluteUrlOverrideTests(SimpleTestCase):
def test_get_absolute_url(self):
"""
get_absolute_url() functions as a normal method.
"""
get_absolute_url = lambda o: '/test-a/%s/' % o.pk
TestA = self._cre... | bsd-3-clause |
elmaso/tno-ai | search/game.py | 5 | 21434 | # game.py
# -------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkel... | gpl-3.0 |
dabiboo/youtube-dl | youtube_dl/extractor/bliptv.py | 85 | 11650 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
unescapeHTML,
xpath_text,
xpath_with_ns,
)
class BlipTVIE(InfoExtractor)... | unlicense |
alexgibson/bedrock | lib/fluent_migrations/firefox/browsers/compare/ie.py | 6 | 14447 | from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
from fluent.migrate.helpers import VARIABLE_REFERENCE, TERM_REFERENCE
from fluent.migrate import REPLACE, COPY
ie = "firefox/compare/ie.lang"
def migrate(ctx):
"""Migrate bedrock/firefox/templ... | mpl-2.0 |
authbox-lib/thrift | contrib/zeromq/TZmqClient.py | 108 | 1942 | #
# 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 u... | apache-2.0 |
kontais/EFI-MIPS | ToolKit/cmds/python/Lib/test/skipped/test_codecmaps_jp.py | 15 | 2552 | #!/usr/bin/env python
#
# test_codecmaps_jp.py
# Codec mapping tests for Japanese encodings
#
# $CJKCodecs: test_codecmaps_jp.py,v 1.3 2004/06/19 06:09:55 perky Exp $
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestCP932Map(test_multibytecodec_support.TestBase_Ma... | bsd-3-clause |
sjtujulian/cuda-convnet2 | python_util/util.py | 181 | 2825 | # 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 |
baylee/django | tests/utils_tests/test_inspect.py | 157 | 1161 | import unittest
from django.utils import inspect
class Person(object):
def no_arguments(self):
return None
def one_argument(self, something):
return something
def just_args(self, *args):
return args
def all_kinds(self, name, address='home', age=25, *args, **kwargs):
... | bsd-3-clause |
Catch-up-TV-and-More/plugin.video.catchuptvandmore | resources/lib/channels/wo/france24.py | 1 | 13096 | # -*- coding: utf-8 -*-
# Copyright: (c) JUL1EN094, SPM, SylvainCecchetto
# Copyright: (c) 2016, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
import json
from codequi... | gpl-2.0 |
juju/python-libjuju | juju/client/codegen.py | 1 | 1347 | from collections import defaultdict
from io import StringIO
from textwrap import indent
class CodeWriter(StringIO):
"""
Blob of text that, when used in the context of facade.py, ends up
holding the source code for a Python class and associated methods.
"""
INDENT = " "
CLASS = 0
METHO... | apache-2.0 |
villrv/MOSFiT | mosfit/samplers/ptsampler.py | 4 | 20059 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["PTSampler"]
import numpy as np
import numpy.random as nr
import multiprocessing as multi
def default_beta_ladder(ndim, ntemps=None, Tmax=None):
... | mit |
cccfran/sympy | sympy/core/tests/test_args.py | 3 | 109937 | """Test whether all elements of cls.args are instances of Basic. """
# NOTE: keep tests sorted by (module, class name) key. If a class can't
# be instantiated, add it here anyway with @SKIP("abstract class) (see
# e.g. Function).
import os
import re
import warnings
from sympy import Basic, S, symbols, sqrt, sin, oo,... | bsd-3-clause |
Motorhead1991/android_kernel_samsung_amazing | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
gaolichuang/neutron-fwaas | neutron_fwaas/tests/unit/services/firewall/drivers/varmour/test_varmour_fwaas.py | 1 | 8982 | # Copyright 2013 vArmour 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
DiamondLightSource/auto_tomo_calibration-experimental | old_code_scripts/lmfit-py/examples/doc_basic.py | 4 | 1237 | #!/usr/bin/env python
#<examples/doc_basic.py>
from lmfit import minimize, Parameters, Parameter, report_fit
import numpy as np
# create data to be fitted
x = np.linspace(0, 15, 301)
data = (5. * np.sin(2 * x - 0.1) * np.exp(-x*x*0.025) +
np.random.normal(size=len(x), scale=0.2) )
# define objective function:... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.