repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
endlessm/chromium-browser
third_party/catapult/third_party/typ/typ/runner.py
1
43781
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
1,785,770,778,176,043,000
36.451668
84
0.552317
false
4.106265
true
false
false
cbernardo/kicad3Dmodels
mcad/scripts/py/samtec_ss_sd_ess_esd_hss.py
1
15397
# file: samtec_ss_sd_ess_esd_hss.py # # Copyright 2012-2014 Cirilo Bernardo # # 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...
gpl-3.0
-7,502,405,196,987,234,000
30.294715
116
0.598039
false
2.197374
false
false
false
Pragmatismo/TimelapsePi-EasyControl
webcamcap_show_magic.py
1
6848
#!/usr/bin/python import time import os import sys import pygame from PIL import Image, ImageDraw, ImageChops print("") print("") print(" USE l=3 to take a photo every 3 somethings, try a 1000 or 2") print(" t to take triggered photos ") print(" cap=/home/pi/folder/ to set caps path other than current dir") ...
gpl-2.0
5,001,668,531,451,163,000
28.016949
168
0.569509
false
3.044909
false
false
false
foreni-packages/pyew
vstruct/defs/kdcom.py
21
8471
""" Initial module with supporting structures for windows kernel serial debugging. """ import vstruct from vstruct.primitives import * # Main packet magic bytes and such BREAKIN_PACKET = 0x62626262 BREAKIN_PACKET_BYTE = 0x62 PACKET_LEADER = 0x30303...
gpl-2.0
9,164,877,291,868,905,000
38.5311
78
0.677724
false
3.078125
false
false
false
Juniper/ceilometer
ceilometer/tests/storage/test_impl_mongodb.py
1
9801
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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
162,084,666,006,797,600
41.799127
79
0.544842
false
4.310026
true
false
false
cemonatk/My-Tools
DSBSCModulation.py
2
1699
#!/usr/bin/env python # -*- coding: utf-8 -*- __date__ = '10.10.2016' __author__ = 'cemonatk' from numpy import cos,pi,sin,arange from matplotlib.pyplot import plot,show,title,subplot,suptitle,xlabel,imshow from matplotlib.image import imread from Tkinter import * def DSBSCModulate(fm,fc,aralik): suptitle('Analo...
mit
-1,485,254,926,386,123,000
23.242857
116
0.669417
false
2.672441
false
false
false
lizardsystem/lizard-rijnmond
lizard_rijnmond/migrations/0002_auto__add_area.py
1
1658
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Area' db.create_table('lizard_rijnmond_area', ( ('id', self.gf('django.db.mode...
gpl-3.0
-1,028,873,226,049,679,200
41.512821
124
0.584439
false
3.490526
false
false
false
mm318/scipysim-nogui
scipysim/actors/logic/compare.py
2
1681
from scipysim.actors import Siso, Event class Compare(Siso): '''This abstract base class is for any actor which carries out a comparison. @requires: Compare function to take a event (dictionary) object and return true/false. ''' def __init__(self, input_channel, output_channel, threshold, boolean_...
gpl-3.0
6,436,603,258,667,358,000
40
93
0.612731
false
4.708683
false
false
false
40423210/2017springcd_hw
plugin/summary/summary.py
317
2852
""" Summary ------- This plugin allows easy, variable length summaries directly embedded into the body of your articles. """ from __future__ import unicode_literals from pelican import signals from pelican.generators import ArticlesGenerator, StaticGenerator, PagesGenerator def initialized(pelican): from pelican...
agpl-3.0
-7,934,641,772,663,153,000
30.688889
81
0.634292
false
4.314675
false
false
false
deevarvar/myLab
baidu_code/soap_mockserver/spyne/const/xml_ns.py
1
2078
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
mit
836,886,115,814,913,900
31.46875
75
0.697305
false
2.960114
false
false
false
coddingtonbear/helga-karma
helga_karma/data.py
2
5891
import datetime import math import sys import pymongo import six from helga import log, settings from helga.db import db logger = log.getLogger(__name__) class KarmaRecord(object): def __init__(self, record): self._record = record @classmethod def get_actual_nick(cls, nick): nick = ni...
mit
8,386,361,549,193,593,000
26.147465
71
0.519946
false
3.945747
false
false
false
ActiveState/code
recipes/Python/576548_Converting_MySQL_database_AmazSimple_DB/recipe-576548.py
1
2289
#!/usr/bin/env python access_key = '' secret_key = '' import boto import MySQLdb from MySQLdb import cursors import threading db_user = '' db_name = '' db = MySQLdb.connect(user=db_user,db=db_name,cursorclass=cursors.DictCursor) c = db.cursor() sdb = boto.connect_sdb(access_key, secret_key) def get_or_create_domain(...
mit
9,157,238,246,033,217,000
31.239437
100
0.590651
false
3.866554
false
false
false
vanbroup/octodns
octodns/source/tinydns.py
2
7213
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from collections import defaultdict from ipaddress import ip_address from os import listdir from os.path import join import logging import re from ..record import Record from ..zone import DuplicateRecordException, Subzone...
mit
-7,311,023,389,690,548,000
31.786364
79
0.491058
false
4.169364
false
false
false
appleseedhq/gaffer
python/GafferUI/MatchPatternPathFilterWidget.py
8
5809
########################################################################## # # Copyright (c) 2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
bsd-3-clause
5,651,052,474,552,065,000
35.534591
125
0.705973
false
4.028433
false
false
false
Dangetsu/vnr
Frameworks/Sakura/py/libs/transer/infoseek.py
1
23154
# coding: utf8 # infoseek.py # 10/12/2012 jichi # # See: http://transer.com/sdk/rest_api_function.html # See (auth): http://translation.infoseek.ne.jp/js/translation-text.js # See (lang): http://translation.infoseek.ne.jp/js/userinfo.js if __name__ == '__main__': import sys sys.path.append('..') import json impor...
gpl-3.0
-467,263,801,323,195,900
21.781473
484
0.51199
false
1.819234
false
false
false
pietern/caffe2
caffe2/python/layers/layers.py
2
14662
# Copyright (c) 2016-present, Facebook, 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 or agreed...
apache-2.0
-6,624,501,043,166,146,000
36.594872
81
0.619424
false
4.387193
false
false
false
potzenheimer/meetshaus
src/meetshaus.landingpage/meetshaus/landingpage/referencelist.py
1
1303
import random from five import grok from plone import api from Products.CMFCore.interfaces import IFolderish from Products.ATContentTypes.interfaces import IATLink class ReferencesListing(grok.View): grok.context(IFolderish) grok.require('zope2.View') grok.name('references-listing') def update(self)...
mit
795,689,706,131,429,200
28.613636
65
0.626247
false
3.960486
false
false
false
MikeOrange/visa-requirements
visamap/management/commands/fill_requirements.py
1
7399
import re from datetime import timedelta from django.core.management.base import BaseCommand from django.core.exceptions import ObjectDoesNotExist from visamap.management.commands._wikipedia_parser import (CountryListParser, RequirementsPage) from visamap.model...
mit
3,359,129,402,281,727,500
34.238095
88
0.59035
false
4.807667
false
false
false
clausqr/HTPC-Manager
libs/pySMART/device.py
3
29834
#Copyright (C) 2014 Marc Herndon # #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 WITHOUT ANY WARRANTY; without ...
mit
-7,718,960,352,460,213,000
47.041868
80
0.508212
false
4.263218
true
false
false
jcchoiling/learningPython
s13/Day12/practice/sql8.py
1
1534
from sqlalchemy import Integer, ForeignKey, String, Column from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy import create_engine engine = create_engine('mysql+pymysql://myuser:mypass@192.168.80.128:3306/s13', max_overflow = 5) # 创建连接 Base...
gpl-3.0
9,089,011,389,167,565,000
18.818182
104
0.671691
false
2.992157
false
false
false
CydarLtd/ansible
lib/ansible/modules/network/nxos/nxos_command.py
58
8491
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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. # # Ansible is distribut...
gpl-3.0
-170,608,296,313,261,820
30.216912
78
0.647745
false
4.284057
false
false
false
modoboa/modoboa-pdfcredentials
modoboa_pdfcredentials/documents.py
1
4570
"""The code used to generate PDF files (based on Reportlab).""" from io import BytesIO from reportlab.lib import colors from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.lib.enums import TA_CENTER from reportlab.lib import utils from reportlab.platypus import ( SimpleDocTemp...
isc
500,975,485,101,272,300
33.885496
79
0.633698
false
3.638535
false
false
false
tacaswell/channelarchiver
tests/mock_archiver.py
2
5534
# -*- coding: utf-8 -*- import os import json import re try: from xmlrpclib import Fault, ProtocolError except ImportError: # Python 3 from xmlrpc.client import Fault, ProtocolError from channelarchiver import codes, utils tests_dir = os.path.dirname(os.path.realpath(__file__)) data_dir = os.path.join(tests...
mit
4,396,028,135,090,320,400
34.025316
68
0.497289
false
3.955683
false
false
false
dan1/horizon-proto
openstack_dashboard/dashboards/project/routers/ports/forms.py
35
8126
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic...
apache-2.0
4,858,175,093,916,278,000
39.834171
78
0.550825
false
4.320043
false
false
false
sathieu/samba
python/samba/tests/samba_tool/provision_password_check.py
1
2154
# Unix SMB/CIFS implementation. # Copyright (C) Catalyst IT Ltd. 2017 # # 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-3.0
6,974,710,073,386,539,000
37.464286
79
0.689879
false
3.778947
true
false
false
ain7/www.ain7.org
ain7/emploi/filters.py
1
1524
# -*- coding: utf-8 """ ain7/emploi/filers.py """ # # Copyright © 2007-2018 AIn7 Devel Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
lgpl-2.1
-7,282,468,565,420,906,000
30.729167
78
0.694682
false
3.935401
false
false
false
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/swiftshader/third_party/LLVM/utils/release/findRegressions.py
1
3156
#!/usr/bin/python import re, string, sys, os, time, math DEBUG = 0 (tp, exp) = ('compile', 'exec') def parse(file): f = open(file, 'r') d = f.read() # Cleanup weird stuff d = re.sub(r',\d+:\d', '', d) r = re.findall(r'TEST-(PASS|FAIL|RESULT.*?):\s+(.*?)\s+(.*?)\r*\n', d) test = {} fname = '' for...
gpl-3.0
2,135,793,082,560,134,400
24.658537
85
0.46673
false
3.002854
true
false
false
adlnet/xci
xci/competency/evaluation.py
1
4776
import requests import json class Evaluate(object): def __init__(self, user): super(Evaluate, self).__init__() self.user = user self.xapi = XAPIWrapper(user.profile.get('lrsprofiles', None)) def check_all(self): comps = self.user.getCompArray() for c in comps: ...
apache-2.0
7,275,294,195,611,147,000
32.633803
93
0.537688
false
4.131488
false
false
false
petr-kalinin/progrobot
StackoverflowHandler.py
1
2771
#!/usr/bin/python3 import html import urllib.request import urllib.parse import json import gzip from html2tele import html2tele from Handler import Handler class StackoverflowHandler(Handler): def handle(self, query, state): if query != "": answer = search(query) else: ans...
agpl-3.0
-6,634,084,180,141,986,000
31.186047
119
0.576075
false
3.764626
true
false
false
nmjacob/PyRPG
Main.py
1
1588
#Main file, used for command and control as well import re import copy from Modules import Screen from Modules import FileRead from Modules import Creature #Global Variables #The current level, in it's current state LEVEL = [] CREATURES = [] PLAYER_ID = 0 #Private Functions def _FindPosition(icon): for y in rang...
mit
-5,140,665,694,715,109,000
16.26087
82
0.642947
false
2.825623
false
false
false
erikedin/introcomplex
introcomplex/__init__.py
1
2258
""" Module for running exercises easily. """ from collections import namedtuple import pylab import importlib Variables = None Parameters = None plots = {} plot_order = [] class Context: """ Keep track of results of each simulation step. """ def __init__(self, variables, parameters): self.tim...
mit
9,195,619,444,651,091,000
26.876543
76
0.625332
false
4.158379
false
false
false
yvaucher/partner-contact
res_partner_affiliate/res_partner.py
37
1415
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
2,409,061,674,984,006,700
35.282051
78
0.574558
false
4.21131
false
false
false
nevermoreluo/sakura
sakura/crypt.py
1
9813
import sys import random import struct import hashlib import hmac import platform from Crypto.Cipher import AES _PY2 = sys.version_info[0] == 2 if not _PY2: long = int xrange = range # if platform.system().lower() == 'darwin': # from sakura.cpplib_osx import xtea_encrypt, xtea_decrypt,...
gpl-3.0
4,900,594,514,200,113,000
28.761755
104
0.572302
false
2.513576
false
false
false
KristoferHellman/gimli
doc/sidebar_gallery.py
1
3907
#!/usr/bin/env python # encoding: utf-8 """ File: sidebar_gallery.py Author: Florian Wagner <fwagner@gfz-potsdam.de> Description: Add all examples/tutorials to sidebar gallery Created on: 2013-10-13 """ from __future__ import print_function import os, re from glob import glob from os.path import abspath, join, dirnam...
gpl-3.0
7,513,357,662,487,837,000
31.02459
100
0.579217
false
3.497762
false
false
false
ppwwyyxx/tensorpack
tensorpack/dataflow/dataset/svhn.py
2
2704
# -*- coding: utf-8 -*- # File: svhn.py import numpy as np import os from ...utils import logger from ...utils.fs import download, get_dataset_path from ..base import RNGDataFlow __all__ = ['SVHNDigit'] SVHN_URL = "http://ufldl.stanford.edu/housenumbers/" class SVHNDigit(RNGDataFlow): """ `SVHN <http://u...
apache-2.0
4,937,587,709,382,378,000
30.08046
93
0.565828
false
3.359006
false
false
false
spacepajamas/DiaTop
LDA/LDA_1_make_dictionary.py
1
1444
import gensim import os import gensim import json import logging import sys from six import iteritems from gensim import corpora import datetime mylist = [] today = datetime.date.today() mylist.append(today) date = str(mylist[0]) # print the date object, not the container ;-) foldername = sys.argv[1] ## 'corpus' fold...
gpl-3.0
6,962,652,556,497,349,000
32.581395
134
0.731994
false
3.304348
false
false
false
project-owner/Peppy
voiceassistant/googleassistant/sounddevicestream.py
1
2703
# Copyright (C) 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 applicable law or agreed to in writi...
gpl-3.0
-6,527,241,304,195,670,000
32.37037
135
0.654458
false
4.016345
false
false
false
sophos/Sophos-Central-SIEM-Integration
siem.py
1
11434
#!/usr/bin/env python # Copyright 2019-2021 Sophos Limited # # 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
-7,375,395,221,655,274,000
27.37469
102
0.612646
false
3.650702
true
false
false
gabofer82/taller_programacion_2017
Diseño Interfaz Gráfica/output/form_reserva_examen.py
1
9165
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'reserva_examen.ui' # # Created: Tue Nov 7 18:24:28 2017 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_dlg_reserva(object): def s...
mit
-1,007,530,162,516,685,200
63.062937
160
0.717607
false
2.970493
false
false
false
Reactive-Extensions/RxPy
rx/concurrency/scheduleditem.py
1
1335
from datetime import timedelta from rx.disposables import SingleAssignmentDisposable def default_sub_comparer(x, y): #print ("default_sub_comparer", x, y) return 0 if x == y else 1 if x > y else -1 class ScheduledItem(object): def __init__(self, scheduler, state, action, duetime, comparer=None): s...
apache-2.0
-8,133,070,663,123,489,000
32.375
73
0.636704
false
3.608108
false
false
false
xnextx/openpaste
application_openpaste/views.py
1
1222
#-*-coding:utf-8-*- from django.shortcuts import render from application_openpaste.models import * import re # Create your views here. # Tools def show_one_inset_tool(request): url = request.get_full_path() priv = re.search('-.*-', url).group() if(priv[1] == '1'):#Prywatny inset = "" for ...
mit
-3,647,610,527,169,451,500
19.728814
60
0.594108
false
3.174026
false
false
false
mabdrabo/GEWB
GEWB/settings.py
1
2580
""" Django settings for GEWB project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
mit
-2,095,680,592,517,604,900
23.571429
71
0.717829
false
3.169533
false
false
false
bmcfee/gordon
scripts/generate_tracklist_from_regexp.py
1
3371
#!/usr/bin/env python """Generates a tracklist file for use by gordon's audio_intake scripts Usage: generate_tracklist_from_regexp <pattern> <outputfilename> file1 file2 ... Extracts metadata from each of the given filenames using the specified regexp pattern to generate a tracklist. The pattern must name matching...
gpl-3.0
5,933,102,403,326,514,000
38.658824
160
0.68051
false
3.045167
false
false
false
uhef/fs-uae-gles
launcher/fs_uae_launcher/fsui/wx/textarea.py
2
1715
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import wx from .common import update_class from .System import System class TextArea(wx.TextCtrl): def __init__(self, parent, text="", read_only=False, h...
gpl-2.0
-2,750,570,435,024,846,000
33.3
68
0.598834
false
3.942529
false
false
false
AndreasMadsen/grace
Code/figures/ols_world.py
1
2580
# -*- coding: utf-8 -*- from setup import * import grace import grace.ols import os.path as path import numpy as np import matplotlib; backend = matplotlib.get_backend() import matplotlib.pyplot as plt import mpl_toolkits.basemap as maps import re Theta = grace.ols.theta_matrix() description = grace.ols.theta_descri...
mit
-361,544,824,449,448,770
24.544554
76
0.674419
false
2.572283
false
false
false
pombredanne/django-bulbs
bulbs/campaigns/models.py
1
1467
from django.db import models from djbetty import ImageField from djes.models import Indexable from bulbs.content.models import ElasticsearchImageField class Campaign(Indexable): sponsor_name = models.CharField(max_length=255) sponsor_logo = ImageField(null=True, blank=True) sponsor_url = models.URLFie...
mit
-6,120,717,607,889,175,000
30.891304
79
0.69257
false
3.732824
false
false
false
dquail/RobotPerception
src/horde/scripts/ActorCriticContinuous.py
1
7119
import numpy import rospy from std_msgs.msg import Float64 from horde.msg import StateRepresentation from TileCoder import * class ActorCriticContinuous(): def __init__(self): self.maxAction = 1023.0 self.minAction = 510.0 self.numberOfFeatures = TileCoder.numberOfTilings * TileCoder.number...
mit
2,053,514,331,639,909,400
37.481081
243
0.618064
false
3.735047
false
false
false
m3ccanico/ti
threat_intelligence/threat_intelligence.py
1
3010
import logging import re import os import validators class ThreatIntelligence(): TYPE_NONE = 'none' TYPE_HASH = 'hash' TYPE_DOMAIN = 'domain' TYPE_IP = 'ip' TYPE_FILE = 'file' TYPE_EMAIL = 'email' TYPE_URL = 'url' @classmethod def get_type(cls, value): type = ThreatInt...
gpl-3.0
-4,253,551,067,674,201,000
25.403509
62
0.569435
false
4.330935
false
false
false
bansalrajnikant/djime
djime/templatetags/statistics_navigation_tags.py
1
2595
from django import template import datetime from django.utils.translation import ugettext_lazy as _ register = template.Library() def do_statistics_nav_vars(parser, token): if len(token.contents.split()) != 2: raise template.TemplateSyntaxError, _("%(name)r tag needs a single argument") % {'name': token....
bsd-3-clause
2,417,586,755,412,758,500
46.2
164
0.66474
false
3.624302
false
false
false
rpstreef/static-site-generator
generate_static_site.py
1
6256
#!/usr/bin/python3.6 """ Generates static site from CodeCommit source and deploys to production S3 Bucket Many thanks to MMusket and Alestic from which i adapted their code. https://github.com/mmusket/s3-hosting-guide https://github.com/alestic/aws-lambda-codepipeline-site-generator-hugo """ from __future__ import pri...
mit
-5,980,306,857,623,508,000
34.954023
116
0.661605
false
3.483296
false
false
false
ksulinski/Arduino
plot/ReceivingSerialData.py
1
3264
# This module connects with Arduino through a serial port and generates data to draw four real-time plots. # It works with uploaded through Arduino IDE (open-source Arduino Software) AnalogReadSerial. # (In this IDE go to: File -> Examples -> 01. Basics -> AnalogReadSerial). # Modify this file to print four values with...
gpl-2.0
-3,922,179,201,439,088,600
36.953488
120
0.594363
false
3.777778
false
false
false
nazrulworld/django-hybrid-access-control-system
setup.py
1
3174
# -*- coding: utf-8 -*- """Installer for the django-hacs package.""" import os import sys from setuptools import setup PY2 = sys.version_info[0] == 2 PY34 = sys.version_info[0:2] >= (3, 4) PY35 = sys.version_info[0:2] >= (3, 5) requirements = [ 'Django>=1.10.3', 'psycopg2', 'django-redis' ]...
gpl-3.0
-4,919,246,653,226,140,000
29.815534
83
0.599244
false
3.769596
true
false
false
shawnhermans/cyborg-identity-manager
django_graph/tests/test_serialization.py
1
2289
import uuid from django_graph.models import Node, Relationship from django_graph.registry import GraphModelRegistry from django_graph.serializers import NodeSerializer, RelationshipSerializer from django_graph.tests.utils import GraphTestCase class SerializationTestCase(GraphTestCase): def setUp(self): se...
mit
-4,873,700,279,917,981,000
44.78
112
0.686763
false
3.752459
true
false
false
google/paramgmt
setup.py
1
1056
import codecs import re import os import sys try: from setuptools import setup except: print('please install setuptools via pip:') print(' <pip_exe> install setuptools') sys.exit(-1) def find_version(*file_paths): version_file = codecs.open(os.path.join(os.path.abspath( os.path.dirname(__file__))...
apache-2.0
3,538,447,092,779,142,000
29.171429
68
0.617424
false
3.45098
false
false
false
inurdata/excelStripper
excelStripper.py
1
11793
import csv import xlrd import argparse #usage info def msg(name=None): return ''' | | | _______|__________*_____________________________ \/ | |_____ | |/ \ | |/ \|/ \| \ |/ /\ | | | | | |\____/|\____/|____/ | | | |____ ____ | | | | | ...
gpl-3.0
-4,576,193,740,828,122,000
33.202985
183
0.599169
false
3.15743
false
false
false
wengyanqing/incubator-hawq
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/util.py
11
1939
class BaseVisitor: def visit(self, unused_node): "method is really overridden by compiler.visitor.ASTVisitor" assert 0, 'Unreachable' def visitChildren(self, n): for c in n.getChildNodes(): self.visit(c) def try_if_exclusive(stmt_node1, stmt_node2): from compiler...
apache-2.0
8,759,233,293,351,371,000
25.561644
75
0.552347
false
3.854871
false
false
false
dantezhu/haven
haven/haven.py
1
3734
import sys import signal from collections import Counter import setproctitle from .mixins import RoutesMixin, AppEventsMixin from .log import logger from . import constants class Haven(RoutesMixin, AppEventsMixin): ############################## configurable begin ############################## name = consta...
mit
-3,988,602,688,791,791,000
25.115942
84
0.541065
false
3.805702
false
false
false
oculusstorystudio/kraken
tests/RigTests/armGuideSync.py
2
1768
import json from kraken import plugins from kraken.core.maths import Xfo, Vec3, Quat from kraken.core.objects.container import Container from kraken.examples.arm_component import ArmComponentGuide, ArmComponent from kraken.core.profiler import Profiler from kraken.helpers.utility_methods import logHierarchy def buil...
bsd-3-clause
-1,682,516,755,871,499,300
27.532258
73
0.635747
false
3.466667
false
false
false
geratarra/Machine-Learning
perceptron.py
1
1833
# -*- coding+: utf-8 -*- """ Created on Thu Feb 5 12:25:41 2015 @author: gerardo """ import random import numpy as np def signo(omegas, punto): resultado = omegas[1]*punto[0] + omegas[2]*punto[1] + omegas[0] print resultado return cmp(resultado, 0) def solve(): puntos = np.random.uniform(0,1, (...
gpl-2.0
7,824,792,272,335,403,000
24.830986
72
0.560284
false
2.64121
false
false
false
eek6/squeakspace
www/proxy/scripts/proxy/post_list.py
1
1603
import squeakspace.common.util as ut import squeakspace.common.util_http as ht import squeakspace.proxy.server.db_sqlite3 as db import squeakspace.common.squeak_ex as ex import config def get_handler(environ): query = ht.parse_get_request(environ) cookies = ht.parse_cookies(environ) user_id = ht.get_requ...
gpl-3.0
-6,807,114,781,945,881,000
34.622222
86
0.646288
false
3.231855
false
false
false
carlomt/dicom_tools
bin/dicom_tool.py
1
63538
#!/usr/bin/python from __future__ import print_function from dicom_tools import __version__ as dicom_tools__version__ import glob import argparse import numpy as np from dicom_tools.pyqtgraph.Qt import QtCore, QtGui from dicom_tools.pyqtgraph.Qt import QtWidgets import dicom_tools.pyqtgraph as pg from dicom_tools.File...
mit
-3,972,198,593,309,668,000
42.728837
151
0.634707
false
3.617101
false
false
false
carbonblack/cb-2fa-login
app/__init__.py
1
1995
from flask import Flask from flask_bootstrap import Bootstrap from flask.ext.login import LoginManager from ConfigParser import ConfigParser import os.path from idp import idp_component from idp import load_all_metadata from admin import setup_admin from shared import db from models import User, Role, CbServer app ...
mit
-7,801,313,831,398,611,000
26.328767
105
0.682206
false
3.398637
true
false
false
daemon/flowboard
flowboard.py
1
8508
#!/usr/bin/python3 from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol, listenWS import bson import cgi import cherrypy import flowboard_auth import flowboard_posts import json import os import os.path import pymongo import pystache import sys import threading from twisted.internet im...
mit
6,939,506,621,984,995,000
37.672727
190
0.680066
false
3.447326
false
false
false
12yujim/pymtl
accel/mvmult/mvmult_fl/MatrixVec.py
7
1743
#========================================================================= # MatrixVec #========================================================================= # Functional implementation of our matrix-vector multiplication unit. from pclib.fl import ListBytesProxy class MatrixVec (object): #--------------------...
bsd-3-clause
-5,647,545,319,809,668,000
27.57377
74
0.347103
false
4.660428
false
false
false
Beit-Hatfutsot/mojp-dbs-pipelines
datapackage_pipelines_mojp/tableschema_elasticsearch/mappers.py
1
4063
from copy import copy # Module API class MappingGenerator(object): def __init__(self, base=None): if not base: base = {} self._mapping = base @classmethod def _convert_date_format(cls, fmt): if fmt not in [None, 'default', 'any']: fmt = fmt.replace('%d', ...
mit
8,102,135,388,515,401,000
33.142857
82
0.497908
false
4.638128
false
false
false
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 1A/instances/3_workflow_full_10files_primary_1sh_1rs_with_annot_with_proj_3s/medianmemory_0/MedianMemory_0.py
8
1100
#!/usr/bin/env python # It will connect to DataStoreClient from sciwonc.dataflow.DataStoreClient import DataStoreClient import ConfigDB_MedianMemory_0 # connector and config client = DataStoreClient("postgres", ConfigDB_MedianMemory_0) data = client.getData() output = [] if(data): #docs = [] n = 0 # p...
gpl-3.0
-2,873,871,933,077,107,700
17.032787
61
0.541818
false
3.832753
false
false
false
aquavitae/mongokit-py3
tests/test_mapreduce.py
1
2697
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2011, Nicolas Clairon # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the abov...
bsd-3-clause
2,546,637,820,456,938,000
41.140625
79
0.672228
false
4.301435
true
false
false
inveniosoftware/invenio-communities
tests/communities/test_resources.py
1
22195
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2021 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Community resources tests.""" import copy from io import BytesIO from invenio_co...
mit
238,655,227,631,018,560
33.198767
97
0.639288
false
3.80638
true
false
false
Unicorn-rzl/pretix
src/pretix/base/signals.py
2
2587
import django.dispatch from django.apps import apps from django.dispatch.dispatcher import NO_RECEIVERS from .models import Event class EventPluginSignal(django.dispatch.Signal): """ This is an extension to Django's built-in signals which differs in a way that it sends out it's events only to receivers w...
apache-2.0
7,292,329,840,105,208,000
35.43662
101
0.654813
false
4.514834
false
false
false
StevenM1/flashtask
FlashStim.py
1
3376
#!/usr/bin/env python # encoding: utf-8 from psychopy import visual import numpy as np class FlashStim(object): """ Initializes and draws flashing circles stimuli. Parameters ---------- screen: psychopy.visual.Window instance session: exp_tools.Session instance n_flashers: int Num...
mit
-1,299,131,936,392,139,800
40.182927
130
0.559242
false
4.188586
false
false
false
shanot/imp
modules/kernel/examples/basic_optimization.py
1
1849
## \example kernel/basic_optimization.py # This illustrates a basic main loop for optimization and searching for the best # scoring conformation. # from __future__ import print_function import IMP.example import IMP.statistics import sys IMP.setup_from_argv(sys.argv, "Basic optimization") (m, c) = IMP.example.create...
gpl-3.0
-4,137,204,283,385,658,000
36.734694
80
0.758789
false
3.337545
true
false
false
rerobins/rho_erudite
erudite/components/commands/inject_triples.py
1
4312
""" Command that will allow for a user to inject triples into a database. """ from rhobot.components.commands.base_command import BaseCommand from erudite.components.utilities import convert_rdf_json_to_storage from rdflib.namespace import DCTERMS import logging import json logger = logging.getLogger(__name__) class...
bsd-3-clause
1,660,516,366,414,843,600
36.824561
119
0.636596
false
4.198637
false
false
false
wordstobytes/contabile
contabile/settings/base.py
1
5177
# Django settings for contabile project. import os PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) PROJECT_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, os.pardir)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMIN...
apache-2.0
6,612,983,500,210,034,000
29.633136
82
0.693452
false
3.526567
false
false
false
kawamon/hue
desktop/core/ext-py/simplejson-3.15.0/simplejson/tests/__init__.py
4
2148
from __future__ import absolute_import import unittest import sys import os class NoExtensionTestSuite(unittest.TestSuite): def run(self, result): import simplejson simplejson._toggle_speedups(False) result = unittest.TestSuite.run(self, result) simplejson._toggle_speedups(True) ...
apache-2.0
5,815,553,546,463,029,000
28.027027
100
0.626164
false
4.130769
true
false
false
yassineS/COSMOS-2.0
cosmos/job/local.py
1
2302
import os import psutil from .drm import DRM from .. import TaskStatus import time class DRM_Local(DRM): name = 'local' def __init__(self, jobmanager): self.jobmanager = jobmanager self.procs = dict() def submit_job(self, task): p = psutil.Popen(task.output_command_script_path,...
gpl-3.0
3,189,507,006,103,542,300
25.45977
82
0.555604
false
3.786184
false
false
false
annavonzansen/exams
exams/migrations/0038_auto__add_field_materialtype_title_fi__add_field_materialtype_title_sv.py
1
29512
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'MaterialType.title_fi' db.add_column(u'exams_materialtype', 'title_fi', ...
gpl-2.0
-3,381,139,321,165,223,400
77.07672
220
0.557095
false
3.593765
true
false
false
plewis/phycas
tests/polytomies/polytomies.py
1
3353
# This example program simulates data on a 5-taxon tree containing one polytomy # This data set is then analyzed using an MCMC analysis that allows polytomies # to demonstrate that the polytomous true tree can be recovered from phycas import * setMasterSeed(98765) print print '~~~~~~~~~~~~~~~~~~~' print 'Simulate a ...
mit
4,810,305,566,541,873,000
32.19802
135
0.719654
false
2.71498
false
false
false
jakobkogler/pyth
test.py
2
25142
#!/usr/bin/python3 import pyth import sys # The idea here is to test each type as input to each function. # num, float, str, list, tuple, set, dict test_cases = [ # Ideally, we want to have tests for every possible token. Please don't # move the tests around, they should be in the same order as in doc.txt ...
mit
55,056,385,421,941,656
26.298588
93
0.282913
false
2.09884
false
false
false
dongjoon-hyun/tools
cli/cam.py
1
2530
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # 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 agr...
apache-2.0
8,798,763,556,977,959,000
26.5
89
0.583794
false
3.494475
false
false
false
NoamRa/project_euler
014 - Longest Collatz sequence.py
1
1232
""" Longest Collatz sequence The following iterative sequence is defined for the set of positive integers: n -> n/2 (n is even) n -> 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 It can be seen that this sequence...
mit
-6,505,470,980,211,998,000
19.898305
107
0.675325
false
3.004878
false
false
false
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/_barpolar.py
1
65684
from plotly.basedatatypes import BaseTraceType as _BaseTraceType import copy as _copy class Barpolar(_BaseTraceType): # class properties # -------------------- _parent_path_str = "" _path_str = "barpolar" _valid_props = { "base", "basesrc", "customdata", "customdat...
mit
917,960,503,252,845,600
32.546476
88
0.549266
false
4.565193
false
false
false
kubeflow/kubeflow
components/crud-web-apps/common/backend/kubeflow/kubeflow/crud_backend/helpers.py
1
3155
""" Common helper functions for handling k8s objects information """ import datetime as dt import logging import os import re import yaml from flask import current_app log = logging.getLogger(__name__) def get_prefixed_index_html(): """ The backend should modify the <base> element of the index.html file to ...
apache-2.0
-4,661,599,507,088,945,000
24.443548
79
0.545483
false
3.904703
false
false
false
openweave/openweave-wdlc
backend/lib/gwv/test_schema.py
1
2667
# # Copyright (c) 2019-2020 Google LLC. All Rights Reserved. # Copyright (c) 2016-2018 Nest Labs 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 # # ...
apache-2.0
2,451,435,317,483,389,000
33.636364
78
0.678665
false
3.804565
true
false
false
k0001/mediasancion
mediasancion/core/urls.py
1
1907
# coding: utf-8 # # MediaSanción, aplicación web para acceder a los datos públicos de la # actividad legislativa en Argentina. # Copyright (C) 2010,2011,2012 Renzo Carbonara <renzo @carbonara .com .ar> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero Genera...
agpl-3.0
-3,678,164,024,594,662,400
28.292308
79
0.649685
false
3.506446
false
false
false
anna-effeindzourou/trunk
examples/test/WireMatPM/net-2part-displ-unloading.py
8
4170
# -*- coding: utf-8 -*- # encoding: utf-8 from yade import ymport, qt, plot ## definition of some colors for colored text output in terminal BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BLACK = '\033[0m' #### short description of script print BLUE+''' Simple test for two particles to tes...
gpl-2.0
-8,428,300,154,008,945,000
29.217391
203
0.728777
false
2.743421
false
false
false
mateor/pants
src/python/pants/goal/context.py
5
13190
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import sys...
apache-2.0
3,648,770,359,162,127,000
35.946779
109
0.688779
false
4.022568
true
false
false
austin987/bandit
bandit/plugins/mako_templates.py
1
1587
# -*- coding:utf-8 -*- # # 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, softw...
apache-2.0
-1,505,857,887,939,576,300
43.083333
77
0.645873
false
4.187335
false
false
false
KordingLab/spykes
tests/ml/tensorflow/test_sparse_filtering.py
1
2092
from __future__ import absolute_import import numpy as np from nose.tools import ( assert_raises, assert_equal, ) from tensorflow import keras as ks from spykes.ml.tensorflow.sparse_filtering import SparseFiltering # Keeps the number of training images small to reduce testing time. NUM_TRAIN = 100 def test...
mit
7,300,094,394,209,541,000
29.318841
79
0.662524
false
3.423895
false
false
false
PYPIT/COS_REDUX
cosredux/science.py
1
7185
""" Utility routines """ from __future__ import (print_function, absolute_import, division, unicode_literals) import numpy as np import os import pdb from matplotlib import pyplot as plt from astropy.table import Table from xastropy.xutils import xdebug as xdb def set_extraction_region(obj_tr, segm, coadd_corrtag...
bsd-2-clause
3,568,034,232,164,029,400
27.291339
148
0.579262
false
3.013842
false
false
false
arowser/wireshark-xcoin
tools/WiresharkXML.py
52
8992
""" Routines for reading PDML produced from TShark. Copyright (c) 2003, 2013 by Gilbert Ramirez <gram@alumni.rice.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License...
gpl-2.0
812,430,714,567,758,000
26.753086
80
0.578181
false
3.961233
false
false
false
rtfm-ctf/rtfmapi
modules/crypto/enigma.py
1
7587
from rtfmapi.modules.crypto.base import Cipher class Enigma(Cipher): ''' The Enigma M3 cipher. The key consists of several parameters. :param settings: The rotor start positions, consists of 3 characters e.g. ('V','B','Q') :param rotors: The rotors and their order e.g. (2,3,1). There are 8 possible ro...
gpl-2.0
-5,532,391,464,798,235,000
54.786765
363
0.562278
false
3.451774
false
false
false
stanta/darfchain
darfchain_docker_vagrant/bigchaindb/backend/query.py
3
9251
"""Query interfaces for backends.""" from functools import singledispatch from bigchaindb.backend.exceptions import OperationError @singledispatch def write_transaction(connection, signed_transaction): """Write a transaction to the backlog table. Args: signed_transaction (dict): a signed transactio...
gpl-3.0
882,979,741,900,210,700
22.659847
88
0.668468
false
4.426316
false
false
false
lituan/tools
similarity_dist_msa.py
3
1311
#!/usr/bin/env python # -*- coding: utf-8 -*- """ plot similarity distribution of sequences """ import sys import os import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt def read_msa(msa_f): with open(msa_f) as o_f: lines = o_f.readlines() lines = [line.rst...
cc0-1.0
7,157,878,225,059,614,000
24.211538
74
0.56598
false
3.041763
false
false
false
moio/spacewalk
client/rhel/rhn-client-tools/src/up2date_client/hardware.py
3
29213
# # Copyright (c) 1999--2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-7,328,965,153,705,738,000
32.121315
118
0.552733
false
3.777217
true
false
false
0xced/youtube-dl
test/test_youtube_subtitles.py
2
3652
#!/usr/bin/env python import sys import unittest import json import io import hashlib # Allow direct execution import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.InfoExtractors import YoutubeIE from youtube_dl.utils import * from youtube_dl import FileDownloader P...
unlicense
-8,615,238,983,597,105,000
35.158416
96
0.648959
false
3.229001
true
false
false
smokorg/termite-platform
termite/resources.py
1
7134
# This file is part of Termite Plugins Platform # Copyright (C) 2014 Pavle Jonoski # # 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 y...
gpl-3.0
6,448,084,850,806,347,000
38.854749
80
0.641015
false
4.506633
false
false
false
WizeCommerce/medusa
tests/test_wize_utils.py
1
1652
""" 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 the Li...
apache-2.0
-1,138,782,399,844,284,900
32.714286
73
0.67615
false
3.952153
true
false
false
ofilangi/askomics
askomics/libaskomics/source_file/SourceFileTsv.py
1
25565
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Classes to import data from a tsv source files """ import re import csv import uuid import json from collections import defaultdict from pkg_resources import get_distribution from askomics.libaskomics.source_file.SourceFile import SourceFile,SourceFileSyntaxError from ...
agpl-3.0
143,621,770,939,110,580
39.515055
254
0.494582
false
4.250915
false
false
false
tuki0918/spiders
danbooru/danbooru/sankaku-spiders/page.py
1
1755
# -*- coding: utf-8 -*- from ..items import Image from scrapy.spiders import CrawlSpider class PageSpider(CrawlSpider): name = "sankaku#page" allowed_domains = ["chan.sankakucomplex.com"] start_urls = [] def __init__(self, *a, **kw): super(PageSpider, self).__init__(*a, **kw) # オプショ...
mit
-7,343,797,019,643,670,000
25.704918
80
0.522406
false
3.085227
false
false
false
Rouzbeh-School/Python101
2017/spring/s12/main.py
1
1351
#!/usr/bin/python3 import sys from PyQt5.QtWidgets import QWidget, QPushButton, QApplication, QGridLayout # from PyQt5.QtCore import QCoreApplication x = input('Enter the height of table: ') y = input('Enter the width of table: ') class Example(QWidget): def __init__(self): super().__init__() se...
mit
-1,686,754,811,134,525,000
27.744681
75
0.587713
false
4.04491
false
false
false