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
Jozhogg/iris
docs/iris/example_tests/test_anomaly_log_colouring.py
1
1304
# (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris 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 ve...
lgpl-3.0
4,757,317,864,431,538,000
33.315789
74
0.736963
false
dgsantana/arsenalsuite
cpp/lib/PyQt4/examples/opengl/samplebuffers.py
20
6279
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
gpl-2.0
-3,656,334,288,124,663,300
32.047368
94
0.607899
false
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sklearn/ensemble/tests/test_weight_boosting.py
23
17698
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true, assert_greater from sklearn.utils.testing impo...
mit
1,253,682,346,333,298,700
36.102725
79
0.632162
false
delectable/DIGITS
tools/test_analyze_db.py
3
1449
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. import os.path import shutil import tempfile import lmdb import numpy as np from . import analyze_db as _ import caffe.io import caffe_pb2 class BaseTestWithDB(object): SAME_SHAPE = True PASS_DEFAULTS = True PASS_FORCE = True PASS_COU...
bsd-3-clause
-5,870,222,944,748,095,000
23.15
85
0.610766
false
michaelrosejr/pyaos6
netmiko/pluribus/pluribus_ssh.py
1
1221
from __future__ import unicode_literals from netmiko.base_connection import BaseConnection class PluribusSSH(BaseConnection): '''Common methods for Pluribus.''' def __init__(self, *args, **kwargs): super(PluribusSSH, self).__init__(*args, **kwargs) self._config_mode = False def disable_p...
mit
7,345,471,844,455,937,000
32
98
0.620803
false
centricular/meson
mesonbuild/modules/gnome.py
1
45416
# Copyright 2015-2016 The Meson development team # 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
4,630,229,603,091,870,000
43.788955
133
0.550489
false
openstack-packages/rdopkg
rdopkg/actionmods/rdoinfo.py
2
4098
from __future__ import print_function import distroinfo import distroinfo.query from distroinfo.info import DistroInfo from rdopkg import exception, helpers from rdopkg.utils import log from rdopkg.conf import cfg def print_releases(info): print("{t.bold}releases & repos:{t.normal}".format(t=log.term)) for r...
apache-2.0
9,216,457,177,252,371,000
30.523077
77
0.546852
false
peragro/peragro-at
src/damn_at/damnfs/path.py
1
5453
""" Path utilities for DAMN FS """ from __future__ import absolute_import from __future__ import print_function import os import six from six.moves import range FILE_MARKER = '<children>' def attach(file_id, trunk, branch=None): """Insert a branch of directories on its trunk.""" if branch is None: br...
bsd-3-clause
5,155,483,631,779,823,000
30.33908
111
0.557491
false
plotly/plotly.py
packages/python/plotly/plotly/validators/histogram2dcontour/_hoverlabel.py
2
2081
import _plotly_utils.basevalidators class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="hoverlabel", parent_name="histogram2dcontour", **kwargs ): super(HoverlabelValidator, self).__init__( plotly_name=plotly_name, ...
mit
-950,340,162,685,917,800
38.264151
82
0.534839
false
JEStaubach/playrestapi
webapp.py
1
17812
import cherrypy import json from collections import OrderedDict import mysql.connector import db_conf import sys import atexit import os import os.path from oauth2client import client, crypt import urllib2 from urlparse import urlparse #sys.stdout = sys.stderr #cherrypy.config.update({'environment': 'embedded'}) clie...
mit
1,731,798,065,227,048,000
44.208122
204
0.542163
false
apyrgio/synnefo
snf-common/synnefo/lib/dictconfig.py
9
22911
# This is a copy of the Python logging.config.dictconfig module. # It is provided here for backwards compatibility for Python versions # prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose an...
gpl-3.0
1,480,099,828,052,946,400
40.43038
105
0.524508
false
ity/pants
src/python/pants/backend/codegen/tasks/apache_thrift_gen.py
1
6470
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re ...
apache-2.0
-5,773,585,216,296,320,000
38.45122
100
0.687172
false
bgarrels/sky
sky/standalone/lxmlTree.py
2
2580
#!/usr/bin/env python3 import asciitree class Node(object): def __init__(self, name, children): self.name = name self.children = children def __str__(self): return(self.name) def lineage(self): total = [self.name] + [y.name for y in self.children] for x in self.c...
bsd-3-clause
5,129,618,601,137,610,000
29
92
0.540698
false
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/numpy/polynomial/tests/test_hermite.py
58
18297
"""Tests for hermite module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.hermite as herm from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_modu...
mit
8,856,769,253,943,782,000
32.449726
78
0.513691
false
indygreg/pymake
pymake/process.py
1
11645
""" Skipping shell invocations is good, when possible. This wrapper around subprocess does dirty work of parsing command lines into argv and making sure that no shell magic is being used. """ #TODO: ship pyprocessing? import multiprocessing, multiprocessing.dummy import subprocess, shlex, re, logging, sys, traceback, ...
mit
4,634,528,347,883,023,000
31.257618
156
0.573207
false
willthames/ansible
lib/ansible/modules/monitoring/pagerduty.py
77
9529
#!/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
3,604,723,450,411,811,000
29.155063
126
0.615804
false
threemeninaboat3247/raipy
raipy/Examples/GPIB_query.py
1
1639
# -*- coding: utf-8 -*- import PyQt5.QtCore from PyQt5.QtGui import QColor import time import numpy as np import raipy.UserClassBase as UserClassBase from datetime import datetime class programThread(UserClassBase.ThreadBase): def run(self): ###The main body of your program ###example: Call self.lc...
mit
4,396,178,931,229,026,300
46.352941
211
0.668738
false
vhernandez/jwsProcessor
src/jwsprocessor/selection_page.py
1
13774
#!/usr/bin/env python # -*- coding: UTF-8 -*- import pygtk pygtk.require("2.0") import gtk import gobject import os, sys from tools import SpectraDB, _ from smoothing_selection import ShowSpectrumPanel from jws_filechooser import JwsFileChooserDialog class SelectionPage(gtk.HPaned): def __init__(self, assistant, c...
gpl-2.0
-401,158,781,915,181,600
42.968051
92
0.556678
false
wxiang7/airflow
airflow/example_dags/example_trigger_target_dag.py
6
1702
from airflow.operators import BashOperator, PythonOperator from airflow.models import DAG from datetime import datetime import pprint pp = pprint.PrettyPrinter(indent=4) # This example illustrates the use of the TriggerDagRunOperator. There are 2 # entities at work in this scenario: # 1. The Controller DAG - the DAG ...
apache-2.0
2,461,589,530,892,142,000
33.734694
100
0.716216
false
kieselai/bashForEach.py
commandBuilder.py
1
4749
# Written by: Anthony Kiesel # URL: https://github.com/kieselai/bashForEach.py import re # Local imports from simpleLogger import SimpleLogger from formatter import Formatter class CommandBuilder: @staticmethod def InsertCommandArguments(commandStr, params): """ Builds commands using a template str...
apache-2.0
50,734,568,756,427,970
52.359551
125
0.657191
false
marcuschia/ShaniXBMCWork
other/livestreamchanges/myFunctions.py
12
1537
import traceback,sys def addme(page_data,a,b): return a+b def call_site(Cookie_Jar,url_to_call): try: import urllib2 import base64 import uuid req = urllib2.Request(url_to_call) str_guid=str(uuid.uuid1()).upper() str_guid=base64.b64encode(str_guid) ...
gpl-2.0
-5,156,817,942,796,603,000
41.971429
177
0.641509
false
bigzz/autotest
server/hosts/base_classes.py
6
2668
# # Copyright 2007 Google Inc. Released under the GPL v2 """ This module defines the base classes for the server Host hierarchy. Implementation details: You should import the "hosts" package instead of importing each type of host. Host: a machine on which you can run programs RemoteHost: a remote mac...
gpl-2.0
-4,457,147,430,933,432,300
33.205128
77
0.685532
false
dakcarto/QGIS
tests/src/python/test_syntactic_sugar.py
7
2532
# -*- coding: utf-8 -*- """QGIS Unit tests for some syntactic sugar in python .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ...
gpl-2.0
9,139,700,097,430,051,000
29.506024
86
0.540284
false
michaupl/materialsapp
materials/migrations/0002_set_type_on_detail.py
1
5253
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
apache-2.0
2,335,361,993,696,155,600
64.6625
194
0.562155
false
zerc/nimply
comments/views.py
1
3254
# coding: utf-8 from datetime import datetime from collections import OrderedDict from flask import request, Blueprint from flask_restful import Resource, Api from app import app, mongo comments_app = Blueprint('comments', __name__) api = Api(comments_app) class CommentsWrapper(object): def __init__(self, db, ...
gpl-2.0
-4,950,754,413,283,852,000
28.853211
78
0.544868
false
orlenko/bccf
src/mezzanine/pages/tests.py
3
8807
from django.db import connection from django.template import Context, Template from mezzanine.conf import settings from mezzanine.core.models import CONTENT_STATUS_PUBLISHED from mezzanine.core.request import current_request from mezzanine.pages.models import Page, RichTextPage from mezzanine.urls import PAGES_SLUG f...
unlicense
-6,495,044,293,988,946,000
40.739336
78
0.612808
false
bruceyou/NewsBlur
apps/profile/views.py
1
20939
# -*- encoding: utf-8 -*- import stripe import datetime from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.views.decorators.csrf import csrf_protect from django.contrib.auth import logout as logout_user from django.contrib.auth import login as log...
mit
7,787,415,308,863,567,000
36.158082
117
0.633061
false
bmya/server-tools
sql_request_abstract/models/sql_request_mixin.py
2
9036
# Copyright (C) 2015 Akretion (<http://www.akretion.com>) # Copyright (C) 2017 - Today: GRAP (http://www.grap.coop) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import re import uuid from io import StringIO import base64 from psycopg2...
agpl-3.0
-8,622,797,667,682,290,000
33.357414
79
0.570938
false
OmeGak/indico
indico/modules/events/layout/util.py
2
13982
# This file is part of Indico. # Copyright (C) 2002 - 2019 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 __future__ import unicode_literals from collections import OrderedDict, defaultdict from itertools i...
mit
5,241,790,921,630,120,000
37.517906
120
0.653268
false
simfarm/ansible-playbooks
test-playbooks/inventories/more_inventories/dyn_inventory.py
3
2333
#!/usr/bin/env python from argparse import ArgumentParser from pprint import pprint inventory = {'group_four': {'hosts': ['group_four_host_0{}'.format(i) for i in range(1, 6)] + ['group_four_and_five_host_0{}'.format(i) for i in range(1, 6)] + ['g...
gpl-3.0
-6,321,689,080,875,422,000
57.325
132
0.49207
false
uday1889/gensim
gensim/similarities/docsim.py
38
27839
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module contains functions and classes for computing similarities across a collection of documents in the Vector Space Model. T...
gpl-3.0
-6,361,021,586,887,310,000
41.180303
158
0.624304
false
midnightradio/gensim
gensim/test/test_big.py
2
2434
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking processing/storing large inputs. """ import logging import unittest import os import numpy as np im...
gpl-3.0
8,973,228,674,481,336,000
32.342466
96
0.614215
false
vyscond/cocos
cocos/audio/SDL/dll.py
4
10357
#!/usr/bin/env python """ """ import six __docformat__ = 'restructuredtext' __version__ = '$Id: $' from ctypes import * from ctypes.util import find_library import sys # Private version checking declared before SDL.version can be # imported. class _SDL_version(Structure): _fields_ = [('major', c_ubyte), ...
bsd-3-clause
991,794,302,125,215,000
38.083019
99
0.548904
false
CXQERP/ODOOERP
addons/l10n_be_invoice_bba/invoice.py
2
12421
# -*- 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 under ...
agpl-3.0
2,143,271,697,212,474,400
51.855319
165
0.512117
false
Tejal011089/huntercamp_erpnext
erpnext/accounts/party.py
17
8239
# 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 import datetime from frappe import _, msgprint, scrub from frappe.defaults import get_user_permissions from frappe.utils import add_days,...
agpl-3.0
-8,767,121,103,044,999,000
36.454545
116
0.70494
false
roopali8/tempest
tempest/stress/actions/ssh_floating.py
8
7744
# 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 # di...
apache-2.0
533,804,512,134,053,950
38.917526
79
0.556302
false
awkspace/ansible
lib/ansible/modules/network/fortios/fortios_firewall_policy6.py
24
37823
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, 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 3 of the Lic...
gpl-3.0
-6,296,476,045,752,827,000
40.246456
138
0.474235
false
wasade/qiime
scripts/count_seqs.py
1
3088
#!/usr/bin/env python # File created on 29 May 2011 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Greg Caporaso" __email__ = "g...
gpl-2.0
6,489,183,005,794,179,000
32.565217
199
0.602655
false
styra/sharedmem
tests/test_sharedmem.py
1
4768
import numpy import sharedmem import time from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_, run_module_suite) import sys def run_idle(pool): def work(i): time.sleep(0.4) with pool: now = time.time() pool.map(work, ...
gpl-3.0
1,804,939,340,465,828,600
25.786517
78
0.566695
false
kylemsguy/limbo
test/test_plugins/test_stock.py
15
1168
# -*- coding: UTF-8 -*- import os import sys from nose.tools import eq_ import vcr DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins')) from stock import on_message, stockprice def test_apple(): with vcr.use_cassette('test/fixtures/stock_apple.yaml'): ...
mit
6,204,202,997,615,499,000
28.923077
64
0.614396
false
rnestler/servo
tests/wpt/web-platform-tests/css/tools/w3ctestlib/OutputFormats.py
80
7230
#!/usr/bin/python # CSS Test Source Manipulation Library # Initial code by fantasai, joint copyright 2010 W3C and Microsoft # Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license> import re import os from os.path import join, exists, splitext, dirname, basename from Sources import XHTML...
mpl-2.0
-4,598,831,042,036,456,000
33.927536
131
0.634578
false
ehabkost/avocado-vt
shared/deps/serial/serial_host_send_receive.py
8
6458
#!/usr/bin/python import os import socket import struct import optparse try: import hashlib except ImportError: import md5 class Md5MissMatch(Exception): def __init__(self, md5_pre, md5_post): Exception.__init__(self, md5_pre, md5_post) self.md5_pre = md5_pre self.md5_post = md5...
gpl-2.0
5,238,338,230,037,466,000
29.752381
76
0.574946
false
rodrigolucianocosta/ProjectParking
ProjectParking/Parking/django-localflavor-1.1/build/lib.linux-x86_64-2.7/localflavor/fi/fi_municipalities.py
17
10416
# -*- coding: utf-8 -*- from __future__ import unicode_literals #: An alphabetical list of Finnish municipalities for use as `choices` in a formfield. MUNICIPALITY_CHOICES = ( ('akaa', "Akaa"), ('alajarvi', "Alajärvi"), ('alavieska', "Alavieska"), ('alavus', "Alavus"), ('artjarvi', "Artjärvi"), ...
mpl-2.0
-5,813,406,947,525,378,000
28.543103
86
0.528353
false
sumanau7/Ele_CC_Sumanau
lib/traitlets/config/tests/test_configurable.py
4
14095
# encoding: utf-8 """Tests for traitlets.config.configurable""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import logging from unittest import TestCase import nose.tools as nt from nose import SkipTest from traitlets.config.configurable import ( Configur...
apache-2.0
-1,090,027,966,061,592,300
29.842451
86
0.562682
false
mjirik/lisa
tests/vein_basin_segmentation_test.py
1
19794
# ! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import sys from PyQt5.QtWidgets import * import os.path # imcut_path = os.path.join(path_to_script, "../../imcut/") # sys.path.insert(0, imcut_path) import unittest import numpy as np import pytest from lisa import organ_segm...
bsd-3-clause
-8,242,498,691,151,463,000
34
125
0.557522
false
jsok/unleashed
tests/test_meta_resources.py
1
3102
from nose.tools import ( assert_true, assert_false, assert_equals, assert_is_none, assert_raises ) from unittest import TestCase from unleashed.resources.fields import Field from unleashed.resources import UnleashedResource class EndpointTestCase(TestCase): def test_endpoint_autocreated(self): ...
mit
6,770,713,216,156,039,000
21.485507
55
0.505158
false
cockpit-project/system-api-roles
roles/selinux/library/selogin.py
5
9073
#!/usr/bin/python # (c) 2017, Petr Lautrbach <plautrba@redhat.com> # Based on seport.py module (c) 2014, Dan Keder <dan.keder@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 ...
gpl-3.0
-8,821,499,433,613,315,000
27.98722
137
0.600463
false
lavvy/osmc
package/mediacenter-addon-osmc/src/script.module.osmcsetting.logging/resources/osmc/OSMCSetting.py
9
8961
''' The settings for OSMC are handled by the OSMC Settings Addon (OSA). In order to more easily accomodate future changes and enhancements, each OSMC settings bundle (module) is a separate addon. The module can take the form of an xbmc service, an xbmc script, or an xbmc module, but it must be installed into the u...
gpl-2.0
-8,756,576,332,101,238,000
41.070423
191
0.677045
false
ThreatCentral/blackberries
src/ThreatCentral/transforms/common/entities.py
1
10597
#!/usr/bin/env python # (c) Copyright [2016] Hewlett Packard Enterprise Development LP 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 Unless required by applicable # law or agreed to in writ...
apache-2.0
-8,450,055,789,026,379,000
48.288372
131
0.741059
false
saschpe/creatrepo
createrepo/merge.py
4
5665
#!/usr/bin/python -tt # 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 i...
gpl-2.0
8,877,100,491,299,574,000
36.766667
91
0.602648
false
WindfallLabs/dslw
tests/test_system.py
1
1781
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_system.py: dslw Testing Suite Copyright (c) 2017 Garin Wally MIT License; see LICENSE """ import os import unittest from ctypes import WinDLL from _ctypes import FreeLibrary from glob import glob import apsw import dslw ALL_DLLS = [ "libfreexl-1.dll", ...
mit
4,667,068,809,762,401,000
23.067568
79
0.540146
false
sajeeshcs/nested_quota_final
nova/network/driver.py
2
1369
# Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
-3,912,460,570,263,867,400
30.113636
78
0.702703
false
pvillela/ServerSim
microservices_example.py
1
7179
""" Comparison of microservice deployment alternatives. """ from __future__ import print_function import random import simpy from serversim import * # fi = open("simout.txt", "w") fi = sys.stdout usersCurve = [(0, 900), (50, 650), (100, 900), (150, 650)] def microservices_example(num_users, weight1, weight2, ...
mit
-6,845,698,734,378,844,000
45.316129
124
0.587268
false
andreadean5/python-hpOneView
hpOneView/resources/storage/storage_volume_attachments.py
1
6229
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
mit
-4,063,065,250,446,386,700
40.251656
109
0.62803
false
bvisness/the-blue-alliance
controllers/admin/admin_user_controller.py
3
1795
from datetime import datetime import logging import os from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.ext.webapp import template from controllers.base_controller import LoggedInHandler from models.account import Account class AdminUserList(LoggedInHandler): """...
mit
7,112,287,158,958,968,000
26.19697
97
0.623398
false
wschoenell/chimera
src/chimera/core/event.py
5
1076
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # chimera - observatory automation system # Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br> # 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 S...
gpl-2.0
6,942,478,345,447,145,000
30.647059
69
0.733271
false
weiyuanke/mykeystone
tests/test_policy.py
3
6593
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Piston Cloud Computing, 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://ww...
apache-2.0
-3,997,542,202,065,827,000
35.627778
78
0.62263
false
sgraham/nope
build/android/pylib/results/flakiness_dashboard/json_results_generator.py
51
23492
# 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. # # Most of this file was ported over from Blink's # Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py # Tools/Scripts/webkitpy/co...
bsd-3-clause
-5,855,518,757,506,057,000
32.704448
83
0.650477
false
RobberPhex/mysql-connector-python
lib/mysqlx/protocol.py
2
16120
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptions to ...
gpl-2.0
-6,779,041,607,374,676,000
41.986667
78
0.611414
false
rishig/zulip
zerver/lib/queue.py
1
14151
from collections import defaultdict import logging import random import threading import time from typing import Any, Callable, Dict, List, Mapping, Optional, Set, Union from django.conf import settings import pika import pika.adapters.tornado_connection from pika.adapters.blocking_connection import BlockingChannel f...
apache-2.0
1,195,079,782,446,228,200
41.881818
109
0.615504
false
paplorinc/intellij-community
python/helpers/py3only/docutils/transforms/parts.py
44
6948
# $Id: parts.py 6073 2009-08-06 12:21:10Z milde $ # Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer; Dmitry Jemerov # Copyright: This module has been placed in the public domain. """ Transforms related to document parts. """ __docformat__ = 'reStructuredText' import sys from docutils import nodes from ...
apache-2.0
-7,092,598,360,172,141,000
37.815642
78
0.609096
false
Tivix/django-common
django_common/decorators.py
2
1852
from __future__ import print_function, unicode_literals, with_statement, division try: from functools import wraps except ImportError: from django.utils.functional import wraps import inspect from django.conf import settings from django.http import HttpResponseRedirect def ssl_required(allow_non_ssl=False)...
mit
9,117,531,020,581,332,000
30.389831
81
0.642009
false
javaos74/neutron
neutron/plugins/ml2/rpc.py
4
13745
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-5,634,697,078,448,194,000
42.496835
78
0.531466
false
olinlibrary/ABE
abe/resource_models/label_resources.py
1
4413
"""Label Resource models for flask""" import logging from flask import request from flask_restplus import Namespace, Resource, fields from abe import database as db from abe.auth import require_scope from abe.helper_functions.converting_helpers import request_to_dict from abe.helper_functions.mongodb_helpers import ...
agpl-3.0
-7,671,649,440,249,133,000
34.878049
95
0.63177
false
suto/infernal-twin
build/pillow/Tests/test_file_bmp.py
11
1784
from helper import unittest, PillowTestCase, hopper from PIL import Image import io class TestFileBmp(PillowTestCase): def roundtrip(self, im): outfile = self.tempfile("temp.bmp") im.save(outfile, 'BMP') reloaded = Image.open(outfile) reloaded.load() self.assertEqual(im...
gpl-3.0
-6,580,235,527,331,182,000
23.777778
62
0.586323
false
mancoast/CPythonPyc_test
cpython/330_test_curses.py
5
10336
# # 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 sys, tempfile, os ...
gpl-3.0
-5,171,228,960,011,170,000
29.134111
80
0.592783
false
wdv4758h/ZipPy
lib-python/3/turtle.py
1
143024
# # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.1b - 4. 5. 2009 # # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl@aon.at # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from th...
bsd-3-clause
8,964,513,729,629,554,000
33.605371
109
0.552012
false
farhaanbukhsh/tunir
tunirlib/__init__.py
1
10840
import os import sys import json import time import redis import signal import argparse import tempfile import shutil import paramiko from pprint import pprint from testvm import build_and_run from tunirvagrant import vagrant_and_run from tunirdocker import Docker, Result from collections import OrderedDict STR = Orde...
gpl-2.0
5,878,103,509,677,801,000
31.166172
121
0.587085
false
serge-sans-paille/pythran
pythran/tests/test_complex.py
1
8598
import numpy as np from pythran.config import cfg from pythran.tests import TestEnv from pythran.typing import NDArray import unittest try: np.float128 has_float128 = True except AttributeError: has_float128 = False class TestComplex(TestEnv): """ Check complex support in Pythran. """ def tes...
bsd-3-clause
-5,162,376,291,478,705,000
46.241758
117
0.544313
false
datalogics-robb/scons
src/engine/SCons/Optik/option.py
2
14507
"""optik.option Defines the Option class and some standard value-checking functions. """ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # Original Optik revision this is based on: __Optik_revision__ = "option.py,v 1.19.2.1 2002/07/23 01:51:14 gward Exp" # Copyright (c) 2001 Gregory P. Ward. All rig...
mit
42,371,967,996,143,944
36.389175
84
0.530158
false
wagnerand/amo-validator
tests/test_js_jstypes.py
2
3042
import validator.testcases.javascript.jstypes as jstypes from js_helper import _do_test_raw def test_jsarray_output(): """Test that the output function for JSArray doesn't bork.""" ja = jstypes.JSArray() ja.elements = [None, None] ja.output() # Used to throw tracebacks. ja.get_literal_value() #...
bsd-3-clause
-6,442,464,064,066,883,000
23.336
77
0.594346
false
WINOT/cide.py
src/preprocessor/compile.py
1
1347
import os import sass PREPROCESSOR_STYLE_EXT = '.scss' COMPILED_STYLE_EXT = '.css' def compile(scss_dir_path, output_dir): # Detect all SASS files scss_files = ["{0}/{1}".format(scss_dir_path,filename) for filename in os.listdir(scss_dir_path) if filename.endswith(PREPROCESSOR_ST...
gpl-3.0
-5,051,824,188,549,518,000
38.617647
92
0.639941
false
ToFuProject/tofu
examples/tutorials/tuto_plot_solid_angles.py
2
3854
""" Computing the integrated solid angle of a particle ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This tutorial show how to crete a configuration and computing the integrated solid angle subtended by a particle's trajectory along phi with certain discretization, and plotting it. :math:`\int_\Phi \Omega R d \Ph...
mit
-8,849,116,922,982,718,000
39.145833
79
0.484172
false
georglind/humo
humo/molparser.py
1
2064
from __future__ import division, print_function import sys import numpy as np import re # molparser function # parses mol file string into a molecule def parse(molfile): with open(molfile, "r") as mfile: data = mfile.readlines() mol = (''.join(data)).splitlines() try: res = read_mol(mol...
mit
-7,508,596,887,681,300,000
20.5
72
0.556202
false
automl/paramsklearn
ParamSklearn/components/classification/qda.py
1
2394
import sklearn.qda from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter from ParamSklearn.components.base import \ ParamSklearnClassificationAlgorithm from ParamSklearn.constants import * from ParamSklearn.implementations.uti...
bsd-3-clause
-6,723,825,138,510,086,000
34.205882
88
0.60401
false
Nu3001/external_chromium_org
chrome/test/chromedriver/archive.py
23
2325
# Copyright (c) 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. """Downloads items from the Chromium continuous archive.""" import os import platform import urllib import util CHROME_27_REVISION = '190466' CHROME_2...
bsd-3-clause
-1,170,667,158,733,422,800
28.0625
75
0.67914
false
openpolis/rst2pdf-patched-docutils-0.8
rst2pdf/tests/execmgr.py
1
12410
#!/usr/bin/env python2 # -*- coding: utf-8 -*- #$HeadURL$ #$LastChangedDate$ #$LastChangedRevision$ # See LICENSE.txt for licensing terms ''' Copyright (c) 2009, Patrick Maupin, Austin, Texas A wrapper around subprocess that performs two functions: 1) Adds non-blocking I/O 2) Adds process killability and timeou...
mit
-1,626,864,979,727,015,200
30.902314
81
0.552941
false
dbentley/pants
src/python/pants/backend/python/python_setup.py
4
5589
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pex....
apache-2.0
-4,818,169,105,469,906,000
38.359155
99
0.684559
false
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/multibytecodec_support.py
11
14523
# # multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from http.client import HTTPException from test import support from io import BytesIO class TestBase: encoding = '' # codec name codec = None # codec tupl...
gpl-2.0
-6,616,056,198,958,550,000
37.522546
82
0.514425
false
caffeinate/test-pylot
FlaskGunicornSqlAlchemy/test.py
1
1341
''' Created on 19 Jun 2015 @author: si ''' import json import unittest from flask_app import create_app, db from config import TestConfig as Config SHOW_LOG_MESSAGES = False if not SHOW_LOG_MESSAGES: # when local log is switched off, also hide logs from app below CRITICAL import logging logging.disable(...
mit
9,216,450,153,285,915,000
22.526316
76
0.561521
false
abhilashnta/edx-platform
common/test/acceptance/pages/lms/teams.py
18
1553
# -*- coding: utf-8 -*- """ Teams page. """ from .course_page import CoursePage from ..common.paging import PaginatedUIMixin TOPIC_CARD_CSS = 'div.wrapper-card-core' BROWSE_BUTTON_CSS = 'a.nav-item[data-index="1"]' class TeamsPage(CoursePage): """ Teams page/tab. """ url_path = "teams" def is_...
agpl-3.0
-6,341,567,472,234,809,000
27.236364
108
0.613651
false
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/aaa/aaasession_args.py
3
2291
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
5,817,614,043,970,136,000
22.377551
89
0.667394
false
CodeLionX/CommentSearchEngine
cse/reader/CommentReader.py
1
5284
import csv import os from cse.reader.ArticleMappingReader import ArticleMappingReader from cse.reader.AuthorMappingReader import AuthorMappingReader class CommentReader(object): def __init__(self, commentsFilepath, arcticlesFilepath, authorsFilepath, delimiter=',', ignoreMapping=True): self.__delimiter ...
mit
4,552,779,042,184,910,300
31.024242
112
0.596139
false
jgmanzanas/CMNT_004_15
project-addons/transportation/__init__.py
1
1134
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Pexego Sistemas Informáticos All Rights Reserved # $Jesús Ventosinos Mayor <jesus@pexego.es>$ # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
1,017,638,475,695,935,600
40.962963
78
0.628092
false
theAeon/Private-Peer-Domain-Syndication
ppds/config.py
1
6516
'''contains configuration class- applies and stores configuration''' import sys import json import os import shutil import requests import ppds.repository def testrepo(repo): '''send http request to repolist on host''' try: repourl = 'http://' + repo request = requests.get("%s/ppdslist.json" %...
gpl-3.0
-2,574,981,858,352,770,000
38.017964
79
0.552179
false
chrisxue815/leetcode_python
problems/test_0127_bfs.py
1
1427
import collections import unittest from typing import List import utils # O(n) time. O(n) space. BFS. class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: if endWord not in wordList: return 0 graph = collections.defaultdict(set) fo...
unlicense
-9,142,651,164,870,475,000
25.425926
85
0.50946
false
nuagenetworks/vspk-python
vspk/v5_0/fetchers/nunsgatewaymonitors_fetcher.py
2
2163
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
-4,801,858,764,833,780,000
39.830189
86
0.731854
false
pombredanne/pyjs
pyjs/runners/sessionhistory.py
6
3046
# Copyright (C) 2007, One Laptop Per Child # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distrib...
apache-2.0
-1,808,784,363,263,737,300
39.078947
77
0.665791
false
lbdreyer/cartopy
lib/cartopy/tests/mpl/test_caching.py
1
8343
# (C) British Crown Copyright 2011 - 2012, Met Office # # This file is part of cartopy. # # cartopy 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)...
lgpl-3.0
2,896,544,417,070,608,400
34.961207
79
0.620161
false
Micutio/ComplexAutomatonBase
cab/ca/ca_rect.py
1
9174
""" This module contains the class for a CA with rectangular cells. Moore and von-Neumann neighborhoods are available. """ from typing import Dict, Tuple, Union import cab.ca.ca as cab_ca import cab.abm.agent as cab_agent import cab.ca.cell as cab_cell __author__: str = 'Michael Wagner' class CARect(cab_ca.CabCA):...
mit
395,515,731,538,101,200
41.669767
117
0.516351
false
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/winbuild/config.py
2
3822
import os SF_MIRROR = 'http://iweb.dl.sourceforge.net' pythons = {#'26': 7, '27': 7, #'32': 7, '33': 7.1, '34': 7.1} VIRT_BASE = "c:/vp/" X64_EXT = os.environ.get('X64_EXT', "x64") libs = { 'zlib': { 'url': 'http://zlib.net/zlib128.zip', 'hash': 'md5:1...
mit
7,292,043,135,636,486,000
25.358621
93
0.502878
false
zaina/nova
nova/tests/functional/v3/test_cloudpipe.py
24
3794
# Copyright 2014 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 agreed t...
apache-2.0
2,481,565,830,314,478,000
38.520833
78
0.630206
false
TheGentlemanOctopus/thegentlemanoctopus
octopus_code/core/octopus/patterns/lavaLampPattern2.py
1
1250
from pattern import Pattern import time import numpy as np class LavaLampPattern2(Pattern): def __init__(self): self.register_param("freq", 0, 1, 0.2) self.register_param("speed_r", 0, 10, 2) self.register_param("speed_g", 0, 10, 1) self.register_param("speed_b", 0, 10, 1.5) ...
gpl-3.0
-7,673,507,445,046,682,000
28.761905
77
0.5512
false
alexandrujuncu/sos
sos/plugins/upstart.py
11
1765
# Copyright (C) 2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.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 License, or # (at your option) any later version. # ...
gpl-2.0
7,508,279,425,462,348,000
32.301887
72
0.633428
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/authorization/authorizationpolicy_aaauser_binding.py
1
5051
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
6,528,671,830,296,188,000
28.028736
137
0.702435
false
dlspano/scripts
python/mysql_backup/mysql_backup.py
2
6244
#!/usr/bin/env python3 import argparse import paramiko import logging import os from datetime import datetime LOG = logging.getLogger(__name__) SSH_USER = "centos" def backup_database(ssh, database, directory): """ Use paramiko to run mysql dump on the remote host :param ssh: :param database: :...
gpl-3.0
-8,992,226,170,535,014,000
28.733333
78
0.599776
false
ZwickyTransientFacility/ztf_sim
ztf_sim/Scheduler.py
1
8313
"""Core scheduler classes.""" import configparser from collections import defaultdict import logging import numpy as np from astropy.time import Time import astropy.units as u from .QueueManager import ListQueueManager, GreedyQueueManager, GurobiQueueManager from .ObsLogger import ObsLogger from .configuration import ...
bsd-3-clause
5,210,332,803,409,682,000
39.950739
130
0.571154
false
khkaminska/bokeh
bokeh/server/tests/test_wsmanager.py
9
2774
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
bsd-3-clause
5,393,376,359,212,422,000
38.070423
78
0.602019
false
akaihola/PyChecker
pychecker2/test.py
11
1470
import os import sys import unittest import glob def test(modules, verbosity): for m in modules: s = unittest.defaultTestLoader.loadTestsFromName(m) result = unittest.TextTestRunner(verbosity=verbosity).run(s) if not result.wasSuccessful(): return 1 return 0 def _modules(r...
bsd-3-clause
3,999,784,883,007,276,000
25.727273
68
0.57551
false
pmdp/GIW
mongodb-2/gr11_mongoengine.py
1
6555
# -*- coding: utf-8 -*- from mongoengine import * db = connect('giw_mongoengine') class CreditCard(EmbeddedDocument): name = StringField(required=True, min_length=3, max_length=40) number = StringField(required=True, regex="^(\d{16})$") month = StringField(required=True, regex="^(0[1-9]|1[0-2])$") y...
gpl-3.0
-5,478,443,918,519,179,000
42.838926
126
0.629
false