repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
lmjohns3/downhill
test/base_test.py
1
3100
import downhill import numpy as np import util class TestBuild: def test_sgd(self): assert isinstance(util.build_rosen('sgd')[0], downhill.SGD) assert isinstance(util.build_factor('sgd')[0], downhill.SGD) def test_nag(self): assert isinstance(util.build_rosen('nag')[0], downhill.NAG)...
mit
-4,127,588,063,821,869,600
33.444444
85
0.590323
false
3.421634
true
false
false
kevthehermit/viper
viper/modules/jar.py
2
2038
# -*- coding: utf-8 -*- # This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import hashlib import zipfile from viper.common.abstracts import Module from viper.core.session import __sessions__ class Jar(Module): cmd = 'jar' description = 'P...
bsd-3-clause
3,725,401,441,174,335,500
30.353846
105
0.541217
false
3.949612
false
false
false
compas-dev/compas
src/compas/datastructures/network/duality.py
1
5940
from __future__ import print_function from __future__ import absolute_import from __future__ import division from math import pi from compas.utilities import pairwise from compas.geometry import angle_vectors from compas.geometry import is_ccw_xy __all__ = [ 'network_find_cycles', ] PI2 = 2.0 * pi def netwo...
mit
5,137,100,386,426,476,000
27.834951
122
0.557407
false
3.673469
false
false
false
rafamanzo/colab
colab/plugins/trac/migrations/0001_initial.py
1
4776
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations, connections def create_views(apps, schema_editor): connection = connections['trac'] cursor = connection.cursor() # revision_view cursor.execute(''' CREATE OR REPLACE VIEW revision_view ...
gpl-2.0
-4,734,781,128,982,950,000
32.87234
96
0.621022
false
4.174825
false
false
false
rembo10/headphones
lib/pygazelle/api.py
1
16383
#!/usr/bin/env python # # PyGazelle - https://github.com/cohena/pygazelle # A Python implementation of the What.cd Gazelle JSON API # # Loosely based on the API implementation from 'whatbetter', by Zachary Denton # See https://github.com/zacharydenton/whatbetter from HTMLParser import HTMLParser import sys import json...
gpl-3.0
1,708,872,479,942,694,700
38.100239
124
0.591101
false
4.175076
false
false
false
reidlindsay/wins
sandbox/experiments/aloha/infocom/parse-per.py
1
6546
#! /usr/bin/env python """ Parse PER vs. SINR data from trace files. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-10-19 17:04:02 -0500 (Wed, 19 Oct 2011) $ * $LastChangedRevision: 5220 $ :author: Ketan Mandke <kmandke@mail.utexas.edu> :copyright: Copyright 2009-2011 The Unive...
apache-2.0
5,629,459,248,063,967,000
35.366667
95
0.543996
false
3.801394
false
false
false
douglassquirrel/alexandra
libraries/pubsub.py
1
7745
from docstore import connect as docstore_connect from pika import BlockingConnection, ConnectionParameters from re import match from time import time as now from urllib2 import build_opener, HTTPHandler, Request, urlopen EXCHANGE = 'alexandra' HTTP_PATIENCE_SEC = 1 class AMQPConnection: def __init__(self, url, co...
mit
-9,086,060,357,095,325,000
33.575893
77
0.59277
false
3.837958
false
false
false
zarr-developers/numcodecs
numcodecs/fixedscaleoffset.py
1
4198
import numpy as np from .abc import Codec from .compat import ensure_ndarray, ndarray_copy class FixedScaleOffset(Codec): """Simplified version of the scale-offset filter available in HDF5. Applies the transformation `(x - offset) * scale` to all chunks. Results are rounded to the nearest integer but ar...
mit
3,727,921,587,109,626,400
29.867647
93
0.57051
false
3.527731
false
false
false
treverhines/PyGeoNS
pygeons/plot/quiver.py
1
5221
''' This module provides a quiver function which allows for error ellipses. ''' import numpy as np from matplotlib.quiver import Quiver as _Quiver from matplotlib.collections import EllipseCollection from matplotlib.backends import pylab_setup from matplotlib.pyplot import sci from matplotlib.pyplot import gca from sc...
mit
676,115,310,877,625,300
28.834286
88
0.583605
false
3.230817
false
false
false
yinzishao/programming
offer_11.py
1
1126
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None """ 链表中倒数第k个结点 题目描述 输入一个链表,输出该链表中倒数第k个结点。 特殊情况 k=0 k 超过长度 head 为空 思路: 如果我们在遍历时维持两个指针,第一个指针从链表的头指针开始遍历,在第k-1步之前,第二个指针保持不动; 在第k-1步开始,第二个指针也开始从链表的头指针开始遍历。 由于两个指针的距离保持在k-1,当第一个(走在前面的)指针到达链表的尾结点时,第二个...
gpl-3.0
-1,569,520,840,452,344,800
20.914286
64
0.55483
false
1.589212
false
false
false
chhsiao90/cheat-ext
cheat_ext/utils.py
1
1503
import re import os _GITHUB_URL = "https://github.com" STATE_UNLINK = "unlink" STATE_CONFLICT = "conflict" STATE_LINKED = "linked" def get_github_url(repo): return _GITHUB_URL + "/" + repo + ".git" def get_cheat_path(): return os.path.join( os.path.expanduser("~"), ".cheat") def get_ext...
mit
-2,809,685,477,133,944,300
24.05
73
0.60479
false
3.211538
false
false
false
RTHMaK/RPGOne
deep_qa-master/deep_qa/layers/attention/attention.py
1
3467
from copy import deepcopy from typing import Any, Dict from keras import backend as K from overrides import overrides from ..masked_layer import MaskedLayer from ...common.params import get_choice_with_default from ...tensors.masked_operations import masked_softmax from ...tensors.similarity_functions import similari...
apache-2.0
5,103,416,499,689,313,000
39.313953
104
0.657341
false
4.259214
true
false
false
canardleteer/pydisque
pydisque/client.py
1
16532
"""Pydisque makes Disque easy to access in python.""" import redis from redis.exceptions import ConnectionError from functools import wraps try: # Python 3 from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest import logging logger = logging.getLogger(__name__) ...
mit
-4,344,732,607,685,367,300
30.792308
150
0.567566
false
4.19381
false
false
false
Trust-Code/trust-addons
crm_multi_call/models/multi_call.py
1
2414
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2015 Trustcode - www.trustcode.com.br # # ...
agpl-3.0
-1,911,900,117,082,598,700
48.265306
79
0.444905
false
4.615679
false
false
false
davy39/eric
Plugins/WizardPlugins/QRegExpWizard/Ui_QRegExpWizardRepeatDialog.py
1
7059
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardRepeatDialog.ui' # # Created: Tue Nov 18 17:53:58 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtW...
gpl-3.0
4,168,190,662,937,062,400
57.338843
121
0.726732
false
3.725066
false
false
false
EluOne/Nett
nett.py
1
42271
#!/usr/bin/python 'Nova Echo Trade Tool' # Copyright (C) 2014 Tim Cumming # # 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 vers...
gpl-3.0
5,782,214,964,515,885,000
51.315594
177
0.606752
false
3.596614
false
false
false
mleger45/turnex
msn/tests/test_consumer.py
1
1441
# -*- coding: utf-8 -*- from channels import Group from channels.test import ChannelTestCase, WSClient, apply_routes #TODO: use apply_routes here, these tests are wrong. from msn import consumer class MSNConsumerTest(ChannelTestCase): def test_ws_connect(self): client = WSClient() default = ...
mit
8,777,828,271,155,742,000
36.921053
87
0.575295
false
4.340361
true
false
false
nens/raster-tools
raster_tools/txt2tif.py
1
2465
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Create tif rasters from xyz files by linear interpolation using griddata. """ import argparse import math import os from osgeo import gdal from osgeo import osr import numpy as np from raster_tools import datasets WIDTH = 0.5 HEIGHT = 0.5 NO_DATA_VALUE = np.finfo('f...
gpl-3.0
-6,831,315,423,260,359,000
27.011364
78
0.599189
false
3.176546
false
false
false
BorgERP/borg-erp-6of3
verticals/garage61/acy_work_order/workorder.py
1
5022
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010 Acysos S.L. (http://acysos.com) All Rights Reserved. # Ignacio Ibeas <ignacio@acysos.com> # $Id$ # # This program i...
agpl-3.0
4,570,658,077,266,191,400
45.943925
310
0.612505
false
3.671053
false
false
false
galad-loth/DescHash
DeepHash/TestDH.py
1
1206
import numpy as npy import mxnet as mx import logging from symbols.symbol_dh import DHMidLayer,DHLossLayer from common.data import SiftSmallIter batchsize=50 opProj1=DHMidLayer(96,0.0001,0.0001) opProj2=DHMidLayer(64,0.0001,0.0001) opOut=DHLossLayer(0.001) data = mx.symbol.Variable('data') lm1=opProj1...
apache-2.0
6,880,003,447,890,738,000
26.046512
63
0.667496
false
2.778802
false
false
false
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/echoclient/cli.py
1
3199
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Dummy echo client based on binary protocol with asyncio ''' import asyncio import struct class conn_mgr: def __init__(self, addr, port, asyncio_loop): ''' initialize object member variables ''' # network connection information self.addr ...
apache-2.0
257,500,368,639,662,980
31.642857
103
0.599562
false
3.99875
false
false
false
DemocracyClub/yournextrepresentative
ynr/apps/people/data_removal_helpers.py
1
4426
""" A set of helpers that automate personal data removal. Used in the admin interface, typically after a GDPR request for removal. """ import abc from collections import defaultdict DELETED_STR = "<DELETED>" class BaseCheck(metaclass=abc.ABCMeta): def __init__(self, person): self.person = person d...
agpl-3.0
-711,959,650,726,068,900
29.736111
79
0.491414
false
4.558187
false
false
false
jstacoder/flask-basehead
flask_basehead/core.py
1
2152
''' new_bc.core.py core api calls for new_bc api library ''' import os import requests API_URL = 'https://basecamp.com/{}/api/v1/' MY_BC_NUMBER = '2361076' def make_api_url(account_num=None,call=None,*args): if account_num is None: account_num = MY_BC_NUMBER if call is None: call = ...
bsd-3-clause
-6,049,897,316,050,391,000
27.693333
84
0.560409
false
3.557025
false
false
false
kaushik94/sympy
sympy/assumptions/satask.py
2
5183
from __future__ import print_function, division from sympy import Symbol, S from sympy.assumptions.ask_generated import get_all_known_facts from sympy.assumptions.assume import global_assumptions, AppliedPredicate from sympy.assumptions.sathandlers import fact_registry from sympy.core import oo from sympy.logic.infere...
bsd-3-clause
-4,291,670,985,093,664,300
31.803797
91
0.612001
false
3.753077
false
false
false
umaptechnologies/must
details/factories.py
1
4044
import inspect from class_pattern import ClassPattern from primitive_musts import SafeObject class Factory(object): ''' WRITEME ''' def __init__(self, obj_constructor, constructor_args, product_pattern, universe, known_parameters): self._obj_constructor = obj_constructor self._constructor_args...
apache-2.0
4,343,050,456,781,097,000
37.514286
213
0.638229
false
4.190674
false
false
false
mjirik/io3d
io3d/fsbrowser.py
1
17535
#! /usr/bin/env python # -*- coding: utf-8 -*- from loguru import logger import glob import numpy as np import os # TODO remove cv2 - done import matplotlib.pyplot as plt from fnmatch import fnmatch try: import pydicom as pdicom except ImportError: import warnings with warnings.catch_warnings(): ...
mit
-8,339,100,194,311,851,000
31.814607
116
0.47315
false
3.863947
false
false
false
sfu-discourse-lab/SFU_Comment_Extractor
Source_Code/CSV_creation/duplicate_threads.py
1
2389
import pandas as pd import re import ast import multiprocessing as mp from multiprocessing import cpu_count import sys def check_match(thread_df): pat = "source2_\d+_\d+" for i, row in thread_df.iterrows(): duplicate = ast.literal_eval(row.duplicate_flag) if not duplicate['exact_match']: ...
mit
-2,227,418,396,662,079,500
30.434211
118
0.609041
false
3.523599
false
false
false
leiferikb/bitpop
src/v8/tools/js2c.py
1
15907
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
gpl-3.0
-8,353,512,724,255,907,000
29.947471
101
0.663293
false
3.540396
false
false
false
fastflo/emma
emmalib/providers/sqlite/test.py
1
1782
# -*- coding: utf-8 -*- # emma # # Copyright (C) 2006 Florian Schmidt (flo@fastflo.de) # 2014 Nickolay Karnaukhov (mr.electronick@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 F...
gpl-2.0
3,862,581,033,829,721,000
31.4
75
0.640853
false
3.807692
false
false
false
jbeyerstedt/RIOT-OTA-update
examples/ota_update/test2.py
1
6712
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017 Jannik Beyerstedt <jannik.beyerstedt@haw-hamburg.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # module for integration in ...
lgpl-2.1
2,028,957,324,872,644,600
30.218605
135
0.639005
false
3.337643
true
false
false
juancarlospaco/unicodemoticon
unicodemoticon/__main__.py
1
1742
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from datetime import datetime from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QStyle from anglerfish import (make_logger, check_encoding, make_post_exec_msg, set_process_name, set_single...
gpl-3.0
616,482,973,865,316,100
28.525424
77
0.691734
false
3.54065
false
false
false
cerisola/fiscomp
percolation/analysis/common.py
1
1592
import numpy as np import scipy.stats as stats import scipy.integrate as integrate Z_normal = { None: 1, '90': 1.644854, '95': 1.959964, '99': 2.575829, '99.9': 3.290527, '99.99': 3.890592 } # % Generic % # def mean(v): return np.mean(v) def var(v): return np.var(v, ddof=1) def std(v): return np.std...
mit
1,011,829,247,394,902,300
20.808219
107
0.56407
false
2.287356
false
false
false
cligs/tmw
tmw_config.py
1
8798
#!/usr/bin/env python3 # Filename: my_tmw.py # Author: #cf # Version 0.2.0 (2015-08-27) ################################################################## ### CONFIG FILE for: Topic Modeling Workflow (tmw) ### ################################################################## # Used in the following pape...
mit
6,944,172,194,449,163,000
36.918103
143
0.69285
false
3.145156
false
false
false
schristakidis/p2ner
p2ner/components/plugin/holepuncher/holepuncher/holepuncher.py
1
8114
from p2ner.core.namespace import Namespace, initNS # Copyright 2012 Loris Corazza, Sakis Christakidis # # 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/l...
apache-2.0
1,949,153,275,522,752,800
32.390947
125
0.576165
false
3.802249
false
false
false
wowkin2/react-redux-api
apps/courses.py
1
3362
from flask_restful import reqparse, abort, Resource from common import api, db from constants import HttpStatus, EMPTY_JSON from helpers import handle_bson COLL_COURSES = 'courses' course_parser = reqparse.RequestParser() course_parser.add_argument('id', required=True) course_parser.add_argument('title') course_par...
mit
4,885,421,960,994,691,000
31.019048
90
0.560976
false
3.565217
false
false
false
Clinical-Developers/Clinical_Developer_Challenges
HCAs-Nurses/Solution.py
1
1260
# This is a maths problem not primarily a progamming one. # As such the solution function call might look like this: This is probably the most compact/clever way to express it in Python. def staffing(staff_units, patients): HCA, nurse = 2*staff_units-patients/2, patients/2-staff_units if HCA < 0 or nurse < 0 o...
gpl-3.0
-7,423,222,444,443,985,000
36.058824
128
0.706349
false
3.255814
false
false
false
bewareoftheapp/fluxapp
user/migrations/0001_initial.py
1
1219
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-09-18 23:37 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import user.models class Migration(migrations.Migration): initial = True dependencies = ...
mit
-2,177,746,098,601,376,000
32.861111
121
0.607055
false
4.232639
false
false
false
tkchafin/mrbait
tests/benchmark_MIS.py
1
5580
#!/usr/bin/python import networkx as nx import time import networkx.algorithms.approximation as nxaa import matplotlib.pyplot as plt import numpy as np from networkx.utils import powerlaw_sequence """Code for ATTEMPTING to approximate the maximal independent set in a graph of conflicting sequences (e.g. aligned > thr...
gpl-3.0
7,596,444,725,467,537,000
31.823529
101
0.62957
false
2.907764
false
false
false
skapfer/rubber
src/depend.py
1
11127
""" This module contains code for handling dependency graphs. """ # vim: noet:ts=4 import logging msg = logging.getLogger (__name__) import os.path import subprocess import rubber.contents from rubber.util import _ class MakeError (Exception): def __init__ (self, msg, errors): super (MakeError, self).__in...
gpl-2.0
1,698,966,926,278,784,000
35.126623
89
0.512717
false
4.665409
false
false
false
bavardage/qtile
libqtile/widget/base.py
1
5948
from .. import command, utils, bar LEFT = object() CENTER = object() class _Drawer: """ A helper class for drawing and text layout. """ _fallbackFont = "-*-fixed-bold-r-normal-*-15-*-*-*-c-*-*-*" def __init__(self, qtile, window): self.qtile, self.window = qtile, window self.win...
mit
11,768,831,008,628,596
31.502732
94
0.566745
false
3.908016
true
false
false
elopio/snapcraft
snapcraft/internal/lxd/_cleanbuilder.py
1
2770
#!/usr/bin/python3 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program...
gpl-3.0
4,744,793,001,829,084,000
40.343284
76
0.646209
false
4.049708
false
false
false
i-wind/pyqt_todo
db/model.py
1
2729
#!/usr/bin/env python # -*- coding: utf8 -*- """ @script : model.py @created : 2012-11-04 01:48:15.090 @changed : 2012-11-08 10:26:47.237 @creator : mkpy.py --version 0.0.27 @author : Igor A.Vetrov <qprostu@gmail.com> @about : model of TODO application """ from __future__ import print_function from argparse import...
mit
-2,385,009,913,102,353,000
30.011364
108
0.584463
false
3.441362
false
false
false
trevor/calendarserver
txdav/caldav/datastore/scheduling/test/test_utils.py
1
7711
## # Copyright (c) 2013-2014 Apple 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 l...
apache-2.0
683,524,874,323,820,200
33.734234
128
0.652315
false
3.62359
true
false
false
synctree/synctree-awsebcli
ebcli/lib/aws.py
1
10403
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
apache-2.0
-8,400,662,935,267,153,000
31.108025
88
0.612804
false
4.230582
false
false
false
dekked/dynamodb-mock
ddbmock/database/storage/sqlite.py
1
3773
# -*- coding: utf-8 -*- from ..item import Item from ddbmock import config import sqlite3, cPickle as pickle # I know, using global "variable" for this kind of state *is* bad. But it helps # keeping execution times to a sane value. In particular, this allows to use # in-memory version of sqlite conn = sqlite3.connect...
lgpl-3.0
7,474,325,584,043,636,000
37.111111
123
0.536973
false
3.83825
false
false
false
uclouvain/osis_louvain
base/business/proposal_xls.py
1
4218
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-4,826,060,251,302,619,000
45.855556
109
0.64904
false
3.799099
false
false
false
digitalocean/netbox
netbox/dcim/tests/test_models.py
1
20944
from django.core.exceptions import ValidationError from django.test import TestCase from circuits.models import * from dcim.choices import * from dcim.models import * from tenancy.models import Tenant class RackGroupTestCase(TestCase): def test_change_rackgroup_site(self): """ Check that all chi...
apache-2.0
6,810,999,451,422,508,000
35.551483
116
0.603419
false
3.795578
true
false
false
adamwiggins/cocos2d
tools/skeleton/skeleton_editor.py
2
5454
import os, sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) # import math from math import pi, atan import cPickle import glob from optparse import OptionParser import pyglet from pyglet.gl import * from pyglet.window import key import cocos from cocos.director import director from cocos.sprit...
bsd-3-clause
6,242,549,518,128,177,000
31.464286
84
0.595526
false
3.434509
false
false
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/work_group_v20.py
1
5166
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
2,386,846,838,889,565,700
30.120482
119
0.590205
false
3.863874
false
false
false
argriffing/arbtkf91
repro/data_source.py
1
1854
""" yield stuff from a hardcoded data source """ from __future__ import print_function, division import os import numpy as np from numpy.testing import assert_array_equal, assert_equal from Bio import SeqIO __all__ = ['gen_files', 'gen_sequence_pairs'] #mypath = os.path.realpath('../../stamatakis/benchMark_data') ...
gpl-2.0
2,098,660,419,289,982,200
24.75
61
0.600863
false
3.458955
false
false
false
Scriptkiddi/Ankipubsub-Client
pubsub/gui/auto_gen/ankipubsub_settings.py
1
2166
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ankipubsub_settings.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fr...
gpl-3.0
377,500,660,763,704,260
38.381818
79
0.672207
false
3.786713
false
false
false
Squishymedia/feedingdb
src/feeddb/feed/migrations/0005_name2title_drop_name.py
1
36453
from south.db import db from django.db import models from feeddb.feed.models import * class Migration: def forwards(self, orm): # Deleting field 'Trial.name' db.delete_column('feed_trial', 'name') # Deleting field 'Experiment.name' db.delete_column('feed_expe...
gpl-3.0
-1,834,002,616,285,841,700
81.659864
189
0.551093
false
3.606351
false
false
false
dashea/redhat-upgrade-tool
redhat_upgrade_tool/sysprep.py
1
8052
# sysprep.py - utility functions for system prep # # Copyright (C) 2012 Red Hat 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 ...
gpl-2.0
5,812,619,654,188,032,000
34.315789
84
0.643939
false
3.75735
true
false
false
jefftc/changlab
Betsy/Betsy/modules/preprocess_mas5.py
1
1766
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, outfile): """preprocess the inputfile with MAS5 using preprocess.py will g...
mit
-8,856,985,929,441,454,000
35.791667
78
0.620612
false
4.14554
false
false
false
MissionCriticalCloud/marvin
marvin/cloudstackAPI/updateNetwork.py
1
11415
"""Updates a network""" from baseCmd import * from baseResponse import * class updateNetworkCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """the ID of the network""" """Required""" self.id = None self.typeInfo['id'] = 'uuid' """Force up...
apache-2.0
-8,208,851,891,698,272,000
40.061151
133
0.599124
false
4.37524
false
false
false
Eigenlabs/EigenD
plg_sampler2/sf2.py
1
7476
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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) a...
gpl-3.0
9,204,759,465,939,505,000
27.753846
167
0.58534
false
2.820068
false
false
false
qiyuangong/APA
anatomizer.py
1
3783
import random, heapq import pdb # by Qiyuan Gong # qiyuangong@gmail.com # @INPROCEEDINGS{ # author = {Xiao, Xiaokui and Tao, Yufei}, # title = {Anatomy: simple and effective privacy preservation}, # booktitle = {Proceedings of the 32nd international conference on Very large data # bases}, # year = {2006},...
mit
1,053,349,836,134,681,500
25.089655
84
0.548506
false
3.562147
false
false
false
xlqian/navitia
source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_journey.py
1
2827
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
-8,374,270,853,840,085,000
30.411111
101
0.651928
false
3.583016
false
false
false
acca90/django-tests
cello/produto/migrations/0001_initial.py
1
1354
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-11 00:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Produt...
mit
7,758,737,332,258,354,000
38.823529
123
0.573855
false
3.699454
false
false
false
coxmediagroup/dolphin
dolphin/testutils.py
1
4503
import os from sys import stdout, stderr from contextlib import contextmanager from django.db.models import get_apps from django.utils import simplejson as sj from django.core import serializers from django.conf import settings from django.utils.itercompat import product from .middleware import LocalStoreMiddleware ...
mit
5,224,790,747,942,182,000
34.456693
97
0.50433
false
5.093891
false
false
false
cmollet/macro-chef
yummly.py
1
3288
import requests import time try: import simplejson as json except ImportError: import json from pymongo import Connection from paleo import paleo_ingredients, excludedIngredients app_key = open('app.key').read().strip() app_id = open('app_id.key').read().strip() def mongoconn(name='bespin'): return Connec...
mit
-4,144,650,630,414,836,000
32.896907
231
0.601277
false
3.058605
false
false
false
shendo/peerz
peerz/examples/visualise.py
1
1704
# Peerz - P2P python library using ZeroMQ sockets and gevent # Copyright (C) 2014-2015 Steve Henderson # # 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...
gpl-3.0
1,749,261,066,399,993,300
33.08
73
0.692488
false
3.728665
false
false
false
nathanielvarona/airflow
tests/providers/qubole/operators/test_qubole_check.py
1
7409
# # 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...
apache-2.0
7,868,135,222,770,688,000
36.419192
110
0.671751
false
3.702649
true
false
false
AvishaySebban/NTM-Monitoring
ansible/psutil-3.0.1/psutil/__init__.py
1
66350
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """psutil is a cross-platform library for retrieving information on running processes and system utilization...
artistic-2.0
-1,882,063,374,360,191,700
34.048626
79
0.550685
false
4.37703
false
false
false
VirusTotal/msticpy
tools/toollib/url_checker_async.py
1
7616
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Python ...
mit
-6,428,462,102,758,438,000
28.75
88
0.588629
false
3.979101
false
false
false
vinaykrdahiya/justuploads
main/__init__.py
1
2292
import falcon # from main.settings import DB as db # from main.helpers import QueryParser import json import urlparse from werkzeug.http import parse_options_header from werkzeug.formparser import parse_form_data from cStringIO import StringIO from werkzeug.wsgi import LimitedStream from werkzeug import secure_filename...
unlicense
-2,264,388,575,298,547,000
33.727273
80
0.603403
false
4.042328
false
false
false
aphelps/platformio
platformio/builder/tools/platformio.py
1
10717
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. import atexit import platform import re from os import getenv, listdir, remove, sep, walk from os.path import basename, dirname, isdir, isfile, join, normpath from time import sleep from SCons.Script import Exit, SConscript, SConscriptChdir fro...
mit
-2,971,078,524,403,639,300
30.15407
79
0.528599
false
3.698068
false
false
false
dlarochelle/extractor_train
tests/test_forms.py
1
2252
# -*- coding: utf-8 -*- import pytest from extractor_train.public.forms import LoginForm from extractor_train.user.forms import RegisterForm from .factories import UserFactory class TestRegisterForm: def test_validate_user_already_registered(self, user): # Enters username that is already registered ...
bsd-3-clause
-4,317,048,631,488,596,000
35.934426
74
0.672735
false
4.415686
true
false
false
aniversarioperu/django-manolo
scrapers/manolo_scraper/spiders/minem.py
2
3163
# -*- coding: utf-8 -*- import math import scrapy from .spiders import ManoloBaseSpider from ..items import ManoloItem from ..item_loaders import ManoloItemLoader from ..utils import make_hash, get_dni # url: http://intranet.minem.gob.pe/GESTION/visitas_pcm class MinemSpider(ManoloBaseSpider): name = 'minem' ...
bsd-3-clause
4,511,216,025,104,690,000
35.356322
112
0.579829
false
3.322479
false
false
false
dderichs/piradio
piradio/observer.py
1
5042
# -*- coding: utf-8 -*- """ * Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net> * * Omikron is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or...
gpl-3.0
-8,911,325,307,187,469,000
29.932515
106
0.576359
false
4.082591
false
false
false
saskartt/P4UL
pyNetCDF/syncMaskWithNetCdf.py
1
5983
#!/usr/bin/env python from netcdfTools import * from mapTools import * from utilities import writeLog import sys import argparse import numpy as np ''' Description: Author: Mikko Auvinen mikko.auvinen@helsinki.fi University of Helsinki & Finnish Meteorological Institute ''' #============= f...
mit
-1,528,385,973,083,507,700
34.402367
94
0.623767
false
2.820839
false
false
false
geodynamics/pylith
tests/fullscale/linearelasticity/nofaults-2d/sheartraction_gendb.py
1
2474
#!/usr/bin/env nemesis # # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://g...
mit
6,571,733,550,315,437,000
29.925
75
0.525869
false
3.871674
false
false
false
gsnbng/erpnext
erpnext/hr/utils.py
1
17205
# 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, erpnext from frappe import _ from frappe.utils import formatdate, format_datetime, getdate, get_datetime, nowdate, flt, cstr, add_days, t...
agpl-3.0
-7,992,770,331,410,956,000
36.730263
123
0.706306
false
3.052697
false
false
false
lantianlz/qiexing
www/journey/views.py
1
5036
# -*- coding: utf-8 -*- import json from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from common import utils, page from www.journey import interface from www.misc.decorators import member_required, staff_req...
gpl-2.0
-7,290,553,088,338,072,000
34.485714
125
0.662037
false
3.244938
false
false
false
MGApcDev/LamasAndGroves
src/wordbranch.py
1
2333
class WordBranch(object): """WordBranch represents a single branch in the tree of all the valid word combinations. Attributes: letter_branch (LetterBranch) The reference to the LetterBranch that represents the word. origin (WordBranch) The reference to the parent WordBranch. ...
mit
8,808,247,715,610,096,000
37.542373
98
0.583369
false
4.486538
false
false
false
alehander42/bach
bach/bach_macro.py
1
4898
import types import bach_ast import compiler import bach_stl from errors import MacroMatchError def register_macro(mapping, label, macro, count=None): if label not in mapping: mapping[label] = [] if isinstance(macro, types.FunctionType): mapping[label].append((count, macro)) else: m...
mit
1,044,999,443,034,420,000
39.147541
126
0.576766
false
3.572575
false
false
false
juliusdedekind/FindDuplicateFiles
FindDuplicates.py
1
2897
"""Find duplicate files inside a directory tree.""" from os import walk, remove, stat from os.path import join as joinpath from hashlib import md5 import threading import Queue import time import sys class Scanner(threading.Thread): def __init__(self, path, queue, finished_scan): threading.Thr...
gpl-3.0
-9,085,385,887,322,903,000
38.802817
103
0.563687
false
4.741408
false
false
false
armanpazouki/chrono
src/demos/python/chrono-tensorflow/PPO/train.py
1
12022
""" PPO: Proximal Policy Optimization serial version """ import sys sys.path.append('../envs') import chtrain as gym import numpy as np from policy import Policy from value_function import NNValueFunction import scipy.signal from utils import Logger, Scaler from datetime import datetime import argparse import signal ...
bsd-3-clause
-2,523,526,546,991,726,000
37.780645
147
0.6182
false
3.786457
false
false
false
RuudBurger/CouchPotatoServer
couchpotato/core/downloaders/deluge.py
1
16194
from base64 import b64encode, b16encode, b32decode from datetime import timedelta from hashlib import sha1 import os.path import re import traceback from bencode import bencode as benc, bdecode from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList from couchpotato.core.helpers.encoding...
gpl-3.0
8,216,095,494,107,268,000
37.374408
512
0.545943
false
4.40893
false
false
false
smira/fmspy
fmspy/application/room.py
1
2208
# FMSPy - Copyright (c) 2009 Andrey Smirnov. # # See COPYRIGHT for details. """ Application rooms. """ class Room(object): """ Room (scope, context) is location inside application where clients meet. Room holds server objects: streams, shared objects, etc. It can be used to iterate over clients in ro...
mit
-1,946,959,390,960,262,100
22.242105
87
0.567482
false
4.238004
false
false
false
chadgates/locmaster
unlocode/csvimport.py
1
10411
from unlocode.models import Country, SubDivision, Locode, LocCountry, LocFunction, LocStatus, LocSubdivision, LocVersion from unlocode.models import LocChangeIndicator import os import csv import logging from django.db import IntegrityError, transaction def saveatomic(object, logger): result = False try: ...
bsd-3-clause
5,067,940,848,887,395,000
31.232198
120
0.600038
false
3.97974
false
false
false
Birion/python-ffdl
pyffdl/core/app.py
1
4385
import shutil from typing import List, Tuple, Optional import attr import click from furl import furl # type: ignore from pyffdl.__version__ import __version__ from pyffdl.sites import ( AdultFanFictionStory, ArchiveOfOurOwnStory, FanFictionNetStory, HTMLStory, TwistingTheHellmouthStory, TGSt...
mit
876,202,144,005,720,600
27.848684
116
0.601596
false
3.316944
false
false
false
libvirt/libvirt-python
examples/domstart.py
1
1239
#!/usr/bin/env python3 """ Check that the domain described by DOMAIN.XML is running. If the domain is not running, create it. """ import libvirt import libxml2 from argparse import ArgumentParser from typing import Tuple # Parse the XML description of domU from FNAME # and return a tuple (name, xmldesc) where NAME #...
lgpl-2.1
-1,861,244,689,678,241,000
25.361702
113
0.688458
false
3.529915
false
false
false
liuwill-projects/flask-server-scaffold
main.py
1
1505
#!/usr/bin/python # -*- coding: UTF-8 -*- import os from flask import Flask, jsonify # , request, current_app from flask_cors import CORS, cross_origin from flask_socketio import SocketIO, emit, send from chat.utils.jsonp import jsonp from chat.controllers.mock import Mock import logging from logging.config import file...
mit
7,558,739,674,957,527,000
24.508475
63
0.682392
false
3.128898
false
false
false
theY4Kman/infusionsoft-client
setup.py
1
1956
import os from setuptools import setup, find_packages def build_install_requires(path): """Support pip-type requirements files""" basedir = os.path.dirname(path) with open(path) as f: reqs = [] for line in f: line = line.strip() if not line: continu...
apache-2.0
1,362,176,675,255,124,500
30.047619
82
0.593047
false
3.842829
false
false
false
brigittebigi/proceed
proceed/src/term/textprogress.py
1
5853
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ __ __ ___ # / | \ | \ | \ / Automatic # \__ |__/ |__/ |___| \__ Annotation # \ | | | | \ ...
gpl-3.0
-6,311,342,072,019,640,000
27.832512
78
0.411584
false
4.495392
false
false
false
chenzhengchen200821109/github-python
socketerror.py
1
1117
#!/bin/python # Error handing import socket, sys host = sys.argv[1] textport = sys.argv[2] filename = sys.argv[3] try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) except socket.error, e: print "Strange error creating socket: %s" % e sys.exit(1) try: port = int(textport) except ValueError: ...
mit
3,929,081,061,703,721,000
20.901961
62
0.615936
false
3.002688
false
false
false
hasibi/TAGME-Reproducibility
scripts/evaluator_annot.py
1
6793
""" This script computes Topic metrics for the end-to-end performance. Precision and recall are macro-averaged. Matching condition: entities should match and mentions should be equal or contained in each other. @author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no) """ from __future__ import division import sys from co...
mit
5,499,083,128,206,597,000
35.718919
117
0.580892
false
3.50697
false
false
false
conda/kapsel
conda_kapsel/internal/toposort.py
1
2834
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright © 2016, Continuum Analytics, Inc. All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. # -------------------------------------------------------------------...
bsd-3-clause
6,041,369,235,106,766,000
31.563218
104
0.5976
false
4.041369
false
false
false
demianw/tract_querier
tract_querier/tests/test_query_eval.py
1
10072
from .. import query_processor from nose.tools import assert_true, assert_equal from numpy import random import ast # Ten tracts traversing random labels another_set = True while (another_set): tracts_labels = dict([(i, set(random.randint(100, size=2))) for i in range(100)]) labels_tracts = query_processor.la...
bsd-3-clause
-3,546,840,993,955,329,000
32.131579
113
0.629468
false
3.286134
true
false
false
morganmeliment/Calculate-Pi
calculatepi.py
1
1034
""" calculatepi.py Author: Morgan Meliment Credit: none Assignment: Write and submit a Python program that computes an approximate value of π by calculating the following sum: (see: https://github.com/HHS-IntroProgramming/Calculate-Pi/blob/master/README.md) This sum approaches the true value of π as n approaches ∞. ...
mit
-4,700,008,651,961,431,000
32.193548
107
0.729835
false
3.384868
false
true
false
gh4w/some
web/diego/pronostix/scripts/load_database.py
1
1473
# coding: utf8 #! /usr/bin/env python3 import json import re import iso8601 as iso from pronostix.models import Club, Rencontre def get_entity_id(entity): return get_url_id(entity['_links']['self']['href']) def get_url_id(url): regex = re.compile('http://api.football-data.org/v1/[^/]+/(?P<id>\d+)$') m = ...
mit
-5,689,127,188,113,624,000
30.340426
138
0.610998
false
2.922619
false
false
false
magnusmorton/nest
nest/main.py
1
1314
#!/usr/bin/env python # encoding: utf-8 """ Created by Magnus Morton on 2012-03-14. (c) Copyright 2012 Magnus Morton. This file is part of Nest. Nest is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either...
agpl-3.0
6,048,209,914,957,177,000
29.55814
104
0.750381
false
3.765043
false
false
false
bazz-erp/erpnext
erpnext/accounts/doctype/eventual_purchase_invoice/eventual_purchase_invoice.py
1
3890
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from erpnext.accounts.general_ledger import make_gl_entries from frappe.utils i...
gpl-3.0
-2,652,611,756,018,956,000
31.416667
128
0.569409
false
3.882236
false
false
false
mtbc/openmicroscopy
components/tools/OmeroWeb/omeroweb/webstart/views.py
1
4134
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008-2014 University of Dundee. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licens...
gpl-2.0
4,398,770,162,860,684,000
33.739496
110
0.676343
false
3.645503
false
false
false
MrChoclate/optim
tsp.py
1
3352
import itertools import math import functools import time import random import copy def timer(func): def with_time(*args, **kwargs): t = time.time() res = func(*args, **kwargs) print("{} took {} sec".format(func.__name__, time.time() - t)) return res return with_time def read()...
gpl-3.0
-7,064,214,220,862,310,000
25.1875
97
0.571599
false
3.207656
false
false
false
nkolban/Espruino
scripts/common.py
1
16586
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # 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 ...
mpl-2.0
-2,976,484,380,835,921,000
43.347594
205
0.574882
false
3.804128
false
false
false
centrofermi/e3pipe
display/E3EventCanvas.py
1
5968
#!/usr/bin/env python # ********************************************************************* # * Copyright (C) 2015 Luca Baldini (luca.baldini@pi.infn.it) * # * * # * For the license terms see the file LICENCE, distributed * # * along ...
gpl-3.0
3,696,403,357,255,309,000
32.909091
78
0.487936
false
3.122972
false
false
false
nithintech/google-python-exercises
babynames/babynames.py
2
2533
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re import os """Baby Names exercise Define the extract_names() function b...
apache-2.0
3,653,605,300,787,971,600
22.896226
79
0.629293
false
3.015476
false
false
false
pbs/django-cms
cms/forms/widgets.py
1
9439
# -*- coding: utf-8 -*- from cms.forms.utils import get_site_choices, get_page_choices from cms.models import Page, PageUser, Placeholder from cms.plugin_pool import plugin_pool from cms.utils import get_language_from_request, cms_static_url from django.conf import settings from django.contrib.sites.models import Site ...
bsd-3-clause
-3,840,572,163,296,305,700
38.827004
139
0.580888
false
3.914973
false
false
false