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
pieiscool/edited-hearthbreaker
hearthbreaker/proxies.py
2
3242
import hearthbreaker.game_objects class ProxyCharacter: def __init__(self, character_ref): if type(character_ref) is str: if character_ref.find(":") > -1: [self.player_ref, self.minion_ref] = character_ref.split(':') self.minion_ref = int(self.minion_ref) ...
mit
-4,825,175,398,938,927,000
32.42268
77
0.550586
false
bmmalone/pymisc-utils
pyllars/suppress_stdout_stderr.py
1
1295
import os class suppress_stdout_stderr(object): ''' A context manager for doing a "deep suppression" of stdout and stderr in Python, i.e. will suppress all print, even if the print originates in a compiled C/Fortran sub-function. This will not suppress raised exceptions, since exceptions are p...
mit
-98,704,784,101,661,800
38.242424
130
0.63861
false
soapy/soapy
soapy/pyqtgraph/functions.py
6
88378
# -*- coding: utf-8 -*- """ functions.py - Miscellaneous functions with no other home Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import division import warnings import numpy as np import decimal, re import ctypes import sys, struct from ...
gpl-3.0
4,420,022,668,646,250,000
37.011188
513
0.501789
false
eugena/django
tests/servers/test_basehttp.py
213
3129
from io import BytesIO from django.core.handlers.wsgi import WSGIRequest from django.core.servers.basehttp import WSGIRequestHandler from django.test import SimpleTestCase from django.test.client import RequestFactory from django.test.utils import captured_stderr class Stub(object): def __init__(self, **kwargs):...
bsd-3-clause
6,652,379,037,856,228,000
34.556818
76
0.598594
false
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/nose/plugins/attrib.py
92
9660
"""Attribute selector plugin. Oftentimes when testing you will want to select tests based on criteria rather then simply by filename. For example, you might want to run all tests except for the slow ones. You can do this with the Attribute selector plugin by setting attributes on your test methods. Here is an example:...
bsd-3-clause
6,311,979,213,802,080,000
32.776224
80
0.548344
false
muntasirsyed/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_renames.py
326
2218
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): re...
apache-2.0
7,627,773,359,990,663,000
30.685714
81
0.545537
false
SNAPPETITE/backend
flask/lib/python2.7/site-packages/sqlalchemy/engine/threadlocal.py
55
4191
# engine/threadlocal.py # Copyright (C) 2005-2016 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 """Provides a thread-local transactional wrapper around the root Engine class....
mit
1,215,146,712,466,827,300
29.369565
78
0.596278
false
tarc/gyp
test/mac/gyptest-xcode-env-order.py
34
3368
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that dependent Xcode settings are processed correctly. """ import TestGyp import TestMac import subprocess import sys if sys...
bsd-3-clause
-7,663,604,948,172,026,000
35.215054
80
0.708432
false
uruz/django-rest-framework
tests/conftest.py
84
1809
def pytest_configure(): from django.conf import settings settings.configure( DEBUG_PROPAGATE_EXCEPTIONS=True, DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}, SITE_ID=1, SECRET_KEY='not very secret in tests', ...
bsd-2-clause
4,138,831,389,181,641,000
29.661017
70
0.5644
false
danmcp/origin
vendor/github.com/google/certificate-transparency/python/utilities/log_list/cpp_generator.py
17
3757
import datetime import base64 import hashlib import math def _write_cpp_header(f, include_guard): year = datetime.date.today().year f.write(( "// Copyright %(year)d The Chromium Authors. All rights reserved.\n" "// Use of this source code is governed by a BSD-style license" " that can b...
apache-2.0
-775,905,152,896,549,500
34.443396
76
0.572265
false
johankaito/fufuka
microblog/flask/venv/lib/python2.7/site-packages/scipy/weave/tests/test_blitz_tools.py
91
7141
from __future__ import absolute_import, print_function import time import parser import warnings from numpy import (float32, float64, complex64, complex128, zeros, random, array) from numpy.testing import (TestCase, assert_equal, assert_allclose, run_module_suite) from ...
apache-2.0
5,534,109,102,705,677,000
40.517442
83
0.510293
false
jballanc/openmicroscopy
components/tools/OmeroWeb/omeroweb/webclient/webclient_utils.py
3
1880
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Fou...
gpl-2.0
7,960,092,979,529,133,000
33.181818
106
0.682979
false
georgemarshall/django
tests/template_tests/filter_tests/test_addslashes.py
48
1203
from django.template.defaultfilters import addslashes from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class AddslashesTests(SimpleTestCase): @setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'}) ...
bsd-3-clause
-2,940,784,489,140,297,700
35.454545
108
0.621779
false
DanielMe/papenburg-presentation
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
-9,151,392,022,180,901,000
30.747573
77
0.553823
false
programadorjc/django
tests/select_related_onetoone/models.py
274
2483
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __str__(self): return self.username @python_2_unicode_compatible class Us...
bsd-3-clause
4,686,381,979,817,189,000
22.875
71
0.692308
false
yamada-h/ryu
ryu/tests/unit/lib/test_stringify.py
23
2008
#!/usr/bin/env python # # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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
6,733,317,943,206,889,000
27.685714
69
0.584163
false
ApptuitAI/xcollector
collectors/lib/hadoop_http.py
1
3440
#!/usr/bin/env python # This file is part of tcollector. # Copyright (C) 2011-2013 The tcollector Authors. # # This program 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 Licen...
lgpl-3.0
7,575,059,846,827,553,000
35.210526
111
0.599419
false
mzizzi/ansible
lib/ansible/modules/files/xattr.py
41
6746
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
2,957,535,436,542,214,700
28.849558
125
0.618589
false
zerkh/GroundHog
groundhog/layers/basic.py
19
22520
""" Parent classes describing a layer, model or operator """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import copy import cPickle as pkl import logging import th...
bsd-3-clause
-1,848,301,121,673,544,400
38.165217
98
0.553641
false
spookylukey/django-autocomplete-light
autocomplete_light/autocomplete/model.py
1
4383
from django.db.models import Q __all__ = ('AutocompleteModel', ) class AutocompleteModel(object): """ Autocomplete which considers choices as a queryset. choices A queryset. limit_choices Maximum number of choices to display. search_fields Fields to search in, configurabl...
mit
1,255,776,757,682,944,800
33.511811
79
0.589779
false
jimcunderwood/MissionPlanner
Lib/unittest/case.py
42
43140
"""Test case implementation""" import collections import sys import functools import difflib import pprint import re import warnings from . import result from .util import ( strclass, safe_repr, unorderable_list_difference, _count_diff_all_purpose, _count_diff_hashable ) __unittest = True ...
gpl-3.0
-6,894,246,960,946,385,000
38.621469
109
0.55714
false
cortedeltimo/SickRage
lib/tzlocal/win32.py
11
3157
try: import _winreg as winreg except ImportError: import winreg from tzlocal.windows_tz import win_tz import pytz _cache_tz = None def valuestodict(key): """Convert a registry key's values to a dictionary.""" dict = {} size = winreg.QueryInfoKey(key)[1] for i in range(size): data = wi...
gpl-3.0
-5,614,554,218,467,360,000
32.231579
96
0.63383
false
pferreir/indico
indico/modules/attachments/__init__.py
4
2521
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import session from indico.core import signals from indico.core.logger import Logger from indi...
mit
700,917,053,364,853,000
38.390625
114
0.767156
false
mozman/ezdxf
tests/test_06_math/test_606_convexhull.py
1
5800
# Author: mozman # Purpose: test convex_hull_2d # Created: 28.02.2010 # License: MIT License import pytest from ezdxf.math import convex_hull_2d from io import StringIO def import_asc_coords(file_obj): """ Import allplan asc-format point file. returns: a dictionary of Coordinates ('name': Coordinate) ""...
mit
7,126,727,931,613,806,000
43.615385
74
0.340172
false
kaustubh-kabra/modified-xen
tools/python/xen/xm/setenforce.py
43
2560
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
-1,595,372,481,932,487,000
33.594595
77
0.596875
false
acfogarty/espressopp
src/tools/vmd.py
7
5181
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of the G...
gpl-3.0
874,844,145,832,545,900
29.476471
98
0.655279
false
gorgorom/p2pool-gor-alts
SOAPpy/Client.py
289
19821
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck...
gpl-3.0
-438,493,544,186,032,600
34.081416
102
0.518036
false
vipulroxx/sympy
sympy/physics/quantum/circuitplot.py
58
12941
"""Matplotlib based plotting of quantum circuits. Todo: * Optimize printing of large circuits. * Get this to work with single gates. * Do a better job checking the form of circuits to make sure it is a Mul of Gates. * Get multi-target gates plotting. * Get initial and final states to plot. * Get measurements to plo...
bsd-3-clause
460,678,188,040,564,800
33.417553
86
0.502975
false
ShassAro/ShassAro
Bl_project/blVirtualEnv/lib/python2.7/site-packages/rest_framework/validators.py
8
9383
""" We perform uniqueness checks explicitly on the serializer class, rather the using Django's `.full_clean()`. This gives us better separation of concerns, allows us to use single-step object creation, and makes it possible to switch between using the implicit `ModelSerializer` class and an equivalent explicit `Seria...
gpl-2.0
6,776,678,874,723,564,000
35.652344
81
0.630289
false
aleisalem/Aion
tools/visualizeFeatureVectors.py
1
5900
#!/usr/bin/python from Aion.data_generation.reconstruction.Numerical import * from Aion.data_inference.visualization.visualizeData import * from Aion.utils.graphics import * from Aion.utils.data import * import pickledb import glob, sys, time, os, argparse, hashlib def defineArguments(): parser = argparse.Argum...
gpl-3.0
-1,384,166,823,167,882,200
54.140187
198
0.635763
false
nostradamIQ/webapp
services/twitter/server.py
6
1750
#!/usr/bin/env python # -*- coding: UTF-8 -*- # serves the twitter files in redis via REST API on URL:8088 from cgi import parse_qs import requests import datetime import os import os.path import redis import json REDIS = redis.Redis() # Format: # HOUR = HH (str) # DATE = DD-MM-YYYY (str) # ARRAY = key for keywords...
gpl-3.0
-2,817,904,669,067,656,000
33.333333
180
0.632
false
chinmaygarde/mojo
tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py
63
3602
#!/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. # This is used to test the findbugs plugin, it calls # build/android/pylib/utils/findbugs.py to analyze the classes in # org.chro...
bsd-3-clause
1,305,129,703,450,591,500
33.634615
78
0.636036
false
BurtBiel/azure-cli
src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_nic/lib/models/template_link.py
1
1664
#--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------------...
mit
-7,847,887,589,772,097,000
35.977778
103
0.543269
false
memtoko/django
tests/auth_tests/urls.py
37
4594
from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.urls import urlpatterns from django.contrib.messages.api import inf...
bsd-3-clause
2,596,226,661,139,238,400
44.485149
118
0.707444
false
eranchetz/nupic
tests/unit/nupic/data/generators/anomalyzer_test.py
35
14938
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
-3,742,207,484,372,354,000
41.802292
72
0.530125
false
artmusic0/theano-learning.part02
cPickle_test/cPickle_out-v3.py
1
2430
# -*- coding: utf-8 -*- """ Created on Mon Dec 07 11:30:17 2015 @author: AkishinoShiame """ import cPickle, gzip, theano.tensor ### file out put code below try: out1 = open("CR_data-train_set.pic.txt","w") out2 = open("CR_data-train_set.lab.txt","w") out3 = open("CR_data-valid_set.pic.txt","w") out4 ...
gpl-3.0
3,504,576,916,073,188,000
24.322917
48
0.638683
false
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/shutil.py
15
39249
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
gpl-2.0
115,127,431,836,196,860
33.795213
90
0.603863
false
Griffen8280/PandoraPi_Website
wificonfig.py
1
1775
#!/usr/bin/python #import Libraries import cgi import cgitb import time import thread import subprocess # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields wifif = form.getvalue('wifi') wifif = '"%s"'%wifif passwordf = form.getvalue('password') passwordf = '"%s"'%passwordf sudo = '/us...
gpl-3.0
-6,889,896,083,043,284,000
24.724638
82
0.704225
false
Vassy/odoo
addons/calendar/__openerp__.py
33
2108
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
-3,358,352,429,545,555,500
34.728814
115
0.581594
false
allanino/nupic
tests/unit/nupic/data/inference_shifter_test.py
35
5836
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
946,607,443,575,077,800
32.930233
72
0.558259
false
edx/lettuce
tests/integration/lib/Django-1.2.5/tests/regressiontests/m2m_through_regress/tests.py
38
5744
try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core import management from django.contrib.auth.models import User from django.test import TestCase from models import (Person, Group, Membership, UserMembership, Car, Driver, CarDriver) cla...
gpl-3.0
-4,623,907,191,853,190,000
37.810811
356
0.603238
false
ruffoa/Qhacks2016
Sigma-Securities/src/sentiment/text_extract.py
1
1390
# Load the AlchemyAPI module code. import AlchemyAPI # Create an AlchemyAPI object. alchemyObj = AlchemyAPI.AlchemyAPI() # Load the API key from disk. alchemyObj.loadAPIKey("api_key.txt"); ''' # Extract a title from a web URL. result = alchemyObj.URLGetTitle("http://www.techcrunch.com/"); print result ''' # Ex...
mit
7,695,036,515,298,593,000
26.8
148
0.75036
false
minhphung171093/GreenERP
openerp/addons/hr_timesheet/report/hr_timesheet_report.py
10
2157
from openerp import tools, models, fields from openerp.addons.decimal_precision import decimal_precision as dp class hr_timesheet_report(models.Model): _name = "hr.timesheet.report" _description = "Timesheet" _auto = False _rec_name = "date" date = fields.Date('Date', readonly=True) product_...
gpl-3.0
-4,286,384,591,069,465,000
32.184615
96
0.531757
false
konklone/shaaaaaaaaaaaaa
fabfile.py
3
1652
import time from fabric.api import run, execute, env environment = "production" env.use_ssh_config = True env.hosts = ["shaaaaa"] branch = "master" repo = "git@github.com:konklone/shaaaaaaaaaaaaa.git" username = "shaaaaa" home = "/home/%s/%s" % (username, username) shared_path = "%s/shared" % home versions_path = "...
bsd-3-clause
1,631,725,637,013,626,600
24.8125
117
0.636804
false
jkyeung/XlsxWriter
dev/docs/source/conf.py
1
9926
# -*- coding: utf-8 -*- # # XlsxWriter documentation build configuration file, created by # sphinx-quickstart on Mon Jan 28 00:12:14 2013. # # 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 file. # # ...
bsd-2-clause
1,914,291,827,022,955,500
31.437908
81
0.68517
false
chrisfranzen/django
django/contrib/flatpages/tests/forms.py
113
4014
from __future__ import unicode_literals from django.conf import settings from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.models import FlatPage from django.test import TestCase from django.test.utils import override_settings from django.utils import translation @override_settings...
bsd-3-clause
-8,554,339,987,948,430,000
39.959184
115
0.649975
false
jart/tensorflow
tensorflow/python/kernel_tests/distributions/kullback_leibler_test.py
31
5251
# 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
9,175,140,346,156,724,000
31.81875
80
0.682156
false
srvg/ansible
lib/ansible/plugins/become/runas.py
29
2455
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ name: runas short_description: Run As user ...
gpl-3.0
4,101,246,815,770,822,700
34.071429
127
0.570672
false
stewartpark/django
django/utils/regex_helper.py
432
12673
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals ...
bsd-3-clause
3,470,583,257,339,907,000
35.312321
92
0.524343
false
CruiseDevice/coala
coalib/bearlib/aspects/meta.py
10
3296
import re from inspect import getmembers, signature from coala_utils.decorators import generate_repr from .base import aspectbase from .docs import Documentation from .exceptions import AspectTypeError from .taste import Taste class aspectclass(type): """ Metaclass for aspectclasses. Root aspectclass ...
agpl-3.0
9,204,589,026,033,625,000
28.428571
78
0.596784
false
ArteliaTelemac/PostTelemac
PostTelemac/meshlayerlibs/pyqtgraph/parametertree/parameterTypes.py
2
25391
from ..Qt import QtCore, QtGui from ..python2_3 import asUnicode from .Parameter import Parameter, registerParameterType from .ParameterItem import ParameterItem from ..widgets.SpinBox import SpinBox from ..widgets.ColorButton import ColorButton from ..colormap import ColorMap from .. import pixmaps as pixmaps from .. ...
gpl-3.0
-487,547,463,250,718,300
36.672107
105
0.582293
false
LiveZenLK/CeygateERP
addons/product/pricelist.py
10
19402
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from itertools import chain import time from openerp import tools from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.osv import fields, osv from openerp.tools.translate import _ import openerp.addons.dec...
gpl-3.0
-4,554,130,163,203,970,600
54.593123
246
0.571694
false
radzhome/AWS-ElasticBeanstalk-CLI
eb/linux/python3/scli/cli_parse.py
4
8680
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
apache-2.0
299,605,684,777,512,000
40.5311
101
0.601613
false
kubeflow/pipelines
samples/core/XGBoost/xgboost_sample.py
1
3056
import kfp from kfp import components chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml') convert_csv_to_apache_parquet_op = components.load_component_from_url('h...
apache-2.0
-8,116,685,501,936,734,000
43.941176
227
0.735602
false
vaginessa/python-gsmmodem
gsmmodem/exceptions.py
13
4484
""" Module defines exceptions used by gsmmodem """ class GsmModemException(Exception): """ Base exception raised for error conditions when interacting with the GSM modem """ class TimeoutException(GsmModemException): """ Raised when a write command times out """ def __init__(self, data=None): ...
lgpl-3.0
8,353,706,558,568,360,000
32.462687
153
0.62868
false
Edraak/edx-platform
common/djangoapps/config_models/admin.py
26
7283
""" Admin site models for managing :class:`.ConfigurationModel` subclasses """ from django.forms import models from django.contrib import admin from django.contrib.admin import ListFilter from django.core.cache import caches, InvalidCacheBackendError from django.core.urlresolvers import reverse from django.http import...
agpl-3.0
8,300,588,188,514,184,000
37.946524
111
0.627763
false
fjbatresv/odoo
addons/document/report/__init__.py
444
1068
# -*- 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
3,656,434,843,605,652,000
45.434783
78
0.617041
false
ARMmbed/yotta
yotta/lib/access_common.py
3
12507
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import tarfile import logging import os import hashlib import tempfile import shutil import functools import random import errno # version, , represent versions and specifica...
apache-2.0
3,971,477,955,093,395,500
34.939655
150
0.627329
false
joksnet/youtube-dl
youtube_dl/extractor/newgrounds.py
5
1287
import json import re from .common import InfoExtractor from ..utils import determine_ext class NewgroundsIE(InfoExtractor): _VALID_URL = r'(?:https?://)?(?:www\.)?newgrounds\.com/audio/listen/(?P<id>\d+)' _TEST = { u'url': u'http://www.newgrounds.com/audio/listen/549479', u'file': u'549479.m...
unlicense
8,346,957,712,387,788,000
32.868421
106
0.531469
false
flavour/tldrmp
modules/geopy/geocoders/dot_us.py
46
3194
import getpass from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder from geopy import util import csv class GeocoderDotUS(Geocoder): def __init__(self, username=None, password=None, format_string='%s'): if username and (password is None): password =...
mit
9,057,918,764,838,065,000
32.270833
115
0.527239
false
j00bar/ansible
lib/ansible/modules/monitoring/stackdriver.py
77
7327
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
4,987,047,925,056,531,000
29.902954
124
0.632441
false
gmarkall/numba
numba/tests/test_import.py
1
2535
import unittest import subprocess import sys from numba.tests.support import TestCase class TestNumbaImport(TestCase): """ Test behaviour of importing Numba. """ def run_in_subproc(self, code, flags=None): if flags is None: flags = [] cmd = [sys.executable,] + flags + ["-...
bsd-2-clause
-1,724,314,524,704,807,000
33.726027
80
0.561341
false
YannThorimbert/PyWorld2D
saveload/io.py
1
3224
import pickle, os import thorpy from PyWorld2D.mapobjects.objects import MapObject def ask_save(me): choice = thorpy.launch_binary_choice("Do you want to save this map ?") default_fn = me.get_fn().replace(".map","") if choice: fn = thorpy.get_user_text("Filename", default_fn, size=(me.W//2,40)) ...
mit
943,511,416,645,779,300
32.936842
85
0.584677
false
hezuoguang/ZGVL
WLServer/site-packages/django/core/signing.py
110
6660
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
apache-2.0
-3,004,027,110,104,332,300
32.467337
98
0.679279
false
yanirs/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py
499
1916
# 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 of conditions and the f...
mpl-2.0
-2,781,867,627,056,334,300
44.619048
73
0.753653
false
hefen1/chromium
third_party/tlslite/tlslite/utils/pem.py
116
3587
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. from .compat import * import binascii #This code is shared with tackpy (somewhat), so I'd rather make minimal #changes, and preserve the use of a2b_base64 throughout. def dePem(s, name): """Decode a PEM string into a...
bsd-3-clause
-7,729,003,407,913,335,000
35.602041
78
0.643156
false
SlimRoms/android_external_chromium_org
tools/telemetry/telemetry/timeline/thread.py
8
9322
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import itertools import telemetry.timeline.event_container as event_container import telemetry.timeline.sample as tracing_sample import telemetry.timeline.sl...
bsd-3-clause
-8,040,722,757,292,877,000
33.913858
80
0.645999
false
opendatagroup/cassius
trunk/cassius/utilities.py
2
20034
# Standard Python packages import math import numbers import time # Special dependencies import numpy # Cassius interdependencies import mathtools def unicode_number(x): """Convert a number to unicode, with appropriate substitutions.""" output = u"%g" % x if output[0] == u"-": output = u"\u2012" + output...
apache-2.0
1,923,064,915,866,844,200
33.013582
136
0.578367
false
ursine/Great68
asm6502.py
1
62272
import re class asm6502(): def __init__(self, debug=0): # print "65C02 Assembler" self.debuglevel = debug self.text_of_lines = list() # of strings self.lines = list() # parsed lines (symbol, opcode, addrmode, value self.symbols = list() # of (name,line#) tuples ...
gpl-2.0
7,200,004,177,900,780,000
40.022398
134
0.500996
false
sbalde/edx-platform
common/lib/xmodule/xmodule/capa_module.py
17
8819
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progress import...
agpl-3.0
-2,155,336,809,489,548,000
35.292181
100
0.630003
false
joeyoung658/A-Level_2016-18
Challenges/Hangman/hangman.py
1
2597
""" Hangman Game (v1.0) Name: Joe Young Date: 24/09/2016 """ #Joe Young #06/09/2016 import sys import platform if "windows" == platform.system(): sys.path.append(sys.path[0]+'\\Extra') else: sys.path.append(sys.path[0]+'//Extra') from random import * from time import * import hangmanp def load_file...
gpl-3.0
-787,107,184,751,073,900
27.228261
85
0.497497
false
gzzhanghao/mitmproxy
mitmproxy/builtins/dumper.py
1
7768
from __future__ import absolute_import, print_function, division import itertools import traceback import click from mitmproxy import contentviews from mitmproxy import ctx from mitmproxy import exceptions from mitmproxy import filt from netlib import human from netlib import strutils def indent(n, text): l = ...
mit
-3,742,639,667,237,943,300
29.825397
78
0.49086
false
mwishoff/mattsWork
checkers/board.py
1
5763
# This class will represent the checkers board. """ ~ 1 2 3 4 5 6 7 8 __________________ a | O O O O | a b | O O O O | b c | O O O O | c d | - - - - | d e | - - - - | e f | x x x x | f g | x x x x | g h | x x x x | h ------------------ ~ 1 2 3 4 5...
gpl-3.0
10,853,761,349,380,958
42.659091
140
0.4194
false
FuzzJunket/pelican-plugins
pelican_comment_system/comment.py
11
1929
# -*- coding: utf-8 -*- """ Author: Bernhard Scheirle """ from __future__ import unicode_literals import os from pelican.contents import Content from pelican.utils import slugify from . import avatars class Comment(Content): mandatory_properties = ('author', 'date') default_template = 'None' def __init...
agpl-3.0
1,577,367,528,522,460,400
29.140625
79
0.585277
false
core-bitcoin/bitcoin
qa/rpc-tests/sendheaders.py
49
25728
#!/usr/bin/env python3 # Copyright (c) 2014-2016 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.mininode import * from test_framework.test_framework import BitcoinTestFramework from...
mit
-3,622,751,721,158,552,000
41.455446
116
0.609103
false
ioos/system-test
Theme_3_Species_and_Habitat/Scenario_3A_SeaBirds/Scenario_3A_Important_Bird_Areas/Scenario_3A_SeaBirds.py
3
8441
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from utilities import css_styles css_styles() # <markdowncell> # # IOOS System Test - Theme 3 - Scenario A - [Description](https://github.com/ioos/system-test/wiki/Development-of-Test-Themes#scenario-3a-assessing-seabird-vulnerability-in-the-bering-sea...
unlicense
-3,764,390,677,663,873,500
34.919149
287
0.690913
false
hakatashi/youtube-dl
youtube_dl/extractor/raywenderlich.py
21
6169
from __future__ import unicode_literals import re from .common import InfoExtractor from .vimeo import VimeoIE from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, merge_dicts, try_get, unescapeHTML, unified_timestamp, urljoin, ) class RayWenderlichIE(InfoEx...
unlicense
402,726,569,759,379,700
33.463687
87
0.495542
false
stacywsmith/ansible
lib/ansible/modules/network/bigswitch/bigmon_chain.py
19
4937
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage Big Monitoring Fabric service chains # (c) 2016, Ted Elhourani <ted@bigswitch.com>, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
-3,814,506,080,868,456,400
30.246835
111
0.635204
false
asm666/sympy
sympy/physics/quantum/tests/test_dagger.py
124
1512
from sympy import I, Matrix, symbols, conjugate, Expr, Integer from sympy.physics.quantum.dagger import adjoint, Dagger from sympy.external import import_module from sympy.utilities.pytest import skip def test_scalars(): x = symbols('x', complex=True) assert Dagger(x) == conjugate(x) assert Dagger(I*x) =...
bsd-3-clause
-8,761,343,181,438,974,000
21.235294
73
0.597222
false
5GExchange/nffg
setup.py
2
1754
# Copyright 2017 Janos Czentye, Balazs Nemeth, Balazs Sonkoly # # 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...
apache-2.0
3,969,531,793,147,027,000
37.130435
74
0.676169
false
bigswitch/nova
nova/objects/instance.py
1
54454
# Copyright 2013 IBM Corp. # # 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
-7,012,962,444,557,100,000
41.409657
79
0.574669
false
chrisfilda/edx_platform
common/lib/xmodule/xmodule/error_module.py
17
6742
""" Modules that get shown to the users when an error has occurred while loading or rendering other modules """ import hashlib import logging import json import sys from lxml import etree from xmodule.x_module import XModule, XModuleDescriptor from xmodule.errortracker import exc_info_to_str from xmodule.modulestore ...
agpl-3.0
-6,421,013,819,790,700,000
33.752577
108
0.616286
false
gezb/osmc
package/mediacenter-addon-osmc/src/script.module.xmltodict/lib/xmltodict.py
53
12257
#!/usr/bin/env python "Makes working with XML feel like you are working with JSON" from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl try: # pragma no cover from cStringIO import StringIO except ImportError: # pragma no cover try: from...
gpl-2.0
-2,007,292,212,503,994,600
33.142061
79
0.568899
false
rdobson/transfervm
transfertests/manualnetwork_test.py
2
1862
import httplib import logging import unittest import urllib2 import testsetup import transferclient import moreasserts M = 1024 * 1024 def assertVdiZero(self, ip, port, record, vdi_mb): # Make a new record with the IP and port fields updated r = dict(record, ip=ip, port=port) moreasserts.assertVdiIsZero...
gpl-2.0
1,429,681,209,166,125,800
42.302326
189
0.711063
false
odoo-turkiye/odoo
addons/account_check_writing/report/__init__.py
446
1066
# -*- 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
-6,435,167,647,636,016,000
41.64
78
0.614447
false
RedhawkSDR/integration-gnuhawk
components/noise_source_f/tests/test_noise_source_f.py
1
4535
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
gpl-3.0
-4,021,284,875,487,565,000
47.763441
133
0.588534
false
thinkasoft/ProyectoRD-dev
l10n_ve_imex/model/customs_form.py
1
15041
# -*- encoding: utf-8 -*- ############################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (c) 2013 Vauxoo C.A. (http://openerp.com.ve/) # All Rights Reserved ############# Credits ###########################################...
agpl-3.0
3,804,743,600,213,934,600
44.304217
86
0.48155
false
fzheng/codejam
lib/python2.7/site-packages/pip/cmdoptions.py
136
15878
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this de...
mit
-2,850,494,018,197,240,000
24.692557
79
0.6065
false
collex100/odoo
addons/account_anglo_saxon/__openerp__.py
264
2393
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
-588,743,138,808,674,600
45.921569
117
0.645215
false
knowledgepoint-devs/askbot-devel
askbot/views/meta.py
1
8905
""" :synopsis: remaining "secondary" views for askbot This module contains a collection of views displaying all sorts of secondary and mostly static content. """ from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.core.paginator import Paginator, ...
gpl-3.0
1,259,977,100,954,009,300
35.346939
111
0.614037
false
wrigri/libcloud
docs/examples/storage/publish_static_website_on_cf.py
58
1117
from StringIO import StringIO from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver CloudFiles = get_driver(Provider.CLOUDFILES_US) driver = CloudFiles('username', 'api key') container = driver.create_container(container_name='my_website') iterator1 = StringIO('<p>Hello Worl...
apache-2.0
2,585,626,817,369,463,300
38.892857
72
0.709042
false
pulinagrawal/nupic
tests/unit/nupic/data/generators/pattern_machine_test.py
15
3539
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
1,103,883,519,793,893,200
27.772358
77
0.671094
false
c4fcm/MediaMeter-Dashboard
app/core/authentication.py
1
2010
import hashlib import datetime from flask_login import UserMixin, AnonymousUserMixin import mediacloud as mcapi import app from app.core import db, mc # User class class User(UserMixin): def __init__(self, username, key, active=True, profile=None): self.name = username self.id = key self...
apache-2.0
-5,627,978,080,478,066,000
24.443038
72
0.61393
false
ncteisen/grpc
tools/run_tests/performance/scenario_config.py
7
44124
# Copyright 2016 gRPC 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 applicable law or agreed to in writing...
apache-2.0
-4,455,269,191,608,428,500
36.939811
126
0.527377
false
freedesktop-unofficial-mirror/papyon
papyon/media/conference.py
6
12851
# -*- coding: utf-8 -*- # # papyon - a python client library for Msn # # Copyright (C) 2009 Collabora Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or #...
gpl-2.0
-4,380,307,798,580,094,500
35.508523
120
0.632869
false
noodle-learns-programming/aiohttp
tests/test_client_functional.py
2
55390
"""Http client functional tests.""" import binascii import gc import io import os.path import json import http.cookies import asyncio import unittest from unittest import mock import aiohttp from aiohttp import client, helpers from aiohttp import test_utils from aiohttp.multidict import MultiDict from aiohttp.multipa...
apache-2.0
4,658,819,973,825,618,000
39.239099
79
0.515595
false
sorenk/ansible
lib/ansible/modules/storage/purestorage/purefa_pg.py
50
5569
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
-3,168,184,809,409,525,000
25.645933
92
0.645717
false
garbear/EventGhost
eg/Classes/DigitOnlyValidator.py
1
2037
# This file is part of EventGhost. # Copyright (C) 2005 Lars-Peter Voss <bitmonster@eventghost.org> # # EventGhost 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 # (a...
gpl-2.0
2,692,391,852,733,284,400
25.16
76
0.604811
false
NPRA/EmissionCalculatorLib
emission/planner.py
2
13540
import json try: from urllib.request import urlopen # Python 3 from urllib.parse import urlencode except ImportError: from urllib import urlopen # Python 2 from urllib import urlencode import socket import math from . import vehicles, log from . import EmissionsJsonParser from .exceptions import Rout...
bsd-2-clause
-9,172,585,734,373,595,000
33.807198
120
0.581315
false
tafia/servo
python/mozlog/mozlog/structured/scripts/format.py
46
1310
import argparse import sys from .. import handlers, commandline, reader def get_parser(add_help=True): parser = argparse.ArgumentParser("format", description="Format a structured log stream", add_help=add_help) parser.add_argument("--input", action="store", default=None, ...
mpl-2.0
5,951,907,479,081,310,000
32.589744
101
0.592366
false