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
mjbrewer/testindex
magnum/tests/unit/common/test_safeutils.py
17
3947
# Copyright 2011 Justin Santa Barbara # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-6,538,411,188,926,366,000
38.868687
78
0.617178
false
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_io.py
8
129855
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
gpl-2.0
7,882,316,852,661,960,000
35.932594
96
0.559616
false
paulmadore/Eric-IDE
6-6.0.9/eric/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py
2
4235
# -*- coding: utf-8 -*- # Copyright (c) 2003 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to enter the commit message. """ from __future__ import unicode_literals import pysvn from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot from PyQt5.QtWidgets import QWidget, QDialogButt...
gpl-3.0
8,617,319,802,010,897,000
30.37037
77
0.599292
false
HadiOfBBG/pegasusrises
csvploader.py
1
3875
import csv from collections import defaultdict import StringIO from google.appengine.ext import blobstore from google.appengine.ext.webapp import blobstore_handlers from jinja_template import JinjaTemplating from google.appengine.ext import db from google.appengine.api import memcache from xml.dom import minidom from m...
apache-2.0
8,669,387,720,736,268,000
34.236364
147
0.60671
false
jacksapper/math-thesis
ode.py
1
2110
# -*- coding: utf-8 -*- #---IMPORTS--- import numpy as np import matplotlib.pyplot as plt #---CONSTANTS--- LBOUND = 0. UBOUND = 1. POINTS = 2**7 EPSILON = 10**-9 INITIAL = (0,1) #Matrix is O(POINTS**2) #---DERIVED CONSTANTS--- INTERVAL_LENGTH = (UBOUND-LBOUND)/(POINTS-1) D0 = .5*(np.eye(POINTS-1,POINTS) \ + np.roll(n...
gpl-3.0
-7,026,794,695,713,071,000
22.455556
54
0.563507
false
Treisy/Django-Angular-Demo
product_wiki/urls.py
1
1159
from django.conf.urls import patterns, include, url from django.contrib import admin from .views import Index, Logout, FormView, PartialView from products.forms import ProductForm, ProductImageForm, ProductTagForm admin.autodiscover() partial_patterns = patterns('', url(r'^hero.html$', PartialView.as_view(temp...
mit
7,677,513,963,242,823,000
41.925926
96
0.695427
false
batxes/4c2vhic
SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models12285.py
2
17580
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
-7,974,832,448,865,208,000
46.131367
75
0.699659
false
danielkitta/libsigrokdecode
decoders/rgb_led_spi/pd.py
8
2072
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Matt Ranostay <mranostay@gmail.com> ## ## 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...
gpl-3.0
4,428,087,484,116,131,000
29.925373
76
0.616313
false
vortex-ape/scikit-learn
sklearn/datasets/__init__.py
4
3794
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_breast_cancer from .base import load_boston from .base import load_diabetes from .base import load_digi...
bsd-3-clause
-360,707,843,709,354,500
35.480769
71
0.684238
false
devoncarew/sky_engine
ci/check_gn_format.py
4
1616
#!/usr/bin/env python # # Copyright 2013 The Flutter 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 sys import subprocess import os import argparse import errno import shutil def GetGNFiles(directory): directory = os.path.ab...
bsd-3-clause
-4,946,851,548,739,962,000
30.686275
99
0.681312
false
wolverineav/neutron
neutron/services/tag/tag_plugin.py
4
5152
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
-9,123,757,742,919,907,000
39.25
78
0.644992
false
bentilly/heroes
lib/flask_restful/inputs.py
16
9016
from calendar import timegm from datetime import datetime, time, timedelta from email.utils import parsedate_tz, mktime_tz import re import aniso8601 import pytz # Constants for upgrading date-based intervals to full datetimes. START_OF_DAY = time(0, 0, 0, tzinfo=pytz.UTC) END_OF_DAY = time(23, 59, 59, 999999, tzinfo...
apache-2.0
365,122,012,350,359,200
31.2
96
0.618678
false
not-nexus/shelf
shelf/routes/artifact.py
2
5229
from flask import request, Blueprint from shelf.endpoint_decorators import decorators import shelf.response_map as response_map artifact = Blueprint("artifact", __name__) @artifact.route("/<bucket_name>/artifact/", methods=["GET", "HEAD"], defaults={"path": "/"}) @artifact.route("/<bucket_name>/artifact/<path:path>"...
mit
4,755,239,638,220,954,000
32.305732
98
0.707592
false
dodobas/osm-export-tool2
api/tests/test_views.py
1
35098
# -*- coding: utf-8 -*- import json import logging import os import uuid from unittest import skip from mock import patch from django.contrib.auth.models import Group, User from django.contrib.gis.geos import GEOSGeometry, Polygon from django.core.files import File from rest_framework import status from rest_framewo...
bsd-3-clause
-5,353,230,866,664,354,000
43.427848
143
0.581087
false
nevercast/home-assistant
homeassistant/components/http.py
4
16083
""" homeassistant.components.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides an API and a HTTP interface for debug purposes. For more details about the RESTful API, please refer to the documentation at https://home-assistant.io/developers/api/ """ from datetime import timedelta import gzip from http import coo...
mit
-639,019,440,193,216,800
32.5762
79
0.603308
false
freeworldxbmc/pluging.video.Jurassic.World.Media
resources/lib/resolvers/kingfiles.py
3
1884
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any ...
gpl-3.0
-6,724,552,432,619,386,000
33.888889
102
0.623673
false
dontnod/weblate
weblate/trans/tests/test_models.py
1
15261
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
gpl-3.0
-6,364,523,919,517,820,000
32.60793
80
0.620134
false
jhayworth/config
.emacs.d/elpy/rpc-venv/lib/python2.7/site-packages/jedi/inference/syntax_tree.py
2
34097
""" Functions inferring the syntax tree. """ import copy from parso.python import tree from jedi._compatibility import force_unicode, unicode from jedi import debug from jedi import parser_utils from jedi.inference.base_value import ValueSet, NO_VALUES, ContextualizedNode, \ iterator_to_value_set, iterate_values ...
gpl-3.0
5,916,072,233,174,465,000
39.256198
97
0.588087
false
chubbypanda/principles-of-computing
practice_activity0.py
5
4720
# Practice Activity 0 for Principles of Computing class, by k., 06/18/2014 # Solitaire Mancala; GUI is provided in codeskulptor (obscure Python interpretter for the class) at: # http://www.codeskulptor.org/#poc_mancala_gui.py class SolitaireMancala(object): ''' class to run the game logic ''' def __...
mit
1,366,974,064,081,838,600
32.239437
100
0.607203
false
vladimir-ipatov/ganeti
lib/cmdlib/common.py
1
44087
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. # # 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...
gpl-2.0
7,406,222,431,369,780,000
35.136885
80
0.664323
false
mcameron/ansible-modules-extras
cloud/misc/proxmox.py
3
17106
#!/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
4,040,748,815,247,288,300
37.440449
197
0.649129
false
ToontownUprising/src
otp/level/EntrancePoint.py
3
1417
from toontown.toonbase.ToontownGlobals import * from direct.directnotify import DirectNotifyGlobal import BasicEntities class EntrancePoint(BasicEntities.NodePathEntity): def __init__(self, level, entId): BasicEntities.NodePathEntity.__init__(self, level, entId) self.rotator = self.attachNewNode('...
mit
-2,693,942,233,462,477,000
34.425
86
0.661962
false
heromod/migrid
user-projects/miginterface/examples/mpi/mpi_example1.py
1
1613
#!/usr/bin/python """ An example script for running an MPI grid job using the mig interface module. """ import miginterface as mig import time, sys def main(): """ Run an mpi job on a grid resource. To run in local mode please install mpi. """ # mig.debug_mode_on() # uncomment to enable debug print...
gpl-2.0
-6,414,359,659,538,479,000
34.065217
119
0.652201
false
miur/miur
logger/setup.py
1
1353
# # SPDX-FileCopyrightText: 2020 Dmytro Kolomoiets <amerlyq@gmail.com> and contributors. # # SPDX-License-Identifier: GPL-3.0-only # # USAGE: call once from main() of each application to register ZMQ log handler # __all__ = [ 'setup_logging', ] import logging import zmq from zmq.log import handlers def setup_lo...
gpl-3.0
3,699,259,694,381,430,300
27.1875
132
0.636364
false
bjlittle/python-csp
test/test_contexts.py
2
1464
#!/usr/bin/python """ Test the CSP class, found in csp.csp and its context managers. TODO: Replace this with proper unit testing. Copyright (C) Sarah Mount, 2010. 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 Softwa...
gpl-2.0
-3,423,141,524,189,817,000
23
69
0.643443
false
wangscript/qb-archetype
quickbundle-rmwebdemo/WebContent/WEB-INF/jython/qb/tools/support/str/transfer_sql.py
2
5536
#coding=UTF-8 import os from os.path import join import sys import re import datetime from os import listdir from os.path import isdir, normpath import math import cPickle import codecs #from qb.tools.support.zip import zip_file #from qb.tools.helper import date_helper import codecs start_time = datetime.datetime.now(...
apache-2.0
4,247,049,595,630,720,000
42.944444
155
0.525108
false
jfinkels/networkx
networkx/algorithms/flow/tests/test_maxflow_large_graph.py
5
4847
# -*- coding: utf-8 -*- """Maximum flow algorithms test suite on large graphs. """ __author__ = """Loïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2010 Loïc Séguin-C. <loicseguin@gmail.com> # All rights reserved. # BSD license. import os from nose.tools import * import networkx as nx from networkx.algorithms...
bsd-3-clause
-5,912,663,946,936,184,000
31.945578
78
0.545736
false
google/timesketch
test_tools/sigma_verify_rules.py
1
9226
# Copyright 2020 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 a...
apache-2.0
-4,156,244,198,128,402,000
35.904
79
0.626816
false
spthaolt/VTK
Examples/Modelling/Python/Delaunay3D.py
9
1692
#!/usr/bin/env python # This example shows how to use Delaunay3D with alpha shapes. import vtk # The points to be triangulated are generated randomly in the unit # cube located at the origin. The points are then associated with a # vtkPolyData. math = vtk.vtkMath() points = vtk.vtkPoints() for i in range(0, 25): ...
bsd-3-clause
8,348,779,720,164,846,000
27.2
69
0.76182
false
simonwagner/mergepbx
src/plist/antlr/PlistParser.py
4
16877
# $ANTLR 3.2 Sep 23, 2009 12:02:23 Plist.g 2013-12-12 18:02:36 import sys from .runtime.antlr3 import * from .runtime.antlr3.compat import set, frozenset from collections import OrderedDict from ..escape import unescape_string # for convenience in actions HIDDEN = BaseRecognizer.HIDDEN # token types BRAC...
gpl-3.0
-557,432,898,065,954,100
27.605085
159
0.486639
false
attwad/python-osc
pythonosc/parsing/osc_types.py
1
14013
"""Functions to get OSC types from datagrams and vice versa""" import struct from pythonosc.parsing import ntp from datetime import datetime, timedelta, date from typing import Union, Tuple class ParseError(Exception): """Base exception for when a datagram parsing error occurs.""" class BuildError(Exception)...
unlicense
7,643,043,762,583,972,000
32.685096
86
0.634768
false
benrudolph/commcare-hq
custom/_legacy/psi/reports/__init__.py
2
12431
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType from corehq.apps.reports.filters.base import BaseSingleOptionFilter from corehq.apps.reports.filters.fixtures import AsyncDrillableFilter from corehq.apps.reports.standard import CustomProjectReport, DatespanMixin from corehq.apps.reports.basic im...
bsd-3-clause
-6,300,116,814,458,997,000
35.031884
126
0.628027
false
msparapa/das
das/optimalcontrol/tests/test_full_ocp_to_bvp_sol.py
1
1966
from ...bvpsol.bvpsol import * from ...bvpsol.bvp import * from ..optimalcontrol import * tol = 0.0005 def test_brachistochrone_collocation_unreduced(): OCP = Problem() Independent('t', 's', OCP) State('x', 'v*cos(theta)', 'm', OCP) State('y', 'v*sin(theta)', 'm', OCP) State('v', '-g*sin(theta)', ...
gpl-3.0
-4,708,808,203,404,356,000
40.829787
112
0.572737
false
Learningtribes/edx-platform
cms/djangoapps/contentstore/views/course.py
1
71400
""" Views related to operations on course objects """ import copy import json import logging import random import string # pylint: disable=deprecated-module from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.u...
agpl-3.0
-7,682,541,370,460,719,000
42.377886
142
0.638978
false
rachelalbert/CS294-26_code
project6_code/main.py
1
1979
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp2d from glob import glob fpath = '/Users/rachel/Desktop/tarot_cards/*.png' flist = glob(fpath) print('loading images...') images = [] for fname in flist: images.append(plt.imread(fname)) def shift_image(im, shift): delta...
mit
3,345,637,577,840,648,700
28.117647
86
0.553815
false
swayand/Checkmate
data/translator.py
1
1656
#!/usr/bin/env python import os, sys import json if len(sys.argv) < 2: exit("Usage: ./translator (file_var.j in old format) (file_var.j in new format)") infile = sys.argv[1] outfile = sys.argv[2] injfile = open(infile, "rb") parameters = json.loads(injfile.read()) injfile.close() if "version" in parameters and...
gpl-2.0
1,584,684,689,227,110,000
32.12
84
0.664855
false
abdullah2891/remo
remo/profiles/migrations/0051_auto__add_field_userprofile_date_left_program.py
3
11137
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.date_left_program' db.add_column('profiles_userprofile', 'date_left_program', ...
bsd-3-clause
-3,303,939,626,081,606,000
84.022901
198
0.55356
false
pombreda/cogen
examples/callevt-profile.py
4
1476
from cogen.common import * count = 0 @coroutine def cogen_b(): global count count += 1 yield yield yield @coroutine def cogen_a(prio): for i in xrange(10000): yield events.Call(cogen_b, prio=prio) def normal_a(): global count count += 1 yield yield ...
mit
8,679,295,486,521,430,000
21.806452
53
0.508808
false
radosuav/QGIS
python/plugins/processing/ProcessingPlugin.py
2
14116
# -*- coding: utf-8 -*- """ *************************************************************************** ProcessingPlugin.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
-6,861,216,234,714,790,000
38.518207
114
0.661327
false
nelson-liu/scikit-learn
examples/svm/plot_svm_scale_c.py
19
5409
""" ============================================== Scaling the regularization parameter for SVCs ============================================== The following example illustrates the effect of scaling the regularization parameter when using :ref:`svm` for :ref:`classification <svm_classification>`. For SVC classificati...
bsd-3-clause
3,283,908,061,440,834,000
34.821192
79
0.647439
false
saurabh6790/frappe
frappe/tests/test_website.py
1
3138
from __future__ import unicode_literals import unittest import frappe from frappe.website import render from frappe.website.utils import get_home_page from frappe.utils import set_request class TestWebsite(unittest.TestCase): def test_home_page_for_role(self): frappe.delete_doc_if_exists('User', 'test-user-for-...
mit
-1,457,067,847,997,497,300
29.764706
89
0.69949
false
calliope-project/calliope
calliope/backend/pyomo/constraints/dispatch.py
1
11639
""" Copyright (C) since 2013 Calliope contributors listed in AUTHORS. Licensed under the Apache 2.0 License (see LICENSE file). dispatch.py ~~~~~~~~~~~~~~~~~ Energy dispatch constraints, limiting production/consumption to the capacities of the technologies """ import pyomo.core as po from calliope.backend.pyomo.ut...
apache-2.0
1,616,952,395,252,772,900
33.434911
127
0.644299
false
YosefLab/scVI
scvi/core/models/base.py
1
9396
import inspect import logging import os import pickle from abc import ABC, abstractmethod from typing import Optional, Sequence import numpy as np import rich import torch from anndata import AnnData from rich.text import Text from scvi import _CONSTANTS, settings from scvi.data import get_from_registry, transfer_ann...
bsd-3-clause
729,081,549,799,827,000
30.850847
95
0.578012
false
kylehogan/hil
examples/dbinit.py
4
1405
#!/usr/bin/python """ Register nodes with HaaS. This is intended to be used as a template for either creating a mock HaaS setup for development or to be modified to register real-life nodes that follow a particular pattern. In the example environment for which this module is written, there are 10 nodes which have IPM...
apache-2.0
-2,548,514,659,423,620,600
30.931818
79
0.706762
false
terianil/minimongo
setup.py
2
1695
# -*- coding: utf-8 -*- import os import sys import subprocess try: from setuptools import find_packages, setup, Command except ImportError: from distutils.core import find_packages, setup, Command here = os.path.abspath(os.path.dirname(__file__)) DESCRIPTION = "Minimal database Model management for MongoD...
bsd-2-clause
8,395,541,138,083,490,000
25.076923
68
0.653687
false
Nikea/VisTrails
vistrails/gui/modules/list_configuration.py
2
5171
from PyQt4 import QtCore, QtGui from vistrails.core.system import get_vistrails_basic_pkg_id from vistrails.gui.modules.module_configure import StandardModuleConfigurationWidget class ListConfigurationWidget(StandardModuleConfigurationWidget): """ Configuration widget allowing to choose the number of ports. ...
bsd-3-clause
618,113,028,576,103,700
38.174242
104
0.635467
false
afronski/playground-other
python/samples/rabbitmq-python/06.RPC/rpc_client.py
2
1182
import pika import uuid class FibonacciRPCClient(object): def __init__(self): self.connection = pika.BlockingConnection(pika.ConnectionParameters(host = "localhost")) self.channel = self.connection.channel() result = self.channel.queue_declare(exclusive = True) self.callback_queue...
mit
1,069,546,968,288,265,300
30.131579
114
0.659898
false
bratsche/Neutron-Drive
google_appengine/lib/webob_1_1_1/tests/test_misc.py
5
3987
import cgi, sys from cStringIO import StringIO from webob import html_escape, Response from webob.multidict import * from nose.tools import eq_ as eq, assert_raises def test_html_escape(): for v, s in [ # unsafe chars ('these chars: < > & "', 'these chars: &lt; &gt; &amp; &quot;'), (' ', '...
bsd-3-clause
1,691,257,841,240,426,800
26.881119
82
0.534738
false
ageron/tensorflow
tensorflow/examples/speech_commands/models_test.py
19
4908
# 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
-5,846,188,645,384,907,000
39.9
80
0.682559
false
ellipsis14/dolfin
test/unit/python/book/test_chapter_1.py
3
5087
#!/usr/bin/env py.test """ Unit tests for Chapter 1 (A FEniCS tutorial). """ # Copyright (C) 2011-2014 Hans Petter Langtangen and Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published b...
gpl-3.0
-5,259,891,238,202,269,000
25.357513
86
0.643601
false
RoboCupULaval/RULEngine
Util/Vector.py
3
8830
# Under MIT License, see LICENSE.txt import math as m from .Position import Position from .Pose import Pose class Vector(object): def __init__(self, length=1.0, direction=0.0): """ Args: length (float): norme du vecteur direction (float): orientation en radian...
mit
-61,378,902,882,137,520
34.584677
111
0.565666
false
lvdongr/spark
python/pyspark/serializers.py
3
23903
# # 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
-8,785,708,909,053,550,000
31.388889
100
0.621972
false
dataxu/jenkins-job-builder
jenkins_jobs/modules/notifications.py
2
3891
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
apache-2.0
-2,689,454,665,151,219,000
36.057143
79
0.63634
false
xzturn/tensorflow
tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/partially_shaped_variables.py
20
1677
# Copyright 2019 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
-3,186,341,485,859,464,700
43.131579
199
0.666667
false
bernard357/shellbot
shellbot/lists/__init__.py
1
5677
# 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 use ...
apache-2.0
-4,369,942,357,568,065,500
29.686486
77
0.586225
false
edfungus/Crouton-ESP8266-Example
luatool.py
1
11277
#!/usr/bin/env python2 # # ESP8266 luatool # Author e-mail: 4ref0nt@gmail.com # Site: http://esp8266.ru # Contributions from: https://github.com/sej7278 # # 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 # Fou...
mit
2,816,334,924,600,987,000
35.028754
132
0.562118
false
anentropic/py-mysql2pgsql
mysql2pgsql/lib/postgres_writer.py
1
11590
from __future__ import absolute_import import re from cStringIO import StringIO from datetime import datetime, date, timedelta from psycopg2.extensions import QuotedString, Binary, AsIs from .writer import Writer class PostgresWriter(Writer): """Base class for :py:class:`mysql2pgsql.lib.postgres_file_writer.Po...
mit
6,767,887,667,339,594,000
50.057269
173
0.534944
false
developerworks/horizon
horizon/dashboards/nova/instances_and_volumes/volumes/forms.py
1
4640
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, Inc. # All rights reserved. """ Views for managing Nova volumes. """ import logging from django import shortcuts from django.contrib import messages from django.utils.translation import ugettext as _ from horizon import api from horizon import fo...
apache-2.0
-1,323,758,585,300,165,000
38.65812
78
0.55194
false
valkyriesavage/invenio
modules/bibsched/lib/bibtask.py
1
38662
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ## Licens...
gpl-2.0
8,104,900,002,468,720,000
40.978284
220
0.594253
false
crscardellino/thesis
thesis/dataset/base.py
1
9238
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import numpy as np import pickle from collections import namedtuple from gensim.models import Word2Vec from scipy.sparse import csr_matrix _InstanceId = namedtuple('InstanceId', 'corpus file sentence lemma idx') class CorpusDataset(...
mit
2,390,123,767,422,768,000
37.65272
118
0.575666
false
lsaffre/lino-welfare
lino_welfare/modlib/active_job_search/models.py
1
1802
# -*- coding: UTF-8 -*- # Copyright 2014-2017 Rumma & Ko Ltd # License: BSD (see file COPYING for details) """ The :xfile:`models.py` module for the :mod:`lino_welfare.modlib.active_job_search` app. """ from django.db import models from django.utils.translation import ugettext_lazy as _ from lino.api import dd fro...
agpl-3.0
3,020,308,845,371,457,500
25.5
73
0.660377
false
changkun/AugmentedTouch
src/script/new/KMMoment.py
2
2415
import time import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.cluster import MiniBatchKMeans from sklearn.cross_validation import train_test_split from loaddata import loadUserData from loaddata import splitMomentDataByFeature from loaddata import splitMomentData...
gpl-2.0
7,702,797,521,755,485,000
28.096386
138
0.713043
false
chuan9/chromium-crosswalk
remoting/tools/remote_test_helper/jsonrpclib.py
51
9346
# 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. """Module to implement the JSON-RPC protocol. This module uses xmlrpclib as the base and only overrides those portions that implement the XML-RPC protocol. T...
bsd-3-clause
5,556,331,560,828,983,000
24.675824
75
0.664455
false
mitdbg/modeldb
protos/gen/python/protos/public/modeldb/Job_pb2_grpc.py
2
3840
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from ..modeldb import Job_pb2 as modeldb_dot_Job__pb2 class JobServiceStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc...
mit
4,864,343,337,607,885,000
38.587629
88
0.715625
false
tu-darmstadt-ros-pkg/hector_flexbe_behavior
hector_flexbe_states/src/hector_flexbe_states/move_along_path.py
1
2254
#!/usr/bin/env python import math import rospy import tf from flexbe_core import EventState, Logger from flexbe_core.proxy import ProxyActionClient, ProxyPublisher from hector_move_base_msgs.msg import MoveBaseAction, MoveBaseGoal, MoveBaseActionPath from rospy import Time from visualization_msgs.msg import MarkerAr...
bsd-3-clause
-2,808,486,417,456,087,000
21.767677
100
0.680124
false
niun/pyoscope
tests/realtime_plot_demo.py
2
1378
#!/usr/bin/env python # # PyUSBtmc # display_channel.py # # Copyright (c) 2011 Mike Hadmack # Copyright (c) 2010 Matt Mets # This code is distributed under the MIT license ''' realtime_plot_demo.py Realtime plot of both channels This is a fork of realtime_chart.py to use the newer RigolScope interface ...
mit
5,325,496,992,515,884,000
25.5
77
0.69521
false
psav/cfme_tests
cfme/tests/containers/test_start_page.py
3
2702
# -*- coding: utf-8 -*- from collections import namedtuple import pytest from cfme.containers.overview import ContainersOverviewView from cfme.containers.node import NodeAllView from cfme.containers.pod import PodAllView from cfme.containers.service import ServiceAllView from cfme.containers.provider import Container...
gpl-2.0
-7,240,210,812,952,324,000
43.295082
94
0.747964
false
qedi-r/home-assistant
homeassistant/components/plugwise/climate.py
2
9762
"""Plugwise Climate component for HomeAssistant.""" import logging import voluptuous as vol import haanna import homeassistant.helpers.config_validation as cv from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice from homeassistant.components.climate.const import ( CURRENT_HVAC_HEAT, CU...
apache-2.0
2,685,025,198,586,849,300
33.132867
86
0.631121
false
BelledonneCommunications/linphone
wrappers/cpp/genwrapper.py
1
21775
#!/usr/bin/python # # Copyright (c) 2010-2019 Belledonne Communications SARL. # # This file is part of Liblinphone. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
-3,895,618,410,983,869,400
39.324074
147
0.712147
false
darkryder/django
tests/test_runner/test_parallel.py
2
2056
import unittest from django.test import SimpleTestCase from django.test.runner import RemoteTestResult from django.utils import six try: import tblib except ImportError: tblib = None class ParallelTestRunnerTest(SimpleTestCase): """ End-to-end tests of the parallel test runner. These tests are ...
bsd-3-clause
1,228,747,512,798,652,200
29.686567
112
0.645428
false
TBillTech/domsocket
domsocket/data/test/app.py
1
10245
#!/usr/bin/python """Copyright (c) 2015 TBillTech. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. """ from domsocket.zmq_runner import ZMQRunner, domsocket_js_path ...
mpl-2.0
3,703,522,824,436,072,400
38.103053
88
0.599317
false
ericsnowcurrently/micropython
tests/pyb/rtc.py
25
1430
import pyb from pyb import RTC rtc = RTC() print(rtc) # make sure that 1 second passes correctly rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0)) pyb.delay(1001) print(rtc.datetime()[:7]) def set_and_print(datetime): rtc.datetime(datetime) print(rtc.datetime()[:7]) # make sure that setting works correctly set_and_...
mit
-3,832,771,854,199,834,600
27.039216
47
0.641958
false
CKehl/pylearn2
pylearn2/training_algorithms/sgd.py
6
48163
""" Stochastic Gradient Descent and related functionality such as learning rate adaptation, momentum, and Polyak averaging. """ from __future__ import division __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow, David Warde-Farley"] __license__ =...
bsd-3-clause
7,701,738,028,510,791,000
39.202838
79
0.595935
false
ylatuya/Flumotion
flumotion/common/signals.py
2
3177
# -*- Mode: Python; test-case-name: flumotion.test.test_common_signals -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License ...
gpl-2.0
-509,771,151,639,042,200
32.442105
74
0.629839
false
SimVascular/VTK
Filters/Modeling/Testing/Python/TestBoxFunction.py
20
1707
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() box = vtk.vtkBox() box.SetXMin(0,2,4) box.SetXMax(2,4,6) sample = vtk.vtkSampleFunction() sample.SetSampleDimensions(30,30,30) sample.SetImplicitFunction(box) sample.SetModelBounds(0,...
bsd-3-clause
6,586,355,180,249,756,000
30.611111
57
0.797891
false
udp3f/gemini
gemini/gim.py
3
20905
#!/usr/bin/env python from __future__ import absolute_import, print_function import sys from collections import Counter, defaultdict from . import GeminiQuery from . import sql_utils try: from compiler import compile except ImportError: basestring = str from .gemini_constants import * from .gemini_bcolz impor...
mit
1,041,871,655,229,049,500
38.667932
136
0.492131
false
mano3m/CouchPotatoServer
libs/pyasn1/type/univ.py
20
39555
# ASN.1 "universal" data types import operator, sys from pyasn1.type import base, tag, constraint, namedtype, namedval, tagmap from pyasn1.codec.ber import eoo from pyasn1.compat import octets from pyasn1 import error # "Simple" ASN.1 types (yet incomplete) class Integer(base.AbstractSimpleAsn1Item): tagSet = bas...
gpl-3.0
-8,862,421,050,925,229,000
37.143684
117
0.551182
false
vrbagalkote/avocado-misc-tests-1
generic/nstress.py
1
2316
#!/usr/bin/env python # 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 ...
gpl-2.0
-7,630,319,848,840,054,000
36.354839
106
0.62867
false
ruschelp/cortex-vfx
test/IECoreHoudini/ops/objectDebug/objectDebug-1.py
12
1247
from IECore import * class objectDebug( Op ) : def __init__( self ) : Op.__init__( self, "Op that prints out debug information about an object parameter.", ObjectParameter( name = "result", description = "A pass through of the input object parameter.", defaultValue = NullObject(), type = Typ...
bsd-3-clause
-1,610,881,850,505,618,000
22.980769
87
0.655172
false
zhounanshu/Flask-AppBuilder
examples/quickimages/app/views.py
3
3138
from models import Person, PersonGroup from flask.ext.appbuilder.views import ModelView, BaseView from flask.ext.appbuilder.charts.views import GroupByChartView from flask.ext.appbuilder.models.group import aggregate_count from flask.ext.appbuilder.models.sqla.interface import SQLAInterface from flask.ext.appbuilder.wi...
bsd-3-clause
6,342,332,440,027,834,000
39.753247
120
0.641491
false
kidmaple/CoolWall
user/python/Lib/ihooks.py
4
17026
"""Import hook support. Consistent use of this module will make it possible to change the different mechanisms involved in loading modules independently. While the built-in module imp exports interfaces to the built-in module searching and loading algorithm, and it is possible to replace the built-in function __impor...
gpl-2.0
2,783,969,446,145,869,300
32.384314
77
0.595912
false
teleshoes/n9-button-monitor
src/config.py
1
9729
#!/usr/bin/python #N9 Button Monitor #Copyright (C) 2013 Elliot Wolk #Copyright (C) 2013 Lcferrum # #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your opt...
gpl-3.0
6,974,518,348,037,700,000
36.419231
79
0.641895
false
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/idlelib/zoomheight.py
5
1571
"Zoom a window to maximum height." import re import sys from idlelib import macosx class ZoomHeight: def __init__(self, editwin): self.editwin = editwin def zoom_height_event(self, event=None): top = self.editwin.top zoomed = zoom_height(top) menu_status = 'Restore' if zoom...
apache-2.0
-2,960,363,129,399,956,500
25.627119
73
0.569064
false
LukeCarrier/py3k-pyrg
pyrg/pyrg.py
1
8423
#!/usr/bin/env python """pyrg - colorized Python's UnitTest Result Tool""" from configparser import ConfigParser from subprocess import Popen, PIPE from select import poll, POLLIN from optparse import OptionParser import sys import re import os import pwd __version__ = '0.2.6' __author__ = 'Hideo Hattroi <hhatto.jp@gm...
bsd-3-clause
7,217,174,423,480,943,000
33.101215
73
0.51763
false
spulec/moto
moto/rds2/exceptions.py
2
4182
from __future__ import unicode_literals from jinja2 import Template from werkzeug.exceptions import BadRequest class RDSClientError(BadRequest): def __init__(self, code, message): super(RDSClientError, self).__init__() template = Template( """ <RDSClientError> <Err...
apache-2.0
-3,694,546,571,745,217,000
33.278689
135
0.636777
false
hurdlea/SimpleCV
SimpleCV/tests/test_stereovision.py
12
5828
# /usr/bin/python # To run this test you need python nose tools installed # Run test just use: # nosetest test_stereovision.py # import os, sys, pickle from SimpleCV import * from nose.tools import with_setup, nottest VISUAL_TEST = True # if TRUE we save the images - otherwise we DIFF against them - the default is...
bsd-3-clause
-3,789,183,460,749,299,700
30
106
0.630233
false
Daniel-CA/odoo-addons
account_invoice_temporal/tests/test_account_invoice_temporal.py
4
1531
# -*- coding: utf-8 -*- # (c) 2015 Esther Martín - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html import openerp.tests.common as common from openerp import exceptions class TestAccountInvoiceTemporal(common.TransactionCase): def setUp(self): super(TestAccountInvoiceTemporal, s...
agpl-3.0
-4,319,140,326,759,959,600
37.25
77
0.651634
false
awong1900/platformio
platformio/builder/scripts/nxplpc.py
3
1364
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ Builder for NXP LPC series ARM microcontrollers. """ from os.path import join from shutil import copyfile from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, DefaultEnvironment, SConscript) ...
mit
6,722,294,072,934,264,000
22.118644
74
0.68915
false
tomduijf/home-assistant
tests/components/sensor/test_mqtt.py
3
1220
""" tests.components.sensor.test_mqtt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests mqtt sensor. """ import unittest import homeassistant.core as ha import homeassistant.components.sensor as sensor from tests.common import mock_mqtt_component, fire_mqtt_message class TestSensorMQTT(unittest.TestCase): """ Test the MQ...
mit
-6,412,931,878,990,657,000
28.756098
69
0.583607
false
syazdan25/SE17-Project
CrossVal.py
1
4486
# -*- coding: utf-8 -*- """ Created on Tue Mar 14 18:06:24 2017 @author: mahna """ from flask import Flask, render_template, flash, request from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField import nltk import numpy from nltk.classify import SklearnClassifier from ...
gpl-3.0
115,934,505,233,283,630
26.226415
117
0.654926
false
TJYee/Sandbox
yahtzee/yahtzee.py
1
2567
import random class Die(object): """ A class used to represent a Die ... Attributes ---------- __value : int The current value of the Die (default is None) side_min_value : int The lowest side value (default is 1) side_count : int The n...
mit
-6,398,496,092,662,879,000
27.208791
73
0.582392
false
GoogleChrome/big-rig
app/src/thirdparty/telemetry/internal/backends/mandoline/mandoline_browser_backend.py
8
4613
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re from telemetry.core import exceptions from telemetry.core import util from telemetry.internal.backends import browser_backend from telemetry.inter...
apache-2.0
1,090,366,271,570,663,000
33.17037
80
0.725992
false
luwensu/autotest-docker
subtests/docker_cli/top/top.py
1
4045
r""" Summary --------- Verify output from docker top against a test-controlled container matches content expectations. Operational Summary ---------------------- #. start container #. execute docker top against container #. verify output """ from time import sleep from time import time from dockertest.subtest impor...
gpl-2.0
-3,137,200,714,642,721,300
33.57265
74
0.571075
false
jianghuaw/nova
nova/tests/unit/virt/hyperv/test_block_device_manager.py
9
20392
# Copyright (c) 2016 Cloudbase Solutions Srl # # 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 applicab...
apache-2.0
8,594,211,752,975,120,000
45.557078
79
0.574539
false
JackDanger/luigi
luigi/contrib/hadoop.py
4
34538
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0
-1,559,398,363,594,478,000
34.242857
143
0.58411
false
canvasnetworks/canvas
website/drawquest/apps/palettes/tests.py
2
1853
from canvas.tests.tests_helpers import (CanvasTestCase, create_content, create_user, create_group, create_comment, create_staff) from drawquest.apps.drawquest_auth.models import AnonymousUser from services import Services, override_service class TestPalettes(CanvasTestCase): ...
bsd-3-clause
1,000,820,004,689,059,100
36.816327
114
0.651376
false
TomAugspurger/pandas
pandas/tests/indexes/datetimes/test_indexing.py
1
23710
from datetime import date, datetime, time, timedelta import numpy as np import pytest import pandas as pd from pandas import DatetimeIndex, Index, Timestamp, date_range, notna import pandas._testing as tm from pandas.core.indexes.base import InvalidIndexError from pandas.tseries.offsets import BDay, CDay START, END...
bsd-3-clause
-7,807,238,278,642,369,000
35.143293
88
0.548714
false
TheMOOCAgency/edx-platform
common/djangoapps/third_party_auth/middleware.py
10
2526
"""Middleware classes for third_party_auth.""" from social.apps.django_app.middleware import SocialAuthExceptionMiddleware from . import pipeline class ExceptionMiddleware(SocialAuthExceptionMiddleware): """Custom middleware that handles conditional redirection.""" def get_redirect_uri(self, request, excep...
agpl-3.0
-6,565,105,050,527,088,000
44.107143
115
0.706651
false
canwe/NewsBlur
apps/rss_feeds/migrations/0010_stories_per_month.py
18
11962
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'StoriesPerMonth' db.create_table('rss_feeds_storiespermonth', ( ('id', self.gf...
mit
2,089,193,026,125,378,000
68.953216
157
0.57248
false
klugjohannes/alembic-sqlite
alembic_sqlite/op.py
1
1388
from alembic import op import sqlalchemy as sa def drop_column_sqlite(tablename, columns): """ column dropping functionality for SQLite """ # we need copy to make a deep copy of the column attributes from copy import copy # get the db engine and reflect database tables engine = op.get_bind() ...
mit
6,067,963,066,410,273,000
30.545455
77
0.68804
false