repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
riusksk/riufuzz
tools/coverage/Utilities/BBminus.py
1
2036
import os import shutil import getopt import sys inputDir = ".\\input" outputDir = ".\\output" inputFile = ".\\result.txt" modules = {} basicblocks = {} #Conf def help(): print "Possible arguments: GenBpFiles.py [-h] [-d DIR] [-o FILE]" print " -h Prints this message to you" print " -d DIR Directory that...
apache-2.0
5,489,864,988,082,207,000
21.141304
66
0.63998
false
2.912732
false
false
false
prasunroypr/ai-driver
v2.0/models.py
1
2226
# -*- coding: utf-8 -*- """ AlexNet. References: - Alex Krizhevsky, Ilya Sutskever & Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. NIPS, 2012. - [AlexNet Paper](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf) """ ...
mit
-5,253,556,282,920,099,000
42.647059
123
0.680144
false
3.456522
false
false
false
pytorch/fairseq
fairseq/data/encoders/moses_tokenizer.py
1
1660
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass, field from fairseq.data.encoders import register_tokenizer from fairseq.dataclass import FairseqDataclass ...
mit
-6,509,349,771,505,510,000
32.877551
85
0.654819
false
3.807339
false
false
false
musashin/Py429
ARINC429/DiscreteBit.py
2
3928
''' Created on 2013-11-05 @author: nicolas ''' import MessageField import Exception class Field(MessageField.Field): ''' This subclass of A429MsgField is part of an ensemble of classes that can be used as an utility for packing and unpacking A429 messages. LabelField is more specifically dedicated to...
mit
-7,028,037,822,746,414,000
33.165217
107
0.529786
false
4.837438
false
false
false
eofs/django-oauth-api
oauth_api/permissions.py
1
1891
from django.core.exceptions import ImproperlyConfigured from rest_framework.permissions import BasePermission SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] class OAuth2ScopePermission(BasePermission): """ Make sure request is authenticated and token has right scope set. """ def has_permission(self, req...
bsd-2-clause
-3,289,867,127,133,433,000
31.050847
117
0.558964
false
4.848718
false
false
false
xju2/xaodtools
bsubs/monojet/submit_monojet.py
1
2672
#!/usr/bin/env python import sys import string import commands import os from optparse import OptionParser import glob base_dir = os.getcwd() exe_base = "/afs/cern.ch/user/x/xju/work/upsilon/code/MyXAODTools/bsubs/monojet/" def check_dir(dir_): if not os.path.exists(dir_): os.mkdir(dir_) def submit(exe...
mit
-6,030,616,063,693,215,000
28.362637
138
0.587201
false
3.132474
false
false
false
primercuervo/cognitive_radio_ml
python/spectrogram_generation.py
1
6291
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generates Spectrograms based on Raw data recorded with GNURadio """ import os import numpy as np import scipy as sp from scipy import signal from scipy.misc import imsave # While using sp.signal.specgram there are two fields that regard the FFT size: # * nfft: Len...
mit
-8,876,635,129,351,106,000
44.586957
119
0.53203
false
3.840659
true
false
false
heticor915/UTP2016-1
IS512/fproject.py
1
1752
#!/usr/bin/python # -*- coding: utf-8 -*- #Project Details: This file is part of the final project of statistics #Team members : Eliana Osorio, Sebastian Idarraga, Hector F. Jimenez #File Details: Contains Colors, And Core functions # url: github.com/heticor915/UTP2016-1/IS512Statistics # License Details: # ...
gpl-3.0
-5,338,926,116,758,308,000
41.8
99
0.656963
false
3.388781
false
false
false
mattjj/pylds
examples/gibbs.py
1
2014
import numpy as np import numpy.random as npr import matplotlib.pyplot as plt from pybasicbayes.util.text import progprint_xrange from pylds.models import DefaultLDS npr.seed(0) # Set parameters D_obs = 1 D_latent = 2 D_input = 1 T = 2000 # Simulate from one LDS truemodel = DefaultLDS(D_obs, D_latent, D_input) inp...
mit
4,016,889,957,529,469,400
23.560976
74
0.70854
false
2.766484
false
false
false
SouthPatron/GojiDNS
site/gojidns/goji/urls.py
1
3332
# GojiDNS - Developed by South Patron CC - http://www.southpatron.com/ # # This file is part of GojiDNS. # # GojiDNS 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 yo...
gpl-3.0
8,165,623,650,469,955,000
39.144578
137
0.677371
false
3.037375
false
false
false
ella/mypage
mypage/pages/models.py
1
4627
import datetime import itertools import logging from copy import deepcopy import anyjson as json from django.db import models from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import force_unicode...
bsd-3-clause
1,911,953,035,815,449,600
32.28777
109
0.671061
false
3.911243
false
false
false
emlynoregan/appenginetaskutils
experiments/countaccountswithfuture.py
1
1246
from model.account import Account import logging from taskutils.future import future, FutureReadyForResult, GenerateOnAllChildSuccess,\ setlocalprogress def CountAccountsWithFutureExperiment(): def Go(): def CountRemaining(futurekey, cursor): logging.debug("Got here") accounts, ...
apache-2.0
-3,864,000,169,989,430,300
35.647059
129
0.592295
false
4.984
false
false
false
eagleatustb/p2pdown
source/third_party/MediaInfoLib/Source/Example/HowToUse_Dll.py
3
3180
## MediaInfoDLL - All info about media files # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for any purpose, # including c...
gpl-2.0
8,083,810,166,341,449,000
28.873786
87
0.604088
false
3.404711
false
false
false
sramana/pysis
apps/myprofile/forms.py
1
1025
from django.conf import settings from django import forms from accounts.models import Profile class GeneralDetailsForm(forms.ModelForm): class Meta: model = Profile fields = list(set(settings.GENERAL_DETAILS_FIELD_LIST) - set(['first_name', 'last_name', 'register_number', '...
unlicense
-8,270,455,928,596,939,000
26.702703
94
0.685854
false
3.972868
false
false
false
h2020-westlife-eu/VRE
api/models.py
1
11347
import copy import json from django.contrib.auth.models import User from django.core import signing from django.db import models from .jobportals.portals import PORTAL_FORMS from .data import ( DATAFILE_STATES, DATAFILE_STATE_CHOICES, DATAFILE_TRANSFER_IN_PROGRESS, EXTERNAL_SUBMISSION_STATE_CHOICES, ...
mit
-2,539,438,578,325,541,400
26.948276
136
0.639464
false
3.988401
false
false
false
darrencheng0817/AlgorithmLearning
USACO/section1/dualpal/dualpal.py
1
1764
''' Created on 2016年2月9日 @author: Darren ''' ''' Dual Palindromes Mario Cruz (Colombia) & Hugo Rickeboer (Argentina) A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes have neither lea...
mit
4,947,112,873,918,593,000
26.920635
256
0.653584
false
3.342205
false
false
false
CarterFendley/2015-robot
robot/autonomous/StackAutonomous.py
1
1979
from robotpy_ext.autonomous import timed_state, StatefulAutonomous # Only for auto complete # from components.drive import Drive from components.forklift import ToteForklift from components.alignment import Alignment class StackAutonomous(StatefulAutonomous): MODE_NAME = 'Stack Auto' DEFAULT = False ...
apache-2.0
-4,853,128,997,016,027,000
29.461538
66
0.618494
false
3.281924
false
false
false
apple/swift-lldb
scripts/utilsDebug.py
6
4226
""" Utility module to help debug Python scripts -------------------------------------------------------------------------- File: utilsDebug.py Overview: Python module to supply functions to help debug Python scripts. Gotchas: None. Copyright: None. ---------------------------...
apache-2.0
2,642,967,391,899,800,000
32.808
79
0.482016
false
4.251509
false
false
false
jeroyang/approx
approx/approx.py
1
6561
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from random import choice, sample from itertools import product def direct_print(text): print(text, flush=True) def question_gues...
bsd-3-clause
5,040,673,850,842,633,000
30.613861
73
0.56852
false
3.179781
false
false
false
andr3wmac/metaTower
packages/dlmanager/NZB/Decoder.py
1
7033
import re, string, os, time, mt from zlib import crc32 yenc_found = False try: import _yenc yenc_found = True except: pass class ArticleDecoder(mt.threads.Thread): def __init__(self, nextSeg, save_to, path, onFinish = None, onSuccess = None, onFail = None, onAssemblyPercent = None): mt.threads...
gpl-3.0
2,171,819,136,183,207,700
35.630208
123
0.488981
false
4.05828
false
false
false
Nehoroshiy/urnn
utils/complex_expm.py
1
2403
import theano import numpy as np from theano import Op, Apply from theano.tensor import as_tensor_variable try: import scipy.linalg imported_scipy = True except ImportError: # some ops (e.g. Cholesky, Solve, A_Xinv_b) won't work imported_scipy = False class ComplexExpm(Op): """ Compute the...
mit
-6,241,389,459,740,728,000
25.417582
89
0.559301
false
3.112694
false
false
false
deloittem/irma-frontend
frontend/helpers/formatters/external/virustotal/virustotal.py
1
2746
# # Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
apache-2.0
8,598,137,284,366,815,000
37.676056
78
0.612163
false
3.261283
false
false
false
brunats/IAR
Proj4 - Simulated Annealing/sa.py
1
7620
# -*- 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...
gpl-3.0
-6,583,067,115,758,831,000
26.066421
100
0.503813
false
3.261578
false
false
false
i02sopop/Kirinki
settings.py
1
4976
# This file is part of Kirinki. # # Kirinki is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Kirinki is distributed in the...
agpl-3.0
-3,486,017,059,594,565,000
35.321168
134
0.706793
false
3.489481
false
false
false
julzhk/crypto_spike
simple_blockchain.py
1
1058
import hashlib from collections import OrderedDict class BlockChain(object): def __init__(self, genesis='None'): self.data = OrderedDict() self.prev = self.make_hash(genesis) def make_hash(self, msg): hasher = hashlib.md5() hasher.update(u'%s' % msg) return hasher.hexdi...
unlicense
4,228,283,874,792,296,000
24.804878
82
0.651229
false
2.762402
false
false
false
sebres/fail2ban
fail2ban/server/observer.py
2
17879
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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;...
gpl-2.0
3,966,489,470,698,092,500
32.356343
133
0.669668
false
3.223765
false
false
false
talcorn92/FoodOrigins
src/scale_toxicity.py
2
1670
def check_toxicity(x): if x <= 5: return "Very Toxic" elif x <= 5 and x >= 50: return "Toxic" elif x <= 50 and x >= 300: return "Moderately Toxic" elif x <= 300 and x >= 2000: return "Not Toxic" elif x == "Varies": return "Unknown" else: return "Un...
mit
-4,583,518,396,735,686,000
27.305085
45
0.55988
false
2.840136
false
false
false
opt9/Mobile-Security-Framework-MobSF
StaticAnalyzer/tools/enjarify/enjarify/main.py
14
4551
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
1,931,750,613,663,698,200
42.342857
242
0.670402
false
4.092626
false
false
false
seanfarley/pygit2
test/test_tag.py
2
3589
# -*- coding: UTF-8 -*- # # Copyright 2010 Google, Inc. # # This file 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. # # In addition to the permissions in the GNU General Public License, # the aut...
gpl-2.0
3,870,672,821,302,102,500
36.778947
77
0.676512
false
3.603414
true
false
false
SunDwarf/ButterflyNet
examples/packets/echo_server.py
1
1624
import asyncio import logging import struct from bfnet.packets import PacketHandler, Packet, PacketButterfly from bfnet import util logging.basicConfig(filename='/dev/null', level=logging.INFO) formatter = logging.Formatter('%(asctime)s - [%(levelname)s] %(name)s - %(message)s') root = logging.getLogger() consoleH...
lgpl-3.0
-3,121,332,836,884,908,000
21.246575
114
0.618842
false
3.68254
false
false
false
anshbansal/general
Python3/project_euler/001_050/017.py
1
1033
NUMS = { 0: 0, #This value makes one condition less 1: 3, 2: 3, 3: 5, 4: 4, 5: 4, 6: 3, 7: 5, 8: 5, 9: 4, 10: 3, 11: 6, 12: 6, 13: 8, 14: 8, 15: 7, 16: 7, 17: 9, 18: 8, 19: 8 } def numeral_to_string(num): ans = 0 if num > 999: ans += len("onethousand") num %= 1000 if num ...
mit
-2,665,086,860,459,994,000
20.520833
60
0.448209
false
3.074405
false
false
false
chunkified/kl-iostream
test/test_all.py
1
2357
import os import sys import glob import subprocess import signal import tempfile import time import unittest class KLTest(unittest.TestCase): def __init__(self, klFilePath): super(KLTest, self).__init__() self.__klFilePath = klFilePath def id(self): return os.path.split(self.__klFilePath)[1].partitio...
bsd-3-clause
-966,766,316,929,872,900
23.552083
105
0.612219
false
3.523169
true
false
false
romanvm/romans_blog
blog/templatetags/blog_tags.py
1
7862
# coding: utf-8 # Module: blog_tags # Created on: 25.11.2015 # Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua) import json from collections import namedtuple from urllib.parse import quote_plus from django import template from django.conf import settings from django.core.urlresolvers import reverse fro...
gpl-3.0
1,597,300,140,016,424,000
32.313559
112
0.619944
false
3.878638
true
false
false
yshalenyk/databridge
databridge/feed.py
1
6704
import gevent import logging import requests from gevent.queue import Queue, Full from gevent.event import Event from .contrib.client import APICLient from .exceptions import LBMismatchError QUEUE_FULL_DELAY = 5 EMPTY_QUEUE_DELAY = 1 ON_EMPTY_DELAY = 10 FORWARD_WORKER_SLEEP = 5 BACKWARD_WOKER_DELAY = 1 WATCH_DELAY = ...
apache-2.0
-4,660,910,926,064,261,000
35.835165
85
0.514171
false
4.463382
true
false
false
alphagov/notifications-api
migrations/versions/0009_created_by_for_jobs.py
1
1253
"""empty message Revision ID: 0009_created_by_for_jobs Revises: 0008_archive_template Create Date: 2016-04-26 14:54:56.852642 """ # revision identifiers, used by Alembic. revision = '0009_created_by_for_jobs' down_revision = '0008_archive_template' from alembic import op import sqlalchemy as sa from sqlalchemy.dial...
mit
-4,739,229,239,736,392,000
35.852941
114
0.676776
false
3.254545
false
false
false
sergey-dryabzhinsky/dedupsqlfs
dedupsqlfs/db/mysql/table/link.py
1
2607
# -*- coding: utf8 -*- __author__ = 'sergey' from dedupsqlfs.db.mysql.table import Table class TableLink( Table ): _table_name = "link" def create( self ): c = self.getCursor() # Create table c.execute( "CREATE TABLE IF NOT EXISTS `%s` (" % self.getName()+ ...
mit
919,150,897,091,248,600
25.876289
83
0.472957
false
3.891045
false
false
false
sassoftware/rbuild
rbuild_test/unit_test/internaltest/plugintest.py
2
4098
#!/usr/bin/python # # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
4,570,665,599,803,566,000
37.299065
78
0.63592
false
3.597893
true
false
false
yulia-baturina/python_training
fixture/group.py
1
4587
__author__ = 'IEUser' from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def is_groups_page_opened(self): wd = self.app.wd return wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0 def return_to_groups_page(se...
apache-2.0
8,509,506,878,258,116,000
32.727941
97
0.583824
false
3.459276
false
false
false
kartvep/Combaine
combaine/common/loggers.py
1
3113
import logging import logging.handlers import combaine.common.configloader.config __all__ = ["ParsingLogger", "AggregateLogger", "CommonLogger"] def _initLogger(name): try: config = combaine.common.configloader.config.parse_common_cfg("combaine")['cloud_config'] except Exception as err: pass ...
lgpl-3.0
-6,377,385,242,612,563,000
33.977528
121
0.612592
false
3.688389
true
false
false
liqd/adhocracy3.mercator
src/adhocracy_core/adhocracy_core/auditing/__init__.py
2
2629
"""Log which user modifies resources in additional 'audit' database.""" import substanced.util import transaction from pyramid.i18n import TranslationStringFactory from pyramid.traversal import resource_path from pyramid.request import Request from BTrees.OOBTree import OOBTree from logging import getLogger from adhoc...
agpl-3.0
-6,708,229,324,273,740,000
30.297619
73
0.669456
false
3.983333
false
false
false
QISKit/qiskit-sdk-py
qiskit/extensions/standard/t.py
1
2534
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
4,434,833,675,723,367,400
24.59596
77
0.561957
false
3.480769
false
false
false
franga2000/django-machina
machina/apps/forum_tracking/abstract_models.py
1
2058
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from machina.core.loading import get_class ForumReadTrackManager = get_...
bsd-3-clause
-2,361,927,502,164,073,000
32.193548
96
0.661322
false
3.875706
false
false
false
Vauxoo/stock-logistics-workflow
stock_lot_scrap/models/stock_scrap_lot.py
2
3602
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2017 David Vidal <david.vidal@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, models from odoo.exceptions import ValidationError f...
agpl-3.0
-6,001,856,978,350,550,000
37.319149
78
0.561077
false
3.683027
false
false
false
enen92/script.sportscenter
resources/lib/tweetbuild.py
1
1318
import xbmc,xbmcgui,xbmcaddon,xbmcplugin import urllib,re,datetime import thesportsdb,feedparser from random import randint from centerutils.common_variables import * from centerutils.tweet import * def tweets(tweeter_user): window = dialog_tweet('DialogTweeter.xml',addonpath,'Default',str(tweeter_user)) window.doM...
gpl-2.0
6,564,910,876,334,208,000
31.146341
86
0.709408
false
2.948546
false
false
false
NiceCircuits/pcbLibraryManager
src/pcbLibraryManager/libraries/libraryTest.py
1
4474
# -*- coding: utf-8 -*- """ Created on Wed Jan 13 06:41:54 2016 @author: piotr at nicecircuits.com """ from libraryManager.library import libraryClass from libraryManager.part import part from footprints.footprintSmdQuad import * from footprints.footprintSmdDualRow import * from libraryManager.footprintPrimitive impo...
cc0-1.0
3,821,752,789,901,822,000
40.045872
110
0.630085
false
3.249092
false
false
false
UdK-VPT/Open_eQuarter
mole/extensions/eval3/oeq_QTP_Wall.py
1
1369
# -*- coding: utf-8 -*- import os,math from qgis.core import NULL from mole import oeq_global from mole.project import config from mole.extensions import OeQExtension from mole.stat_corr import contemporary_base_uvalue_by_building_age_lookup def calculation(self=None, parameters={},feature = None): from math impo...
gpl-2.0
-3,066,049,638,907,766,000
34.102564
101
0.693207
false
3.244076
false
false
false
jgao54/airflow
airflow/contrib/hooks/ssh_hook.py
3
10449
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
459,037,617,762,114,000
40.963855
90
0.56503
false
4.564875
true
false
false
jbagd/twitter-sentiment
twitterstream-copy.py
1
1814
import oauth2 as oauth import urllib2 as urllib # See https://dev.twitter.com/oauth/overview/application-owner-access-tokens for how to get these credentials access_token_key = "type in your credentials" access_token_secret = "type in your credentials" consumer_key = "type in your credentials" consumer_secret = "type...
mit
-2,520,181,808,444,195,300
28.737705
109
0.662624
false
3.763485
false
false
false
niosus/EasyClangComplete
tests/test_flags_source.py
1
2063
"""Tests for cmake database generation.""" import imp from os import path from unittest import TestCase from EasyClangComplete.plugin.flags_sources import flags_source from EasyClangComplete.plugin.utils import flag imp.reload(flags_source) imp.reload(flag) FlagsSource = flags_source.FlagsSource Flag = flag.Flag c...
mit
-3,226,830,194,560,409,600
39.45098
79
0.610276
false
3.982625
true
false
false
gautam1858/tensorflow
tensorflow/python/kernel_tests/bias_op_test.py
2
11215
# Copyright 2015 The TensorFlow 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 required by applica...
apache-2.0
-2,695,578,192,542,703,000
41.642586
80
0.594383
false
3.33482
true
false
false
simon816/Command-Block-Assembly
cbl/array_support.py
1
7466
from collections import namedtuple from .native_type import NativeType from .containers import DelegatedWrite import cmd_ir.instructions as i Pair = namedtuple('Pair', 'left right min max') class ArrayType(NativeType): def __init__(self, elem_type, size): super().__init__() assert size > 0, "Si...
mit
-2,577,474,538,730,189,300
35.067633
88
0.602465
false
3.567129
false
false
false
wf4ever/ro-manager
src/checklist/minim_graph.py
1
5519
# Minim_graph.py """ Module to create RDF Minim graph throughn simple set of API calls """ __author__ = "Graham Klyne (GK@ACM.ORG)" __copyright__ = "Copyright 2011-2013, University of Oxford" __license__ = "MIT (http://opensource.org/licenses/MIT)" import rdflib from rocommand.ro_namespaces import RDF f...
mit
5,834,525,901,752,327,000
40.496241
100
0.596666
false
3.400493
false
false
false
j12y/predixpy
predix/data/weather.py
1
3570
import os import urllib import predix.config import predix.service class WeatherForecast(object): """ Weather Forecast Service .. important:: Deprecated """ def __init__(self, *args, **kwargs): super(WeatherForecast, self).__init__(*args, **kwargs) key = predix.config....
bsd-3-clause
3,104,528,244,405,958,700
32.055556
77
0.589356
false
4.075342
false
false
false
koalakoker/knote_gcrypt
GCryptNote/__init__.py
1
2654
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 24/mag/2015 @author: koala ''' from keepnote.gui import extension import sys try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gtk.glade except: sys.exit(1) class debugView: """debug view""" ...
gpl-2.0
7,136,069,054,866,454,000
24.737864
99
0.537736
false
3.665284
false
false
false
ehfeng/pipet
pipet/sources/zendesk/views.py
2
3440
from datetime import datetime from flask import Blueprint, redirect, request, Response, render_template, url_for from flask_login import current_user, login_required import requests from sqlalchemy.exc import ProgrammingError from pipet.models import db from pipet.sources.zendesk import ZendeskAccount from pipet.sour...
mit
-7,385,483,556,247,478,000
31.45283
95
0.679942
false
3.926941
false
false
false
anryko/ansible
lib/ansible/modules/cloud/google/gcp_pubsub_topic_info.py
13
6629
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
4,018,752,534,457,117,700
32.649746
100
0.610801
false
4.401726
false
false
false
sebdelsol/pyload
module/plugins/container/RSDF.py
3
1608
# -*- coding: utf-8 -*- from __future__ import with_statement import base64 import binascii import re from module.plugins.Container import Container from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" __version__ = "0.24" __pattern__ = r'.+\.rsdf' __description__ = """R...
gpl-3.0
1,757,640,070,915,786,800
27.714286
102
0.556592
false
3.613483
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/xfs/package.py
1
1790
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-3,601,966,879,886,061,000
40.627907
78
0.660894
false
3.653061
false
false
false
scott-maddox/simplepl
src/simplepl/instruments/drivers/thorlabs_fw102c.py
1
3238
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of SimplePL. # # SimplePL is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your opt...
agpl-3.0
6,502,911,783,775,601,000
29.54717
72
0.559296
false
3.873206
false
false
false
mafagafogigante/spellscream
spellscream.py
1
6260
import argparse import collections import os class InspectionReport: """ The result of an inspection. """ def __init__(self, filename): self.filename = filename self.word_count = 0 self.warnings = [] self.issues = [] def __len__(self): return len(self.issu...
isc
4,623,976,332,109,623,000
29.79803
119
0.613884
false
3.88323
false
false
false
grow/grow
grow/documents/document_test.py
1
33384
"""Tests for documents.""" import textwrap import unittest from grow.common import utils from grow.testing import testing from grow.documents import document from grow.translations import locales from grow.pods import pods from grow import storage class DocumentsTestCase(unittest.TestCase): def setUp(self): ...
mit
-1,329,246,219,627,932,700
37.638889
100
0.549305
false
3.729639
true
false
false
laufercenter/meld
meld/system/openmm_runner/cmap.py
1
6968
# # Copyright 2015 by Justin MacCallum, Alberto Perez, Ken Dill # All rights reserved # from collections import OrderedDict, namedtuple import os import math from simtk import openmm import numpy as np from meld.system.system import ParmTopReader CMAPResidue = namedtuple('CMAPResidue', 'res_num res_name index_N in...
mit
4,541,306,422,953,295,000
34.917526
110
0.562141
false
3.482259
false
false
false
traceguide/api-python
examples/trivial/main.py
1
3315
"""Simple example showing several generations of spans in a trace. """ import argparse import contextlib import sys import time import opentracing import lightstep.tracer def sleep_dot(): """Short sleep and writes a dot to the STDOUT. """ time.sleep(0.05) sys.stdout.write('.') sys.stdout.flush() ...
mit
6,759,870,083,484,675,000
34.645161
98
0.629261
false
3.779932
false
false
false
hoover/snoop
snoop/management/commands/exportpgp.py
1
2884
from django.core.management.base import BaseCommand from pathlib import Path import base64 from ... import models from ... import emails from ... import pgp from ... import utils from ...content_types import guess_content_type class Command(BaseCommand): help = "Export digested pgp .eml files to a zip archive" ...
mit
-19,401,088,531,284,572
35.05
72
0.552358
false
4.016713
false
false
false
pfre00/a3c
shared_rmsprop.py
1
1231
import torch import torch.optim as optim class SharedRMSprop(optim.RMSprop): def __init__(self, params, lr=1e-2, alpha=0.99, eps=1e-8, weight_decay=0, momentum=0, centered=False): super(SharedRMSprop, self).__init__(params, lr, alpha, eps, weight_decay, momentum, centered) for group ...
mit
581,964,390,641,405,000
41.482759
106
0.515841
false
3.945513
false
false
false
thehub/hubspace
monkeypatch.py
1
1050
import sys sys.path.extend(['develop-eggs/PIL-1.1.6-py2.7-linux-i686.egg', 'develop-eggs/pycairo-1.8.10-py2.7-linux-i686.egg']) reload(sys) sys.setdefaultencoding('utf-8') del sys.setdefaultencoding print "default encoding: utf-8" #monkeypatch cherrypy, see #http://trac.turbogears.org/turbogears/ticket/1022 import ch...
gpl-2.0
4,549,012,412,736,883,700
27.378378
116
0.646667
false
3.52349
false
false
false
LaPingvino/pasportaservo
tools/migration_family_members.py
1
4145
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys import pprint import pytz import pymysql as mdb from datetime import datetime from getpass import getpass import django from django.utils.timezone import make_aware from django.utils.translation import ugettext_lazy as _ from django.db import transaction fr...
agpl-3.0
-6,203,545,569,085,463,000
31.131783
150
0.641978
false
3.451291
false
false
false
svalenti/agnkey
trunk/bin/agnscheduler.py
1
15953
#!/dark/usr/anaconda/bin/python import agnkey import numpy as np import os,string,re import datetime,time,ephem import requests def getstatus_all(token,status,date,user='stefano_valenti1',proposal='KEY2018B-001'): req = 'https://observe.lco.global/api/userrequests/' + '?limit=1000&'+\ 'proposal=' + pro...
mit
-5,159,076,196,331,648,000
46.620896
204
0.474519
false
3.977312
false
false
false
jemofthewest/GalaxyMage
src/Main.py
1
5206
## Automatically adapted for numpy.oldnumeric Jul 22, 2012 by # Copyright (C) 2005 Colin McMillen <mcmillen@cs.cmu.edu> # # This file is part of GalaxyMage. # # GalaxyMage 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...
gpl-2.0
-9,194,749,660,764,425,000
33.939597
91
0.629466
false
4.092767
false
false
false
hamogu/marxs
marxs/optics/baffle.py
2
2038
# Licensed under GPL version 3 - see LICENSE.rst import numpy as np from .base import FlatOpticalElement from ..math.utils import h2e from ..visualization.utils import plane_with_hole class Baffle(FlatOpticalElement): '''Plate with rectangular hole that allows photons through. The probability of photons tha...
gpl-3.0
2,371,856,094,042,839,000
36.054545
85
0.490677
false
3.685353
false
false
false
sourlows/rating-cruncher
src/app/api/leaderboard.py
1
2094
from app.api.base import BaseAuthResource, StringArgument, IntegerArgument, DatastoreCursorArgument from app.participant.models import ParticipantModel from flask_restful import fields, marshal LEADERBOARD_TEMPLATE = { 'name': fields.String, 'rating': fields.Float, 'games_played': fields.Integer, 'wins...
apache-2.0
-6,152,879,241,195,459,000
37.777778
117
0.653295
false
3.725979
false
false
false
imallett/MOSS
source/x86/scripts/_build.py
1
6833
import hashlib import os try: import cPickle as pickle #Only present in Python 2.*; Python 3 automatically imports the except: import pickle as pickle #new equivalent of cPickle, if it's available. from subprocess import call import _paths #Directories def get_abs_path(rel_path): return os.path.abspath(rel_p...
mit
-1,722,869,990,907,578,400
34.774869
144
0.605444
false
3.5077
false
false
false
wolfthefallen/king-phisher
king_phisher/templates.py
4
11551
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/templates.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this l...
bsd-3-clause
-2,517,951,449,152,028,000
36.26129
126
0.710415
false
3.349087
false
false
false
alfredodeza/ceph-doctor
setup.py
1
3740
from setuptools import setup, find_packages, Command import re import sys import subprocess install_requires = [] pyversion = sys.version_info[:2] def read_module_contents(): with open('ceph_medic/__init__.py') as f: return f.read() module_file = read_module_contents() metadata = dict(re.findall("__([...
mit
5,626,192,557,359,190,000
26.703704
78
0.563102
false
3.777778
false
false
false
yaukwankiu/armor
video/makeVideo.py
1
14964
# -*- coding: utf-8 -*- """ Module to convert videos from jpgs or pdfs USE: cd /media/KINGSTON/ARMOR/python python from armor.video import makeVideo as mv reload(mv); mv.main() mv.main(inputDate='2013-07-12', inputType='satellite1') mv.main(inputDate='2013-07-12', inputType='satellite4') import time t0=time.time() ...
cc0-1.0
344,819,082,421,561,900
39.117962
132
0.556803
false
3.765476
false
false
false
Jokeren/neon
neon/data/dataloader.py
1
12387
# ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
apache-2.0
2,418,779,810,224,474,600
41.276451
88
0.588036
false
4.088119
false
false
false
jimporter/bfg9000
test/unit/builtins/test_file_types.py
1
13686
from unittest import mock from .common import AttrDict, BuiltinTest from bfg9000.builtins import find, project, regenerate, version # noqa from bfg9000.builtins.file_types import make_file_list, static_file from bfg9000.file_types import * from bfg9000.path import Path, Root def srcpath(p): return Path(p, Root...
bsd-3-clause
-5,738,996,323,690,692,000
37.661017
78
0.571095
false
3.647655
true
false
false
gabrielferreira/apprelease
apprelease/settings.py
1
6032
""" Django settings for apprelease project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build p...
apache-2.0
7,062,167,176,622,131,000
29.933333
100
0.661472
false
3.560803
false
false
false
stryku/hb
client_server/strbot/strykubot.py
1
2285
from git import Repo import os import shutil import stat import utils import tempfile def on_rm_error(func, path, exc_info): # path contains the path of the file that couldn't be removed # let's just assume that it's read-only and unlink it. os.chmod(path, stat.S_IWRITE) os.unlink(path) class Stryku...
mit
-4,906,395,253,340,578,000
30.736111
128
0.595186
false
3.441265
false
false
false
ezhuk/aws-tools
ec2/check_snapshot_status.py
1
1693
#!/usr/bin/env python # Copyright (c) 2014 Eugene Zhuk. # Use of this source code is governed by the MIT license that can be found # in the LICENSE file. """Checks AWS EBS Snapshot status. This script displays the current status of one or more AWS EBS snapshots. Usage: ./check_snapshot_status.py [options] """ i...
mit
5,892,942,803,866,929,000
25.453125
80
0.561134
false
3.795964
false
false
false
palerdot/calibre
src/calibre/gui2/viewer/config.py
4
15408
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
-7,370,443,364,022,408,000
46.555556
126
0.620132
false
3.648591
true
false
false
shashikiranrp/kasi
src/kasi.py
1
2877
#!/usr/bin/env python import string, sys, getopt, codecs DEFAULT_MAP_FILE = "../kw_maps/kw_map_kannada.txt" def getKeywordMapFromFile(fileName): _k_map = {} with codecs.open(fileName, "r", "utf-8") as fh: for line in filter(lambda ln: 0 <> len(ln) and not ln.startswith("#"), map(string.strip, fh.readlines())...
apache-2.0
-6,251,791,946,654,577,000
25.394495
110
0.533542
false
3.329861
false
false
false
bwasti/caffe2
caffe2/python/layers/uniform_sampling.py
1
3104
## @package uniform_sampling # Module caffe2.python.layers.uniform_sampling from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np from caffe2.python import core, schema from caffe2.python.layers.layers im...
apache-2.0
5,770,119,703,379,451,000
30.353535
79
0.539626
false
4.390382
false
false
false
ramonvanalteren/jenkinsapi
jenkinsapi/artifact.py
2
3818
""" Artifacts can be used to represent data created as a side-effect of running a Jenkins build. Artifacts are files which are associated with a single build. A build can have any number of artifacts associated with it. This module provides a class called Artifact which allows you to download objects from the server ...
mit
-676,388,693,495,890,400
34.351852
103
0.59979
false
4.444703
false
false
false
fginter/roope
gui/roope.py
1
9619
from PyQt4.QtGui import * from PyQt4.QtCore import Qt, pyqtSlot, QThread from ui_roope import * import sys import struct import serial.tools.list_ports import serial import math import time import datetime DOWN=180 UP=0 #COMMAND: # DSSAAPB; (D)rive (S)teps (A)ngle 2bytes, 0-360 (P)en 1byte 0-255 (B)ackwards 1by...
gpl-2.0
-6,359,030,835,796,211,000
36.870079
161
0.573033
false
3.260678
false
false
false
notsambeck/siftsite
siftsite/skeleton.py
1
3619
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following line in the entry_points section in setup.cfg: console_scripts = fibonacci = siftsite.skeleton:run Then run `python setup.py ins...
mit
-3,538,116,300,525,530,000
27.496063
77
0.623377
false
3.715606
false
false
false
Antergos/Cnchi
src/installation/wrapper.py
1
6440
#!/usr/bin/env python # -*- coding: utf-8 -*- # # wrapper.py # # Copyright © 2013-2018 Antergos # # This file is part of Cnchi. # # Cnchi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of th...
gpl-3.0
-5,595,447,501,265,313,000
33.994565
88
0.634726
false
3.754519
false
false
false
openstack/zaqar
zaqar/storage/swift/subscriptions.py
1
7064
# Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
apache-2.0
-8,218,387,053,009,681,000
42.337423
79
0.54346
false
5.002833
false
false
false
aagusti/e-sipkd
esipkd/views/reports.py
1
155518
import sys import re from email.utils import parseaddr from sqlalchemy import not_, func, case, and_, or_, desc, extract from sqlalchemy.orm import aliased from sqlalchemy.sql.expression import literal_column, column from datetime import datetime from time import gmtime, strftime from pyramid.view import ( ...
lgpl-3.0
5,254,077,287,836,435,000
52.299476
218
0.471997
false
3.768672
false
false
false
baolinw/cloud
cloudAPI/local_api/lib_local.py
1
1721
import argparse import httplib2 import os import sys import json import io import os.path from os import listdir from os.path import isfile,join # simulate the 'Cloud' in local storage ROOT_DIR = '/home/ubuntu/tmp/' def upload_file(service,from_file_name,to_file_name): # try delete it first try: d...
apache-2.0
9,077,936,335,657,262,000
28.192982
121
0.66473
false
2.821311
false
false
false
vamitrou/jpath-py
jpath.py
1
4364
######################################################################## # # jpath-py # An XPath-like querying interface for JSON objects # # author: Vasileios Mitrousis # email: vamitrou@gmail.com # # The software is given as is, no guarantees from the author # Licenced under Apache 2.0 licence # #####...
apache-2.0
-5,848,436,728,557,343,000
36.299145
115
0.43538
false
4.588854
false
false
false
jedie/DragonPy
PyDC/PyDC/configs.py
1
4858
#!/usr/bin/env python2 """ PyDC - configs ============== :copyleft: 2013 by Jens Diemer :license: GNU GPL v3 or above, see LICENSE for more details. """ import inspect from MC6809.utils.humanize import byte2bit_string class BaseConfig: """ shared config values """ # For writing WAVE files...
gpl-3.0
1,682,621,820,583,178,200
35.253731
112
0.568958
false
3.110115
true
false
false
qqwjq/crab
scikits/crab/recommenders/knn/base.py
10
5194
""" Generalized Recommender models amd utility classes. This module contains basic memory recommender interfaces used throughout the whole scikit-crab package as also utility classes. The interfaces are realized as abstract base classes (ie., some optional functionality is provided in the interface itself, so that th...
bsd-3-clause
1,605,499,775,484,829,700
30.289157
94
0.632075
false
4.854206
false
false
false
prasanna08/oppia
scripts/linters/test_files/invalid_metaclass.py
2
1562
# coding: utf-8 # # Copyright 2020 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
786,655,446,843,638,700
30.877551
78
0.684379
false
3.934509
false
false
false
tutufan/subterfugue
tricks/FileTrick.py
1
1633
# # Substitute one filename by another in open and stat64 call # # Copyright 2003 Jiri Dobes <dobes@centrum.cz> # Can be freely distributed and used under the terms of the GNU GPL. # # Version 0.0.1 from Trick import Trick from Memory import * class File(Trick): def usage(self): re...
gpl-2.0
-6,754,329,897,064,963,000
30.403846
74
0.532762
false
3.719818
false
false
false
simonolander/euler
euler-323-bitwise-or-operations-on-random-integers.py
1
1292
import operator as op from functools import reduce def ncr(n, r): r = min(r, n-r) if r == 0: return 1 numer = reduce(op.mul, range(n, n-r, -1)) denom = reduce(op.mul, range(1, r+1)) return numer//denom def p(n, r): return ncr(n, r) / 2**n f8 = 0 # f7 = 1 + p(1, 1)*f8 + p(1, 0)*f7 -> (1 - p(1, 0) * f7 = f7 =...
mit
6,128,869,015,706,782,000
29.046512
128
0.4613
false
1.684485
false
false
false
vntarasov/openpilot
selfdrive/locationd/models/live_kf.py
1
12011
#!/usr/bin/env python3 import sys import numpy as np import sympy as sp from selfdrive.locationd.models.constants import ObservationKind from rednose.helpers.ekf_sym import EKF_sym, gen_code from rednose.helpers.sympy_helpers import euler_rotate, quat_matrix_r, quat_rotate EARTH_GM = 3.986005e14 # m^3/s^2 (gravita...
mit
648,415,760,771,225,300
40.560554
161
0.590126
false
2.757979
false
false
false
uahic/nest-simulator
pynest/nest/tests/test_labeled_synapses.py
3
6034
# -*- coding: utf-8 -*- # # test_labeled_synapses.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 L...
gpl-2.0
7,329,957,250,267,788,000
33.878613
78
0.558336
false
3.977587
true
false
false
lapets/bu-gsubmit-grading
gradefiles-push.py
1
2477
##################################################################### ## ## gradefiles-push.py ## ## Script to post grade files to the gsubmit directories of ## enrolled students; the input grade file names should correspond ## to the user names of the students. ## ## import sys # For command line arguments. im...
mit
-784,425,278,218,611,800
30.367089
94
0.505046
false
3.616058
false
false
false
jimberlage/servo
tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/client_upgrade_fragment.py
26
3723
# -*- coding: utf-8 -*- """ Client Plaintext Upgrade ~~~~~~~~~~~~~~~~~~~~~~~~ This example code fragment demonstrates how to set up a HTTP/2 client that uses the plaintext HTTP Upgrade mechanism to negotiate HTTP/2 connectivity. For maximum explanatory value it uses the synchronous socket API that comes with the Pytho...
mpl-2.0
8,718,685,781,124,614,000
35.145631
79
0.689229
false
3.858031
false
false
false