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
sebp/scikit-survival
sksurv/io/arffread.py
1
1842
# 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 is distributed in the hope that it will be useful, # bu...
gpl-3.0
4,945,237,253,024,241,000
30.758621
92
0.632465
false
4.048352
false
false
false
luismack1997/PrograMate201603126
Project Euler/Ejercicio61(Malo).py
1
2477
import math x=1010 encontrado=0 p1=0 n2=0 p2=0 n3=0 p3=0 n4=0 p4=0 n5=0 p5=0 n6=0 p6=0 n1="" while encontrado==0: p1=(-1+math.sqrt( 1+8*x) )/2 if p1.is_integer(): for x1 in range(10,100): n2=int(str(x)[2:]+str(x1)) p2=math.sqrt(n2) if p2.is_integer(): ...
gpl-3.0
4,305,224,028,166,594,000
38.951613
82
0.264433
false
4.234188
false
false
false
OpenMined/PySyft
packages/grid/apps/network/src/main/core/infrastructure/providers/provider.py
2
1466
# stdlib import json import os from pathlib import Path import subprocess import time from types import SimpleNamespace # third party import terrascript from terrascript import Module import terrascript.data as data import terrascript.provider as provider import terrascript.resource as resource # grid relative from ....
apache-2.0
6,556,837,879,173,098,000
24.275862
76
0.621419
false
4.236994
false
false
false
plusbeauxjours/nomadgram
nomadgram/images/migrations/0006_auto_20171219_2351.py
1
1528
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-19 14:51 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): dependencies = [ ('images', '0005_image_tags'...
mit
3,959,965,401,266,159,000
35.380952
145
0.615183
false
3.968831
false
false
false
skymill/cumulus
cumulus/cumulus_ds/__init__.py
1
3590
""" Cumulus Deployment Suite APACHE LICENSE 2.0 Copyright 2013-2014 Skymill Solutions 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...
apache-2.0
-7,610,889,218,934,756,000
26.615385
72
0.555153
false
4.28401
true
false
false
matichorvat/pydmrs
dmrs_preprocess/cycle_remove.py
1
15342
import re import itertools from collections import Counter import xml.etree.ElementTree as xml from graph import load_xml, dump_xml def cycle_remove(dmrs_xml, debug=False, cnt=None, realization=False): """ Iteratively remove cycles from graph by 1) checking if they match any of the specific patterns and 2) c...
mit
-3,205,243,571,582,745,600
33.947608
135
0.625212
false
3.779749
false
false
false
lambda2/Fennec
fennec/logger.py
1
1715
import logging import os import datetime import string import random class Logger(): """ Creates a beautifully crafted logger object to use with fennec. """ def __init__(self, root_path): self.logger = logging.getLogger('fennec') self.logger.setLevel(logging.DEBUG) trace_id = ''.join(random.choice(string.as...
gpl-3.0
5,221,612,199,813,064,000
39.833333
118
0.721866
false
3.235849
false
false
false
jcfr/mystic
mystic/python_map.py
1
2543
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE """ Defaults for mapper and l...
bsd-3-clause
4,970,051,188,387,460,000
28.229885
80
0.644908
false
3.441137
false
false
false
nickodell/infinitearray
infinitearray.py
1
1627
# An infinite and sparse array; automatically set to all zeros. # By Nick O'Dell from array import array from collections import defaultdict from math import floor ALLOC_SIZE = 24 # Number of elements to allocate at once class infarray: def __init__(self, typecode, block_size = ALLOC_SIZE): self._initial_l...
lgpl-3.0
6,600,198,761,114,615,000
37.738095
63
0.585126
false
4.017284
false
false
false
EvanMPutnam/RIT_BrickHack_2017_3
automation/basicTwitter.py
1
2101
''' RIT SPEX: Twitter posting basic. Basic python script for posting to twitter. Pre-Req: Python3 Tweepy library twitter Contributors: Evan Putnam Henry Yaeger John LeBrun Helen O'Connell ''' import tweepy def tweetPicture(api ,picUrl): ''' Tweets picture from url :param api:...
mit
-4,215,846,390,751,506,000
21.115789
121
0.618753
false
3.466997
false
false
false
meigrafd/Sample-Code
ScanGPIOs2.py
1
1699
#!/usr/bin/python # # v0.3 (c) by meigrafd # import RPi.GPIO as GPIO import time, curses #--------------------------------------------------------------------- # only one of following: PULL = GPIO.PUD_DOWN #GPIO -> GND #PULL = GPIO.PUD_UP #GPIO -> 3V3 #-----------------------------------------------------------------...
mit
-1,072,960,405,187,117,400
26.868852
99
0.622719
false
2.528274
false
false
false
tbtraltaa/medianshape
medianshape/experiment/msfn/msfndemo2d.py
1
1792
# encoding: utf-8 ''' MSFN demo 2D ++++++++++++ ''' from __future__ import absolute_import import time import numpy as np import matplotlib.pyplot as plt from scipy.sparse import csr_matrix from medianshape.simplicial.meshgen import distmesh2d from medianshape.simplicial.mesh import Mesh2D from medianshape.simplici...
gpl-3.0
-4,271,374,795,619,694,000
28.866667
114
0.647321
false
3.132867
false
false
false
Nestorcoin/nestorcoin
contrib/spendfrom/spendfrom.py
1
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
421,810,565,403,201,540
36.651685
111
0.619815
false
3.872496
true
false
false
feigaochn/leetcode
p486_predict_the_winner.py
2
1750
#!/usr/bin/env python # coding: utf-8 """ Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a number, that number will not be available for the next player. This continu...
mit
-2,267,595,352,191,179,000
34
103
0.566857
false
3.054101
false
false
false
averagesecurityguy/alias
alias/config.py
1
1154
# -*- coding: utf-8 -*- import json import os class AliasConfig(): def __init__(self): config_file = os.path.join('conf', 'alias.conf') config = self.__load_config(config_file) self.tw_consumer_key = config.get('tw_consumer_key', '') self.tw_consumer_secret = config.get('tw_consum...
bsd-3-clause
6,270,341,239,864,460,000
35.0625
70
0.566724
false
3.364431
true
false
false
gyllstar/appleseed
ext/mininet/pcount_expt.py
1
7191
"""Custom topology example Two directly connected switches plus a host for each switch: host --- switch --- switch --- host Adding the 'topos' dict with a key/value pair to generate our newly defined topology enables one to pass in '--topo=mytopo' from the command line. """ from mininet.topo import Topo from min...
gpl-3.0
3,140,770,223,639,350,000
34.59901
314
0.694201
false
2.920796
false
false
false
burun/FinnDict
dictionary/migrations/0001_initial.py
1
1064
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Word', fields=[ ('id', models.AutoField(verbose...
mit
-4,151,755,025,172,163,000
34.466667
114
0.551692
false
4.360656
false
false
false
Supermanu/miniflux-notif
feed-notif.py
1
1260
#!/usr/bin/python3 ## Copyright (C) 2015 Manuel Tondeur ## 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 ...
gpl-3.0
-6,098,518,680,346,574,000
33.054054
117
0.712698
false
3.761194
false
false
false
ctn-waterloo/nengo_theano
nengo_theano/input.py
1
2970
from numbers import Number import theano from theano import tensor as TT import numpy as np from . import origin class Input(object): """Inputs are objects that provide real-valued input to ensembles. Any callable can be used an input function. """ def __init__(self, name, values, zero_after_time=...
mit
6,811,384,487,296,432,000
33.137931
78
0.570707
false
4.13649
false
false
false
Quiark/populus
populus/compilation.py
1
4232
import itertools import glob import os import json import functools from populus.utils import ( get_contracts_dir, get_build_dir, ) from populus.solidity import solc def find_project_contracts(project_dir): contracts_dir = get_contracts_dir(project_dir) # TODO: support non-solidity based contract com...
mit
7,524,976,073,232,986,000
29.446043
91
0.672023
false
3.648276
false
false
false
hizni/vod-systems
vod_systems/vod/templatetags/vod_tags.py
1
3714
from django import template from datetime import timedelta, datetime register = template.Library() def days_between(d1, d2): return abs((d2 - d1).days) @register.simple_tag def bilirubin_rating(data): test_value = data.data_value if test_value < 34: return_value = 0 elif test_value >= 34 a...
mit
8,592,146,935,419,570,000
32.160714
111
0.624663
false
3.36718
true
false
false
vollov/lotad
team/migrations/0001_initial.py
1
1996
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-01-25 13:21 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 = [ migrations...
mit
-7,632,874,340,958,087,000
37.384615
132
0.566633
false
4.283262
false
false
false
parall4x/pentext
scripts/gitlab-to-pentext.py
1
8931
#!/usr/bin/env python """ Gitlab bridge for PenText: imports and updates gitlab issues into PenText (XML) format Copyright (C) 2016 Peter Mosmans [Radically Open Security] 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...
gpl-2.0
-7,199,705,289,243,283,000
33.616279
87
0.580674
false
4.008528
false
false
false
fabric/fabric
fabric/tunnels.py
1
5520
""" Tunnel and connection forwarding internals. If you're looking for simple, end-user-focused connection forwarding, please see `.Connection`, e.g. `.Connection.forward_local`. """ import errno import select import socket import time from threading import Event from invoke.exceptions import ThreadException from inv...
bsd-2-clause
-3,268,324,491,220,171,300
34.159236
79
0.593297
false
4.487805
false
false
false
jardiacaj/finem_imperii
messaging/shortcuts.py
1
1991
from django.template.loader import render_to_string from messaging.models import CharacterMessage, MessageRecipient, \ MessageRecipientGroup def create_message( template, world, title, template_context=None, sender=None, link=None ): content = render_to_string( '{}'.format(template), ...
agpl-3.0
-8,132,369,329,593,001,000
31.112903
78
0.677549
false
4.484234
false
false
false
jamesbeebop/evennia
evennia/commands/default/system.py
1
27477
""" System commands """ import traceback import os import datetime import sys import django import twisted from time import time as timemeasure from django.conf import settings from evennia.server.sessionhandler import SESSIONS from evennia.scripts.models import ScriptDB from evennia.objects.models import ObjectDB ...
bsd-3-clause
-7,030,992,218,817,748,000
35.106439
141
0.572697
false
3.964935
false
false
false
charmasaur/digbeta
tour/src/ijcai15_setup.py
1
1504
#!/usr/bin/env python3 import requests import tempfile import zipfile import os import sys def download_data(url): """Download data from a specified URL, save it to a temp file, return the full path of the temp file. """ print('Downloading data from', url) fname = None r = requests.get(url,...
gpl-3.0
1,667,361,917,010,721,300
27.377358
98
0.651596
false
3.327434
false
false
false
maurermj08/efetch
efetch_server/plugins/fa_regview/fa_regview_ajax.py
1
4657
""" AJAX for Registry Viewer plugin """ from yapsy.IPlugin import IPlugin from flask import Response from Registry import Registry import binascii import json import logging class FaRegviewAjax(IPlugin): def __init__(self): self.display_name = 'Regview Ajax' self.popularity = 0 self.cache...
apache-2.0
4,094,978,261,066,774,500
34.557252
142
0.604896
false
3.687253
false
false
false
brain-research/mirage-rl-qprop
plot_rewards.py
1
6499
""" Copyright 2018 Google LLC Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT. """ import os import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib import colors as mcolors import ma...
mit
2,869,637,058,391,384,600
40.132911
298
0.617787
false
3.193612
false
false
false
unkyulee/elastic-cms
src/web/modules/post/controllers/post/create.py
1
5686
from flask import request, render_template import json import traceback import lib.es as es import web.util.tools as tools import web.modules.post.services.workflow as workflow import web.modules.post.services.upload as upload import web.util.jinja as jinja import web.modules.admin.services.notification as notification...
mit
7,498,665,677,712,942,000
33.253012
109
0.46764
false
4.337147
false
false
false
Jumpscale/core9
JumpScale9/errorhandling/JSExceptions.py
1
4443
from JumpScale9 import j import pssh.exceptions JSBASE = j.application.jsbase_get_class() class BaseJSException(Exception, JSBASE): def __init__(self, message="", level=1, source="", actionkey="", eco=None, tags="", msgpub=""): JSBASE.__init__(self) if j.data.types.string.check(level): ...
apache-2.0
-8,367,997,841,520,555,000
31.430657
99
0.575512
false
3.647783
false
false
false
zturchan/CMPUT410Lab1
name-family.py
1
1340
#Defines a student class capable of storing 2 names and a dictionary of courses/marks #can compute the arithmetic mean average of a student's grades class Student: name= "" family= "" courseMarks={} def __init__(self, name, family): self.name = name self.family = family def addCourseMark(self, course, mark): ...
apache-2.0
-1,997,546,862,915,419,400
26.916667
85
0.675373
false
2.845011
false
false
false
dc3-plaso/plaso
plaso/analysis/file_hashes.py
1
3152
# -*- coding: utf-8 -*- """A plugin to generate a list of unique hashes and paths.""" from plaso.analysis import interface from plaso.analysis import manager from plaso.containers import reports class FileHashesPlugin(interface.AnalysisPlugin): """A plugin for generating a list of file paths and corresponding hash...
apache-2.0
-6,729,445,681,006,131,000
34.818182
80
0.688769
false
3.959799
false
false
false
noba3/KoTos
addons/script.module.urlresolver/lib/urlresolver/plugins/usersfiles.py
1
2379
# -*- coding: UTF-8 -*- """ Copyright (C) 2015 tknorris 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
-7,718,940,618,217,960,000
36.171875
78
0.652795
false
3.830918
false
false
false
iedparis8/django-xadmin
plugins/xversion.py
1
26294
from django.contrib.contenttypes.generic import GenericRelation from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.db import models from django.db.models.query import QuerySet from django.db.models.fields.related import ManyToOneRel from django.for...
bsd-3-clause
-3,582,939,868,430,101,000
39.021309
183
0.617898
false
3.939176
false
false
false
wallarelvo/SE
server/financecache.py
1
9646
from flask import request, redirect, url_for, abort, jsonify import rethinkdb as r import yahoofin as yf import json from app import app, db import datetime, time import threading def getTime(toConvert = None): """ Get current time in seconds or convert given time in seconds Arguments: toConvert ...
apache-2.0
-5,439,746,409,817,502,000
25.283379
78
0.588119
false
3.981015
false
false
false
xaroth8088/SystemPanic
SystemPanic/GamePaks/Players/ExamplePlayer1/pak.py
1
11882
def get_sprite_details(): """ Tells the game engine how to slice up your spritesheet. Each slice of your spritesheet should be an object that looks like this: { "image rect": { "x": <x offset in pixels, relative to left edge>, "y": <y offset in pi...
mit
-2,808,027,291,711,192,000
30.186352
121
0.375778
false
4.610788
false
false
false
souravbadami/oppia
extensions/issues/base_test.py
1
3818
# coding: utf-8 # # Copyright 2018 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
8,245,517,598,683,924,000
35.018868
77
0.549764
false
4.46028
true
false
false
thonkify/thonkify
src/lib/telegram/inlinekeyboardmarkup.py
1
2251
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2017 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
mit
8,672,879,309,780,002,000
30.704225
83
0.67259
false
4.199627
false
false
false
kmoocdev2/edx-platform
cms/djangoapps/contentstore/views/helpers.py
1
11808
""" Helper methods for Studio views. """ from __future__ import absolute_import import urllib from uuid import uuid4 from django.conf import settings from django.http import HttpResponse from django.utils.translation import ugettext as _ from opaque_keys.edx.keys import UsageKey from xblock.core import XBlock impor...
agpl-3.0
370,603,852,801,315,600
36.015674
111
0.627879
false
4.241379
false
false
false
abinit/abinit
tests/pymods/yaml_tools/__init__.py
1
4191
""" This package gathers all tools used by the Abinit test suite for manipulating YAML formatted data. """ from __future__ import print_function, division, unicode_literals import warnings from .errors import NoYAMLSupportError, UntaggedDocumentError, TagMismatchError try: import yaml import numpy # numpy is...
gpl-3.0
-5,719,373,870,939,230,000
29.816176
98
0.553806
false
4.397692
false
false
false
rkokkelk/Gulliver
deluge/ui/console/commands/scan.py
1
1652
# -*- coding: utf-8 -*- # # Roy Kokkelkoren <roy.kokkelkoren@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # import os from o...
gpl-3.0
1,099,781,968,269,163,600
31.392157
98
0.618644
false
3.754545
false
false
false
Guokr1991/cervix
ve_phantom/ve_phantom.py
1
3973
""" ve_phantom.py - setup sge scripts to launch sims on the cluster Guassian excitation sims for UWM for soft, VE phantoms and processing phase velocity information. """ __author__ = 'Mark Palmeri' __date__ = '2014-10-16' import os # define some stuff G0 = [10.0] # kPa GI = [1.0] # kPa ETA = [0.01, 1.0, 3.0, 6.0,...
mit
-1,463,306,680,516,055,300
41.265957
155
0.407249
false
3.214401
false
false
false
grave-w-grave/zulip
zerver/lib/bugdown/fenced_code.py
1
9851
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~ ... ''' >>> ht...
apache-2.0
-8,403,807,125,077,519,000
31.087948
92
0.528982
false
4.027392
false
false
false
Trinak/SuperPong
superPong/actors/ballAI/ballState/ballSad.py
1
1279
''' Created on Nov 2, 2014 @author: Arrington ''' from pyHopeEngine import engineCommon as ECOM from superPong.actors.ballAI.ballState.ballState import BallState class BallSad(BallState): #Goal: Feels down, stays on bottom half of screen def __init__(self, ball): super().__init__(ball) transformC...
gpl-3.0
6,844,097,133,628,720,000
32.684211
75
0.621579
false
3.935385
false
false
false
mosen/commandment
commandment/inventory/schema.py
1
2233
from marshmallow_jsonapi import fields from marshmallow_jsonapi.flask import Relationship, Schema class InstalledProfileSchema(Schema): class Meta: type_ = 'installed_profiles' self_view = 'api_app.installed_profile_detail' self_view_kwargs = {'installed_profile_id': '<id>'} self_v...
mit
-3,349,279,915,475,628,000
32.328358
63
0.659651
false
3.601613
false
false
false
WalkingMachine/sara_behaviors
sara_flexbe_states/src/sara_flexbe_states/ClosestObject.py
1
4360
#!/usr/bin/env python # encoding=utf8 import json import requests,math from flexbe_core import EventState, Logger from sara_msgs.msg import Entity, Entities """ Created on 05/07/2019 @author: Huynh-Anh Le """ class ClosestObject(EventState): ''' Read the position of a room in a json string ># object ...
bsd-3-clause
1,735,552,049,645,402,400
30.142857
94
0.569037
false
4.172249
false
false
false
apollo-ng/governess
server/lib/drivers/input/hx711/example.py
1
2129
import RPi.GPIO as GPIO import time import sys from hx711 import HX711 def cleanAndExit(): print ("Cleaning...") GPIO.cleanup() print("Bye!") sys.exit() hx = HX711(5, 6) # I've found out that, for some reason, the order of the bytes is not always the same between versions of python, numpy and the hx7...
gpl-3.0
2,100,305,988,766,961,000
39.942308
141
0.690465
false
3.379365
false
false
false
bintlabs/python-sync-db
dbsync/utils.py
1
4441
""" .. module:: dbsync.utils :synopsis: Utility functions. """ import random import inspect from sqlalchemy.orm import ( object_mapper, class_mapper, ColumnProperty, noload, defer, instrumentation, state) def generate_secret(length=128): chars = "0123456789"\ "abcdefghijklm...
mit
-6,795,532,643,665,150,000
28.606667
75
0.62531
false
3.958111
false
false
false
opnmind/python-olapdb-palo-web
src/py3/palo_example.py
1
5293
# -*- coding: utf-8 -*- from __future__ import print_function from PyJedoxWebApi.PyJedoxWeb import PyJedoxWeb P = PyJedoxWeb() print("SID: " + P.getSid()) database = "control_musterstadt" cubename = "fcmain" res = P.CreateDatabase(DBName=database) print(res) P.loadDBList() DB = P.getDB(DBName=database) ...
gpl-3.0
2,195,037,829,077,101,600
31.27673
155
0.689095
false
3.00625
true
false
false
rndusr/stig
stig/commands/tui/tui.py
1
45516
# 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 is distributed in the hope that it will be useful # but...
gpl-3.0
-9,125,426,363,984,953,000
38.994728
111
0.546447
false
4.199871
false
false
false
swprojects/Serial-Sequence-Creator
dialogs/stepvoltage.py
1
10958
""" Description: Requirements: pySerial, wxPython Phoenix glossary and of other descriptions: DMM - digital multimeter PSU - power supply SBC - single board computer INS - general instrument commands GEN - general sequence instructions """ import wx import theme import base # from wx.lib.agw import spinctrl cl...
mit
7,247,116,515,581,154,000
37.452632
96
0.551926
false
3.304584
false
false
false
PaskoMoto/fermatic
monitor_dbus-1.0.py
1
2367
# Fernando Pascual Sesma. Abril de 2016 #!/usr/bin/python3 from gi.repository import GLib import time import datetime import os import sys import dbus import dbus.glib OBJ_PATH = '/ril_0' INTERFACE = 'org.ofono.NetworkRegistration' SERVICE = 'org.ofono' LOG = open('/home/nemo/fermatic/log.txt','a') CellIds = [line.rstr...
gpl-3.0
-6,474,788,818,252,318,000
47.306122
208
0.680186
false
3.147606
false
false
false
GoogleCloudPlatform/repo-automation-playground
xunit-autolabeler-v2/ast_parser/core/polyglot_drift_data.py
1
1183
# Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-7,444,638,999,246,896,000
30.131579
74
0.709214
false
3.917219
false
false
false
Psychedelic-Engineering/sleep-machine
hardware/channel.py
1
2995
from collections import deque import math import numpy as np from scipy import signal class Channel: def __init__(self, name, min, max, maxNum, offset=0.0): self.name = name self.min = min self.max = max self.num = 0 self.sum = 0 self.buffersum = 0 self.size = maxNum self.buffer = deque(maxlen=maxNu...
mit
-5,301,480,919,418,147,000
23.760331
68
0.620033
false
2.780873
false
false
false
dscho/hg
mercurial/wireproto.py
1
32128
# wireproto.py - generic wire protocol support functions # # Copyright 2005-2010 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import hashlib import itertool...
gpl-2.0
8,150,214,625,042,414,000
32.890295
80
0.58491
false
4.103717
false
false
false
COL-IU/XLSearch
library/MZXMLReader.py
1
1872
import xml.etree.ElementTree as et import base64 import struct from Spectrum import * class MZXMLReader: def __init__(self, fileName): self.fileName = fileName self.baseName = fileName[:fileName.index('.')].split('/')[-1] def getSpectraList(self, mass, param): fileName = self.fileName baseName = self.baseNam...
mit
1,492,171,613,617,418,800
28.25
89
0.605769
false
2.925
false
false
false
MiniSEC/GRR_clone
lib/communicator.py
1
19629
#!/usr/bin/env python """Abstracts encryption and authentication.""" import hashlib import time import zlib from M2Crypto import BIO from M2Crypto import EVP from M2Crypto import Rand from M2Crypto import RSA from M2Crypto import X509 from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib import ...
apache-2.0
1,933,268,720,333,809,700
32.045455
80
0.675174
false
3.979927
false
false
false
sophie63/FlyLFM
stanford_lfanalyze_v0.4/lflib/calibration/frames.py
1
6602
# Frame of reference manager for scope.py # # We manage the following frame of reference here: # # - Camera pixels to camera lenslets # - Camera lenslets to projector lenslets # - Projector pixels to projector lenslets # - Camera lenslets to x,y positions in micrometers in the native plane. import numpy as np from cali...
bsd-2-clause
-4,746,820,665,191,476,000
51.396825
110
0.556952
false
4.075309
false
false
false
souradeep100/messenger_smart_entertainer
server.py
1
1851
# coding: utf-8 import warnings import os from flask import Flask, request from subprocess import call import chatbot import messenger app = Flask(__name__) FACEBOOK_TOKEN = "page token generated on messenger page of facebook app dashboard" bot = None @app.route('/', methods=['GET']) def verify(): if request.ar...
apache-2.0
6,455,081,532,198,493,000
33.924528
101
0.63047
false
3.702
false
false
false
jabesq/home-assistant
homeassistant/components/pushover/notify.py
1
4061
"""Pushover platform for notify component.""" import logging import voluptuous as vol from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import ( ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNo...
apache-2.0
1,982,162,388,152,748,800
36.256881
77
0.565624
false
4.641143
false
false
false
partofthething/home-assistant
homeassistant/components/smartthings/fan.py
1
3105
"""Support for fans through the SmartThings cloud API.""" import math from typing import Optional, Sequence from pysmartthings import Capability from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity from homeassistant.util.percentage import ( int_states_in_range, percentage_to_ranged_value, ...
mit
-5,242,772,678,061,566,000
33.120879
85
0.655717
false
4.011628
false
false
false
kevin2seedlink/newrelic-plugin-agent
newrelic_plugin_agent/plugins/postgresql.py
1
13830
""" PostgreSQL Plugin """ import logging import psycopg2 from psycopg2 import extensions from psycopg2 import extras from newrelic_plugin_agent.plugins import base LOGGER = logging.getLogger(__name__) ARCHIVE = """SELECT CAST(COUNT(*) AS INT) AS file_count, CAST(COALESCE(SUM(CAST(archive_file ~ $r$\.ready$$r$ as IN...
bsd-3-clause
-4,528,111,542,233,855,000
44.196078
100
0.555242
false
3.878295
false
false
false
RonnyPfannschmidt/pytest-xdist
src/xdist/remote.py
1
9117
""" This module is executed in remote subprocesses and helps to control a remote testing session and relay back information. It assumes that 'py' is importable and does not have dependencies on the rest of the xdist code. This means that the xdist-plugin needs not to be installed in remote environm...
mit
4,634,997,689,573,559,000
34.337209
89
0.62707
false
4.055605
true
false
false
crf1111/Bio-Informatics-Learning
Bio-StrongHold/src/Character_Based_Phylogeny.py
1
3663
import newick_git class Node: def __init__(self, taxon = None): self.adjs = set() for adj in self.adjs: adj.add_adj(self) self.taxon = taxon def add_adj(self, branch): self.adjs.add(branch) if not branch.is_adj(self): branch.add_adj(self) ...
mit
7,473,962,612,973,214,000
19.469274
79
0.487851
false
3.619565
false
false
false
renskiy/fabricio
tests/__init__.py
1
9002
import argparse import itertools import shlex import unittest2 as unittest class FabricioTestCase(unittest.TestCase): def command_checker(self, args_parsers=(), expected_args_set=(), side_effects=()): def check_command_args(command, **kwargs): try: command_parser = next(args_...
mit
-4,580,777,568,621,133,300
53.228916
116
0.733504
false
3.562327
false
false
false
pulkitpagare/adagio
adagio/core/featureAnalysis.py
1
6583
#!/usr/bin/python # ADAGIO Android Application Graph-based Classification # featureAnalysis.py >> Analysis of features from SVM linear model # Copyright (c) 2013 Hugo Gascon <hgascon@uni-goettingen.de> import os import sys import os import ml import eval import FCGextractor import instructionSet import random import...
gpl-2.0
2,773,955,001,052,645,400
33.108808
110
0.598359
false
3.452019
false
false
false
leanguru/teamforge-charts
teamforge_import/generate_mongoimport_files.py
1
3993
import json from os import environ from datetime import datetime # Set the import timestamp timestamp_string = datetime.now().strftime('%Y-%m-%dT%H:%M:%S') # Set the path variable path = environ["TMP_DIR"] + "/" + environ["TRACKER"] # Generate Lookup Table for planning folders and import timestamp to planning folder...
mit
3,191,176,110,185,584,000
42.402174
112
0.70849
false
3.561998
false
false
false
totem/yoda-discover
tests/unit/test_util.py
1
3775
import discover.util from mock import patch from nose.tools import eq_ from discover.util import convert_to_milliseconds, DEFAULT_TIMEOUT_MS def test_convert_to_milliseconds_for_timeout_in_hours(): # When: I convert timeout to 'ms' timeout_ms = convert_to_milliseconds('1h') # Then: Expected timeout (int...
mit
5,562,059,840,405,288,000
28.038462
76
0.685033
false
3.42559
true
false
false
samuxiii/prototypes
bot/main.py
1
2611
import os import dtree as dt import telebot from telebot import types import time from optparse import OptionParser import wikiquery as wq #get token from command line parser = OptionParser() parser.add_option("-t", "--token") (options, args) = parser.parse_args() TOKEN = options.token if not TOKEN: #try from env...
mit
-2,413,570,020,326,716,000
25.11
97
0.632325
false
3.276035
false
false
false
LukasMosser/pmgan
main.py
1
7590
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchv...
mit
3,921,008,595,127,081,500
34.302326
113
0.615415
false
3.108108
false
false
false
asweigart/stickysticks
tests/basicTests.py
1
2372
import unittest import sys import os sys.path.append(os.path.abspath('..')) import stickysticks class BasicTests(unittest.TestCase): def test_stickDefaults(self): st = stickysticks.Stick(0, 100, (0,0)) self.assertEqual(st.start, (0, 0)) self.assertEqual(st.end, (100, 0)) self.asser...
bsd-3-clause
9,019,264,947,030,571,000
30.626667
92
0.577993
false
3.080519
true
false
false
vision1983/pyipcalc
tests/test.py
1
1818
# PyIPCalc # # Copyright (c) 2017, Christiaan Frans Rademan. # All rights reserved. # # LICENSE: (BSD3-Clause) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above ...
bsd-3-clause
7,228,426,390,637,662,000
45.615385
79
0.769527
false
4.423358
true
false
false
pferreir/PySecretHandshake
secret_handshake/boxstream.py
1
2543
import struct from asyncio import IncompleteReadError from async_generator import async_generator, yield_ from nacl.secret import SecretBox from .util import inc_nonce, split_chunks HEADER_LENGTH = 2 + 16 + 16 MAX_SEGMENT_SIZE = 4 * 1024 TERMINATION_HEADER = (b'\x00' * 18) def get_stream_pair(reader, writer, **kwa...
mit
436,206,435,234,890,000
27.255556
75
0.587102
false
3.706997
false
false
false
fortes/mashpress
handlers.py
1
4427
from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.ext import db from google.appengine.api import memcache from google.appengine.ext.webapp import template import logging import models import os class SlashRedirectHandler(webapp.RequestHandler): """Strip off slash...
mit
6,586,475,358,431,210,000
32.285714
92
0.605376
false
3.988288
false
false
false
angr/angr
angr/analyses/decompiler/ailgraph_walker.py
1
1603
import networkx # pylint:disable=unused-import class RemoveNodeNotice(Exception): pass class AILGraphWalker: """ Walks an AIL graph and optionally replaces each node with a new node. """ def __init__(self, graph, handler, replace_nodes: bool=False): self.graph = graph # type: network...
bsd-2-clause
-3,466,230,535,631,935,000
31.06
75
0.470992
false
4.415978
false
false
false
limbail/ceamon
pandorabox/ceamon/views.py
1
5902
from django.shortcuts import render from django.views.generic import ListView from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse, HttpResponseRedirect # IMPORT REST from rest_framework import status, generics, mixins, viewsets from rest_framework.decorators import api_view from re...
mit
5,553,470,778,808,345,000
34.769697
84
0.699763
false
4.039699
false
false
false
Brainiq7/Ananse
ananse_dl/extractor/streamcloud.py
1
1923
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) class StreamcloudIE(InfoExtractor): IE_NAME = 'streamcloud.eu' _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?...
unlicense
-2,342,502,022,879,466,000
29.967742
108
0.5125
false
3.39823
false
false
false
waelkht/Onto.KOM
ontokom/preprocessing.py
1
4861
import re import os from glob import glob from textblob import TextBlob from nltk.corpus import stopwords from nltk import download from tqdm import tqdm def download_preprocessing_prerequisites(): """Downloads the NLTK prerequisites needed for other functions""" download("averaged_perceptron_tagger") # POS T...
mit
887,392,361,918,140,200
37.888
98
0.608517
false
3.537846
false
false
false
pyfa-org/Pyfa
gui/builtinContextMenus/additionsExportSelection.py
1
1609
import wx import gui.mainFrame from gui.contextMenu import ContextMenuSelection from gui.utils.clipboard import toClipboard from service.fit import Fit from service.port.eft import exportBoosters, exportCargo, exportDrones, exportFighters, exportImplants _t = wx.GetTranslation class AdditionsExportAll(ContextMenuSe...
gpl-3.0
-5,329,103,880,391,081,000
33.234043
102
0.666874
false
3.90534
false
false
false
JohnReid/biopsy
Python/biopsy/gene_locations.py
1
2058
import os, sys, cookbook from env import * _ensembl_data_dir = os.path.join(get_data_dir(), 'ensembl') def gene_location_filename( genome ): return os.path.normpath( os.path.join( _ensembl_data_dir, 'gene_locations-%s.txt' % genome ) ) def ense...
mit
-5,305,037,074,829,856,000
32.737705
82
0.543732
false
3.335494
false
false
false
TecnoSalta/bg
mezzanine/galleries/models.py
1
5827
from __future__ import unicode_literals from future.builtins import str from future.utils import native, PY2 from io import BytesIO import os from string import punctuation from zipfile import ZipFile from django.core.files.base import ContentFile from django.core.files.storage import default_storage from ...
bsd-2-clause
197,956,677,122,037,630
39.621429
78
0.565471
false
4.287712
false
false
false
VCG/gp
slurm/patchgen/patchgen3.py
1
4341
import sys sys.path.append('../../') import gp import glob import mahotas as mh import numpy as np import os import time def read_section(path, z, verbose=True, withNP=True): ''' ''' image = sorted(glob.glob(os.path.join(path, 'image', '*_'+str(z).zfill(9)+'_image.png'))) mask = sorted(glob.glob(os.path.join(p...
mit
7,463,076,509,551,324,000
28.331081
147
0.589265
false
2.995859
false
false
false
ESOedX/edx-platform
cms/djangoapps/contentstore/tests/test_clone_course.py
1
6390
""" Unit tests for cloning a course between the same and different module stores. """ from __future__ import absolute_import import json import six from django.conf import settings from mock import Mock, patch from opaque_keys.edx.locator import CourseLocator from contentstore.tasks import rerun_course from contents...
agpl-3.0
-2,465,608,985,981,198,300
44.642857
136
0.654617
false
3.796791
true
false
false
DanielTakeshi/rl_algorithms
trpo/trpo.py
1
19601
""" This contains the TRPO class. Following John's code, this will contain the bulk of the Tensorflow construction and related code. Call this from the `main.py` script. (c) April 2017 by Daniel Seita, based upon `starter code` by John Schulman, who used a Theano version. """ import gym import numpy as np import tens...
mit
8,762,082,859,905,008,000
47.880299
115
0.617366
false
3.601801
false
false
false
SecuredByTHEM/ndr
ndr/cert_request.py
1
2219
# This file is part of NDR. # # Copyright (C) 2017 - Secured By THEM # Original Author: Michael Casadevall <michaelc@them.com> # # NDR 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 Li...
gpl-3.0
-5,842,498,683,836,158,000
35.983333
79
0.701667
false
3.976703
false
false
false
aswarren/GOGranny
GOGranny/semGODiGraph.py
1
8815
#class with two way transitive closure (ancestors and descendants) computed for nodes for the purpose of calculating the Graph Entropy #author: Andrew Warren aswarren@gmail.com #NOTE: There are obsolete terms. Not in the graph itself and not in the nodes or node iterator but in the term lookup table (node_lookup) fro...
gpl-2.0
-7,691,478,473,109,416,000
36.510638
151
0.732048
false
3.130327
false
false
false
blueyed/pipsi
pipsi.py
1
12835
import os import sys import shutil import glob from os.path import join, realpath, dirname, normpath, normcase from operator import methodcaller try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import click from pkg_resources import Requirement try: WindowsError exc...
bsd-3-clause
5,156,685,130,349,038,000
29.271226
76
0.579275
false
4.084978
false
false
false
MerleLK/StudentSystem
teacher/migrations/0001_initial.py
1
1390
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-12 10:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
gpl-3.0
3,426,778,220,125,253,600
32.902439
141
0.564748
false
4.34375
false
false
false
mp2893/retain
process_mimic.py
1
5376
# This script processes MIMIC-III dataset and builds longitudinal diagnosis records for patients with at least two visits. # The output data are cPickled, and suitable for training Doctor AI or RETAIN # Written by Edward Choi (mp2893@gatech.edu) # Usage: Put this script to the foler where MIMIC-III CSV files are locate...
bsd-3-clause
-4,906,818,398,973,014,000
31.581818
240
0.69308
false
2.747062
false
false
false
cytomine/Cytomine-python-datamining
cytomine-applications/classification_validation/add_and_run_job.py
1
16322
# -*- coding: utf-8 -*- # # * Copyright (c) 2009-2016. Authors: see NOTICE file. # * # * 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...
apache-2.0
1,978,683,460,693,328,600
53.761745
341
0.675164
false
3.415446
true
false
false
ksmit799/Toontown-Source
toontown/coghq/GameSprite3D.py
1
13284
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * import math import random class GameSprite: colorRed = Vec4(1, 0.2, 0.2, 1) colorBlue = Vec4(0.7, 0.8, 1, 1) colorGreen = Vec4(0, 1, 0, 1) colorGhostRed = Vec4(1, 0.2, 0.2, 0.5) colorGhostBlue = Vec4(0.7, 0.8, 1, 0.5) ...
mit
-3,959,399,585,208,441,000
35.196185
395
0.559696
false
3.357937
false
false
false
MediaKraken/MediaKraken_Deployment
source/common/common_pagination_bootstrap.py
1
3264
""" Copyright (C) 2020 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but ...
gpl-3.0
-2,698,689,213,716,076,500
38.804878
97
0.551164
false
4.211613
false
false
false
drinkertea/pywinauto
pywinauto/unittests/test_handleprops.py
1
13319
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
bsd-3-clause
-8,643,938,393,951,203,000
41.668852
87
0.656055
false
4.014165
true
false
false
hoglet67/ElectronFpga
pcb/common/build_gerber_previews.py
1
2124
from __future__ import print_function # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
gpl-3.0
6,145,875,204,471,986,000
26.584416
85
0.636064
false
3.551839
false
false
false
qxf2/qxf2-page-object-model
utils/gmail/utf.py
1
3234
# The contents of this file has been derived code from the Twisted project # (http://twistedmatrix.com/). The original author is Jp Calderone. # Twisted project license follows: # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # ...
mit
-3,698,311,829,193,470,500
31.676768
74
0.611936
false
3.687571
false
false
false
kittiu/sale-workflow
sale_promotion_rule/models/sale_order_line.py
1
1567
# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Benoît GUILLOT <benoit.guillot@akretion.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models class SaleOrderLine(models.Model): _inherit = 'sale.order.line' promotion_r...
agpl-3.0
-253,570,785,712,559,520
30.32
70
0.616858
false
3.353319
false
false
false
ScaleXY/speedby
speedby/transaction/views.py
1
3241
from django.shortcuts import render from django.http import Http404 from django.http import HttpResponse, HttpResponseRedirect,Http404 import datetime from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils.timezone import localtime from transaction.models import...
gpl-2.0
-8,113,250,145,105,668,000
31.089109
154
0.71984
false
3.90012
false
false
false
huhongbo/dd-agent
utils/flare.py
1
22464
# stdlib import atexit import cStringIO as StringIO from collections import namedtuple from functools import partial import glob try: import grp except ImportError: # The module only exists on Unix platforms grp = None import logging import os try: import pwd except ImportError: # Same as above (exi...
bsd-3-clause
3,822,984,352,316,557,300
38.135889
114
0.569044
false
3.93967
true
false
false
Seko34/Kodi-Development
script.module.seko.downloader/lib/downloaderModule/plugins/AdvancedDownloader.py
1
55224
# -*- coding: utf-8 -*- #--------------------------------------------------------------------- ''' Created on 07 Nov. 2015 @author: Seko @summary: Advanced Downloader ''' #--------------------------------------------------------------------- # ____________________ I M P O R T ____________________ impor...
gpl-3.0
4,965,653,996,201,922,000
40.900607
311
0.485821
false
4.647702
false
false
false