repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
geudrik/Random
getPETimestamp.py
1
2487
#! /usr/bin/env python2.7 # # Author: Pat Litke (C) 2014 # # Description: # Quick and dirty module to read a binary file, look at the DOS header for the PE offset # Seek to the PE offset, read the third DWORD in, unpack it, and return either EPOCH or GMTIMEs # # NOTE: DON'T USE THIS IN PRODUCTION. This was a demo/l...
agpl-3.0
9,112,870,340,023,117,000
33.068493
136
0.640933
false
3.756798
false
false
false
quake0day/oj
minWindow.py
1
1347
import sys class Solution: """ @param source: A string @param target: A string @return: A string denote the minimum window Return "" if there is no such a string """ def minWindow(self, source, target): # write your code here count1 = {} count2 = {} f...
mit
7,392,275,635,060,292,000
27.659574
68
0.491463
false
3.582447
false
false
false
lmazuel/azure-sdk-for-python
azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/contentmoderator/models/detected_terms.py
2
1479
# 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
4,822,046,231,881,180,000
34.214286
81
0.578093
false
4.085635
false
false
false
belimawr/portunhol
portunhol/portunhol.py
1
2346
#!/bin/env python # -*- coding: utf-8 -*- ''' 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 version. This program ...
gpl-3.0
4,610,024,063,292,360,000
22.555556
82
0.528731
false
2.918648
false
false
false
PJMODOS/Pyrseas
pyrseas/dbobject/trigger.py
1
8299
# -*- coding: utf-8 -*- """ pyrseas.trigger ~~~~~~~~~~~~~~~ This module defines two classes: Trigger derived from DbSchemaObject, and TriggerDict derived from DbObjectDict. """ from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id EXEC_PROC = 'EXECUTE PROCEDURE ' EVENT_TYPES = ['INSERT'...
bsd-3-clause
-911,084,058,431,578,400
38.146226
79
0.54127
false
4.139152
false
false
false
dipongkar/ligocam
ligocam/LigoCAM_plotutils.py
1
23497
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pylab as plb import numpy as np def timeseries_plot(run_dir, x_n, x_nn, strcurGpsTime, strcurUtcTime, data, Fs): dlen = int(len(data) / 512) fig = plt.figure(2, figsize=(10,8)) plt.subplot(311) plt.plot(range(0, 50*dlen), da...
gpl-3.0
615,731,121,038,946,300
54.157277
81
0.485381
false
2.493844
false
false
false
HiSPARC/publicdb
publicdb/histograms/migrations/0016_meta.py
1
2804
# -*- coding: utf-8 -*- # Generated by Django 1.11.12 on 2018-07-06 11:46 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('histograms', '0015_datasettype_has_multiple_datasets'), ] operations = [ migration...
gpl-3.0
-4,751,105,452,675,926,000
40.850746
149
0.584522
false
4.581699
false
false
false
vertexproject/synapse
setup.py
1
4114
#!/usr/bin/env python import os import sys import subprocess from setuptools import setup, find_packages from setuptools.command.install import install VERSION = '2.47.0' class VerifyVersionCommand(install): """Custom command to verify that the git tag matches our version""" description = 'verify that the gi...
apache-2.0
-4,948,825,787,619,388,000
29.701493
87
0.528439
false
3.468803
false
false
false
palli/monitor-iceland
nagios-plugins/check_earthquake.py
1
2161
#!/usr/bin/env python # This script connects to hraun.vedur.is and # Graphs all earthquake measures found from dateutil.parser import parse import requests import sys import time from BeautifulSoup import BeautifulSoup from pynag.Plugins import PluginHelper,ok,warning,critical,unknown reload(sys) sys.setdefaultenco...
agpl-3.0
-291,186,427,164,655,800
28.60274
135
0.70199
false
3.201481
false
false
false
alvarocneto/learning_log
users/views.py
1
1160
from django.contrib.auth import authenticate, login, logout from django.contrib.auth.forms import UserCreationForm from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render def logout_view(request): """Faz logout do usuário""" logout(request)...
mit
7,321,275,416,293,730,000
35.09375
79
0.642424
false
4.277778
false
false
false
keysona/WeatherServer
WeatherSpider/WeatherSpider/pipelines.py
1
10440
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import logging from datetime import datetime from WeatherSpider import Province, City, Country,\ RealTimeInfo, T...
mit
-5,302,560,100,797,905,000
33.751678
99
0.479239
false
4.209756
false
false
false
Roguelazer/muttdown
muttdown/main.py
1
7320
from __future__ import print_function import argparse import sys import smtplib import re import os.path import email import email.iterators from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import subprocess import six import markdown import pynliner from . import config from . im...
isc
-1,156,613,102,188,773,400
32.577982
106
0.585792
false
3.895689
true
false
false
ScreamingUdder/mantid
Testing/SystemTests/tests/analysis/SANSFileChecking.py
3
9427
#pylint: disable=invalid-name,no-init #pylint: disable=too-many-public-methods """ Check that file manipulation works fine """ from __future__ import (absolute_import, division, print_function) import unittest import stresstesting from mantid.simpleapi import * import SANSUtility as su import os from ISISCommandInterf...
gpl-3.0
-4,389,141,456,974,014,500
39.286325
104
0.653548
false
3.29385
true
false
false
mburakergenc/Malware-Detection-using-Machine-Learning
cuckoo/analyzer/windows/modules/packages/doc.py
1
2418
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from _winreg import HKEY_CURRENT_USER from lib.common.abstracts import Package class DOC(Package): "...
mit
-421,892,278,962,936,960
36.78125
83
0.547146
false
3.918963
false
false
false
nishantnath/InsightDataScience_CodingChallenge2015
src/average_degree.py
1
6079
# example of program that calculates the average degree of hashtags # !/usr/bin/env python ''' Author : Nishant Nath | nnath@usc.edu | nishantnath.com Submission for the Insight Data Science - Coding Challenge. From : Insight Data Science Git Repo Readme.md The point of the second feature is to continually update the ...
mit
7,747,075,237,324,527,000
33.737143
167
0.674289
false
3.894299
false
false
false
peap/djarzeit
timers/views.py
1
7816
from datetime import datetime, time, timedelta import json from django.contrib import messages from django.core.exceptions import ValidationError from django.http import HttpResponse from django.shortcuts import redirect from django.utils.timezone import now from categories.models import Category from categories.view...
mit
-1,576,924,556,339,193,900
31.032787
78
0.551433
false
3.979633
false
false
false
landlab/landlab
tests/components/plant_competition_ca/test_plant_competition_ca.py
3
2228
""" Unit tests for landlab.components.plant_competition_ca.plant_competition_ca """ import numpy as np import pytest from numpy.testing import assert_array_almost_equal (_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e0, 10e0), (0.0, 0.0)) _ARGS = (_SHAPE, _SPACING, _ORIGIN) def test_name(ca_veg): assert ca_veg.name...
mit
-7,139,163,366,557,555,000
29.520548
81
0.637343
false
2.743842
true
false
false
mvaled/sentry
tests/sentry/utils/hashlib/tests.py
2
1266
# -*- coding: utf-8 -*- from __future__ import absolute_import import pytest import six from sentry.utils.hashlib import md5_text, sha1_text, hash_values from unittest import TestCase HASHLIB_VALUES_TESTS = ( ("seed", None, "75a0ad233bd9a091d9d26bacbe2f377e"), ("seed", True, "1057fb936dc9056388c0b9b48dd0c7...
bsd-3-clause
2,671,606,940,028,419,000
34.111111
81
0.704905
false
2.478431
true
false
false
QuinAsura/Omnipresence
OmniServer/HandGesEnable.py
1
8400
#!/usr/bin/python import socket, traceback import os import os.path import time import math from wiringx86 import GPIOGalileoGen2 as GPIO gpio = GPIO(debug=False) import thread #Stepper Motor Pins step = 0 direction = 1 #DC Motor Pins #For Motor 1 dir1 = 2 pwm1 = 3 brk1 = 4 #For Motor 2 dir2 = 8 pwm2 = 9 brk...
gpl-3.0
-2,289,714,226,189,698,000
31.941176
78
0.493333
false
3.804348
false
false
false
mfine/piksi_tools
piksi_tools/console/utils.py
1
3878
# Copyright (C) 2011-2014, 2016 Swift Navigation Inc. # Contact: Gareth McMullin <gareth@swift-nav.com> # Pasi Miettinen <pasi.miettinen@exafore.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # T...
lgpl-3.0
-7,628,762,170,297,414,000
24.682119
83
0.627901
false
2.949049
false
false
false
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/mkldnn/scripts/generate_mkldnn_debug.py
1
5741
#!/usr/bin/env python #=============================================================================== # Copyright 2018 Intel Corporation # # 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 # # ...
apache-2.0
-1,714,487,773,612,457,500
26.208531
80
0.602508
false
3.149205
false
false
false
tensorflow/agents
tf_agents/agents/ddpg/actor_rnn_network.py
1
6825
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
4,357,262,612,502,945,000
38.680233
80
0.657436
false
3.797997
false
false
false
windelbouwman/ppci-mirror
test/wasm/test_table_and_element.py
1
3919
""" Test WASM Table and Element definition classes. """ from ppci.api import is_platform_supported, get_current_arch from ppci.wasm import Module, Table, run_wasm_in_node, has_node from ppci.wasm import instantiate from ppci.utils.reporting import HtmlReportGenerator def dedent(code): return '\n'.join(line[4: ]f...
bsd-2-clause
-6,637,629,520,545,791,000
26.598592
76
0.529982
false
3.384283
false
false
false
syl20bnr/i3ci
_deprecated/scripts/menu/common.py
1
1341
# author: syl20bnr (2013) # Common functions for all feeders. import re # declare --------------------------------------------------------------------- def add_monitor_param(parser, mandatory=False): parser.add_argument('-m', '--monitor', type=int, choices=[0, 1]...
mit
6,219,459,621,622,446,000
25.82
79
0.460104
false
4.45515
false
false
false
marwoodandrew/superdesk-core
superdesk/io/feed_parsers/dpa_iptc7901.py
5
2822
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from .iptc7...
agpl-3.0
-8,137,226,763,979,752,000
43.793651
119
0.573352
false
4.031429
false
false
false
erramuzpe/NeuroVault
neurovault/apps/statmaps/tests/test_qa.py
4
1919
import os import nibabel as nb import numpy as np from django.test import TestCase from neurovault.apps.statmaps.models import BaseStatisticMap from neurovault.apps.statmaps.utils import is_thresholded, infer_map_type class QATest(TestCase): def setUp(self): this_path = os.path.abspath(os.path.dirname(...
mit
-6,340,708,049,936,182,000
49.526316
112
0.660761
false
3.017296
true
false
false
abhaystoic/barati
barati/customers/views_cluster/remove_from_wishlist.py
1
1064
from django.shortcuts import render from django.template import RequestContext from django.views.generic import View from django.http import HttpResponse from customers import models as m from wishlist import Wishlist import sys, json class Remove_From_Wishlist(Wishlist, View): try: def __init__(self): ...
apache-2.0
-5,871,811,887,125,335,000
35.689655
89
0.678571
false
3.733333
false
false
false
trangel/Insight-Data-Science
flaskapp/query_model.py
1
4513
from collections import defaultdict from gensim import corpora, models, similarities from operator import itemgetter def filter_posts(sims,readability_fname, bad_words_fname ): import pandas as pd from operator import itemgetter r_score_min = 8.0 # filter minimum value length_filter = 50 # filter bel...
gpl-3.0
-4,740,705,742,251,177,000
31.467626
79
0.615112
false
3.260838
false
false
false
aleksandra-tarkowska/django
tests/migrations/test_loader.py
2
7972
from unittest import skipIf from django.test import TestCase, override_settings from django.db import connection, connections from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migrations.recorder import MigrationRecorder from django.test import modify_settings from django.utils imp...
bsd-3-clause
6,363,392,651,763,292,000
37.143541
110
0.594079
false
4.385039
true
false
false
Jannis/ardour3
libs/pbd/pbd/signals.py
1
10246
#!/usr/bin/python # # Copyright (C) 2009-2012 Paul Davis # # 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
-1,844,222,052,949,241,900
32.48366
176
0.61829
false
3.275575
false
false
false
jigarkb/Programming
LeetCode/111-E-MinimumDepthOfBinaryTree.py
2
1498
# Given a binary tree, find its minimum depth. # # The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. # # Note: A leaf is a node with no children. # # Example: # # Given binary tree [3,9,20,null,null,15,7], # # 3 # / \ # 9 20 # / \ # ...
mit
6,359,063,325,170,275,000
26.236364
116
0.536716
false
3.931759
false
false
false
chys87/scripts
update-cygwin-installer.py
1
2559
#!/usr/bin/env python from __future__ import print_function import os import re import sys try: from urllib.request import urlopen except ImportError: from urllib import urlopen def get_installation_dir(): try: with open('/Cygwin.bat') as f: content = f.read().replace('\r\n', '\n') ...
bsd-3-clause
-4,545,452,470,644,185,600
24.336634
72
0.57288
false
3.539419
false
false
false
franklingu/leetcode-solutions
questions/binary-watch/Solution.py
1
2043
""" A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right. For example, the above binary watch reads "3:25". Given a non-negative integer n which represents the nu...
mit
-5,507,852,952,139,361,000
32.508197
142
0.526676
false
3.951644
false
false
false
SensSolutions/sens_platform
mqttwarn/samplefuncs.py
1
1194
import time try: import json except ImportError: import simplejson as json def OwnTracksTopic2Data(topic): if type(topic) == str: try: # owntracks/username/device parts = topic.split('/') username = parts[1] deviceid = parts[2] except: ...
gpl-3.0
3,805,658,439,928,674,000
29.615385
81
0.592127
false
3.685185
false
false
false
garbled1/ansible
lib/ansible/plugins/lookup/aws_ssm.py
1
2920
# (c) 2016, Bill Wang <ozbillwang(at)gmail.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.ec2 import HAS_BOTO3 from ansible.er...
gpl-3.0
-2,461,684,160,150,125,000
33.352941
117
0.57226
false
3.967391
false
false
false
HoliestCow/ece692_deeplearning
project2/vgg_outparser.py
1
1851
import numpy as np import matplotlib.pyplot as plt import re import glob def main(): filelist = glob.glob('*.out') container = {} keys = [] for item in filelist: print(item) if item == 'sgd.out' or item == 'nodatanormoraugmetnation.out': continue f = open(item, 'r'...
mit
-2,091,856,953,795,238,700
28.870968
81
0.518098
false
3.92161
true
false
false
marcieloliveira/snmp-gateway-ccn
miniccnx_metrics-collector/net.py
1
31306
""" Mininet: A simple networking testbed for OpenFlow/SDN! author: Bob Lantz (rlantz@cs.stanford.edu) author: Brandon Heller (brandonh@stanford.edu) Mininet creates scalable OpenFlow test networks by using process-based virtualization and network namespaces. Simulated hosts are created as processes in separate ...
mit
-4,256,933,717,512,944,000
37.506765
233
0.563023
false
4.038442
true
false
false
justasabc/python_tutorials
tutorial/gui/tk/ui/sui/TkinterMessageBox.py
1
1193
# -*- coding:utf-8 -*- # file: TkinterMessageBox.py # ''' tkMessageBox 1 fun askokcancel askquestion askyesno showinfo showwarning showerror 2 attr title message ''' # 1 import import Tkinter import tkMessageBox #---------------------------------------- # user defined fun handler and classes def cmd(...
gpl-3.0
-1,364,708,740,893,089,500
19.303571
58
0.639564
false
3.090674
false
false
false
seecr/meresco-components
meresco/components/version.py
1
3257
## begin license ## # # "Meresco Components" are components to build searchengines, repositories # and archives, based on "Meresco Core". # # Copyright (C) 2014-2016, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl # Copyright (C) 2020 Data Archiving and Network Services https://dans.knaw.nl # Copyright (C) 2020 S...
gpl-2.0
1,263,974,507,155,704,600
38.240964
133
0.680381
false
3.840802
false
false
false
NeuralEnsemble/libNeuroML
neuroml/hdf5/NetworkBuilder.py
1
16034
# # # A class which stores the contents of a NeuroML file in libNeuroML classes # Used mainly to convert HDF5 representations of NeuroML to internal libNeuroML format # # Author: Padraig Gleeson # # This file has been developed as part of the neuroConstruct project # This work has been funded by the Medical R...
bsd-3-clause
2,003,665,220,760,238,600
43.173554
157
0.501434
false
4.32533
false
false
false
jaheba/flask-rst
flaskrst/modules/tags.py
1
1579
# -*- coding: utf-8 -*- """ flask-rst.modules.tags ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by Christoph Heer. :license: BSD, see LICENSE for more details. """ from math import log from flask import Blueprint, render_template from jinja2 import Markup from flaskrst.modules.blog import get_post...
bsd-3-clause
5,207,773,354,699,058,000
24.901639
72
0.575681
false
3.417749
false
false
false
dramaticlly/Python4Interview
find-friends.py
1
2916
# Other point-point solution can be find in infinite.py # my approach draw the entire picture of the union, but their solution is fast and understandable def union_helper(outer): resultlist = [] # outer length will not be changed, but its element is subject to change outerlen = len(outer) if outerlen >=...
mit
4,289,801,635,481,166,300
35.4625
97
0.51989
false
3.945873
false
false
false
Autophagy/aerende
aerende/interface.py
1
8561
from urwid import (Columns, LineBox, Text, Frame, ListBox, AttrMap, Padding, SimpleListWalker, signals, connect_signal, emit_signa...
mit
259,723,003,991,132,480
29.575
79
0.553206
false
3.839013
false
false
false
xiaohan2012/temporal-topic-mining
lda_test.py
1
2376
import lda import itertools import numpy as np import codecs from temporal import doc_topic_strengths_over_periods from sklearn.feature_extraction.text import CountVectorizer from mynlp.preprocess import (transform, ALL_PIPELINE_NAMES) from util import load_line_corpus def main(): # parameters collection_na...
mit
1,613,840,153,848,066,800
30.263158
77
0.589226
false
3.666667
false
false
false
ceache/treadmill
lib/python/treadmill/trace/_events.py
2
1768
"""Trace events. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import logging _LOGGER = logging.getLogger(__name__) class TraceEvent(abc.ABC): """Abstract base class of all trace events. ""...
apache-2.0
-6,899,729,068,600,003,000
22.573333
75
0.56448
false
4.260241
false
false
false
khattori/kimpira
kimpira/lib/email.py
1
3987
from __future__ import absolute_import import email import email.header import imaplib import smtplib import yaml from email.MIMEText import MIMEText def imap4_create(host, port=None, use_ssl=False): args = [host] if port: args.append[port] if use_ssl: return imaplib.IMAP4_SSL(*args) e...
mit
8,233,744,833,081,218,000
29.669231
81
0.561826
false
3.559821
false
false
false
jjgomera/pychemqt
lib/mEoS/HCl.py
1
5030
#!/usr/bin/python3 # -*- coding: utf-8 -*- '''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar...
gpl-3.0
4,093,740,460,682,522,600
37.381679
79
0.58035
false
2.632461
false
false
false
amarandon/opencore
opencore/views/search.py
4
14203
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz.org # 2010-2011 Large Blue # Fergus Doyle: fergus.doyle@largeblue.com # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version ...
gpl-2.0
-5,145,929,663,430,193,000
31.801386
95
0.600648
false
4.150497
false
false
false
AechPro/Machine-Learning
Partners Healthcare/2016 Breast Cancer/dev/ReconNet/util/Image_Excel_Wrapper.py
1
7755
from util import Image_Processor as imp import os import cv2 def load_cell_images(directory): samples = [] discoveredCells = {} #print("loading directory",directory) for fileName in os.listdir(directory): #print("processing file",fileName) cell = {} cell["470"] = {} ...
apache-2.0
3,673,304,225,423,468,500
46.167702
139
0.512186
false
3.910741
false
false
false
PriviPK/privipk-sync-engine
tests/general/test_sync_start_logic.py
2
3590
import platform from inbox.mailsync.service import SyncService from tests.util.base import default_account __all__ = ['default_account'] def test_start_already_assigned_accounts(db, default_account): default_account.sync_host = platform.node() ss = SyncService(cpu_id=1, total_cpus=2) assert ss.accounts_to...
agpl-3.0
159,195,975,711,494,750
33.190476
75
0.675766
false
3.37406
true
false
false
douglaskastle/AcraNetwork
AcraNetwork/protocols/network/BasePacket.py
1
6988
import struct import importlib STRUCT_ARRAY = { # 'Z' : 1, # 'V' : 2, # 'N' : 4, 'B' : 8, 'H' : 16, 'I' : 32, 'Q' : 64, } class BasePacket(object): ''' Class to build and unpack a Base packet ''' CALC_HEADER = None BASETYPE_MAPPING = None TRAILER_LENGTH = 0...
gpl-2.0
8,907,796,866,001,738,000
32.596154
103
0.454637
false
4.310919
false
false
false
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/utils/systemd.py
1
2750
# -*- coding: utf-8 -*- ''' Contains systemd related help files ''' # import python libs from __future__ import absolute_import import logging import os import subprocess # Import Salt libs from salt.exceptions import SaltInvocationError import salt.utils log = logging.getLogger(__name__) def booted(context=None): ...
apache-2.0
-6,296,404,118,557,528,000
28.891304
77
0.643273
false
4.154079
false
false
false
Willempie/Artificial_Intelligence_Cube
objects/cube/rubiks_cube.py
1
8980
from b_rubiks_cube import BRubiksCube from cube import Cube from helper import Helper from random import randint, choice class RubiksCube(BRubiksCube): def __init__(self, size=None, set_color=True): BRubiksCube.__init__(self) #Minimum size is 2 if size is None or size < 2: se...
apache-2.0
-4,453,696,039,501,512,000
31.658182
100
0.514922
false
3.814783
false
false
false
Manu343726/siplasplas
src/reflection/parser/syncmanager.py
2
1465
import os import json class SyncManager: """ Manages source files timestamps so parsing is done only if the file changed """ def __init__(self, databasefile, sourcedir): self.databasefile = os.path.abspath(databasefile) self.rootpath = sourcedir if os.path.isfile(self.data...
mit
-6,642,154,556,352,217,000
30.170213
99
0.638908
false
4.069444
false
false
false
Amoki/Amoki-Music
endpoints/login.py
1
2173
from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status, exceptions from player.models import Room from player.serializers import RoomSerializer from django.conf import settings from endpoints.utils.authentication import authenticate @api_view([...
mit
3,991,235,064,942,214,000
27.973333
109
0.624942
false
4.311508
false
false
false
jayhorn/cav_experiments
runner.py
1
6708
import argparse import textwrap import json import csv import os import glob import subprocess import stats def processFile(bench, result, tool): stats = {"tool": tool, "ans":"", "time":"", "mem":"", "inst":""} if result is None: stats.update({"ans":"ERR"}) return {bench:stats}, stats if to...
mit
3,374,411,834,814,295,600
35.064516
139
0.521467
false
3.22345
false
false
false
CRImier/WCS
ui/printer.py
2
3829
from time import sleep def Printer(message, i, o, sleep_time=1, skippable=False): """Outputs string data on display as soon as it's called. Args: ...
apache-2.0
-8,243,952,730,959,243,000
53.7
182
0.540089
false
4.733004
false
false
false
cmorgan/toyplot
toyplot/webm.py
1
2620
# Copyright 2014, Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain # rights in this software. from __future__ import absolute_import from __future__ import division import os import subprocess import toyplot.png def _require_ffmpeg(): ...
bsd-3-clause
-4,287,837,108,985,693,000
27.791209
85
0.615649
false
4.068323
false
false
false
timtadh/PyOhio2011
lalr.py
1
1879
#!/usr/bin/env python # -*- coding: utf-8 -*- #Author: Tim Henderson #Email: tim.tadh@hackthology.com #For licensing see the LICENSE file in the top level directory. ''' Generates Abstract Syntax Trees (ASTs) using PLY as the parser engine. The AST generated is from the LALR grammar. ''' import functools from ply im...
bsd-3-clause
6,285,520,738,380,325,000
22.78481
83
0.562001
false
3.035541
false
false
false
mohawkhq/django-cross-origin
cross_origin/views.py
1
3466
"""View mixins provided by django-cross-origin.""" from django.http import HttpResponse ACCESS_CONTROL_ALLOW_ORIGIN_ALL = "*" class AccessControlMixin(object): access_control_allow_origin = () def get_access_control_allow_origin(self): """ An container of origin domains allowed to access ...
bsd-3-clause
-6,009,588,264,883,753,000
36.268817
130
0.644547
false
4.392902
false
false
false
spantaleev/roscraco
roscraco/response/dhcp.py
1
6304
from roscraco.helper import validator, converter from roscraco.exception import RouterSettingsError class DHCPReservationList(list): """A response class representing the router's address reservation list (static DHCP entries). """ def __init__(self, *args, **kwargs): list.__init__(self, *args...
bsd-3-clause
5,356,628,830,602,198,000
26.893805
99
0.579473
false
4.109518
false
false
false
i5o/followme
simon.py
1
2738
# simon.py """ Copyright (C) 2010 Peter Hewitt 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 version. "...
gpl-2.0
6,782,827,520,530,257,000
28.087912
78
0.511322
false
3.705007
false
false
false
Kortemme-Lab/covariation
analysis/utils/extract_fasta.py
1
1709
import glob pdblist = glob.glob('./*0001.pdb') outfileA = open("ChainA_seqs.fasta", "w") outfileB = open("ChainB_seqs.fasta", "w") AA3toAA1= {'CYS': 'C', 'ASP': 'D', 'SER': 'S', 'GLN': 'Q', 'LYS': 'K', 'ILE': 'I', 'PRO': 'P', 'THR': 'T', 'PHE': 'F', 'ASN': 'N', 'GLY': 'G', 'HIS': 'H', 'LEU': 'L', 'ARG': 'R', 'TRP': '...
mit
-5,181,386,123,851,268,000
17.180851
249
0.562902
false
2.312585
false
false
false
fabiocorneti/django-media-bundler
media_bundler/bundler.py
2
9485
# media_bundler/bundle.py from __future__ import with_statement import math import os import shutil import subprocess import re from StringIO import StringIO from media_bundler.conf import bundler_settings from media_bundler.bin_packing import Box, pack_boxes from media_bundler.jsmin import jsmin from media_bundler....
bsd-3-clause
1,510,923,885,461,151,200
34.657895
80
0.583237
false
3.952083
false
false
false
DannyArends/genenetwork2
scripts/maintenance/QTL_Reaper_v6.py
1
3217
####### To run this program do: python QTL_Reaper_v2.py 235 #Where 163 is the ProbeSetFreeze Id of the database that we want to calculate #the LRS #!/usr/bin/python import sys import os import reaper import MySQLdb import time con = MySQLdb.Connect(db='db_webqtl',user='username',passwd='', host="localhost") cursor = c...
agpl-3.0
-807,718,823,734,747,600
28.787037
158
0.728629
false
2.766122
false
false
false
ragerri/ixa-pipe-convert
to_treebank.py
1
5491
# coding=utf-8 """ Process a Ancora style xml into CONLL 2011 format """ from __future__ import unicode_literals __author__ = 'Josu Bermudez <josu.bermudez@deusto.es>' from xml import sax import sys import re FALSE = False TRUE = "yes" FILL = "-" ARTICLE = "article" SENTENCE = "sentence" POS = "pos" FORM = "wd" LEMM...
apache-2.0
5,910,730,144,038,378,000
27.604167
122
0.536696
false
3.805267
false
false
false
lilsweetcaligula/Online-Judges
leetcode/medium/linked_list_random_node/py/solution.py
1
1453
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def __init__(self, head): """ @param head The linked list's head. Note that the head is guaranteed to be not null, so it con...
mit
-3,264,285,347,405,308,000
22.819672
90
0.448039
false
4.540625
false
false
false
Datera/cinder
cinder/api/versions.py
1
4172
# Copyright 2010 OpenStack Foundation # Copyright 2015 Clinton Knight # 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/license...
apache-2.0
6,758,929,912,190,190,000
30.847328
78
0.638543
false
3.88093
false
false
false
jonathanslenders/python-prompt-toolkit
examples/tutorial/sqlite-cli.py
1
3600
#!/usr/bin/env python import sqlite3 import sys from pygments.lexers.sql import SqlLexer from prompt_toolkit import PromptSession from prompt_toolkit.completion import WordCompleter from prompt_toolkit.lexers import PygmentsLexer from prompt_toolkit.styles import Style sql_completer = WordCompleter( [ "a...
bsd-3-clause
-5,514,938,429,498,071,000
18.565217
75
0.428056
false
4.2007
false
false
false
sbg/sevenbridges-python
sevenbridges/models/project.py
1
14084
import logging from sevenbridges.decorators import inplace_reload from sevenbridges.errors import SbgError, ResourceNotModified from sevenbridges.meta.collection import Collection from sevenbridges.meta.fields import ( HrefField, StringField, UuidField, BasicListField, CompoundField, DateTimeField) from sevenb...
apache-2.0
7,702,978,848,621,446,000
33.689655
79
0.559429
false
4.273058
false
false
false
nafex/pyload
module/remote/thriftbackend/Transport.py
42
1161
# -*- coding: utf-8 -*- from thrift.transport.TTransport import TBufferedTransport from thrift.transport.TZlibTransport import TZlibTransport class Transport(TBufferedTransport): DEFAULT_BUFFER = 4096 def __init__(self, trans, rbuf_size = DEFAULT_BUFFER): TBufferedTransport.__init__(self, trans, rbuf...
gpl-3.0
-35,476,653,765,477,868
30.405405
69
0.677003
false
3.989691
false
false
false
ChileanVirtualObservatory/DISPLAY
src/packages/asydopy/factory.py
1
5654
#This file is part of ChiVO, the Chilean Virtual Observatory #A project sponsored by FONDEF (D11I1060) #Copyright (C) 2015 Universidad Tecnica Federico Santa Maria Mauricio Solar # Marcelo Mendoza # Universidad de Chile Die...
gpl-3.0
1,954,030,295,856,988,700
31.872093
252
0.631235
false
3.092998
false
false
false
dwhswenson/openpathsampling
openpathsampling/tests/external_engine/microtest.py
3
1221
""" Quick test script to show how the automatic sleep optimization works. Change the engine_sleep parameter to see different sleep times. """ import openpathsampling.engines as peng import openpathsampling as paths import numpy as np import os import logging def build_engine(template): opts = { 'n_frames...
mit
-2,039,148,183,699,456,800
28.780488
72
0.63964
false
3.827586
false
false
false
wasiahmad/Paraphrase-Identification-Task
source_code_in_theano/utils.py
1
4178
import numpy as np import sys import operator def train_with_sgd(model, X_train, y_train, learning_rate=0.001, nepoch=20, decay=0.9, callback_every=10000, callback=None): num_examples_seen = 0 for epoch in range(nepoch): # For each training example... for i in np.random.perm...
mit
629,135,278,784,726,500
44.413043
109
0.5955
false
3.57094
false
false
false
mmlab/eice
EiCGraphAlgo/core/deprecated_pathfinder.py
1
12886
import numpy as np import scipy import networkx as nx from scipy import linalg, spatial from core import graph import core.deprecated_resourceretriever as resourceretriever import time, gc, sys, logging from core.worker_pool import Worker from core.deprecated_resourceretriever import Resourceretriever import math clas...
agpl-3.0
-663,936,799,906,128,500
39.778481
124
0.577216
false
3.939468
false
false
false
benhamner/EventRecommendationChallenge
Stats/events_shown_attendees_disjoint.py
1
2575
from __future__ import division from copy import copy import csv from dateutil.parser import parse import numpy as np import os import pandas as pd import random class CsvDialect(csv.Dialect): def __init__(self): self.delimiter = ',' self.doublequote = True self.escapechar = None s...
bsd-2-clause
2,035,909,265,431,433,200
34.763889
98
0.613981
false
3.475034
false
false
false
GuillaumeMorini/roomfinder
roomfinder_web/roomfinder_web/web_server.py
2
3743
#!/usr/bin/env python2.7 import sys reload(sys) sys.setdefaultencoding("utf-8") from flask import Flask, render_template, request import datetime import os, sys import requests app = Flask(__name__, static_folder='static') @app.route('/') def index(): u = data_server + "/" try: page = requests.get(...
apache-2.0
-4,557,246,980,894,574,000
30.720339
93
0.565322
false
3.776993
false
false
false
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/astroid/tests/unittest_scoped_nodes.py
1
68113
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> # Copyright (c) 2011, 2013-2015 Google, Inc. # Copyright (c) 2013-2020 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2013 Phil Schaf <flying-sheep@web.de> # Copyright (c) 2014 Eevee (Alex Munroe) <amunroe@yelp.com> # Copyright (c) 2015-2...
mit
-7,210,829,100,485,218,000
32.902937
88
0.539986
false
3.991503
true
false
false
natetrue/ReplicatorG
skein_engines/skeinforge-0006/skeinforge_tools/skeinforge_utilities/xml_simple_parser.py
2
5426
""" The xml_simple_parser.py script is an xml parser that can parse a line separated xml text. This xml parser will read a line seperated xml text and produce a tree of the xml with a root element. Each element can have an attribute table, children, a class name, parents, text and a link to the root element. This ex...
gpl-2.0
-7,223,349,863,397,433,000
32.701863
157
0.68098
false
3.174956
false
false
false
oreno4645/clustering
clusters/clusters.py
1
10185
#!/usr/bin/env python # -*- coding: utf-8 -*- import random from PIL import Image, ImageDraw from math import sqrt class bicluster: def __init__(self, vec, left = None, right = None, distance = 0.0, id = None): self.left = left self.right = right self.vec = vec self.id = id self.distance = distance de...
mit
479,381,271,074,670,500
22.610795
122
0.618096
false
1.839938
false
false
false
syn7gerr/ros_tutorials
python_io_tutorial/motor_runner.py
1
1233
import Adafruit_BBIO.GPIO as GPIO import Adafruit_BBIO.PWM as PWM import time motor_1_pin_1 = "P8_11" motor_1_pin_2 = "P8_12" motor_1_pin_pwm = "P8_13" motor_2_pin_1 = "P8_17" motor_2_pin_2 = "P8_18" motor_2_pin_pwm = "P8_19" motor_3_pin_1 = "P9_11" motor_3_pin_2 = "P9_12" motor_3_pin_pwm = "P9_14" motor_4_pin_1 =...
bsd-3-clause
7,680,030,152,236,410,000
20.649123
37
0.690998
false
1.969649
false
true
false
cloudera/hue
desktop/core/ext-py/pyu2f-0.1.4/pyu2f/apdu.py
12
3878
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-7,088,018,514,870,485,000
25.380952
74
0.669159
false
3.437943
false
false
false
tjps/bitcoin
test/functional/p2p_disconnect_ban.py
1
5575
#!/usr/bin/env python3 # Copyright (c) 2014-2018 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 node disconnect and ban behavior""" import time from test_framework.test_framework import Bitcoin...
mit
3,770,858,446,789,730,000
47.903509
155
0.650762
false
3.330346
true
false
false
selective-inference/selective-inference
selectinf/distributions/intervals.py
3
6816
""" This module contains a class for forming confindence intervals and testing 1-dimensional linear hypotheses about the underlying mean vector of a Gaussian subjected to selection. """ from __future__ import print_function, division import numpy as np class intervals_from_sample(object): """ Construct confi...
bsd-3-clause
2,100,826,509,509,966,600
30.410138
98
0.571156
false
4.074118
false
false
false
craigthomas/Chip8Python
chip8/emulator.py
1
1620
""" Copyright (C) 2012-2019 Craig Thomas This project uses an MIT style license - see LICENSE for details. A simple Chip 8 emulator - see the README file for more information. """ # I M P O R T S ############################################################### import pygame from chip8.config import FONT_FILE, DELAY_I...
mit
-5,898,968,385,088,034,000
30.153846
79
0.534568
false
4
false
false
false
poliastro/poliastro
src/poliastro/threebody/restricted.py
1
3734
"""Circular Restricted 3-Body Problem (CR3BP) Includes the computation of Lagrange points """ import numpy as np from astropy import units as u from scipy.optimize import brentq from poliastro.util import norm @u.quantity_input(r12=u.km, m1=u.kg, m2=u.kg) def lagrange_points(r12, m1, m2): """Computes the ...
mit
-239,449,576,426,633,250
26.057971
80
0.594804
false
2.921753
false
false
false
movicha/dcos
gen/azure/azure_client.py
1
9652
#!/usr/bin/env python3 """Azure Image Creation, Management, Testing""" import os import random import uuid from urllib.parse import quote import requests OAUTH_ENDPOINT_TEMPLATE = 'https://login.microsoftonline.com/{}/oauth2/token' MANAGEMENT_ROOT = 'https://management.azure.com' SUBSCRIPTION_ENDPOINT = '{base_url...
apache-2.0
1,354,963,181,874,292,700
35.149813
104
0.628678
false
4.144268
false
false
false
Telestream/telestream-cloud-python-sdk
telestream_cloud_qc_sdk/test/test_black_frame_test.py
1
2443
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import telestream_cloud_qc from telestream_cl...
mit
-8,609,678,905,460,357,000
31.144737
92
0.559967
false
4.031353
true
false
false
dsparrow27/vortexUI
vortex/ui/graphics/graphpanels.py
1
5107
from qt import QtWidgets, QtCore, QtGui from zoo.libs.pyqt.widgets.graphics import graphicitems from vortex.ui.graphics import plugwidget class PanelWidget(QtWidgets.QGraphicsWidget): def __init__(self, model, acceptsContextMenu=True, parent=None): super(PanelWidget, self).__init__(parent=parent) ...
mit
7,766,117,533,008,697,000
42.65812
115
0.657333
false
4.059618
false
false
false
alberthxf/custodian
scripts/custodian_example.py
1
4816
#!/usr/bin/env python """ This module provides an demonstration of how to use the Custodian framework. """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyuep@gmail.com" __date_...
mit
-1,664,813,274,105,203,500
30.077419
78
0.603613
false
4.191471
false
false
false
intake/filesystem_spec
fsspec/implementations/dbfs.py
1
14649
import base64 import urllib import requests from fsspec import AbstractFileSystem from fsspec.spec import AbstractBufferedFile class DatabricksException(Exception): """ Helper class for exceptions raised in this module. """ def __init__(self, error_code, message): """Create a new Databricks...
bsd-3-clause
-2,107,464,996,375,871,000
31.054705
88
0.546658
false
4.53951
false
false
false
tgroh/beam
sdks/python/apache_beam/io/gcp/bigquery.py
2
61558
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
3,484,228,478,499,429,000
41.453793
80
0.678043
false
4.054937
true
false
false
ut-ras/robotticelli
src/software/primavera/primavera/primavera.py
1
2489
import argparse import importlib import math import json import numpy as np import scipy as sp from .modules.colors import detect_colors def primavera(image, colors, dither, palette_size=5, save_image='out.png', save_labels='lout.png', resize=1, overshoot=1, merge=True, quick=False, entire=False): ...
lgpl-3.0
-3,123,337,161,985,598,000
34.557143
104
0.634793
false
3.358974
false
false
false
gandalfcode/gandalf
tests/paper_tests/example.py
1
1789
from __future__ import division import matplotlib.pyplot as plt import numpy as np from matplotlib import patches from matplotlib.ticker import NullFormatter # SIS Functions TE = 1 # Einstein radius g1 = lambda x,y: (TE/2) * (y**2-x**2)/((x**2+y**2)**(3/2)) g2 = lambda x,y: -1*TE*x*y / ((x**2+y**2)**(3/2)) kappa = la...
gpl-2.0
4,286,216,590,281,882,000
30.946429
67
0.634433
false
2.230673
false
false
false
redhat-performance/quads
quads/tools/reports.py
1
6498
import logging import sys from quads.helpers import date_span, first_day_month, last_day_month, month_delta_past, date_to_object_id from quads.model import Schedule, Host, CloudHistory, Cloud, Q from datetime import datetime, timedelta logger = logging.getLogger(__name__) logger.addHandler(logging.StreamHandler(sys....
gpl-3.0
5,182,701,269,777,215,000
30.852941
105
0.538319
false
3.491671
false
false
false
wetterfroschdus/Jodel-Wetterfrosch
create_account.py
1
6584
import json import jodel_api import requests from operator import itemgetter from builtins import input class JodelAcc(object): def __init__(self, lat, lng, city, access_token, expiration_date, refresh_token, distinct_id, device_uid, legacy): self.access_token = access_token self.expiration_date =...
gpl-3.0
128,439,492,359,282,700
32.938144
139
0.594471
false
3.578261
false
false
false
tkasp/osmose-backend
mapcss/item_map.py
4
34342
#-*- coding: utf-8 -*- item_map = \ {'FranceSpecificRules': {'class': {None: 0, 'validation rules highway milestone': 9019001, 'validation rules nat_ref in France': 9019002}, 'item': 9019, 'prefix': '...
gpl-3.0
-4,710,682,329,078,598,000
82.89951
277
0.494727
false
4.240183
false
false
false
Swieter/Carriots-Utilities
Alarms/carriots_alarms_delete.py
1
1702
# Carriots Utilities - Alarms Delete # By Timothy D. Swieter, P.E. # MIT License # Access Carriots and pull down a list of all alarms based on any parameters specified. # Then attempt to delete each alarm. Display the interaction on the terminal. # See the following link for the API information: https://www.carriots...
mit
3,460,501,286,383,566,300
28.362069
126
0.722092
false
3.383698
false
false
false
edx/ecommerce
ecommerce/extensions/refund/signals.py
1
1471
from django.dispatch import Signal, receiver from ecommerce.core.constants import SEAT_PRODUCT_CLASS_NAME from ecommerce.extensions.analytics.utils import silence_exceptions, track_segment_event # This signal should be emitted after a refund is completed - payment credited AND fulfillment revoked. post_refund = Sig...
agpl-3.0
-6,159,153,480,809,497,000
37.710526
103
0.688647
false
3.954301
false
false
false
ethiery/heat-solver
trunk/cholesky.py
1
2853
# A library for running Cholesky factorization and Cholesky incomplete # factorization # author : Etienne THIERY import trunk.matgen from numpy import * def oldCompleteCholesky(M): ''' Computes the cholesky factorization of a matrix M, i.e the lower triangular matrix T such as M = T . T.transpose M should ...
mit
4,237,637,251,507,400,700
30.01087
106
0.499474
false
3.212838
false
false
false