repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
diana-hep/carl
tests/distributions/test_join.py
1
1471
# Carl is free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. import numpy as np from numpy.testing import assert_array_almost_equal from carl.distributions import Join from carl.distributions import Normal from carl.distributions...
bsd-3-clause
550,063,724,693,675,600
31.688889
67
0.635622
false
Azure/azure-sdk-for-python
sdk/datalake/azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/account/models/data_lake_analytics_account_basic_py3.py
1
3694
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
5,611,381,449,626,307,000
40.977273
112
0.615864
false
jpirko/lnst
lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
1
4345
import copy from lnst.Common.Parameters import Param from lnst.Controller.RecipeResults import ResultLevel from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin class OffloadSubConfigMixin(BaseSubConfigMixin): """ This class is an extension to the :any:`BaseEnrtRecipe` class that e...
gpl-2.0
4,285,374,703,023,726,600
36.456897
80
0.551208
false
Mugginz/Thermofun
thermostat/subroutine.py
1
2625
# Helper functions for controller import time, os, sys, threading, socket THERMOMETER_URI = '/sys/bus/w1/devices/28-0000054b97a5/w1_slave' LOGFILE = 'incidents.log' # Change argument to 'w' to clear logs on startup. with open(LOGFILE, 'a') as f: pass def eventLog(message): try: # Limit file size. with open(LOGF...
gpl-2.0
-4,010,749,887,447,146,000
24.240385
72
0.663238
false
glabilloy/fabrydb
fabrydb/conf/settings.py
1
1697
import os from global_settings import * try: from local_settings import * from local_settings_secret import * except ImportError: import warnings warnings.warn('Local settings have not been found (src.conf.local_settings). Trying to import Heroku config...') try: from local_settings_heroku...
bsd-2-clause
-1,389,080,983,223,519,000
33.632653
116
0.713612
false
dibaunaumh/tikal-corp-website
cms/menu.py
1
8499
from menus.menu_pool import menu_pool from menus.base import Menu, NavigationNode, Modifier from cms.utils import get_language_from_request from cms.utils.moderator import get_page_queryset, get_title_queryset from django.conf import settings from django.contrib.sites.models import Site from cms.utils.i18n import get_f...
bsd-3-clause
-5,967,053,210,868,146,000
37.986239
117
0.53218
false
AdirShemesh/LibraryWiki
app/node_entities.py
1
3155
import json from app.authorities import CODES from requests import get import xmltodict class Entity: def __init__(self, data): self.data = data self.properties = self._build_properties() self.labels = self._build_labels() def _build_properties(self): raise NotImplemented ...
gpl-2.0
9,033,349,775,582,352,000
28.485981
100
0.562282
false
cloudify-cosmo/cloudify-plugins-common
cloudify/utils.py
1
15485
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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
3,845,092,131,709,111,300
30.473577
79
0.613174
false
bodylabs/blmath
blmath/geometry/transform/rigid_transform.py
1
2624
def find_rigid_transform(a, b, visualize=False): """ Args: a: a 3xN array of vertex locations b: a 3xN array of vertex locations Returns: (R,T) such that R.dot(a)+T ~= b Based on Arun et al, "Least-squares fitting of two 3-D point sets," 1987. See also Eggert et al, "Estimating 3-D ...
bsd-2-clause
5,908,274,546,677,623,000
27.521739
127
0.552973
false
Exgibichi/statusquo
test/functional/httpbasics.py
1
4850
#!/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. """Test the RPC HTTP basics.""" from test_framework.test_framework import StatusquoTestFramework from tes...
mit
-2,739,805,825,693,611,000
43.090909
110
0.624536
false
Colin-b/pyconfigparser
setup.py
1
1185
import os from setuptools import setup, find_packages this_dir = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_dir, 'README.md'), 'r') as f: long_description = f.read() setup(name='pyconfigparser', version='0.1', author='Bounouar Colin', maintainer='Bounouar Colin', ...
mit
2,933,620,478,361,313,300
31.916667
65
0.587342
false
redhat-performance/tuned
tuned/plugins/plugin_sysctl.py
2
5586
import re from . import base from .decorators import * import tuned.logs from subprocess import * from tuned.utils.commands import commands import tuned.consts as consts import errno import os log = tuned.logs.get() DEPRECATED_SYSCTL_OPTIONS = [ "base_reachable_time", "retrans_time" ] SYSCTL_CONFIG_DIRS = [ "/run/sys...
gpl-2.0
-8,132,232,217,691,364,000
29.692308
118
0.674902
false
UCSD-E4E/aerial_lidar
catkin_ws/src/laser_tfs/src/nodes/plot.py
1
1482
#!/usr/bin/env python import roslib roslib.load_manifest('laser_tfs') import rospy import math import matplotlib.pyplot as plt import numpy as np import tf from geometry_msgs.msg import PoseWithCovarianceStamped def handle_fcu_pose(msg): br = tf.TransformBroadcaster() global count p = msg.pose.pose.posi...
mit
5,908,898,019,131,150,000
24.118644
66
0.597841
false
nityansuman/Python-3
data_structures/tuples.py
1
1373
# Tuple data structure sample_tuple = ('Glenn', 'Sally', 'John') print(sample_tuple) # First Element of the tuple print(sample_tuple[0]) y = (1, 9, 15) # New tuple print(max(y)) # Max value of the tuple # Tuples are immutable like strings, cannot change the value of tuples # You cannot sort, reverse or ...
gpl-3.0
3,198,536,309,866,640,000
21.672414
126
0.622724
false
SKIRT/PTS
magic/misc/imfit.py
1
12412
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
-2,269,840,293,426,458,600
35.395894
102
0.593183
false
google/iree
third_party/format_diff/format_diff.py
1
5904
#!/usr/bin/env python3 # #===- format_diff.py - Diff Reformatter ----*- python3 -*--===# # # This file is licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===-----------------------------...
apache-2.0
-8,796,428,589,158,364,000
34.781818
94
0.612297
false
Azure/azure-sdk-for-python
sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_results_operations.py
1
5214
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-1,931,421,254,802,879,700
45.553571
205
0.664173
false
skosukhin/spack
var/spack/repos/builtin/packages/py-python-gitlab/package.py
1
1868
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
5,940,696,918,200,540,000
44.560976
90
0.67773
false
troywatson/Python-Grammar-Checker
fartherVsFurther/CountSyllables.py
1
2787
''' Count Syllables v1.0 A simple class to count syllables using a dictionary method This class will attempt to calculate syllables of words not found in dictionary ''' class CountSyllables(object): ...
mit
-3,347,954,875,784,145,400
35.671053
116
0.425188
false
aronasorman/kolibri
kolibri/auth/test/test_api.py
1
18028
from __future__ import absolute_import, print_function, unicode_literals import collections import factory import sys from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APITestCase as BaseTestCase from django.contrib.sessions.models import Session from .. ...
mit
3,542,706,537,411,612,700
46.193717
146
0.68499
false
yeming233/rally
rally/plugins/common/validators.py
1
14381
# 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 agreed to in...
apache-2.0
-4,676,884,078,922,632,000
37.9729
79
0.568667
false
lgarren/spack
var/spack/repos/builtin/packages/opencv/package.py
1
10399
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-4,794,252,325,094,675,000
44.017316
104
0.561689
false
gam17/QAD
qad_circle_fun.py
1
63798
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin funzioni per creare cerchi ------------------- begin : 2018-04-08 copyright : iiiii emai...
gpl-3.0
9,054,910,789,273,340,000
39.761468
118
0.607645
false
hortonworks/hortonworks-sandbox
desktop/core/src/desktop/middleware_test.py
1
1593
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
5,882,152,061,198,778,000
36.046512
74
0.733208
false
corumcorp/redsentir
redsentir/lineatiempo/migrations/0001_initial.py
1
2480
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2018-04-04 18:06 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
gpl-3.0
3,658,711,810,807,085,600
39
121
0.587097
false
bdunnette/djecks
migrations/0005_auto__add_field_case_source__chg_field_case_title__chg_field_deck_titl.py
1
3187
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Case.source' db.add_column(u'djecks_case', 'source', ...
agpl-3.0
-5,144,000,211,033,142,000
50.419355
165
0.564481
false
jreades/starspy
stars/visualization/kernelDensityTime.py
1
7148
""" Yet Another Kernel Density Implementation in Python This one supports updating the raster one event at a time, to allow for time series visualization. """ from sys import stdout import pysal import numpy from math import exp,pi,ceil,floor,sqrt #try: # from osgeo import gdal, gdal_array # from osgeo.gdalcon...
gpl-2.0
3,872,030,793,151,872,500
35.284264
145
0.559177
false
hayj/WorkspaceManager
workspacemanager/test/setuptest.py
1
1453
# coding: utf-8 import unittest import doctest import os from workspacemanager import setup from workspacemanager import generateSetup from workspacemanager.utils import * from shutil import * from workspacemanager.test.utils import * # The level allow the unit test execution to choose only the top level test min = ...
mit
-396,985,961,022,106,430
25.418182
101
0.613902
false
michaelkuty/feincms
feincms/module/extensions/ct_tracker.py
1
6323
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ # # ct_tracker.py # FeinCMS # # Created by Martin J. Laubach on 02.10.09. # Copyright (c) 2009 Martin J. Laubach. All rights reserved. # Updated in 20...
bsd-3-clause
-4,565,303,736,663,644,700
38.030864
79
0.558754
false
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/horovod/setup.py
1
24873
# Copyright 2017 Uber Technologies, 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 applica...
apache-2.0
-2,906,233,090,748,756,500
37.985893
118
0.590359
false
brsbilgic/django-quick-reports
docs/source/conf.py
1
9285
# -*- coding: utf-8 -*- # # django-quick-reports documentation build configuration file, created by # sphinx-quickstart on Sun Jul 12 09:08:52 2015. # # 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 # autogenerate...
mit
-1,353,983,440,115,746,000
31.693662
81
0.709101
false
skirpichev/omg
diofant/tests/polys/test_polyoptions.py
1
13603
"""Tests for options manager for :class:`Poly` and public API functions.""" import pytest from diofant import (CC, EX, FF, GF, QQ, RR, ZZ, ComplexField, GeneratorsError, I, Integer, OptionError, Options, RealField, Symbol, lex, sqrt) from diofant.abc import x, y, z from diofa...
bsd-3-clause
5,180,508,136,568,610,000
25.830375
91
0.625524
false
avalentino/gsdview
exectools/tests/gtkshell.py
1
9226
#!/usr/bin/env python # GSDView - Geo-Spatial Data Viewer # Copyright (C) 2008-2021 Antonio Valentino <antonio.valentino@tiscali.it> # # This module 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 versio...
gpl-2.0
-1,603,177,992,602,668,000
33.94697
78
0.609365
false
helixyte/TheLMA
thelma/resources/experiment.py
1
12060
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Experiment resources. """ from datetime import datetime import logging from pyramid.httpexceptions import HTTPBadRequest from everest.querying.specificatio...
mit
-6,446,421,184,529,573,000
43.832714
80
0.646186
false
ArcasProject/Arcas
src/arcas/PLOS/main.py
1
3663
from arcas.tools import Api import xml.etree.ElementTree as etree from xml.etree import ElementTree class Plos(Api): def __init__(self): self.standard = 'http://api.plos.org/search?q=' def create_url_search(self, parameters): """Creates the search url, combining the standard url and various ...
mit
3,411,965,802,518,887,400
36.762887
89
0.555283
false
b1-systems/kiwi
kiwi/repository/base.py
1
3962
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
7,048,106,492,177,465,000
26.901408
73
0.650681
false
cangencer/hazelcast-python-client
tests/address_test.py
1
1917
import unittest from hazelcast.core import Address, Member from hazelcast.util import get_possible_addresses class AddressTest(unittest.TestCase): def test_no_given_address(self): addresses = get_possible_addresses([]) self.assertItemsEqual(addresses, [Address("127....
apache-2.0
-2,888,269,739,710,410,000
35.865385
115
0.593636
false
flavour/ifrc_qa
modules/s3db/ocr.py
1
7350
# -*- coding: utf-8 -*- """ OCR Utility Functions @copyright: 2009-2016 (c) Sahana Software Foundation @license: MIT 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 ...
mit
1,902,842,553,426,639,000
34.167464
79
0.428027
false
libo/Enigma2
lib/python/Screens/TimerEdit.py
1
14240
from Components.ActionMap import ActionMap from Components.Button import Button from Components.config import config from Components.MenuList import MenuList from Components.TimerList import TimerList from Components.TimerSanityCheck import TimerSanityCheck from Components.UsageConfig import preferredTimerPath from Rec...
gpl-2.0
2,415,394,993,166,281,700
31.290249
179
0.692275
false
treww/counters
server/performance_server.py
1
4745
__author__ = 'treww' import json import MySQLdb as mysql import http.client import tornado.ioloop import tornado.web class _DatabaseRows: _cursor = None def __init__(self, cursor): self._cursor = cursor def __iter__(self): return self def __next__(self): row = self._cursor...
mit
6,965,204,526,205,543,000
29.22293
110
0.567545
false
nkmk/python-snippets
notebook/numpy_nan_replace.py
1
1889
import numpy as np a = np.genfromtxt('data/src/sample_nan.csv', delimiter=',') print(a) # [[11. 12. nan 14.] # [21. nan nan 24.] # [31. 32. 33. 34.]] a_nan = np.array([0, 1, np.nan, float('nan')]) print(a_nan) # [ 0. 1. nan nan] print(np.nan == np.nan) # False print(np.isnan(np.nan)) # True print(a_nan == np.na...
mit
8,838,509,263,677,381,000
21.759036
82
0.51244
false
carlos-ferras/Sequence-ToolKit
controller/genrep/dialogs/apply_this_to.py
1
5418
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import partial from model.handle_config import ConfigHandler from view.genrep.dialogs.ui_apply_this_to import Ui_apply_to from view.dialogs.base_dialog import BaseDialog class ApplyThisTo(BaseDialog, Ui_apply_to):...
gpl-3.0
-4,717,723,878,453,943,000
38.26087
101
0.607973
false
NotBobTheBuilder/robogrid
robogrid/robot.py
1
2297
from .grids import Simple_Grid class Robot(object): def __init__(self, name, grid=None): self.name = name if grid == None: grid = Simple_Grid(20) self.grid = grid start_pos = self.grid.free_position() if start_pos == None: raise ValueError("No space...
mit
6,702,044,922,090,397,000
23.178947
74
0.491946
false
ppyordanov/HCI_4_Future_Cities
Server/src/virtualenv/Lib/encodings/iso8859_16.py
1
12859
""" Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py. """ # " import codecs # ## Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return codecs.charmap_encode(input, errors, encoding_table) def decode(self, inpu...
mit
-2,447,403,365,782,937,600
40.347267
109
0.578505
false
alsoicode/django-maintenancemode-2
testproject/testproject/urls.py
1
1160
"""testproject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
apache-2.0
1,782,432,068,853,554,000
34.151515
77
0.67931
false
Grumbel/scatterbackup
scatterbackup/format.py
1
7129
# ScatterBackup - A chaotic backup solution # Copyright (C) 2016 Ingo Ruhnke <grumbel@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 3 of the License, or # (at your ...
gpl-3.0
-175,609,349,884,586,240
24.280142
92
0.534016
false
carefree0910/MachineLearning
_Dist/NeuralNetworks/_Tests/_UnitTests/b_Advanced.py
1
2339
import os import sys root_path = os.path.abspath("../../../../") if root_path not in sys.path: sys.path.append(root_path) import unittest import numpy as np from Util.Util import DataUtil from _Dist.NeuralNetworks.e_AdvancedNN.NN import Advanced from _Dist.NeuralNetworks._Tests._UnitTests.UnitTestUtil import clea...
mit
-1,695,884,148,561,220,400
32.898551
108
0.637024
false
paiser/component-management
t.py
1
11560
#!/usr/bin/env python from storm.locals import * from IMSmotorcfg import * from IMSmotor import * import sys class Instrument(object): __storm_table__ = "instrument" id = Int(primary=True) name = Unicode() #locations = Unicode() def __init__(self, name): self.name = name class Loc(...
gpl-2.0
5,738,453,091,251,084,000
38.453925
256
0.609689
false
SasView/sasmodels
sasmodels/models/polymer_micelle.py
1
5987
r""" This model provides the form factor, $P(q)$, for a micelle with a spherical core and Gaussian polymer chains attached to the surface, thus may be applied to block copolymer micelles. To work well the Gaussian chains must be much smaller than the core, which is often not the case. Please study the reference caref...
bsd-3-clause
991,960,999,830,574,600
38.649007
113
0.632036
false
oldm/OldMan
oldman/resource/manager.py
1
7765
from oldman.resource.resource import ClientResource from oldman.store.selector import DataStoreSelector from oldman.model.manager import ClientModelManager DEFAULT_MODEL_NAME = "Default_Client" class ClientResourceManager: """ TODO: describe """ def __init__(self, data_stores, schema_graph=None, at...
bsd-3-clause
4,425,027,235,086,407,700
55.678832
121
0.616098
false
erinspace/modular-file-renderer
mfr_code_pygments/__init__.py
1
1672
# -*- coding: utf-8 -*- from mfr import FileHandler, get_file_extension try: # requires pygments from mfr_code_pygments.render import render_html renderers = { 'html': render_html, } except ImportError: renderers = {} EXTENSIONS = [ '.rb', '.c', '.cs', '.ahk', '.rs', ...
apache-2.0
-7,561,032,911,051,015,000
12.704918
56
0.373804
false
decodio/l10n_hr
l10n_hr_vat/wizard/wizard_pdv_knjiga.py
1
11523
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Author: # mail: # Copyright: # Contributions: # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
8,604,639,130,252,183,000
39.566901
115
0.512369
false
dreadrel/UWF_2014_spring_COP3990C-2507
notebooks/scripts/book_code/code/getattribute-person.py
1
1434
class Person: # Portable: 2.X or 3.X def __init__(self, name): # On [Person()] self._name = name # Triggers __setattr__! def __getattribute__(self, attr): # On [obj.any] print('get: ' + attr) if attr == 'name'...
apache-2.0
6,289,622,435,151,963,000
43.8125
76
0.459554
false
kissgyorgy/Womanager
mainwindow.py
1
47297
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Thu Oct 10 19:57:03 2013 # by: PyQt4 UI code generator 4.10.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Att...
gpl-2.0
-7,005,826,944,289,512,000
52.624717
106
0.672495
false
figshare/Total-Impact
plugins/aliases/url2id/Plugin.py
1
5545
#!/usr/bin/env python import simplejson import json import urllib import time import re import nose from nose.tools import assert_equals import sys import os # This hack is to add current path when running script from command line sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import BaseP...
mit
-5,771,353,778,099,712,000
35.012987
123
0.621821
false
smilebin818/wx-cqwdt
DBDATA/fileServer.py
1
1270
#!/usr/bin/env python # -*- coding: utf-8 -*- import SocketServer import struct import os # Format: name_len --- one byte # name --- name_len bytes # data --- variable length # Save data to name into current directory # Refer to: http://blog.csdn.net/g__gle/article/details/8144...
gpl-3.0
-6,804,128,155,356,753,000
28.534884
74
0.570866
false
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/httplib2/tests/test_encoding.py
5
3632
import httplib2 import tests def test_gzip_head(): # Test that we don't try to decompress a HEAD response http = httplib2.Http() response = tests.http_response_bytes( headers={'content-encoding': 'gzip', 'content-length': 42}, ) with tests.server_const_bytes(response) as uri: respo...
bsd-3-clause
4,938,064,596,127,947,000
35.686869
77
0.657764
false
blaze225/zulip
zerver/views/users.py
1
16558
from __future__ import absolute_import from typing import Text, Union, Optional, Dict, Any, List, Tuple import os import simplejson as json from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from django.shortcuts import redirect from django.conf import settings from ...
apache-2.0
-2,537,478,890,875,718,000
41.239796
140
0.650803
false
dnbaker/emp
python/master_map.py
1
1618
#!/usr/bin/env python import sys import multiprocessing import gzip import os from subprocess import check_call as cc, CalledProcessError from download_genomes import is_valid_gzip, xfirstline argv = sys.argv def getopts(): import argparse a = argparse.ArgumentParser() a.add_argument("paths", nargs="+", h...
gpl-3.0
451,841,040,786,476,540
27.892857
76
0.567367
false
rvanlaar/easy-transifex
src/transifex/transifex/resources/tests/views/status.py
1
2520
# -*- coding: utf-8 -*- from django.test.client import Client from transifex.languages.models import Language from transifex.resources.models import Resource from transifex.txcommon.tests.base import BaseTestCase class StatusCodesTest(BaseTestCase): """Test that all app URLs return correct status code. Moreo...
bsd-2-clause
2,930,107,120,704,847,000
41
74
0.526984
false
kseetharam/genPolaron
xanalysis_groundstate_paper.py
1
26133
import numpy as np import pandas as pd import xarray as xr import matplotlib import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from matplotlib.lines import Line2D import matplotlib.colors as colors from matplotlib.animation import writers import os import itertools import pf_dynamic_cart as...
mit
5,256,427,196,833,747,000
44.60733
257
0.576895
false
adamnovak/hgvm-builder
src/hgvmbuilder/toilvgfacade.py
1
14356
# hgvm-builder toilvgfacade.py: Provide a function-argument-based toil-vg API """ toil-vg curtrently has lots of cases where low-level functions depend on command-line arguments in the options object. To make toil-vg targets callable on arbitrary Toil file IDs, we need wrappers. To use this facade, run add_options() ...
apache-2.0
-7,453,239,172,026,143,000
32.231481
80
0.654012
false
mmeslab/linux-nctusde
compute_nctuss_related_function_size.py
1
1314
#!/usr/bin/python nctuss_symbol_names = ["nctuss_poll_emacps", "nctuss_xemacps_tx_poll", "xemacps_tx_hwtstamp", "nctuss_xemacps_rx", "nctuss_xemacps_send_skb", "nctuss_xemacps_start_xmit", "xemacps_clear_csum", "nctuss_xemacps_return_skb", "nctuss_skb_pool_return", "nctuss_...
gpl-2.0
-1,664,718,970,826,183,700
22.464286
52
0.616438
false
bxlab/HiFive_Paper
Scripts/hifive-1.1.3/hifive/hic_binning.py
1
92093
#!/usr/bin/env python """ This is a module contains scripts for generating compact, upper-triangle and full matrices of HiC interaction data. Concepts -------- These functions rely on the :class:`HiC` class in conjunction with the :class:`Fend` and :class:`HiCData` classes. Data can either be arranged in compact, c...
bsd-3-clause
5,788,391,827,346,598,000
57.249842
696
0.601859
false
CroissanceCommune/autonomie
autonomie/alembic/versions/3_0_migrate_task_lines_2192101f133b.py
1
1508
"""3.0 : Migrate task lines Revision ID: 2192101f133b Revises: 465776bbb019 Create Date: 2015-06-29 11:57:26.726124 """ # revision identifiers, used by Alembic. revision = '2192101f133b' down_revision = '36b1d9c38c43' from alembic import op import sqlalchemy as sa def upgrade(): from autonomie.models.task imp...
gpl-3.0
-5,757,862,300,584,383,000
21.176471
72
0.566313
false
niosus/EasyClangComplete
tests/test_makefile.py
1
3170
"""Tests for Makefile flags extraction.""" import imp import platform from os import path from unittest import TestCase from EasyClangComplete.plugin.utils import flag from EasyClangComplete.plugin.utils import search_scope from EasyClangComplete.plugin.flags_sources import makefile imp.reload(makefile) imp.reload(fl...
mit
-5,041,730,860,606,384,000
34.222222
79
0.633438
false
jyi/ITSP
prophet-gpl/tools/httpd-build.py
1
3243
# Copyright (C) 2016 Fan Long, Martin Rianrd and MIT CSAIL # Prophet # # This file is part of Prophet. # # Prophet 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 y...
mit
2,086,195,526,570,263,600
31.757576
156
0.5572
false
praekelt/jmbo-contact
contact/models.py
1
1051
from django.contrib.auth.models import User from django.db import models from preferences.models import Preferences class ContactPreferences(Preferences): __module__ = 'preferences.models' telephone = models.CharField( max_length=24, blank=True, null=True, ) fax = models.Char...
bsd-3-clause
1,976,256,016,569,341,200
21.361702
70
0.596575
false
nealtodd/wagtail
wagtail/images/views/serve.py
3
3400
import base64 import hashlib import hmac import imghdr from wsgiref.util import FileWrapper from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.http import HttpResponse, HttpResponsePermanentRedirect, StreamingHttpResponse from django.shortcuts import ...
bsd-3-clause
-6,663,978,026,707,857,000
34.789474
114
0.707353
false
toros-astro/ProperImage
properimage/utils.py
1
10039
#!/usr/bin/env python # -*- coding: utf-8 -*- # # utils.py # # Copyright 2016 Bruno S <bruno@oac.unc.edu.ar> # # 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 Licens...
bsd-3-clause
2,111,238,457,958,437,600
27.278873
77
0.591892
false
HybridF5/jacket
jacket/tests/storage/unit/api/contrib/test_snapshot_manage.py
1
5611
# Copyright (c) 2015 Huawei Technologies Co., Ltd. # # 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 applic...
apache-2.0
4,292,069,018,880,063,000
41.18797
79
0.648726
false
seung-lab/cloud-volume
cloudvolume/datasource/precomputed/image/rx.py
1
11090
from functools import partial import itertools import math import os import threading import numpy as np from six.moves import range from tqdm import tqdm from cloudfiles import reset_connection_pools, CloudFiles, compression import fastremap from ....exceptions import EmptyVolumeException, EmptyFileException from ....
bsd-3-clause
5,789,913,100,231,406,000
27.656331
101
0.67358
false
tangentlabs/tangent-deployer
src/tangentdeployer/aws/elb.py
1
4028
import json import utils import boto.ec2.elb from fabconfig import env from fabric.api import local def get_or_create_load_balancer(): utils.status("Getting %s load balancer" % env.environment) load_balancer = get(load_balancer_name=env.load_balancer_name) if not load_balancer: return create_load...
mit
-4,524,741,475,131,346,400
31.483871
77
0.617428
false
Blazemeter/taurus
tests/resources/apiritif/test_codegen.py
1
2578
# coding=utf-8 import logging import random import string import sys import unittest from time import time, sleep import apiritif log = logging.getLogger('apiritif.http') log.addHandler(logging.StreamHandler(sys.stdout)) log.setLevel(logging.DEBUG) class TestWithExtractors(unittest.TestCase): def setUp(self):...
apache-2.0
2,061,219,892,558,965,800
34.315068
105
0.611715
false
jureslak/racunalniske-delavnice
fmf/python_v_divjini/projekt/test/test_game.py
1
1623
from tictactoe import game, player import unittest from unittest import mock class GameTest(unittest.TestCase): def setUp(self): self.num_of_players = 2 self.width = 3 self.height = 3 self.game = game.Game(2, 3, 3) def test_init(self): self.assertEqual(self.game.board,...
gpl-2.0
-3,384,628,318,615,924,700
35.066667
71
0.583487
false
bengosney/romrescue.org
team/migrations/0005_auto_20161029_1857.py
1
1667
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-10-29 18:57 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ('team', '0004_teammember_job'), ...
gpl-3.0
2,396,542,858,550,056,400
39.658537
236
0.604079
false
stvstnfrd/edx-platform
common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py
1
1619
# lint-amnesty, pylint: disable=missing-module-docstring import copy from opaque_keys.edx.locator import DefinitionLocator class DefinitionLazyLoader(object): """ A placeholder to put into an xblock in place of its definition which when accessed knows how to get its content. Only useful if the containin...
agpl-3.0
-1,342,814,386,339,033,600
45.257143
108
0.704756
false
Antergos/Cnchi
src/widgets/webcam_widget.py
1
5550
#!/usr/bin/env python # -*- coding: utf-8 -*- # # webcam_widget.py # # Copyright © 2013-2018 Antergos # # This file is part of Cnchi. # # Cnchi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 ...
gpl-3.0
-5,490,614,462,187,439,000
30.890805
88
0.631465
false
NPPC-UK/wireless_sensors
setup_logger/setup_logger.py
1
7621
#!/usr/bin/env python # Copyright (C) 2017 Aberystwyth University # 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 later versi...
gpl-3.0
-9,138,549,356,838,000,000
27.436567
278
0.668023
false
googleads/googleads-python-lib
examples/ad_manager/v202105/custom_field_service/deactivate_all_line_item_custom_fields.py
1
2682
#!/usr/bin/env python # # Copyright 2015 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 requir...
apache-2.0
8,414,907,480,595,389,000
35.739726
80
0.709918
false
Rogentos/argent-anaconda
installclasses/awesome.py
1
2687
# # awesome.py # # Copyright (C) 2010 Fabio Erculiani # # 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...
gpl-2.0
2,908,679,965,218,311,700
28.527473
83
0.679196
false
jgyates/genmon
gentankdiy.py
1
6642
#!/usr/bin/env python #------------------------------------------------------------------------------- # FILE: gentankdiy.py # PURPOSE: gentankdiy.py add enhanced external tank data to genmon # # AUTHOR: jgyates # DATE: 06-18-2019 # # MODIFICATIONS: #--------------------------------------------------------------...
gpl-2.0
5,548,805,097,713,764,000
36.954286
156
0.549082
false
Jazende/ProjectEuler
problem_026.py
1
2481
import math def go_until_repeat_remainder(nom, den, cur_max=1000): remainders = [] cycles = 0 while True: if nom < den: nom*=10 cycles += 1 if nom == den: break if nom > den: remainder = nom%den if remainder in remainders: ...
gpl-3.0
-6,844,096,892,728,083,000
26.566667
116
0.512696
false
leewinder/tslerp
automation/prepare_distribution_package.py
1
2629
""" Builds up a release package ready to be built or distributed by NPM. The distributable content is taken from the development folder to make it easier to strip out unneeded package content. """ #!/usr/bin/python # Imports import os import shutil import fnmatch import distutils.dir_util import cli # # Finds all fi...
mit
491,645,362,754,421,000
26.103093
99
0.669836
false
zigazupancic/sat-solver
boolean.py
1
4960
class Formula: def __ne__(self, other): return not (self == other) def flatten(self): return self def getVariable(self, mapping): if self not in mapping: mapping[self] = freshVariable() return mapping[self] class Variable(Formula): def __init__(self, x): ...
mit
3,495,161,264,798,552,000
23.554455
73
0.55
false
mozillazg/lark
lark/lark/settings.py
1
1098
""" Django settings for lark project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ import os from .base import * # Build paths inside the project like this: os...
mit
7,931,855,443,845,683,000
27.153846
71
0.716758
false
bodacea/datasciencefordevelopment
Code_examples/python/linear_regression.py
1
1984
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
cc0-1.0
6,711,675,007,412,280,000
28.191176
77
0.700101
false
bi4o4ek/yandex-loganalytics
loganalytics.py
1
3271
#!/usr/bin/python # -*- coding: utf-8 -*- # This script calculates 95th percentile for request time and shows top 10 requests ID with max send time to customers # # Start example: # ./loganalytics.py /path-to-log/input.txt > /path-to-some-dir/output.txt # then you can complete analysis by running 2nd script # ./granaly...
apache-2.0
-2,882,829,045,544,299,000
32.442105
118
0.678628
false
e-gun/HipparchiaBuilder
builder/parsers/regexsubstitutions.py
1
29163
# -*- coding: utf-8 -*- """ HipparchiaBuilder: compile a database of Greek and Latin texts Copyright: E Gunderson 2016-21 License: GNU GENERAL PUBLIC LICENSE 3 (see LICENSE in the top level directory of the distribution) """ from string import punctuation from typing import List import configparser import re fro...
gpl-3.0
2,887,905,583,091,091,000
32.451843
264
0.656619
false
limiear/soyprice
tests/chicago_test.py
1
1161
import unittest import abstract from soyprice.model import database as db from soyprice.model.soy import Chicago import os import datetime import requests class TestChicago(abstract.TestCase): def setUp(self): self.remove('cache*') self.cache = db.open() self.var = Chicago(self.cache) ...
gpl-3.0
-8,152,060,232,558,465,000
28.025
79
0.613264
false
rspavel/spack
var/spack/repos/builtin/packages/ibm-java/package.py
1
3917
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import platform import os class IbmJava(Package): """Binary distribution of the IBM Java Softwar...
lgpl-2.1
-2,857,033,170,495,520,000
38.969388
100
0.66071
false
EmanueleCannizzaro/scons
test/option-b.py
1
1515
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 limitation the rights to us...
mit
2,320,631,516,134,854,700
34.232558
90
0.747855
false
gt-ros-pkg/hrl_autobed_dev
autobed_pose_estimator/src/visualize_pressure_mat_3d.py
1
1438
import numpy as np import roslib; roslib.load_manifest('hrl_msgs') import rospy import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D from hrl_msgs.msg import FloatArrayBare class Visualize3D(): def __init__(self): rospy.Subscriber("/fsascan", FloatArrayBare,...
mit
3,793,219,297,732,556,300
30.955556
80
0.625869
false
jeffmarcom/checkbox
plainbox/plainbox/abc.py
1
6650
# This file is part of Checkbox. # # Copyright 2012 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox 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 versio...
gpl-3.0
-5,495,530,179,601,678,000
31.281553
79
0.671278
false
kriberg/stationspinner
stationspinner/accounting/urls.py
1
1078
from django.conf.urls import url, include from rest_framework import routers from stationspinner.accounting.views import APIKeyViewset, LoginView, \ CapsulerViewset, LogoutView, MissingTrainingViewset, RevalidateKeyView, \ ObtainAuthTokenView, CheckAuthTokenView, RefreshAuthTokenView router = routers.DefaultRo...
agpl-3.0
-8,888,957,358,530,266,000
52.95
93
0.751391
false
robert-7/gambit
src/python/gambit/tests/test_games/personal_test_games/read_and_solve.py
1
1668
import gambit, time, os, sys from utils import compute_time_of ''' Read GAME_FILE in SAVED_GAMES_DIRECTORY and create a tree from it. ''' def create_tree(args): os.chdir(SAVED_GAMES_DIRECTORY) g = gambit.Game.read_game(GAME_FILE) os.chdir(PARENT_DIRECTORY) return g ''' Solve the game. ''' def solve_ga...
gpl-2.0
2,718,975,047,332,783,600
24.272727
98
0.642086
false
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/core/basics/map.py
1
3291
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
mit
8,885,819,028,416,556,000
35.555556
128
0.452888
false
legalsylvain/oca-custom
__unported__/oca_freestore/models/github_organization.py
1
5227
# -*- coding: utf-8 -*- # Copyright (C) 2016-Today: Odoo Community Association (OCA) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api class GithubOrganization(models.Model): _name = 'github.or...
agpl-3.0
4,811,223,040,879,998,000
36.604317
78
0.62005
false
Edern76/MatchsticksGame
name.py
1
11395
#!/usr/bin/env python3 # -*- coding: utf8 -*- import threading, time from tkinter import * from tkinter.messagebox import * status = '' #Variable servant à la fois à indiquer si l'on peut poursuivre l'exécution du programme (càd si l'on a entré un (ou plusieurs, selon la situation) nom valide et cliqué sur OK) et à r...
mit
-1,213,387,413,839,428,000
59.473118
523
0.639459
false
DataONEorg/d1_python
gmn/src/d1_gmn/app/management/commands/diag-restore-sciobj.py
1
8217
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
apache-2.0
-1,802,804,323,378,339,300
48.203593
111
0.720579
false