repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
fabaff/mqtt-panel
test-messages.py
1
1054
#!/usr/bin/python3 # # test-messages.py - This script publish a random MQTT messages every 2 s. # # Copyright (c) 2013-2020, Fabian Affolter <fabian@affolter-engineering.ch> # Released under the MIT license. See LICENSE file for details. # import random import time import paho.mqtt.client as mqtt timestamp = int(time....
mit
9,109,013,109,760,228,000
29.114286
80
0.656546
false
3.174699
false
false
false
DanteOnline/free-art
venv/bin/enhancer.py
1
1612
#!/home/dante/Projects/free-art/venv/bin/python3 # # The Python Imaging Library # $Id$ # # this demo script creates four windows containing an image and a slider. # drag the slider to modify the image. # try: from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL except ImportError: from Tkinter imp...
gpl-3.0
-3,770,789,276,532,839,400
24.587302
80
0.640819
false
3.082218
false
false
false
stefsmeets/scatter
scatter/scatter.py
1
18719
#!/usr/bin/env python # Scatter - A python tool to plot and output atomic scattering factors # Copyright (C) 2018 Stef Smeets # # 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; ei...
gpl-2.0
-6,991,040,486,443,301,000
34.519924
222
0.490411
false
2.863984
false
false
false
MinerKasch/dd-agent
utils/kubeutil.py
1
7617
# (C) Datadog, Inc. 2015-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from collections import defaultdict import logging import os from urlparse import urljoin # project from util import check_yaml from utils.checkfiles import get_conf_path from utils.http import retrieve_...
bsd-3-clause
-6,266,671,579,742,541,000
35.444976
97
0.598267
false
3.874364
false
false
false
hzlf/openbroadcast
website/apps/atracker/models.py
1
5334
"""Models for the ``object_events`` app.""" from django.conf import settings from django.contrib.auth.models import SiteProfileNotAvailable from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.signals import post_sa...
gpl-3.0
-7,528,221,619,261,303,000
30.755952
98
0.648669
false
4.154206
false
false
false
k1ltr0/jquery.ajax.uploader
sample/server.py
1
1547
#!/usr/bin/python # -*- coding: UTF-8 -*- import logging import os import base64 import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.render("sample.html") def post(self): image_name = self.get_argument("name", "") image_data = s...
mit
2,569,699,705,626,129,000
22.8
71
0.574014
false
3.791667
false
false
false
sigmavirus24/github-cli
gh/commands/issue/assign.py
1
1327
from gh.base import Command from gh.util import get_issue_number from gh.util import mktmpfile, rmtmpfile class IssueAssignCommand(Command): name = 'issue.assign' usage = '%prog [options] issue.assign [#]number assignee' summary = 'Assign an issue' subcommands = {} def run(self, options, args): ...
gpl-3.0
-1,235,657,331,162,847,000
26.645833
72
0.589299
false
4.095679
false
false
false
mikewesner-wf/glasshouse
glasshouse.indigoPlugin/Contents/Server Plugin/rest.py
1
2064
from flask import Flask, url_for, Response, json, jsonify, request app = Flask(__name__) import indigo from decorators import requires_apitoken, requires_auth import requests import db import settings # # Appspot Account Setup Process @app.route('/token', methods=['PUT']) def token(): new_api_token = request.head...
apache-2.0
-8,721,313,835,489,108,000
24.8
102
0.62064
false
3.378069
false
false
false
flgiordano/netcash
+/google-cloud-sdk/lib/surface/compute/instance_groups/managed/list.py
1
4512
# 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 ag...
bsd-3-clause
-6,334,655,391,686,217,000
33.707692
80
0.717199
false
4.028571
false
false
false
Meallia/robotframework-appiumlibrary
AppiumLibrary/keywords/_android_utils.py
1
5329
# -*- coding: utf-8 -*- import base64 from .keywordgroup import KeywordGroup from selenium.common.exceptions import TimeoutException from kitchen.text.converters import to_bytes class _AndroidUtilsKeywords(KeywordGroup): # Public def get_network_connection_status(self): """Returns an integer bitmask ...
apache-2.0
-2,644,014,547,221,142,000
36.265734
125
0.586789
false
4.311489
false
false
false
odoo-brazil/odoo-brazil-commission
l10n_br_sale_commission/models/account_invoice.py
1
1097
# -*- coding: utf-8 -*- # © 2016 KMEE INFORMATICA LTDA (https://www.kmee.com.br) # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api from openerp.tools.safe_eval import safe_eval class AccountInvoiceLineAgent(models.Model): _inherit = 'account.invoice.line.agent' ...
agpl-3.0
897,987,496,867,799,300
41.153846
78
0.610401
false
3.665552
false
false
false
Lothiraldan/pytf
pytf/reporters.py
1
3761
from __future__ import print_function import sys import time import traceback class BaseReporter(object): def begin_tests(self): pass def end_tests(self): pass class TextTestReporter(BaseReporter): head_template = '{double_dash}\n{status}: {id}\n{single_dash}\n' message_template...
mit
-6,397,205,347,495,334,000
27.709924
77
0.556767
false
3.853484
true
false
false
zstackio/zstack-woodpecker
integrationtest/vm/mn_ha2/test_mnha2_1_mn_host_grace_stop_crt_vm.py
1
3095
''' Test Steps: 1. grace stop host where vip located. 2. check vip switch to another MN. 3. create vm to validate everything goes on well. @author: SyZhao ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test...
apache-2.0
-55,401,214,068,597,270
39.266667
166
0.67399
false
2.852535
true
false
false
chrisnorman7/menu
menu/menu.py
1
1890
"""Menu objects.""" from pyglet.window import key from .errors import EmptyMenuError class Menu(object): """A menu object. Use window.set_menu(menu) to add it to the window.""" def __init__(self, title): self.window = None # The window this menu will be attached to. self.title = title # The title of th...
mpl-2.0
-1,545,767,328,364,982,000
25.794118
83
0.640741
false
3.53271
false
false
false
tsujamin/digi-approval
src/digiapproval_project/digiapproval_project/apps/digiapproval/migrations/0004_auto__chg_field_task_uuid__add_field_workflowspec_toplevel.py
1
7190
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Task.uuid' db.alter_column(u'digiapproval_task', 'uuid...
gpl-3.0
-1,770,627,764,572,038,700
66.839623
226
0.566064
false
3.702369
false
false
false
geopython/geolinks
tests/run_tests.py
1
2016
# ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2019 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in ...
mit
-5,451,843,022,301,467,000
35
72
0.637897
false
4.382609
true
false
false
williballenthin/synapse
synapse/__init__.py
1
1264
''' The synapse distributed key-value hypergraph analysis framework. ''' import os import msgpack import tornado import logging logger = logging.getLogger(__name__) if msgpack.version < (0,4,2): raise Exception('synapse requires msgpack >= 0.4.2') if tornado.version_info < (3,2,2): raise Exception('synapse r...
apache-2.0
1,146,409,635,272,664,300
27.727273
68
0.705696
false
3.067961
false
false
false
GoteoFoundation/goteo-api
goteoapi/users/resources.py
1
4320
# -*- coding: utf-8 -*- import time from flask import g from flask.ext.restful import fields from flasgger.utils import swag_from from ..ratelimit import ratelimit from ..auth.decorators import requires_auth from ..helpers import DateTime, marshal, bad_request from ..base_resources import BaseItem, BaseList, Response ...
agpl-3.0
3,585,244,529,358,929,000
29.638298
73
0.585417
false
4.044944
false
false
false
HiTechIronMan/openfda
openfda/res/scrape_historic.py
1
6477
#!/usr/bin/python """ Scrapes historic HTML RES reports into the JSON format used for the new reports. Note that the following fields in this new record format are populated: product-type recalling-firm distribution-pattern classification product-description code-info product-quantity reason-for-recall report-date ...
cc0-1.0
6,793,334,345,480,814,000
32.734375
657
0.661417
false
3.556837
false
false
false
odysseywestra/mypaint
gui/backgroundwindow.py
1
15970
# This file is part of MyPaint. # Copyright (C) 2009-2018 by the MyPaint Development Team. # Copyright (C) 2008-2014 by Martin Renold <martinxyz@gmx.ch> # # 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 Fou...
gpl-2.0
-2,074,244,919,298,233,000
32.340292
78
0.565373
false
3.75588
false
false
false
anthrotype/lzcomp
Lib/lzcomp/cli.py
1
3259
#! /usr/bin/env python """lzcomp %s -- compression/decompression utility using the LZCOMP algorithm.""" from __future__ import print_function import argparse import sys import os import lzcomp import platform def get_binary_stdio(stream): """ Return the specified standard input, output or errors stream as a ...
apache-2.0
5,779,710,267,726,327,000
34.813187
80
0.583001
false
4.089084
false
false
false
istio/tools
isotope/runner/wait.py
1
4107
# Copyright Istio Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
apache-2.0
1,688,670,624,286,156,500
33.225
79
0.644753
false
4.018591
false
false
false
KamilSzot/365_programs
2017-04-02/sdl.py
1
2280
import os import time import ctypes from math import sin, cos, pi os.environ["PYSDL2_DLL_PATH"] = "C:\\Program Files\\Python35\\other" import sdl2 import sdl2.ext import sdl2.sdlttf as sdlttf SCREEN_WIDTH = 1920 SCREEN_HEIGHT = 1080 sdl2.ext.init() window = sdl2.ext.Window("Game (not really)", size=...
unlicense
-7,732,825,467,773,092,000
26.860759
115
0.639474
false
2.911877
false
false
false
pigmej/solar
solar/cli/inputs.py
1
3767
# Copyright 2015 Mirantis, 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 ...
apache-2.0
7,739,368,291,777,561,000
32.336283
78
0.63313
false
3.574004
false
false
false
dwalton76/ev3dev-lang-python
ev3dev2/display.py
1
14796
# ----------------------------------------------------------------------------- # Copyright (c) 2015 Ralph Hempel <rhempel@hempeldesigngroup.com> # Copyright (c) 2015 Anton Vanhoucke <antonvh@gmail.com> # Copyright (c) 2015 Denis Demidov <dennis.demidov@gmail.com> # Copyright (c) 2015 Eric Pascual <eric@pobot.org> # # ...
mit
8,205,199,397,252,134,000
33.814118
117
0.574277
false
3.686099
false
false
false
Breakthru/splitbills
offset/migrations/0001_initial.py
1
1369
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Mortgage', fields=[ ('id', models.AutoField(ver...
gpl-3.0
1,168,651,718,606,197,800
37.027778
114
0.553689
false
4.359873
false
false
false
briend/mypaint
gui/dialogs.py
1
12908
# This file is part of MyPaint. # -*- coding: utf-8 -*- # Copyright (C) 2010-2018 by the MyPaint Development Team. # Copyright (C) 2009-2013 by Martin Renold <martinxyz@gmx.ch> # # 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...
gpl-2.0
98,405,544,774,130,530
30.832099
78
0.630546
false
3.543705
false
false
false
Fabien-B/Web_ASA_Sourdoire
www/page_conso.py
1
6251
template = Import('template.py' ) # import du fichier template (entete, pieds de page...) connexion = Import('gestion_session.py') releve = Import('releve.py') parcelle = Import('parcelle.py') compteur = Import('compteur.py') exploitant = Import('Exploitant.py') def index(error=''): if "login" in Session() and not...
lgpl-3.0
772,124,882,227,105,900
31.541667
142
0.573715
false
3.078857
false
false
false
ColumbiaSC-Tech/botty_mcbotface
botty_mcbotface/botty/db/__init__.py
1
2644
import os from botty_mcbotface import log from sqlalchemy import create_engine, insert from sqlalchemy.orm import Query, scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import MetaData DB_NAME = 'botty_db' DB_URI = 'sqlite:///botty_db' class BottyDB: ""...
mit
-5,054,454,187,015,856,000
26.257732
78
0.624811
false
3.553763
false
false
false
rahuldan/sympy
sympy/functions/special/delta_functions.py
2
16753
from __future__ import print_function, division from sympy.core import S, sympify, diff, oo from sympy.core.function import Function, ArgumentIndexError from sympy.core.relational import Eq from sympy.core.logic import fuzzy_not from sympy.polys.polyerrors import PolynomialError from sympy.functions.elementary.complex...
bsd-3-clause
461,175,796,935,635,400
29.294756
132
0.529577
false
3.693342
false
false
false
nomad010/typesafe_json
type_from_json.py
1
2268
import json import os import sys def print_usage(): print """./type_from_json <json_file> [ARGS] Options --typedef <type_name>\t\t\t Displays the type as a typedef.""" def type_of_int(obj): return "JSONNumber" type_of_float = type_of_int def type_of_string(obj): return "JSONString" type_of_un...
mit
2,502,793,068,441,330,000
23.663043
120
0.567901
false
3.473201
false
false
false
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/build/android/incremental_install/installer.py
1
7393
#!/usr/bin/env python # # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Install *_incremental.apk targets as well as their dependent files.""" import argparse import glob import logging import os impor...
mit
3,702,598,307,499,654,700
38.116402
80
0.631408
false
3.872708
false
false
false
sadowski/sublime-regex-align
RegexAlign.py
1
3725
import sublime import sublime_plugin import re # Takes the sublime.View and a sublime.Region object # Return the array of strings, each element represents on line of the selection def get_lines(view, selection_region): multiline_text = view.substr(selection_region) lines = re.split(r'(.*\n)', multiline_text, re.DO...
mit
2,233,810,149,495,154,400
38.62766
82
0.665772
false
3.717565
false
false
false
frankyrumple/smc
controllers/test.py
1
3559
# -*- coding: utf-8 -*- # try something like #from ednet.ad import AD #from ednet import Util, SequentialGUID, AppSettings, W2Py, Student #from ednet import * from ednet.ad import AD from ednet.faculty import Faculty from ednet.util import Util from ednet.canvas import Canvas from pytube import YouTube import os impo...
mit
-9,005,375,558,022,422,000
31.953704
297
0.652149
false
2.820127
true
false
false
krother/maze_run
leftovers/part2_before_refac.py
1
11978
# TODO: fix and check allcommand-line arguments from util import debug_print from pygame import image, Rect, Surface from pygame.locals import KEYDOWN, KEYUP, USEREVENT import pygame import sys import random import json import os from collections import namedtuple from functools import partial import argparse import ...
mit
-8,104,493,672,380,548,000
29.478372
85
0.584822
false
3.48603
false
false
false
OrganicNavigation/Python-Environments-for-Science-and-Engineering
fit_data.py
1
2118
""" Sample script for fitting sinusoidal data. This script uses the data file: sample_AD_data.csv This data was logged on: 2017-03-08 12:40 pm using an arduino A/D pin and an associated test circuit. Author: HMokhtarzadeh Date: April 13, 2017 """ import pandas as pd import numpy as np # # Load Data # path_data = ...
bsd-3-clause
4,361,661,130,279,193,600
29.710145
117
0.679887
false
2.582927
false
false
false
orionzhou/robin
formats/coords.py
1
16290
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ parses JCVI software NUCMER (http://mummer.sourceforge.net/manual/) output - mostly as *.coords file. """ import sys import logging from math import exp from itertools import groupby from maize.formats.base import LineFile, must_open from maize.algorithms.graph impo...
gpl-2.0
-849,455,419,382,932,000
28.089286
97
0.578085
false
3.565332
false
false
false
OpenVolunteeringPlatform/django-ovp-core
ovp_core/migrations/0004_load_skills_and_causes.py
1
1337
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-25 01:14 from __future__ import unicode_literals from django.db import migrations skills = ['Arts/Handcrafting', 'Communication', 'Dance/Music', 'Law', 'Education', 'Sports', 'Cooking', 'Management', 'Idioms', 'Computers/Technology', 'Health', 'Others'] ...
agpl-3.0
-6,059,131,419,789,719,000
30.093023
249
0.662678
false
3.011261
false
false
false
berndf/avg_q
python/avg_q/numpy_Script.py
1
10710
# Copyright (C) 2013-2021 Bernd Feige # This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING). import avg_q import numpy # Layout helper function to get a 2D arrangement of nplots plots def nrows_ncols_from_nplots(nplots): ncols=numpy.sqrt(nplots) if ncols.is_integer(): nrows=ncols else: ...
gpl-3.0
-4,866,024,738,652,813,000
36.711268
208
0.696825
false
3.059126
false
false
false
lidavidm/mathics-heroku
mathics/builtin/exptrig.py
1
15655
# -*- coding: utf8 -*- """ Exponential, trigonometric and hyperbolic functions Mathics basically supports all important trigonometric and hyperbolic functions. Numerical values and derivatives can be computed; however, most special exact values and simplification rules are not implemented yet. """ from __future__ im...
gpl-3.0
-3,177,187,880,955,658,000
18.185049
103
0.477611
false
2.76639
false
false
false
cykustcc/bib2reSTcitation
bib2reSTcitation.py
1
2664
#Author Yukun Chen #email: cykustc@gmail.com #Date: Sept 04 2015 import getopt import argparse import sys import re from collections import defaultdict def displaymatch(match): if match is None: return None return '<Match: %r, groups=%r>' % (match.group(), match.groups()) def bib2rest(input_bibfile...
mit
4,266,559,960,915,698,700
32.734177
161
0.61036
false
2.908297
false
false
false
40323230/Pyslvs-PyQt5
pyslvs_ui/info/info.py
1
6021
# -*- coding: utf-8 -*- """Information. + Module versions. + Help descriptions. + Check for update function. """ __author__ = "Yuan Chang" __copyright__ = "Copyright (C) 2016-2021" __license__ = "AGPL" __email__ = "pyslvs@gmail.com" from typing import Optional from importlib.util import find_spec from enum import a...
agpl-3.0
-4,527,536,843,177,410,000
27.808612
80
0.57914
false
3.742076
false
false
false
apapillon/django-twitsocket
twitsocket/management/commands/lister.py
1
2822
import json import urllib2 import urllib import time from django.conf import settings from django.core.management.base import NoArgsCommand import oauth2 as oauth from twitsocket.models import Tweet LIST_MEMBERS = 'https://api.twitter.com/1/%s/members.json' % settings.TWITTER_LIST def oauth_request(url, method='GE...
bsd-3-clause
-6,183,423,698,888,465,000
32.595238
82
0.576896
false
3.829037
false
false
false
quequino/CloudStream-for-KODI
resources/lib/xfilesharing.py
1
33713
''' xfilesharing XBMC Plugin Copyright (C) 2013-2014 ddurdle 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 ver...
gpl-2.0
-3,813,098,866,034,628,600
39.423261
506
0.497434
false
3.973715
false
false
false
esarafianou/rupture
backend/breach/models/round.py
1
4368
from __future__ import unicode_literals from django.db import models from django.core.exceptions import ValidationError from breach.analyzer import decide_next_world_state from itertools import groupby class Round(models.Model): class Meta: unique_together = (('victim', 'index'),) def check_block_ali...
mit
3,845,078,980,088,209,000
37.654867
96
0.619963
false
4.554745
false
false
false
google-research/recsim
recsim/environments/interest_exploration_test.py
1
1847
# coding=utf-8 # coding=utf-8 # Copyright 2019 The RecSim Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
1,407,724,409,636,544,300
31.982143
74
0.685436
false
3.60039
true
false
false
manuelli/director
src/python/director/visualization.py
1
39578
import director.objectmodel as om import director.applogic as app from shallowCopy import shallowCopy import director.vtkAll as vtk from director import transformUtils from director import callbacks from director import frameupdater from director.fieldcontainer import FieldContainer from PythonQt import QtCore, QtGui i...
bsd-3-clause
8,944,330,065,811,042,000
31.151097
171
0.645839
false
3.948718
false
false
false
johnboyington/homework
me777/hw5/hw5_p4.py
1
1418
import numpy as np from numpy.random import rand import matplotlib.pyplot as plt def walk_on_lines(r, n, bounds, bound_temp, tol): s = 0 for z in range(n): x = r found = False while not found: L, R = abs(bounds[0] - x), abs(bounds[1] - x) if L < R: ...
gpl-3.0
-8,456,888,572,681,269,000
29.847826
72
0.507757
false
2.819085
false
false
false
sgrvinod/ml4seti-Effsubsee
folds/create_h5_tensors.py
1
11714
import ibmseti import os import pandas as pd from sklearn.model_selection import StratifiedKFold from sklearn.utils import shuffle import numpy as np import h5py from tqdm import tqdm def create_tensors_hdf5_logmod2_ph(dataset_name, dataset_folder, output_folder, number_of_folds, ti...
apache-2.0
3,222,924,417,227,544,600
49.930435
120
0.603807
false
3.610974
true
false
false
ARM-software/mbed-beetle
tools/get_config.py
1
3238
#! /usr/bin/env python2 """ mbed SDK Copyright (c) 2011-2013 ARM 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 applicabl...
apache-2.0
6,115,368,512,132,941,000
33.446809
109
0.625077
false
4.210663
true
false
false
blablacar/exabgp
lib/exabgp/reactor/peer.py
1
22086
# encoding: utf-8 """ peer.py Created by Thomas Mangin on 2009-08-25. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import time # import traceback from exabgp.bgp.timer import ReceiveTimer from exabgp.bgp.timer import SendTimer from exabgp.bgp.message import Message from exabgp.bgp.fsm import FSM fr...
bsd-3-clause
1,086,304,427,348,369,500
29.254795
140
0.692158
false
3.414657
false
false
false
romanorac/discomll
discomll/examples/ensemble/dwf_rand_breastcancer_url.py
1
1134
from disco.core import result_iterator from discomll import dataset from discomll.ensemble import distributed_weighted_forest_rand from discomll.utils import accuracy train = dataset.Data(data_tag=[ ["http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data"]],...
apache-2.0
-3,606,847,400,242,093,000
38.103448
119
0.656966
false
3.478528
false
false
false
dahebolangkuan/ToughRADIUS
radiusd/plugins/admin_update_cache.py
1
1839
#!/usr/bin/env python #coding=utf-8 from twisted.python import log from store import store from settings import * import logging import json def process(req=None,admin=None): msg_id = req.get("msg_id") cache_class = req.get("cache_class") if not cache_class: reply = json.dumps({'msg_id':msg_id,'da...
bsd-2-clause
-7,725,087,970,054,210,000
36.530612
93
0.604133
false
3.44382
false
false
false
jwhitlock/dsh-orderwrt-bug
setup.py
1
1622
#!/usr/bin/env python # -*- coding: utf-8 -*- """Packaging setup for dsh-orderwrt-bug.""" from sample import __version__ as version try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :chan...
mpl-2.0
-2,333,552,451,090,873,000
25.590164
74
0.609125
false
3.678005
true
false
false
bitcraft/pyglet
contrib/wydget/wydget/widgets/drawer.py
1
6309
from wydget import anim from wydget.widgets.frame import Frame class Drawer(Frame): """A *transparent container* that may hide and expose its contents. """ name = 'drawer' HIDDEN = 'hidden' EXPOSED = 'exposed' LEFT = 'left' RIGHT = 'right' TOP = 'top' BOTTOM = 'bottom' def _...
bsd-3-clause
-1,548,507,284,185,789,000
34.24581
72
0.511333
false
3.558376
false
false
false
Mynti207/cs207project
tsdb/tsdb_serialization.py
1
3930
import json from collections import OrderedDict LENGTH_FIELD_LENGTH = 4 def serialize(json_obj): ''' Turn a JSON object into bytes suitable for writing out to the network. Includes a fixed-width length field to simplify reconstruction on the other end of the wire. Parameters ---------- j...
mit
-9,098,841,175,235,348,000
26.103448
79
0.573537
false
4.781022
false
false
false
praekelt/panya-social
social/class_modifiers.py
1
2132
from django.contrib import auth from django.contrib.auth.models import AnonymousUser, User from panya.utils import modify_class def _user_has_field_perm(user, perm, obj, field): anon = user.is_anonymous() for backend in auth.get_backends(): if not anon or backend.supports_anonymous_user: i...
bsd-3-clause
-75,271,136,306,387,950
39.226415
97
0.646811
false
4.478992
false
false
false
aeklant/scipy
scipy/io/matlab/tests/test_mio_funcs.py
1
1382
''' Jottings to work out format for __function_workspace__ matrix at end of mat file. ''' import os.path import io from numpy.compat import asstr from scipy.io.matlab.mio5 import MatFile5Reader test_data_path = os.path.join(os.path.dirname(__file__), 'data') def read_minimat_vars(rdr): rdr.initialize_read() ...
bsd-3-clause
2,204,432,114,049,731,600
25.075472
72
0.60275
false
3.02407
false
false
false
gitcoinco/web
app/avatar/migrations/0009_avatartextoverlayinput.py
1
1176
# Generated by Django 2.2.4 on 2020-03-26 19:49 from django.db import migrations, models import economy.models class Migration(migrations.Migration): dependencies = [ ('avatar', '0008_auto_20200301_2047'), ] operations = [ migrations.CreateModel( name='AvatarTextOverlayInput...
agpl-3.0
7,582,269,842,014,924,000
36.935484
114
0.571429
false
4.215054
false
false
false
cristianav/PyCRC-old
CRCModules/CRC16SICK.py
1
1820
#!/usr/bin/env python3 # -*- coding: utf8 -*- # CRC16SICK MODULE # # Cristian NAVALICI cristian.navalici at gmail dot com # from ctypes import c_ushort class CRC16SICK(object): # The CRC's are computed using polynomials. Here is the most used coefficient for CRC16 SICK crc16SICK_constant = 0x8005 def __...
gpl-3.0
-2,695,530,379,084,512,000
31.5
110
0.531868
false
3.880597
false
false
false
thehub/hubplus
apps/plus_permissions/types/TgGroup.py
1
19483
from apps.plus_permissions.interfaces import InterfaceReadProperty, InterfaceWriteProperty, InterfaceCallProperty from apps.plus_permissions.models import SetSliderOptions, SliderOptions, SetAgentDefaults, SetPossibleTypes, SetSliderAgents, PossibleTypes, get_interface_map, SetVisibleAgents, SetVisibleTypes, SetTypeLab...
gpl-3.0
4,864,147,382,982,466,000
42.488839
334
0.563312
false
4.830895
false
false
false
mozeq/fros
src/pyfros/controls.py
1
4623
## Copyright (C) 2013 ABRT team <abrt-devel-list@redhat.com> ## Copyright (C) 2013 Red Hat, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at yo...
gpl-2.0
-7,644,101,290,094,040,000
38.177966
89
0.665801
false
3.716238
false
false
false
Jacob-Barhak/MIST
Transitions.py
1
25760
################################################################################ ############################################################################### # Copyright (C) 2013-2014 Jacob Barhak # Copyright (C) 2009-2012 The Regents of the University of Michigan # # This file is part of the MIcroSimulation Tool (...
gpl-3.0
-406,100,797,457,983,550
44.352113
210
0.616227
false
3.77768
false
false
false
Vito2015/tcc3-portal
tcc3portal/tcc_frontend/__init__.py
1
1994
# coding:utf-8 """ tcc3portal.tcc_frontend ~~~~~~~~~~~~~~~~~~~ tcc3portal tcc_frontend ui templates package. :copyright: (c) 2015 by Vito. :license: GNU, see LICENSE for more details. """ from flask import Blueprint, Flask, url_for, current_app def tcc_frontend_find_resource(filename, cdn, local...
gpl-2.0
6,461,207,089,957,628,000
27.084507
82
0.575727
false
3.948515
false
false
false
vacancy/TensorArtist
tartist/data/rflow/push_pipe.py
1
3288
# -*- coding:utf8 -*- # File : push_pipe.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 4/2/17 # # This file is part of TensorArtist. from . import configs, utils from ...core.utils.meta import notnone_property import zmq import threading import queue import contextlib import collections imp...
mit
4,289,777,976,493,546,000
24.488372
86
0.591545
false
3.601314
false
false
false
brianjking/nDeploy
scripts/accountmodify_hook_pre.py
1
3296
#!/usr/bin/env python import yaml import sys import json import os import subprocess __author__ = "Anoop P Alias" __copyright__ = "Copyright 2014, PiServe Technologies Pvt Ltd , India" __license__ = "GPL" __email__ = "anoop.alias@piserve.com" installation_path = "/opt/nDeploy" # Absolute Installation Path backen...
gpl-3.0
-5,765,584,925,556,428,000
46.085714
102
0.691141
false
3.115312
false
false
false
Dawny33/Code
Compiler Design Assignments/Week1/C_literals_paser.py
1
1278
f = open("C:\\Users\\acer\\Desktop\\Compiler Design\\simple_c_program.c", 'r') arr = [] for line in f: for i in line.split(): arr.append(i) #print type(arr[8]) char_arr = [] for token in arr: for ch in token: char_arr.append(ch) #print char_arr #For identifying integer literals. num...
gpl-3.0
-824,359,838,254,555,600
21.421053
78
0.541471
false
3.072115
false
false
false
vidartf/hyperspy
hyperspy/tests/signal/test_eds_sem.py
1
13067
# Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 ...
gpl-3.0
7,186,505,502,727,921,000
38.477341
81
0.586286
false
3.314815
true
false
false
AutohomeRadar/Windows-Agent
utils/log.py
1
1091
import logging import os import inspect import g def get_logger(logger_name='[PythonService]', dirpath=None): logger = logging.getLogger(logger_name) if dirpath is None: # dirpath = os.path.join(os.path.dirname(__file__), os.path.abspath('..')) dirpath = os.path.dirname(__file__)...
apache-2.0
1,451,566,442,821,719,300
30.088235
153
0.636114
false
3.648829
false
false
false
psychopy/versions
psychopy/app/pavlovia_ui/search.py
1
11197
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from past.builtins import basestring from .project import DetailsPanel from .functions im...
gpl-3.0
-3,274,404,417,799,227,000
39.422383
100
0.612753
false
3.932912
false
false
false
mikecrittenden/zen-coding-gedit
zencoding/stparser.py
1
3770
''' Zen Coding's settings parser Created on Jun 14, 2009 @author: Sergey Chikuyonok (http://chikuyonok.ru) ''' from copy import deepcopy import re import types from .zen_settings import zen_settings _original_settings = deepcopy(zen_settings) TYPE_ABBREVIATION = 'zen-tag', TYPE_EXPANDO = 'zen-expando', TYPE_REFEREN...
unlicense
4,056,994,817,509,625,000
22.416149
113
0.648276
false
2.931571
false
false
false
lutcheti/webtext
src/request/backends/BackendMovie.py
1
6501
# -- coding: utf-8 -- ########################################################################### # # # WebText # # ...
gpl-3.0
-3,935,210,647,555,079,000
45.042553
110
0.498922
false
3.941712
false
false
false
javaes/sailfish-msg-importer
tests/test_SMSBackup.py
1
2440
import unittest from sail_sms import SMSBackup, SMSImporter, SMSParser import time import os class SMSBackupTest(unittest.TestCase): def setUp(self): self.backup_tool = SMSBackup("assets/test_commhistory.db", "assets/") parser = SMSParser("assets/samples.xml") self.sms_list = parser.get_a...
apache-2.0
8,166,459,498,394,153,000
39.683333
81
0.634426
false
3.572474
true
false
false
tensorflow/lucid
lucid/recipes/activation_atlas/layout.py
1
2698
# Copyright 2018 The Lucid 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 applicable l...
apache-2.0
7,013,863,676,461,393,000
35.459459
104
0.67828
false
3.932945
false
false
false
geoserver/wps-remote
src/wpsremote/output_file_parameter.py
1
17313
# (c) 2016 Open Source Geospatial Foundation - all rights reserved # (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE) # (c) 2013 - 2014 German Aerospace Center (DLR) # This code is licensed under the GPL 2.0 license, available at the root # application directory. import os import tempfile import...
gpl-2.0
3,631,209,823,113,164,300
39.736471
120
0.50517
false
4.344542
false
false
false
alexkuz/pg_unidecode
builder/builder.py
1
2589
# -*- coding: utf-8 -*- """ Generates source data """ from __future__ import print_function import imp import os import io import re import sys DATA_DIR = os.environ.get("DATA_DIR") UNIDECODE_REPOPATH = os.environ.get("UNIDECODE_REPOPATH") if not DATA_DIR and UNIDECODE_REPOPATH: DATA_DIR = os.path.join(UNIDECODE...
gpl-2.0
2,638,439,943,840,021,000
25.96875
106
0.526458
false
3.323492
false
false
false
DolphinDream/sverchok
old_nodes/formula_mk4.py
1
9177
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import ast from math import * from...
gpl-3.0
2,291,811,314,450,939,000
34.847656
146
0.589517
false
4.055236
false
false
false
uunicorn/pyskype
src/rsa_keygen.py
1
1550
import random def miller_rabin(n, k = 100): if n > 31: for p in [3, 5, 7, 11, 13, 17, 19, 23, 29, 31]: if n % p == 0: return False d=n-1 s=0 while d & 1 == 0: d = d >> 1 s += 1 for i in range(k): a = random.randint(2,n-1) x = pow...
mit
-2,289,449,030,673,462,800
17.902439
77
0.433548
false
3.081511
false
false
false
pengli09/Paddle
python/paddle/v2/framework/io.py
1
7239
import os import cPickle as pickle from paddle.v2.framework.framework import Program, Parameter, g_program, \ Variable __all__ = [ 'save_vars', 'save_params', 'save_persistables', 'load_vars', 'load_params', 'load_persistables', "save_inference_model", "load_inference_model" ] def is_parameter(var): ...
apache-2.0
4,832,600,745,266,361,000
30.473913
92
0.626191
false
4.092142
false
false
false
lifanov/cobbler
cobbler/tftpgen.py
1
49135
""" Generate files provided by TFTP server based on Cobbler object tree. This is the code behind 'cobbler sync'. Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
gpl-2.0
3,414,772,886,900,080,000
44.411275
261
0.570164
false
4.043367
false
false
false
NuGrid/NuPyCEE
chem_evol.py
1
325358
# coding=utf-8 from __future__ import (division, print_function, absolute_import, unicode_literals) ''' Chemical Evolution - chem_evol.py Functionality ============= This is the superclass inherited by the SYGMA and the OMEGA modules. It provides common functions for initialization and for ...
bsd-3-clause
-8,643,699,521,290,951,000
38.303817
180
0.51382
false
3.530847
false
false
false
hale36/SRTV
sickbeard/providers/torrentz.py
1
5614
# Author: Dustyn Gibson <miigotu@gmail.com> # URL: https://github.com/SiCKRAGETV/SickRage # # This file is part of SickRage. # # SickRage 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
-9,218,043,349,983,745,000
38.535211
272
0.584788
false
4.038849
false
false
false
memsharded/conan
conans/model/requires.py
1
5387
from collections import OrderedDict import six from conans.errors import ConanException from conans.model.ref import ConanFileReference from conans.util.env_reader import get_env class Requirement(object): """ A reference to a package plus some attributes of how to depend on that package """ def __i...
mit
4,285,353,454,071,079,000
35.154362
95
0.573046
false
4.553677
false
false
false
vmont/specfem3d
utils/Cubit_or_Gmsh/LibGmsh2Specfem_convert_Gmsh_to_Specfem3D.py
1
17706
#!/usr/bin/env python # -*- coding: utf-8 -*- #------------------------------------------------------------- # GMSH mesh convertion for SPECFEM3D # # by Thomas CURTELIN # Centrale Marseille, France, July 2012 # # Based on Paul Cristini's equivalent script for 2D meshes # # For now it can only handle v...
gpl-3.0
6,999,215,924,848,763,000
42.826733
130
0.486841
false
3.96196
false
false
false
asm-products/pants-party
ppuser/forms.py
1
1367
from django import forms from django.contrib.auth.forms import UserChangeForm from ppuser.models import CustomUser class CustomUserCreationForm(forms.ModelForm): password1 = forms.CharField(label='Password', widget=forms.PasswordInput) password2 = forms.CharField(label='Password confirmation', widget=forms.Pa...
agpl-3.0
-5,837,199,713,151,674,000
34.051282
90
0.673007
false
4.325949
false
false
false
caiuspb/home-assistant
homeassistant/util/template.py
1
3232
""" homeassistant.util.template ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Template utility methods for rendering strings with HA data. """ # pylint: disable=too-few-public-methods import json import logging import jinja2 from jinja2.sandbox import ImmutableSandboxedEnvironment from homeassistant.const import STATE_UNKNOWN from home...
mit
4,492,025,769,520,362,500
27.60177
74
0.631188
false
4.197403
false
false
false
timor-raiman/yas3fs
yas3fs/fuse.py
1
28128
# Copyright (c) 2012 Terence Honles <terence@honles.com> (maintainer) # Copyright (c) 2008 Giorgos Verigakis <verigak@gmail.com> (author) # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permiss...
mit
7,666,557,376,124,482,000
30.324053
78
0.539107
false
3.585926
false
false
false
ytaben/cyphesis
rulesets/basic/mind/NPCMind.py
1
38678
#This file is distributed under the terms of the GNU General Public license. #Copyright (C) 1999 Aloril (See the file COPYING for details). import random import traceback from atlas import * from physics import * from physics import Quaternion from common import const from types import * from physics import Vector3D...
gpl-2.0
7,546,670,054,895,222,000
41.880266
173
0.562413
false
4.119502
false
false
false
d120/pyophase
clothing/migrations/0006_auto_20160830_1443.py
1
1098
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-30 12:43 from __future__ import unicode_literals from django.db import migrations, models from clothing.models import Size def forwards_func(apps, schema_editor): db_alias = schema_editor.connection.alias # Set size_sortable for all exsisting size...
agpl-3.0
-3,176,314,207,166,486,500
30.2
148
0.644689
false
3.615894
false
false
false
eharney/cinder
cinder/api/contrib/cgsnapshots.py
1
5734
# Copyright (C) 2012 - 2014 EMC Corporation. # 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 # # Unle...
apache-2.0
-6,161,191,167,094,759,000
33.751515
78
0.649634
false
4.052297
false
false
false
cbib/taxotree
plottingValues.py
1
3214
import matplotlib.pyplot as plt import numpy as np #@pearson is the Pearson coefficient def plotPearsonGraph(xArray,yArray,pearson,xLabel="X",yLabel="f(X)",maxx=10,minx=0,maxy=10,miny=0,title="Plotting of unknown function f"): mini = min(minx,miny) n = len(xArray) if not (n == len(yArray)): print "...
mit
-835,832,434,081,338,900
34.318681
187
0.635034
false
3.046445
false
false
false
Guts/isogeo-api-py-minsdk
tests/test_search.py
1
11978
# -*- coding: UTF-8 -*- #! python3 """ Usage from the repo root folder: .. code-block:: python # for whole test python -m unittest tests.test_search # for specific python -m unittest tests.test_search.TestSearch.test_search_search_as_application """ # #######################...
gpl-3.0
-1,019,222,056,491,242,000
36.314642
105
0.574386
false
3.856407
true
false
false
ibab/missing_hep
missing_hep/fourmomentum.py
1
2278
""" Implementation of a vectorized four-momentum vector class Adapted from http://lapth.cnrs.fr/pg-nomin/wymant/FourMomentumClass.py originally implemented by Chris Waymant """ import numpy as np class FourMomentum: def __init__(self, E, px, py, pz): self.E = np.array(E) self.px = np.array(px) self...
mit
-8,135,912,276,558,034,000
24.311111
94
0.566286
false
2.997368
false
false
false
Danielweber7624/pybuilder
src/main/python/pybuilder/plugins/python/flake8_plugin.py
1
3425
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2015 PyBuilder Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
apache-2.0
-2,326,735,212,889,654,000
37.483146
99
0.688467
false
3.690733
false
false
false
rsethur/DMNPlusTF
Attention.py
1
3210
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np from dnn import matmul_3d_2d from dnn import l2_reg class DMNAttentionGate: """ Possible enhancements 1. make scope as an input param 2. get shape f...
mit
2,930,214,116,487,884,000
46.205882
154
0.632399
false
3.515882
false
false
false
Donkyhotay/MoonPy
zope/server/logger/socketlogger.py
1
1579
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
-9,021,838,366,546,479,000
31.895833
78
0.613046
false
4.188329
false
false
false
RaviVengatesh/Guvi_codes
Translation.py
1
1090
def TotalTranslation(input_seq): Total_Seq=0; input_seq_len=len(input_seq); Seq_Itr=0; Seq_Stack_Init=[]; Seq_Stack_Len=[]; for itr in range(0,input_seq_len): Seq_Stack_Init.append(0); Seq_Stack_Len.append(1); input_seq_len-=1; Seq_Itr+=1; while(1): while(Seq_Itr>0): Next_Start_Pos=Seq_Stack_Init[Seq...
gpl-3.0
7,337,645,847,466,676,000
26.948718
79
0.627523
false
2.374728
false
false
false
xcrespo/Flute-Fingering
fingering.py
1
1301
#Converts a txt file containing a list of notes into an image #with the corresponding fingering images #Inputs: txt file name from PIL import Image import math import sys #Definitions iHeigth = 300 iWidth = 150 iGridWidth = 8.0 #items i = 0 #counts the current note index #Open fingering images si0 = Image.open("Note...
gpl-2.0
8,647,078,093,658,456,000
26.125
83
0.69485
false
2.676955
false
false
false
drtuxwang/system-config
bin/offline.py
1
3502
#!/usr/bin/env python3 """ Run a command without network access. """ import argparse import glob import os import signal import sys from typing import List import command_mod import subtask_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace =...
gpl-2.0
3,856,035,756,455,022,600
23.48951
78
0.519132
false
4.16409
false
false
false
sainipray/djadmin
djadmin/middleware.py
1
2550
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django from django.contrib.admin.sites import AdminSite from django.utils.functional import SimpleLazyObject from djadmin import settings from .models import DjadminModelSetting from .signals import get_register_model_with_mixin, handle_djadmin_fi...
mit
7,572,932,252,606,137,000
51.040816
109
0.664706
false
3.923077
false
false
false