repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
walterbender/portfolio
odf/draw.py
1
5639
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
gpl-3.0
-4,131,335,225,744,125,400
23.513043
80
0.659808
false
laiqiqi886/kbengine
kbe/src/lib/python/Lib/concurrent/futures/thread.py
93
4548
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" __author__ = 'Brian Quinlan (brian@sweetapp.com)' import atexit from concurrent.futures import _base import queue import threading import weakref # Workers are created as daemon...
lgpl-3.0
6,511,911,652,504,655,000
33.454545
80
0.599604
false
TravisCG/SI_scripts
samerec.py
1
1175
#!/usr/bin/python """ Read a pair of fastq files and filter out reads which IDs not found in both files """ import sys fq1 = open(sys.argv[1]) fq2 = open(sys.argv[2]) out1 = open(sys.argv[3], "w") out2 = open(sys.argv[4], "w") stack1 = dict() stack2 = dict() counter = 0 same = False while True: read1 = fq1.rea...
gpl-3.0
-8,358,680,412,213,693,000
16.279412
81
0.628085
false
firerszd/kbengine
kbe/src/lib/python/Lib/tkinter/test/test_ttk/test_widgets.py
59
56828
import unittest import tkinter from tkinter import ttk from test.support import requires import sys from tkinter.test.test_ttk.test_functions import MockTclObj from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel, simulate_mouse_click) from tkinter.test.wid...
lgpl-3.0
5,589,900,279,530,257,000
34.561952
87
0.588953
false
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/internet/protocol.py
31
26263
# -*- test-case-name: twisted.test.test_factories,twisted.internet.test.test_protocol -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Standard implementations of Twisted protocol-related interfaces. Start here if you are looking to write a new protocol implementation for Twisted. The ...
bsd-3-clause
4,923,557,377,898,244,000
29.970519
89
0.639036
false
gnowledge/ncert_nroer
gstudio/templatetags/gstudio_tags.py
1
27697
# Copyright (c) 2011, 2012 Free Software Foundation # 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 version 3 of the # License, or (at your option) any later ver...
agpl-3.0
4,942,955,280,426,499,000
32.410133
166
0.634112
false
gemfire/py-gemfire-rest
tests/PerformanceTests.py
2
2432
''' Copyright (c) 2014 Pivotal Software, 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
81,333,886,949,984,320
32.777778
114
0.599918
false
bdh1011/wau
venv/lib/python2.7/site-packages/nbformat/v4/tests/test_validate.py
3
2506
"""Tests for nbformat validation""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import io import os import nose.tools as nt from nbformat.validator import validate, ValidationError from ..nbjson import reads from ..nbbase import ( nbformat, new_code_c...
mit
4,945,232,103,774,989,000
22.866667
106
0.647247
false
bstadie/cgt
examples/demo_char_rnn.py
13
12470
""" A nearly direct translation of Andrej's code https://github.com/karpathy/char-rnn """ from __future__ import division import cgt from cgt import nn, utils, profiler import numpy as np, numpy.random as nr import os.path as osp import argparse from time import time from StringIO import StringIO from param_collection...
mit
-4,721,882,045,012,063,000
37.018293
131
0.624379
false
jacshfr/mozilla-bedrock
vendor-local/packages/chardet/chardet/mbcsgroupprober.py
236
1889
######################## 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...
mpl-2.0
2,186,669,350,203,373,800
36.78
69
0.692959
false
ToonTownInfiniteRepo/ToontownInfinite
Panda3D-1.9.0/python/Lib/site-packages/setuptools/tests/test_upload_docs.py
522
2139
"""build_ext tests """ import sys, os, shutil, tempfile, unittest, site, zipfile from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo') """ class TestUploadDocsTest(unittest.TestCase): def setUp(self): ...
mit
-4,058,993,172,534,987,300
28.708333
71
0.583918
false
mrquim/repository.mrquim
script.module.pycryptodome/lib/Crypto/SelfTest/Cipher/test_CFB.py
5
16124
# =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributio...
gpl-2.0
-3,972,363,009,042,638,000
39.209476
91
0.585463
false
lukleh/TwistedBot
twistedbot/plugins/base.py
1
2342
import os import pkgutil import abc from functools import wraps class PluginMeta(abc.ABCMeta): def __new__(meta, name, bases, dct): cls = super(PluginMeta, meta).__new__(meta, name, bases, dct) cls.handlers = [] for name, obj in cls.__dict__.iteritems(): if hasattr(obj, "__c...
mit
-5,671,564,216,552,540,000
27.91358
95
0.583689
false
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/gunicorn/arbiter.py
24
17047
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from __future__ import with_statement import errno import os import random import select import signal import sys import time import traceback from gunicorn.errors import HaltServer, AppImpo...
mit
1,040,810,405,387,226,100
29.550179
77
0.526486
false
nikesh-mahalka/cinder
cinder/api/views/cgsnapshots.py
23
2446
# Copyright (C) 2012 - 2014 EMC 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 # # Unle...
apache-2.0
-1,952,304,181,464,326,000
34.449275
78
0.619379
false
vivianli32/TravelConnect
flask/lib/python3.4/site-packages/openid/extension.py
13
1703
import warnings from openid import message as message_module class Extension(object): """An interface for OpenID extensions. @ivar ns_uri: The namespace to which to add the arguments for this extension """ ns_uri = None ns_alias = None def getExtensionArgs(self): """Get the ...
mit
-2,377,073,209,210,731,500
33.06
73
0.616559
false
the76thHunter/tmdbsimple
tmdbsimple/search.py
8
6919
# -*- coding: utf-8 -*- """ tmdbsimple.search ~~~~~~~~~~~~~~~~~ This module implements the Search functionality of tmdbsimple. Created by Celia Oakley on 2013-10-31. :copyright: (c) 2013-2014 by Celia Oakley :license: GPLv3, see LICENSE for more details """ from .base import TMDB class Search(TMDB): """ Se...
gpl-3.0
-1,946,622,739,095,508,700
32.921569
78
0.552247
false
MQQiang/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/command/easy_install.py
206
72706
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ impo...
lgpl-3.0
-5,834,135,800,087,649,000
36.96658
96
0.564438
false
jquacinella/IS602_Project
web/gluon/rocket.py
19
58903
# -*- coding: utf-8 -*- # This file is part of the Rocket Web Server # Copyright (c) 2011 Timothy Farrell # Modified by Massimo Di Pierro # Import System Modules import sys import errno import socket import logging import platform # Define Constants VERSION = '1.2.6' SERVER_NAME = socket.gethostname() SERVER_SOFTWAR...
gpl-2.0
7,902,708,074,817,093,000
30.482095
108
0.519957
false
MSylvia/pyNES
pynes/tests/adc_test.py
27
4340
# -*- coding: utf-8 -*- ''' ADC, Add with Carry Test This is an arithmetic instruction of the 6502. ''' import unittest from pynes.tests import MetaInstructionCase class AdcImmTest(unittest.TestCase): ''' Test the arithmetic operation ADC between decimal 16 and the content of the accumulator. ''' ...
bsd-3-clause
-7,589,190,946,173,644,000
29.34965
71
0.607604
false
awalls-cx18/gnuradio
gr-blocks/python/blocks/qa_skiphead.py
2
4748
#!/usr/bin/env python # # Copyright 2007,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
-7,484,946,431,934,732,000
34.17037
78
0.619419
false
materialsproject/pymatgen
pymatgen/io/xtb/inputs.py
1
4045
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Classes for writing XTB input files """ import logging import os from typing import Dict, Optional, Union, List from monty.json import MSONable from pymatgen.core import Molecule __author__ = "Alex Epstein...
mit
-6,063,907,934,486,460,000
34.79646
117
0.593078
false
shayneholmes/plover
plover/machine/base.py
7
5860
# Copyright (c) 2010-2011 Joshua Harlan Lifton. # See LICENSE.txt for details. # TODO: add tests for all machines # TODO: add tests for new status callbacks """Base classes for machine types. Do not use directly.""" import serial import threading from plover.exception import SerialPortException import collections S...
gpl-2.0
8,348,072,675,902,209,000
30.005291
81
0.619625
false
google-code/android-scripting
python/src/Lib/test/test_curses.py
55
8582
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import curses, sys, tempf...
apache-2.0
9,054,400,872,793,077,000
29.65
79
0.595432
false
msarana/selenium_python
ENV/Lib/site-packages/pip/utils/ui.py
25
11320
from __future__ import absolute_import from __future__ import division import itertools import sys from signal import signal, SIGINT, default_int_handler import time import contextlib import logging from pip.compat import WINDOWS from pip.utils import format_size from pip.utils.logging import get_indentation from pip...
apache-2.0
7,285,293,368,798,881,000
32.39233
79
0.62553
false
edgedb/edgedb
edb/pgsql/delta.py
1
188387
# mypy: ignore-errors # # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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 ...
apache-2.0
-3,232,752,061,285,571,600
33.091024
79
0.539443
false
wasade/qiime
qiime/remote.py
1
13012
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2012, The QIIME project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" """Contains functionality to i...
gpl-2.0
-3,657,277,499,824,228,400
41.943894
100
0.600599
false
olafhauk/mne-python
mne/utils/numerics.py
4
36095
# -*- coding: utf-8 -*- """Some utility functions.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from contextlib import contextmanager import hashlib from io import BytesIO, StringIO from math import sqrt import numbers import operator import os import os.path as op from ma...
bsd-3-clause
3,660,217,680,164,539,400
33.115312
79
0.591345
false
tiefpunkt/thingstore
thingstore/models.py
1
2775
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.utils.timezone import now, utc import calendar, datetime, string, random # Create your models here. class Thing(models.Model): name = models.CharField(max_length=255) location = models.C...
mit
-3,062,768,217,435,428,000
28.83871
142
0.718198
false
vbshah1992/microblog
flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/html5lib/filters/lint.py
250
4062
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
bsd-3-clause
2,923,873,812,112,633,300
42.677419
108
0.510094
false
FIWARE-TMForum/business-ecosystem-charging-backend
src/wstore/__init__.py
1
2300
# -*- coding: utf-8 -*- # Copyright (c) 2016 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid # This file belongs to the business-charging-backend # of the Business API Ecosystem. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
-815,755,948,076,390,000
34.921875
104
0.721618
false
aequitas/home-assistant
homeassistant/components/conversation/__init__.py
7
5514
"""Support for functionality to have conversations with Home Assistant.""" import logging import re import voluptuous as vol from homeassistant import core from homeassistant.components import http from homeassistant.components.cover import ( INTENT_CLOSE_COVER, INTENT_OPEN_COVER) from homeassistant.components.ht...
apache-2.0
7,398,157,632,579,395,000
28.967391
77
0.63765
false
valentin-krasontovitsch/ansible
lib/ansible/plugins/doc_fragments/docker.py
5
5695
# -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Docker doc fragment DOCUMENTATION = r''' options: docker_host: description: - The URL or Unix socket path used to connect to the Do...
gpl-3.0
-6,953,489,562,432,565,000
53.759615
127
0.661457
false
mbauskar/sapphire-erpnext
erpnext/stock/get_item_details.py
1
15380
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days, cstr import json from erpnext.accounts.doctype.pricing_rule.pric...
agpl-3.0
3,590,138,322,818,248,700
33.407159
126
0.692588
false
Krossom/python-for-android
python-modules/twisted/twisted/words/test/test_irc.py
49
58572
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.protocols.irc}. """ import time from twisted.trial import unittest from twisted.trial.unittest import TestCase from twisted.words.protocols import irc from twisted.words.protocols.irc import IRCClient from...
apache-2.0
6,612,655,994,867,814,000
34.010161
101
0.552363
false
ofayans/freeipa
ipaclient/remote_plugins/2_49/automount.py
8
34860
# # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # # pylint: disable=unused-import import six from . import Command, Method, Object from ipalib import api, parameters, output from ipalib.parameters import DefaultFrom from ipalib.plugable import Registry from ipalib.text import _ from ipapython.dn ...
gpl-3.0
-3,637,372,465,941,941,000
27.457143
162
0.508176
false
gustavo-guimaraes/siga
backend/venv/lib/python2.7/site-packages/unidecode/x026.py
165
4020
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '[?]', # 0x14 '[?]', # 0x...
mit
3,818,406,042,418,843,600
14.642023
16
0.254726
false
RecursiveGreen/pymod
formats/MOD.py
1
9729
import struct from pymod.constants import * from pymod.module import * from pymod.tables import * from pymod.util import * MOD_TYPES = ( ('M.K.', 'Amiga-NewTracker', 4), ('M!K!', 'Amiga-ProTracker', 4), ('M&K!', 'Amiga-NoiseTracker', 4), ('N.T.', 'Amiga-NoiseTracker?', 4), # ???, mentioned in libMod...
gpl-3.0
8,350,322,968,958,532,000
36.133588
98
0.490698
false
heiko-r/paparazzi
sw/tools/airframe_editor/gui_dialogs.py
29
1632
#!/usr/bin/env python from __future__ import print_function import gtk from os import path if gtk.pygtk_version < (2, 3, 90): print("Please upgrade your pygtk") raise SystemExit def filechooser(pathname): dialog = gtk.FileChooserDialog("Open ...", None, gtk.FILE_CHOO...
gpl-2.0
-247,942,472,923,176,500
27.631579
101
0.604779
false
kuri65536/python-for-android
python-modules/twisted/twisted/python/hook.py
90
5266
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ I define support for hookable instance methods. These are methods which you can register pre-call and post-call external functions to augment their functionality. People familiar with more esoteric languages may think of these a...
apache-2.0
7,849,887,658,224,969,000
28.751412
85
0.661033
false
leggitta/mne-python
mne/decoding/mixin.py
19
1063
class TransformerMixin(object): """Mixin class for all transformers in scikit-learn""" def fit_transform(self, X, y=None, **fit_params): """Fit to data, then transform it Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X. Pa...
bsd-3-clause
-7,794,861,591,294,883,000
34.433333
71
0.591722
false
ooici/coi-services
ion/agents/instrument/test/test_agent_persistence.py
1
29918
#!/usr/bin/env python """ @package ion.agents.instrument.test.test_agent_persistence @file ion/agents.instrument/test_agent_persistence.py @author Edward Hunter @brief Test cases for R2 instrument agent state and config persistence between running instances. """ __author__ = 'Edward Hunter' # Import pyon first for ...
bsd-2-clause
-5,372,083,795,564,110,000
37.957031
397
0.568721
false
akaszynski/vtkInterface
examples/02-plot/lighting.py
1
1906
""" Lighting Controls ~~~~~~~~~~~~~~~~~ Control aspects of the rendered mesh's lighting such as Ambient, Diffuse, and Specular. These options only work if the ``lighting`` argument to ``add_mesh`` is ``True`` (it's true by default). You can turn off all lighting by passing ``lighting=False`` to ``add_mesh``. """ # sp...
mit
3,560,562,684,647,035,000
31.862069
79
0.519937
false
nion-software/nionswift
nion/swift/HistogramPanel.py
1
37648
# standard libraries import functools import gettext import operator import typing # third party libraries import numpy # local libraries from nion.data import Core from nion.data import Image from nion.swift import DisplayPanel from nion.swift import Panel from nion.swift.model import DisplayItem from nion.swift.mod...
gpl-3.0
-7,656,245,261,976,129,000
44.968254
208
0.638467
false
leighpauls/k2cro4
third_party/webdriver/pylib/test/selenium/webdriver/common/google_one_box.py
51
1418
# Copyright 2008-2009 WebDriver committers # Copyright 2008-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 requ...
bsd-3-clause
-8,576,295,042,937,328,000
32.761905
74
0.688293
false
elit3ge/SickRage
sickbeard/providers/binsearch.py
7
3930
# Author: moparisthebest <admin@moparisthebest.com> # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-7,481,161,041,487,897,000
32.589744
176
0.599237
false
kchodorow/tensorflow
tensorflow/python/client/session_benchmark.py
32
4750
# 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
-6,427,539,207,456,145,000
39.254237
80
0.665263
false
tatsuy/ardupilot
Tools/LogAnalyzer/tests/TestDualGyroDrift.py
73
5485
from __future__ import print_function from LogAnalyzer import Test,TestResult import DataflashLog # import scipy # import pylab #### TEMP!!! only for dev # from scipy import signal class TestDualGyroDrift(Test): '''test for gyro drift between dual IMU data''' def __init__(self): Test.__init__(self) self.n...
gpl-3.0
-2,669,074,225,204,437,500
44.330579
193
0.687511
false
fragro/django-postman
setup.py
6
1183
from setuptools import setup, find_packages setup( name='django-postman', version=__import__('postman').__version__, description='User-to-User messaging system for Django, with gateway to AnonymousUser,' \ ' moderation and thread management, user & exchange filters, inbox/sent/archives/trash folder...
bsd-3-clause
622,612,458,379,260,200
37.16129
106
0.640744
false
konstruktoid/ansible-upstream
lib/ansible/modules/monitoring/icinga2_feature.py
89
4294
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Copyright (c) 2018, Ansible Project # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu...
gpl-3.0
261,821,691,930,976,100
31.530303
114
0.585235
false
Distrotech/intellij-community
python/lib/Lib/dummy_threading.py
102
2900
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``thread`` wa...
apache-2.0
7,024,737,521,234,688,000
33.939759
76
0.674138
false
dssg/cincinnati2015-public
evaluation/webapp/evaluation.py
1
5838
from datetime import datetime import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import metrics from webapp import config def weighted_f1(scores): f1_0 = scores["f1"][0] * scores["support"][0] f1_1 = scores["f1"][1] * scores["support"][1] return (f1_0 + f1_1) / (scores[...
mit
-4,625,434,244,903,208,000
36.909091
116
0.651936
false
oihane/odoo
openerp/addons/base/tests/test_orm.py
49
18125
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID DB = common.DB class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ d...
agpl-3.0
8,808,555,461,813,095,000
41.151163
137
0.569766
false
anirudhSK/chromium
tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py
2
3190
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import unittest from telemetry import test from telemetry.core import bitmap from telemetry.core import util from telemetry.core.pl...
bsd-3-clause
-3,807,787,277,986,968,000
31.55102
78
0.689655
false
hubert667/AIR
build/scripts-2.7/summarize-learning-experiment.py
1
3971
#!/usr/bin/python # This file is part of Lerot. # # Lerot 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 the License, or # (at your option) any later version. # # Lerot is distribu...
gpl-3.0
-5,586,761,019,017,056,000
36.462264
78
0.658776
false
devendermishrajio/nova_test_latest
doc/ext/nova_todo.py
64
3385
# -*- coding: utf-8 -*- # This is a hack of the builtin todo extension, to make the todo_list # more user friendly. from sphinx.ext.todo import * import re def _(s): return s def process_todo_nodes(app, doctree, fromdocname): if not app.config['todo_include_todos']: for node in doctree.traverse(tod...
apache-2.0
8,875,676,542,032,268,000
31.548077
78
0.554505
false
zuoshifan/instimager
imager/telescope.py
1
33995
import abc import numpy as np import visibility from util import util from util import typeutil from cora.util import hputil, units from caput import config def in_range(arr, min, max): """Check if array entries are within the given range. Parameters ---------- arr : np.ndarray Array to ch...
gpl-2.0
1,637,115,405,818,776,000
30.564531
163
0.592911
false
you21979/phantomjs
src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py
151
1061
#!/usr/bin/env python # Copyright (c) 2009 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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
bsd-3-clause
9,062,123,375,338,552,000
26.205128
76
0.63902
false
ovresko/erpnext
erpnext/education/doctype/fee_schedule/fee_schedule.py
7
5324
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils impor...
gpl-3.0
-6,626,682,885,636,041,000
35.217687
139
0.710368
false
iiisthu/sparkSdn
python/pyspark/conf.py
4
5745
# # 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
-854,066,612,910,973,700
32.994083
147
0.646127
false
mfjb/scikit-learn
sklearn/feature_selection/rfe.py
137
17066
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Vincent Michel <vincent.michel@inria.fr> # Gilles Louppe <g.louppe@gmail.com> # # License: BSD 3 clause """Recursive feature elimination for feature ranking""" import warnings import numpy as np from ..utils import check_X_y, safe_sqr fro...
bsd-3-clause
9,013,960,329,241,268,000
37.436937
79
0.607641
false
citrusleaf/dd-agent
utils/flare.py
5
20834
# stdlib import atexit import cStringIO as StringIO from functools import partial import glob try: import grp except ImportError: # The module only exists on Unix platforms grp = None import logging import os try: import pwd except ImportError: # Same as above (exists on Unix platforms only) pwd...
bsd-3-clause
3,683,223,257,445,479,000
38.68381
114
0.575214
false
OdifYltsaeb/django-guardian
guardian/backends.py
12
2073
from django.db import models from guardian.conf import settings from guardian.exceptions import WrongAppError from guardian.core import ObjectPermissionChecker from guardian.models import User class ObjectPermissionBackend(object): supports_object_permissions = True supports_anonymous_user = True supports...
bsd-2-clause
4,688,309,511,736,784,000
33.55
78
0.621322
false
ChemiKhazi/Sprytile
rx/linq/observable/groupby.py
3
1224
from rx import Observable from rx.internal import extensionmethod @extensionmethod(Observable) def group_by(self, key_selector, element_selector=None, key_serializer=None): """Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the...
mit
-6,568,667,219,648,725,000
35
97
0.700163
false
codingvirtual/fullstack-p4-conference
utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
apache-2.0
-1,614,123,089,165,855,200
34.022222
78
0.560279
false
zzxuanyuan/root
documentation/doxygen/converttonotebook.py
4
35547
#!/usr/bin/env python # Author: Pau Miquel i Mir <pau.miquel.mir@cern.ch> <pmm1g15@soton.ac.uk>> # Date: July, 2016 # # DISCLAIMER: This script is a prototype and a work in progress. Indeed, it is possible that # it may not work for certain tutorials, and that it, or the tutorial, might need to be # tweaked slightly to...
lgpl-2.1
-6,022,820,875,227,234,000
41.368296
663
0.594565
false
angelman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py
122
3414
# 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
1,892,203,215,410,281,500
41.675
79
0.689221
false
untrustbank/litecoin
test/functional/feature_logging.py
13
2462
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test debug logging.""" import os from test_framework.test_framework import BitcoinTestFramework class Log...
mit
-1,613,068,283,968,426,000
40.728814
90
0.622665
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py
1
8115
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
1,469,604,475,419,676,000
45.371429
202
0.64313
false
ingadhoc/odoo
addons/l10n_be_coda/wizard/__init__.py
439
1098
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
7,707,345,081,814,983,000
42.92
78
0.619308
false
40223234/w16b_test
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testwith.py
739
5806
import unittest from warnings import catch_warnings from unittest.test.testmock.support import is_instance from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call something = sentinel.Something something_else = sentinel.SomethingElse class WithTest(unittest.TestCase): def test_with_sta...
agpl-3.0
2,412,066,780,545,380,000
31.988636
130
0.593352
false
zeimusu/D1
nummeth.py
1
1770
def sample_cubic(x): return x**3 - 2*x - 1 def Dsample_cubic(x): return 3*x**2 - 2 def sign(x): if x<0: return -1 else: return 1 def bisection(f,a,b,fa,fb): """given a function, f, and an interval [a,b] in which f changes sign return a new interval [x,y] in which f changes si...
gpl-3.0
-8,754,877,294,183,066,000
21.987013
75
0.554802
false
HPPTECH/hpp_IOSTressTest
Refer/IOST_OLD_SRC/IOST_0.17/Libs/IOST_AboutDialog.py
2
2723
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : IOST_AboutDialog.py # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # Copyright : 2016 ...
mit
-4,751,123,583,145,951,000
40.257576
135
0.663974
false
pietern/caffe2
caffe2/python/helpers/conv.py
3
11062
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
3,940,835,675,468,680,700
28.736559
80
0.564545
false
diofeher/django-nfa
django/core/management/commands/runserver.py
16
3339
from django.core.management.base import BaseCommand, CommandError from optparse import make_option import os import sys class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noreload', action='store_false', dest='use_reloader', default=True, help='Tells Django to ...
bsd-3-clause
5,220,049,861,294,354,000
42.363636
109
0.566637
false
yufengg/tensorflow
tensorflow/contrib/boosted_trees/python/ops/model_ops.py
17
5122
# 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
-388,517,911,334,306,400
42.042017
95
0.70285
false
aavanian/bokeh
examples/app/crossfilter/main.py
5
2462
import pandas as pd from bokeh.layouts import row, widgetbox from bokeh.models import Select from bokeh.palettes import Spectral5 from bokeh.plotting import curdoc, figure from bokeh.sampledata.autompg import autompg_clean as df df = df.copy() SIZES = list(range(6, 22, 3)) COLORS = Spectral5 N_SIZES = len(SIZES) N_C...
bsd-3-clause
-6,240,720,743,522,132,000
27.627907
111
0.636474
false
espadrine/opera
chromium/src/tools/swarm_client/isolateserver_archive.py
2
14494
#!/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. """Archives a set of files to a server.""" import binascii import cStringIO import hashlib import itertools import logging import ...
bsd-3-clause
7,453,980,111,897,373,000
35.054726
80
0.664068
false
dobbymoodge/origin
vendor/github.com/getsentry/raven-go/docs/_sentryext/sentryext.py
36
25388
import re import os import sys import json import posixpath from itertools import chain from urlparse import urljoin from docutils import nodes from docutils.io import StringOutput from docutils.nodes import document, section from docutils.statemachine import ViewList from docutils.parsers.rst import directives from s...
apache-2.0
5,946,610,400,902,372,000
34.858757
82
0.553175
false
pythonchelle/opencomparison
apps/apiv1/tests/test_resources.py
3
1333
import json from django.test import TestCase from django.core.urlresolvers import reverse from apiv1.tests import data class ResourcesV1Tests(TestCase): base_kwargs = {'api_name': 'v1'} def setUp(self): data.load() def test_01_category(self): kwargs = {'resource_name': 'category'} ...
mit
-2,551,496,421,112,930,300
36.027778
64
0.636909
false
martinblech/pyfpm
pyfpm/pattern.py
2
10947
""" This module holds the actual pattern implementations. End users should not normally have to deal with it, except for constructing patterns programatically without making use of the pattern syntax parser. """ import re try: # python 2.x base string _basestring = basestring except NameError: # python ...
mit
-5,982,177,463,813,209,000
30.011331
80
0.54636
false
MarcosCommunity/odoo
comunity_modules/product_prices_update/wizard/wizard_update_prices.py
3
7297
# -*- coding: utf-8 -*- from openerp import fields, models, api, _ from openerp.exceptions import Warning from openerp import tools class prices_update_wizard(models.TransientModel): _name = 'product.prices_update_wizard' price_type = fields.Selection( [('list_price', 'Sale Price'), ('standard_price'...
agpl-3.0
643,656,491,633,140,200
40.697143
139
0.521036
false
orospakr/peephole
peephole/peephole_client.py
1
5019
#!/usr/bin/env python # Peephole - a D-Bus service providing access to small LCD panels # Copyright (C) 2007-2008 Andrew Clunis # 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...
gpl-3.0
-3,722,204,027,374,416,400
34.595745
100
0.635784
false
puchake/market-teller
src/data_handling/set_assembly.py
1
7628
import numpy as np import datetime as dt from os import listdir, path def gather_mats( split_mat, avg_5_mat, avg_25_mat, avg_50_mat, dates_mat, min_year ): """ Collects chosen columns from split and avg matrices and adds dates_mat indicator data for each row (each day). :param split_mat: origi...
mit
4,783,202,378,305,829,000
39.152632
79
0.601599
false
FlaPer87/django-nonrel
django/dispatch/dispatcher.py
19
8313
import weakref from django.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)) return id(target) class Signal(object): """ Base class for all signals ...
bsd-3-clause
48,644,300,632,171,970
34.075949
83
0.560447
false
margaret/python-datamuse
datamuse/test_api.py
1
1445
import unittest import datamuse from datamuse import Datamuse class DatamuseTestCase(unittest.TestCase): def setUp(self): self.api = Datamuse() self.max = 5 # words endpoint def test_sounds_like(self): args = {'sl': 'orange', 'max': self.max} data = self.api.words(**args) ...
mit
-978,083,975,301,407,400
28.489796
55
0.579931
false
jetskijoe/headphones
lib/unidecode/x0d5.py
253
4680
data = ( 'pyuk', # 0x00 'pyut', # 0x01 'pyup', # 0x02 'pyuh', # 0x03 'peu', # 0x04 'peug', # 0x05 'peugg', # 0x06 'peugs', # 0x07 'peun', # 0x08 'peunj', # 0x09 'peunh', # 0x0a 'peud', # 0x0b 'peul', # 0x0c 'peulg', # 0x0d 'peulm', # 0x0e 'peulb', # 0x0f 'peuls', # 0x1...
gpl-3.0
6,608,159,422,335,880,000
17.139535
19
0.451496
false
KiChjang/servo
tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/client_https_setup_fragment.py
14
3887
# -*- coding: utf-8 -*- """ Client HTTPS Setup ~~~~~~~~~~~~~~~~~~ This example code fragment demonstrates how to set up a HTTP/2 client that negotiates HTTP/2 using NPN and ALPN. For the sake of maximum explanatory value this code uses the synchronous, low-level sockets API: however, if you're not using sockets direct...
mpl-2.0
-4,884,118,786,317,630,000
34.327273
79
0.699177
false
farhaanbukhsh/sympy
sympy/plotting/pygletplot/color_scheme.py
85
12579
from __future__ import print_function, division from sympy import Basic, Symbol, symbols, lambdify from util import interpolate, rinterpolate, create_bounds, update_bounds from sympy.core.compatibility import range class ColorGradient(object): colors = [0.4, 0.4, 0.4], [0.9, 0.9, 0.9] intervals = 0.0, 1.0 ...
bsd-3-clause
5,139,992,811,954,619,000
36.106195
83
0.445743
false
martinribelotta/micropython
drivers/onewire/onewire.py
66
11789
""" OneWire library ported to MicroPython by Jason Hildebrand. TODO: * implement and test parasite-power mode (as an init option) * port the crc checks The original upstream copyright and terms follow. ------------------------------------------------------------------------------ Copyright (c) 2007, Jim Studt ...
mit
4,351,900,132,377,236,500
34.08631
97
0.556536
false
jashug/Lightning
serverutil.py
1
2368
"""Utility functions for the server. This includes the interface from the server implementation to the payment channel and lightning network APIs. requires_auth -- decorator which makes a view function require authentication authenticate_before_request -- a before_request callback for auth api_factory -- returns a fl...
mit
-6,842,408,270,781,522,000
34.878788
78
0.71326
false
jolevq/odoopub
addons/report_webkit/wizard/report_webkit_actions.py
382
6537
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville # # WARNING: This program as such is intended to be used by professional # programmers who take the...
agpl-3.0
-3,401,475,155,584,591,400
45.035211
165
0.47866
false
qaugustijn/stk-code
tools/update_characteristics.py
16
2103
#!/usr/bin/env python3 # # SuperTuxKart - a fun racing game with go-kart # Copyright (C) 2006-2015 SuperTuxKart-Team # # 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...
gpl-3.0
-1,202,708,781,186,728,000
41.06
103
0.676652
false
mkuron/espresso
src/python/espressomd/lbboundaries.py
1
2672
# Copyright (C) 2010-2018 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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-3.0
1,940,086,444,955,502,600
29.363636
133
0.59768
false
jeasoft/odoo
comunity_modules/house_booking/__openerp__.py
4
1098
# -*- coding: utf-8 -*- { 'name' : 'Booking management', 'version' : '1.2', 'author' : 'Alicia FLOREZ & Sébastien CHAZALLET', 'category': 'Sales Management', 'summary': 'Management of house, guestroom or hotel bookings.', 'description' : """ Manage your bookings ==================== This modul...
agpl-3.0
3,958,434,852,969,881,600
21.387755
71
0.561531
false
arokem/scipy
scipy/sparse/linalg/tests/test_norm.py
1
5427
"""Test functions for the sparse.linalg.norm module """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.linalg import norm as npnorm from numpy.testing import assert_allclose from pytest import raises as assert_raises import scipy.sparse from scipy.sparse.linalg import ...
bsd-3-clause
-6,420,942,241,783,860,000
42.071429
79
0.533628
false
dafei2015/hugula
Client/tools/site-packages/PIL/MicImagePlugin.py
13
2228
# # The Python Imaging Library. # $Id: MicImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $ # # Microsoft Image Composer support for PIL # # Notes: # uses TiffImagePlugin.py to read the actual image streams # # History: # 97-01-20 fl Created # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredri...
mit
8,036,012,872,591,752,000
22.208333
74
0.574057
false
pascalguru/florincoin
qa/rpc-tests/getblocktemplate_longpoll.py
163
3683
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCExce...
mit
1,128,812,502,512,409,200
39.032609
113
0.652729
false
liavkoren/djangoDev
tests/serializers/models.py
29
3090
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.utils import six from django...
bsd-3-clause
1,495,655,246,450,982,700
22.587786
88
0.652427
false
klebercode/lionsclub
eventi/subscriptions/tests/test_views_subscribe.py
1
3025
# coding: utf-8 from django.test import TestCase from django.core.urlresolvers import reverse as r from eventex.subscriptions.forms import SubscriptionForm from eventex.subscriptions.models import Subscription class SubscribeTest(TestCase): def setUp(self): self.resp = self.client.get(r('subscriptions:sub...
mit
2,913,360,455,850,260,000
29.26
82
0.614545
false