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
iocoop/beancount
src/python/beancount/reports/tree_table.py
1
6891
"""Routines to render an HTML table with a tree of accounts. """ __author__ = "Martin Blais <blais@furius.ca>" import io from beancount.core import account_types from beancount.core import position from beancount.core import data from beancount.core import inventory from beancount.core import realization # A specia...
gpl-2.0
-8,422,161,384,260,948,000
36.655738
85
0.631548
false
4.328518
false
false
false
hyounggyu/timeline
crawler/daemon.py
1
2990
#!/usr/bin/env python # # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ # import sys, os, time, atexit from signal import SIGTERM class Daemon(object): """ A generic daemon class. Usage: subclass the Daemon class and override the run() method """ def __init__(self, pidfile, stdi...
gpl-2.0
-2,132,992,963,061,303,600
21.481203
104
0.632441
false
2.84491
false
false
false
tbraun89/teamcity-delcom-usbled
setup.py
1
2032
# TeamCity Delcom USB Led Daemon # Copyright (C) 2014 Torsten Braun # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #...
gpl-2.0
5,414,642,264,940,778,000
35.945455
112
0.679134
false
3.497418
false
false
false
daftano/git
git-p4.py
1
137845
#!/usr/bin/env python # # git-p4.py -- A tool for bidirectional operation between a Perforce depot and git. # # Author: Simon Hausmann <simon@lst.de> # Copyright: 2007 Simon Hausmann <simon@lst.de> # 2007 Trolltech ASA # License: MIT <http://www.opensource.org/licenses/mit-license.php> # import sys if sys.he...
gpl-2.0
5,899,208,382,554,103,000
36.590674
228
0.542298
false
4.186891
true
false
false
ctn-waterloo/nengo_theano
nengo_theano/scripts/TRN.py
1
6709
import nengo_theano as nef import random import abs_val def make(net, name, neurons, dimensions, dim_fb_err, radius=1.5, tau_inhib=0.005, inhib_scale1=10, inhib_scale2=1): """A function that makes a subnetwork to calculate the weighted value of a specified cortical action. :param Networ...
mit
-3,274,943,388,442,785,300
36.480447
79
0.6299
false
3.531053
false
false
false
thisforeda/socket-http
httpx.py
1
13562
#-*- coding: UTF-8 -*- import gzip import re import time import ssl from socket import AF_INET,SOCK_STREAM,socket,getaddrinfo try: from urllib.parse import urlencode # Version: Python 3.x except ImportError: from urllib import urlencode # Version: Python 2.X #import os #import tempfile #impo...
gpl-3.0
-2,288,551,477,685,950,700
32.366412
98
0.479491
false
4.458897
false
false
false
Castronova/EMIT
gui/controller/NetcdfDetailsCtrl.py
1
3505
import datetime as dt import netCDF4 as nc import wx import wrappers from coordinator import engineAccessors as engine from gui.views.NetcdfDetailsView import NetcdfDetailsView from gui.controller.CanvasCtrl import CanvasCtrl class NetcdfDetailsCtrl(NetcdfDetailsView): def __init__(self, parent, file, filename): ...
gpl-2.0
4,419,385,347,532,166,000
37.944444
96
0.611127
false
3.76073
false
false
false
marcuskelly/recover
app/models.py
1
3118
# Authors: Mark Kelly <c00198041@gmail.com> from flask_user import UserMixin from flask_user.forms import RegisterForm from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, DateField, validators from app.init_app import db # Define the User data model. Make sure to add the flask_user.UserMixi...
bsd-2-clause
5,297,808,295,892,338,000
41.712329
109
0.695638
false
3.555302
false
false
false
michaelBenin/django-base-template
project_name/settings/local-dist.py
1
2357
""" This is an example settings/local.py file. These settings overrides what's in settings/base.py """ from . import base # To extend any settings from settings/base.py here's an example: INSTALLED_APPS = base.INSTALLED_APPS + ('django_nose',) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sql...
bsd-3-clause
-230,055,142,458,911,940
26.091954
77
0.645312
false
3.476401
false
false
false
gurneyalex/odoo
addons/crm_iap_lead/models/crm_iap_lead_helpers.py
7
5436
from math import floor, log10 from odoo import api, models class CRMHelpers(models.Model): _name = 'crm.iap.lead.helpers' _description = 'Helper methods for crm_iap_lead modules' @api.model def notify_no_more_credit(self, service_name, model_name, notification_parameter): """ Notify a...
agpl-3.0
-6,900,626,802,472,399,000
43.92562
136
0.5539
false
3.718194
false
false
false
gabegaster/DivvyVoronoi
munge/aggregate_trips.py
1
2526
'''Aggregates individual trips to get trip-counts from A-to-B. Makes csv for web. ''' import numpy as np import csv import sys import json import os from itertools import izip # data_dir = "data/Divvy_Stations_Trips_2013" data_dir = "data/divvy_data_challenge_2014" web_dir = "web/data" def read_stations(): stat...
mit
5,209,829,401,277,511,000
29.804878
81
0.58274
false
3.250965
false
false
false
deleidos/de-visualization-wizard
language-processing-service/modeler/modelerserver/domainmodeler/python-goose/goose/extractors/images.py
1
15154
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
421,670,711,373,725,700
35.167064
96
0.572192
false
4.305114
false
false
false
mikelarre/hr-addons
calendar_holiday_project_timesheet/models/hr_contract.py
1
1290
# -*- coding: utf-8 -*- # (c) 2017 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api class HrContract(models.Model): _inherit = 'hr.contract' @api.multi def _generate_calendar_from_wizard(self, year): analytic_line_obj...
agpl-3.0
1,753,850,249,147,689,200
42
70
0.515504
false
3.633803
false
false
false
ericpp/hippyvm
hippy/main.py
1
3898
#!/usr/bin/env python """ Hippy VM. Execute by typing hippy [--gcdump dumpfile] [--cgi] <file.php> [php program options] and enjoy """ import sys import os if __name__ == '__main__': sys.path.insert(0, os.path.dirname( os.path.dirname(os.path.abspath(__file__)))) from hippy.phpcompiler import compile_p...
mit
2,219,783,079,784,674,600
28.530303
85
0.541303
false
3.694787
false
false
false
radicalbit/ambari
ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/service_check.py
1
2597
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
apache-2.0
-5,678,983,040,632,312,000
33.171053
112
0.731998
false
3.673267
false
false
false
botswana-harvard/getresults-aliquot
getresults_aliquot/admin/aliquot_admin.py
1
1300
from django.contrib import admin from getresults.admin import admin_site from ..models import Aliquot, AliquotCondition, AliquotType from ..filters import AliquotPatientFilter class AliquotAdmin(admin.ModelAdmin): def get_readonly_fields(self, request, obj=None): if obj: # In edit mode ret...
gpl-2.0
-4,345,795,405,402,350,600
39.625
96
0.702308
false
3.812317
false
false
false
iw3hxn/LibrERP
account_central_journal/account.py
1
1853
# -*- coding: utf-8 -*- # # # OpenERP, Open Source Management Solution # Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundati...
agpl-3.0
2,708,771,059,748,574,700
37.604167
77
0.66109
false
3.844398
false
false
false
eBADGE/message-bus
ebadge_msg/heh_level.py
1
14513
""" Copyright (c) 2013, XLAB D.O.O. 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 above copyright notice, this list of conditions and the following...
bsd-3-clause
-299,126,777,384,559,550
27.568898
208
0.606491
false
3.965301
false
false
false
rectangletangle/nlplib
src/nlplib/general/unittest.py
1
5764
''' This module handles unit testing for the package. If this module is ran as a script, it will run all of the tests for the entire package. These tests are denoted by the <__test__> module level functions. ''' import unittest import pkgutil import warnings __all__ = ['UnitTest', 'mock', 'test_everything'] _lo...
bsd-2-clause
-7,823,965,918,323,248,000
36.921053
119
0.56263
false
4.12894
true
false
false
encukou/freeipa
ipatests/pytest_ipa/integration/config.py
3
6425
# Authors: # Petr Viktorin <pviktori@redhat.com> # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2013 Red Hat # see file 'COPYING' for use and warranty information # # 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 # t...
gpl-3.0
-1,864,109,093,066,941,200
31.286432
79
0.623191
false
3.67984
true
false
false
swarlesbarkely/PyCharm
HeaderHelper/HeaderHelper.py
1
5867
import datetime ############################################################################## # Creates main function header for .h files and smaller headers for .c files # Input: None # Return: None ############################################################################## def CreateFunctionHeader(): # Get ...
gpl-2.0
-6,842,796,398,845,576,000
32.146893
110
0.435657
false
4.828807
false
false
false
yuzie007/ph_plotter
ph_plotter/colormap_creator.py
1
3963
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from matplotlib.colors import ( ColorConverter, LinearSegmentedColormap, ListedColormap) __author__ = "Yuji Ikeda" def create_colors_inter...
mit
-3,090,212,609,305,412,000
31.219512
91
0.581125
false
3.29975
false
false
false
OCA/social
mail_notification_custom_subject/models/mail_thread.py
1
2732
# Copyright 2020-2021 Tecnativa - João Marques # Copyright 2021 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, models class MailThread(models.AbstractModel): _inherit = "mail.thread" @api.returns("mail.message", lambda value: value.id) ...
agpl-3.0
9,186,002,110,983,448,000
35.413333
77
0.498718
false
4.491776
false
false
false
lasigeBioTM/ssm
ssmpy/data.py
1
2025
import sqlite3 from sqlite3 import Error import pandas as pd def create_connection(db_file): """ create a database connection to the SQLite database specified by db_file :param db_file: database file :return: Connection object or None """ try: conn = sqlite3.connect(db_file) ...
apache-2.0
1,221,823,157,110,491,400
23.107143
85
0.630617
false
3.835227
false
false
false
dthain/cctools
resource_monitor/src/bindings/python3/resource_monitor.bindings.py
1
20733
# Copyright (C) 2016- The University of Notre Dame This software is distributed # under the GNU General Public License. # See the file COPYING for details. # ## @package resource_monitor # # Python resource_monitor bindings. # # The objects and methods provided by this package correspond to the native # C API in @ref c...
gpl-2.0
6,511,793,542,054,220,000
35.246503
156
0.619881
false
4.027389
false
false
false
zegami/image-similarity-clustering
parse_data.py
1
2961
# -*- coding: utf-8 -*- """ Created on Wed Mar 18 20:12:11 2020 @author: dougl """ import os import pandas as pd from utils import col_alpha_to_num, col_num_to_alpha def parse_data(data, feature_cols=None, unique_col=None): ''' Ensures we're dealing with a pandas DataFrame, and cuts the frame down to only t...
mit
6,975,482,101,907,511,000
40.138889
163
0.601824
false
3.820645
false
false
false
w1ll1am23/simplisafe-python
simplipy/sensor.py
1
3944
"""Define a SimpliSafe sensor.""" import logging from enum import Enum from typing import Union from .errors import SimplipyError _LOGGER = logging.getLogger(__name__) class SensorTypes(Enum): """Define sensor types.""" keypad = 1 keychain = 2 panic_button = 3 motion = 4 entry = 5 glass...
mit
7,205,658,644,938,090,000
26.774648
78
0.590771
false
4.227224
false
false
false
aztrosist/aztrobot
cogs/debug.py
1
4415
import asyncio, contextlib, io, inspect, sys, functools, subprocess, discord from discord.ext import commands from .utils import checks @contextlib.contextmanager def stdoutIO(stdout=None): old = sys.stdout if stdout == None: stdout = io.StringIO() sys.stdout = stdout yi...
apache-2.0
-8,819,632,907,733,841,000
44.989583
214
0.466138
false
4.437186
false
false
false
mpasternak/wxMailServer
wxMailServer.py
1
4952
# -*- encoding: utf-8 -*- import smtpd import webbrowser import asyncore import threading import Queue import re import email import wx from wx import html from wx._core import EVT_ACTIVATE import wx.lib.newevent TRAY_TOOLTIP = 'wxMailServer' TRAY_ICON = 'icon.png' messages = Queue.Queue() def create_menu_item(men...
mit
8,413,609,713,104,940,000
27.039773
214
0.570734
false
3.015892
false
false
false
sloshedpuppie/LetsGoRetro
addons/plugin.video.emby-master/resources/lib/kodimonitor.py
1
9120
# -*- coding: utf-8 -*- ################################################################################################# import json import xbmc import xbmcgui import clientinfo import downloadutils import embydb_functions as embydb import playbackutils as pbutils import utils #####################...
gpl-2.0
3,806,743,188,749,237,000
41.645933
99
0.460417
false
4.74259
false
false
false
zachmath/HFODD_scripts
inertia/post-run_PES_inertia_setup.py
1
6009
########################################################## # Right now this script is only configured to index QP # # files according to their Q20 and Q30 multipole values, # # so if you were to probe, say, the Q22 direction, this # # script would create a lot of files with redundant # # (indistinguishable) fil...
gpl-3.0
-1,187,716,630,810,027,300
37.767742
193
0.490265
false
4.121399
false
false
false
lief-project/LIEF
examples/python/keygen/lief_patch.py
1
1378
#!/usr/bin/env python2 # Description # ----------- # Patch binary to remove anti-debug import sys from lief import ELF import distorm3 def remove_anti_debug(binary): patch = [0x83, 0xf8, 0xff, 0x90, 0x90] # cmp eax, 0xFFFFFFFF ep = binary.header.entrypoint text_section = binary.section_...
apache-2.0
-5,260,542,259,613,499,000
26.52
102
0.630087
false
3.092135
false
false
false
ketan-analytics/learnpython
Safaribookonline-Python/courseware-btb/labs/py2/generators/adapter.py
1
3239
'''In this lab, you practice "fanning in" and "fanning out" with generator functions. NOTE: The methods of str are detailed here: https://docs.python.org/3/library/stdtypes.html#string-methods First, define the words_in_text() generator function. It takes a path to a text file, and reads its contents, producing its w...
gpl-2.0
-3,956,069,354,972,020,000
17.299435
85
0.687867
false
3.061437
false
false
false
realmar/Tamandua
src/plugins/plugin_collections.py
1
5663
"""Module which contains all classes needed for the plugin collection.""" from abc import ABCMeta, abstractmethod from typing import cast, List from .interfaces import IDataContainer, \ IPlugin, \ IProcessorPlugin, \ IRequiresPl...
gpl-3.0
-302,056,263,436,762,300
29.28877
89
0.645947
false
4.566935
false
false
false
andyzsf/django
tests/template_tests/syntax_tests/test_include.py
1
7673
from django.conf import settings from django.template.base import Context, TemplateDoesNotExist, TemplateSyntaxError from django.template.loader import get_template from django.test import SimpleTestCase from .test_basic import basic_templates from .utils import render, setup include_fail_templates = { 'include-...
bsd-3-clause
5,124,965,033,503,856,000
36.612745
103
0.598462
false
4.161063
true
false
false
fkie-cad/FACT_core
src/plugins/analysis/file_system_metadata/routes/routes.py
1
3629
import os from base64 import b64encode from common_helper_files.fail_safe_file_operations import get_dir_of_file from flask import render_template_string from flask_restx import Resource, Namespace from helperFunctions.database import ConnectTo from objects.file import FileObject from web_interface.components.compone...
gpl-3.0
-7,054,074,500,314,914,000
39.775281
158
0.669055
false
3.764523
false
false
false
jrderuiter/ngs-tk
ngs_tk/enrichment/kegg.py
1
4679
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip) import io import re import pandas a...
gpl-2.0
7,799,505,050,766,100,000
33.404412
79
0.636033
false
3.558175
false
false
false
liesbethvanherpe/NeuroM
examples/features_graph_table.py
1
4049
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
bsd-3-clause
7,995,716,329,012,625,000
32.741667
94
0.658434
false
4.339764
false
false
false
carpe-diem/LinodeDNS
src/utils.py
1
3138
# -*- coding: utf-8 -*- from json import load try: from urllib.request import urlretrieve except Exception as excp: exit("Couldn't import the standard library. Are you running Python 3?") API_URL = "https://api.linode.com/api/?api_key={0}&resultFormat=JSON" API_BASE ="https://api.linode.com/?api_key={key}&ap...
gpl-3.0
-2,895,234,349,088,772,000
30.69697
78
0.559911
false
3.749104
false
false
false
tsnoam/python-telegram-bot
telegram/ext/dispatcher.py
1
22931
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
-2,800,896,975,033,076,700
31.526241
79
0.58881
false
4.746636
false
false
false
gdoermann/django-limbo
limbo/apps/datatables/views.py
1
2143
from django.core.exceptions import ImproperlyConfigured from django.views.generic.base import TemplateView from django.views.generic.list import ListView from limbo.context import PageContext class GenericDatatableAjaxView(ListView): datatable = None response_type='json' is_ajax=True template_name='da...
mit
-6,799,830,901,510,624,000
32.484375
86
0.678488
false
3.946593
false
false
false
ndp-systemes/odoo-addons
purchase_delivery_tracking_ups/purchase_delivery_tracking_ups.py
1
5872
# -*- coding: utf8 -*- # # Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licen...
agpl-3.0
3,752,012,865,438,895,000
49.612069
130
0.540283
false
4.199571
false
false
false
Uberi/botty-bot-bot-bot
utils/download-history.py
1
8340
#!/usr/bin/env python3 import json, os, sys, logging, time, re import urllib.request, shutil from slackclient import SlackClient if not 2 <= len(sys.argv) <= 3: print("Usage: {} SLACK_API_TOKEN [SAVE_FOLDER]".format(sys.argv[0])) print(" SLACK_API_TOKEN Slack API token (obtainable from https://api.slac...
mit
6,914,084,955,550,510,000
54.231788
170
0.643405
false
3.751687
false
false
false
nagyistoce/how-to-graphlab-create
word_frequency.py
1
1527
import graphlab as gl def get_word_frequency(docs): """ Returns the frequency of occorance of words in an SArray of documents Args: docs: An SArray (of dtype str) of documents Returns: An SFrame with the following columns: 'word' : Word used 'count' : Number of times the word occured...
cc0-1.0
2,676,822,704,947,216,400
30.8125
74
0.53831
false
3.187891
false
false
false
Nero-Hu/mt
alignment/fast_align/fast_align.py
1
7800
#!/usr/bin/env python import optparse import sys import numpy import math def main(argv): #Shameless copy optparser = optparse.OptionParser() optparser.add_option("-d", "--data", dest="train", default="data/hansards", help="Data filename prefix (default=data)") optparser.add_option("-e", "--english", dest="englis...
mit
-6,924,432,184,449,009,000
24.242718
158
0.607179
false
2.452059
false
false
false
seedinvest/sorl-thumbnail
sorl/thumbnail/engines/pil_engine.py
1
8648
from __future__ import division import math from sorl.thumbnail.engines.base import EngineBase from sorl.thumbnail.compat import BufferIO try: from PIL import Image, ImageFile, ImageDraw, ImageChops, ImageFilter except ImportError: import Image, ImageFile, ImageDraw, ImageChops def round_corner(radius, fill...
bsd-3-clause
6,888,941,617,140,991,000
34.735537
108
0.564755
false
3.823165
false
false
false
juanpablos/CC5114-Projects
Class 02/src/Arbitrary_training.py
1
2584
import random import matplotlib import matplotlib.pyplot as plt from Neurons.NeuralNetwork import NeuralNetwork from Utils.utilities import generate_network, get_seeds matplotlib.style.use('ggplot') def two_scales(ax1, x, data1, data2, c1, c2): ax2 = ax1.twinx() ax1.plot(x, data1, color=c1) ax1.set_xl...
mit
-7,146,472,941,380,417,000
28.363636
107
0.63661
false
3.501355
true
false
false
cstipkovic/spidermonkey-research
js/src/tests/lib/progressbar.py
1
3646
# Text progress bar library, like curl or scp. from datetime import datetime, timedelta import math import sys if sys.platform.startswith('win'): from terminal_win import Terminal else: from terminal_unix import Terminal class NullProgressBar(object): def update(self, current, data): pass def poke(se...
mpl-2.0
-4,033,012,915,065,984,500
31.553571
93
0.581185
false
3.92465
false
false
false
connordittmar/avoidance
bin/nav.py
1
1523
# Main Loop from avoidance import logic from bin import gpsutils from math import atan2, sin, cos, sqrt import numpy as np class Avoid(object): def __init__(self,plane_lla,obj_lla,wp_lla,safety_dist,obj_rad,step_size): self.plane_lla = plane_lla self.obj_lla = obj_lla self.wp_lla = wp_lla ...
mit
-4,801,580,550,563,771,000
34.418605
108
0.594879
false
3.076768
false
false
false
antring/PollyPy
PollyUpload/migrations/0001_initial.py
1
1032
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='MovieSub', fields=[ ('id', models.AutoField(aut...
mit
8,485,221,043,333,731,000
31.25
114
0.525194
false
4.566372
false
false
false
MozillaSecurity/FuzzManager
FTB/Running/GDB.py
1
1797
# encoding: utf-8 ''' GDB - Contains functions directly used by GDB for crash processing @author: Christian Holler (:decoder) @license: This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozill...
mpl-2.0
-5,319,527,842,205,390,000
27.983871
98
0.621592
false
2.990017
false
false
false
claws/txPachube
examples/trigger_view.py
1
2052
#!/usr/bin/env python """ Lists triggers visible to the supplied Pachube user API key To use this script you must create a text file containing your API key and pass it to this script using the --keyfile argument as follows: List all triggers visible to supplied key: $ trigger_view.py --keyfile=/path/to/apikey/file...
mit
670,998,721,017,884,000
24.987342
119
0.658869
false
3.871698
false
false
false
subhasis256/cache_spice
scripts/decoder.py
1
8813
from gates import * from models import * from logic_path import LogicPath from operator import mul from math import log # create a predecoder chain # the algorithm is as follows # start with the highest level, and recursively split it into 2 # at each level, if the size is odd, take the smaller partition # create a br...
mit
1,520,015,018,461,368,300
37.317391
79
0.585612
false
3.676679
false
false
false
TAdeJong/python-ising
visualcollapse.py
1
2452
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider, Button, RadioButtons import sys n=[10,20,30] name = sys.argv[1] print name if len(sys.argv) > 2 : n = sys.argv[2] fig, (axchi, axbeta) = plt.subplots(1,2) plt.subplots_adjust(bottom=0.30) gamma0 = 7./4. nu0 = 1.0 betac0 = 1/...
mit
2,500,420,463,094,199,000
27.847059
83
0.631321
false
2.298032
false
false
false
endlessm/chromium-browser
third_party/catapult/common/py_utils/py_utils/memory_debug.py
2
2918
#!/usr/bin/env python # Copyright 2017 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. import heapq import logging import os import sys try: import psutil except ImportError: psutil = None BYTE_UNITS = ['B', 'KiB', '...
bsd-3-clause
-7,898,849,950,684,109,000
29.715789
79
0.656957
false
3.293454
false
false
false
pyqt/python-qt5
PyQt5/pylupdate_main.py
1
7131
# Copyright (c) 2016 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file is part of PyQt5. # # This file may be used under the terms of the GNU General Public License # version 3.0 as published by the Free Software Foundation and appearing in # the file LICENSE included in the packaging of this fi...
gpl-3.0
5,146,823,901,984,737,000
28.83682
86
0.515916
false
4.160443
false
false
false
morganics/bayesianpy
bayesianpy/distributed.py
1
3606
from typing import Iterable import pandas as pd import dask.dataframe as dd import dask.array as da import numpy as np import pathos.multiprocessing as mp import logging class DaskPool: ''' We need to use DaskPool to avoid hanging in linux when multiprocessing is required. Jpype hangs when processes are no...
apache-2.0
-6,178,725,426,357,095,000
30.356522
101
0.617582
false
3.649798
false
false
false
rockho-team/shuup-shipping-table
shuup_shipping_table/migrations/0002_cubic_weight.py
1
9350
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-24 12:20 from __future__ import unicode_literals from decimal import Decimal from django.db import migrations, models import django.db.models.deletion import django.db.models.manager import django_countries.fields import shuup.core.fields class Migratio...
agpl-3.0
-8,517,622,395,162,997,000
66.73913
349
0.666132
false
4.214608
false
false
false
ph4r05/NATSimTools
dataproc.py
1
3696
import os import sys import fileinput import re import random import math from operator import itemgetter, attrgetter import subprocess from optparse import OptionParser import copy import time import argparse from dateutil import parser as dparser import calendar from scipy.stats import binom from scipy.stats import...
apache-2.0
1,816,945,003,158,546,000
36.72449
149
0.608225
false
3.526718
false
false
false
seppovic/check_mk-plugins
omd-sane-cleanup/web/plugins/wato/agent_bakery_omd-sane-cleanup.py
1
2574
#!/usr/bin/python import agent_bakery import cmk.paths group = "agents/" + _("Agent Plugins") register_rule(group, "agent_config:omd-sane-cleanup", Transform( Alternative( title = _("omd-sane-cleanup agent plugin (Linux)"), help = _("This will deploy the <tt>omd-sane-cleanup ...
gpl-2.0
4,281,027,535,656,400,400
32.868421
130
0.405594
false
4.69708
false
false
false
madscatt/zazzie_1.5
trunk/sassie/calculate/sld_mol/sld_mol_driver.py
1
4152
import sys import sassie.interface.input_filter as input_filter import sassie.interface.sld_mol_filter as sld_mol_filter import sassie.calculate.sld_mol.sld_mol as sld_mol class Drv(): module = 'sld_mol' def run_me(self): # BEGIN USER EDIT # BEGIN USER EDIT # BEGIN USER EDIT runname =...
gpl-3.0
986,192,114,071,265,800
29.755556
156
0.563825
false
3.162224
false
false
false
Damgaard/PyImgur
pyimgur/request.py
1
4036
# This file is part of PyImgur. # PyImgur 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. # PyImgur is distributed in the hope that i...
gpl-3.0
5,950,646,951,055,798,000
37.438095
79
0.660059
false
4.01992
false
false
false
danleyb2/django-pa
pa/serializers.py
1
4256
from django.forms import widgets from django.contrib.auth.models import User, Group from rest_framework import serializers from .models import * class IconSerializer(serializers.ModelSerializer): class Meta: model=Icon fields = ('__all__') class ServiceSerializer(serializers.ModelSerializer):...
gpl-3.0
6,213,573,619,591,888,000
31.746154
95
0.6539
false
4.470588
false
false
false
gschua/COMP3297-Fume-Community-Platform
vapoursite/fume/models.py
1
9360
from django.db import models from django.utils import timezone from django.db.models import Q from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.contrib.auth.models import AbstractBaseUser, UserManager, PermissionsMixin import os reward_threshold=100 reward_expir...
mit
7,988,183,730,205,863,000
35.705882
128
0.662179
false
3.709869
false
false
false
aequitas/home-assistant
homeassistant/components/sun/__init__.py
1
8376
"""Support for functionality to keep track of the sun.""" import logging from datetime import timedelta from homeassistant.const import ( CONF_ELEVATION, SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET) from homeassistant.core import callback from homeassistant.helpers.entity import Entity from homeassistant.helpers.event imp...
apache-2.0
5,565,378,156,473,050,000
36.348214
72
0.63268
false
3.300197
false
false
false
freifeld/cpabDiffeo
cpab/cpa3d/utils/_create_verts_and_H_type_II.py
1
3593
#!/usr/bin/env python """ TODO: make it sparse. Created on Thu Jan 16 15:09:36 2014 @author: Oren Freifeld Email: freifeld@csail.mit.edu """ from of.utils import ObsoleteError raise ObsoleteError import numpy as np from of.utils import * #from scipy import sparse def create_verts_and_H(nC, cells_multiidx, cells_ve...
mit
8,220,174,782,314,280,000
26.427481
87
0.456165
false
3.333024
false
false
false
pjg101/SickRage
sickbeard/metadata/wdtv.py
1
11248
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # # 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 L...
gpl-3.0
-5,548,558,702,852,466,000
35.519481
116
0.572368
false
4.147493
false
false
false
dantezhu/yunbk
yunbk/backend/ali_oss.py
1
1746
# -*- coding: utf-8 -*- """ 阿里云 OSS SDK: https://docs.aliyun.com """ import os import oss2 from .base import BaseBackend from ..utils import filter_delete_filename_list class OSSBackend(BaseBackend): """ 阿里OSS后端,依赖 oss v2 pip install oss2 """ bucket = None def __init__(self, access_key_id, ...
mit
-1,760,791,467,379,374,800
27.271186
93
0.594125
false
3.153119
false
false
false
rg3915/orcamentos
selenium/selenium_all_pages.py
1
1158
import time from decouple import config from selenium import webdriver HOME = config('HOME') # page = webdriver.Firefox() page = webdriver.Chrome(executable_path=HOME + '/chromedriver/chromedriver') page.maximize_window() time.sleep(0.5) pages = [ 'http://localhost:8000/', 'http://localhost:8000/proposal/entr...
mit
4,424,392,718,106,289,700
30.297297
76
0.669257
false
3.356522
false
false
false
tarballs-are-good/sympy
sympy/assumptions/tests/test_refine.py
1
1875
from sympy import S, symbols, Assume, exp, pi, sqrt, Rational, I, Q, refine, Abs from sympy.utilities.pytest import XFAIL def test_Abs(): x = symbols('x') assert refine(Abs(x), Assume(x, Q.positive)) == x assert refine(1+Abs(x), Assume(x, Q.positive)) == 1+x assert refine(Abs(x), Assume(x, Q.negative))...
bsd-3-clause
7,965,980,856,757,963,000
39.76087
80
0.5584
false
2.54065
false
false
false
pytroll/satpy
satpy/readers/abi_l2_nc.py
1
4008
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2019 Satpy developers # # 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
-4,528,894,264,033,314,300
40.75
105
0.619261
false
4.024096
false
false
false
bit-bots/bitbots_behaviour
bitbots_body_behavior/src/bitbots_body_behavior/actions/go_to_role_position.py
1
1959
import rospy from tf2_geometry_msgs import PoseStamped from geometry_msgs.msg import Point from dynamic_stack_decider.abstract_action_element import AbstractActionElement class GoToRolePosition(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(GoToRolePosition, self).__i...
bsd-3-clause
-1,689,900,924,203,362,600
49.230769
144
0.668198
false
3.879208
false
false
false
idekerlab/graph-services
services/nx_layout/service/service.py
1
2430
import cxmate from networkx.drawing.nx_pydot import graphviz_layout from cxmate.service import NetworkElementBuilder import logging logging.basicConfig(level=logging.DEBUG) # Label for CXmate output OUTPUT_LABEL = 'out_net' class NxLayoutService(cxmate.Service): def process(self, params, input_stream): ...
mit
1,124,569,323,005,940,600
31.4
105
0.598354
false
4.097808
false
false
false
brenthuisman/phd_tools
analysis.falloff.py
1
18030
#!/usr/bin/env python import numpy as np,plot,auger import scipy.stats from numpy import sqrt #OPT: quickly get sorted rundirs # zb autogen | sort -k1.13 -r #OPT: fix seed #np.random.seed(65983247) #we dont know what the added or reduced noise level is when changing energy windows, so we cant compare performance for...
lgpl-3.0
-2,664,697,214,235,430,400
46.075718
231
0.61858
false
2.447068
false
false
false
captsens/clichart
src/main/python/statslib.py
1
10945
#! /usr/bin/env python """ (C) Copyright 2006-2008, by John Dickson Project Info: http://clichart.sourceforge.net/ 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 ...
lgpl-2.1
8,170,707,546,586,499,000
37.674912
117
0.542257
false
4.623997
false
false
false
bixbydev/Bixby_v3
database/postgres/base.py
1
1356
#!/usr/bin/env python # Filename: base.py #=====================================================================# # Copyright (c) 2015 Bradley Hilton <bradleyhilton@bradleyhilton.com> # # Distributed under the terms of the GNU GENERAL PUBLIC LICENSE V3. # #===========================================================...
gpl-3.0
1,398,696,458,786,871,300
25.096154
71
0.603245
false
3.398496
true
false
false
AthrunArthur/dotfile
clang-format.py
1
4671
# This file is a minimal clang-format vim-integration. To install: # - Change 'binary' if clang-format is not on the path (see below). # - Add to your .vimrc: # # map <C-I> :pyf <path-to-this-file>/clang-format.py<cr> # imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr> # # The first line enables clang-fo...
mit
-8,357,956,030,071,012,000
35.779528
82
0.669022
false
3.454882
false
false
false
ContentMine/old_site
portality/app.py
1
3730
from flask import Flask, request, abort, render_template, make_response from flask.views import View from flask.ext.login import login_user, current_user import portality.models as models import portality.util as util from portality.core import app, login_manager from portality.view.account import blueprint as accou...
mit
3,795,506,366,530,557,400
30.344538
95
0.663539
false
3.646139
false
false
false
javioreto/google_cloud_iot
locust/web.py
1
7878
# encoding: utf-8 import csv import json import os.path from time import time from itertools import chain from collections import defaultdict from six.moves import StringIO, xrange import six from gevent import wsgi from flask import Flask, make_response, request, render_template from . import runners from .cache im...
apache-2.0
-3,746,938,283,376,965,600
33.704846
153
0.614369
false
3.648912
false
false
false
qpfiffer/waifu.xyz
scripts/oleg_to_pg_posts.py
1
2745
#!/usr/bin/env python3 from olegdb.oleg import OlegDB import lz4.block, json, psycopg2, time, multiprocessing import mmap olegdb_c = OlegDB(db_name="waifu") values_file = open("./data/waifu.val", "r+b") values_file_map = mmap.mmap(values_file.fileno(), 0) def insert_post(conn, oconn, okey, od, should_commit=True): ...
agpl-3.0
6,729,734,562,813,854,000
29.5
115
0.589435
false
3.129989
false
false
false
hrishioa/Aviato
flask/Scripts/gdalimport.py
1
3001
#!C:\Users\SeanSaito\Dev\aviato\flask\Scripts\python.exe #****************************************************************************** # $Id$ # # Name: gdalimport # Project: GDAL Python Interface # Purpose: Import a GDAL supported file to Tiled GeoTIFF, and build overviews # Author: Frank Warmerdam, war...
gpl-2.0
-5,876,758,303,498,510,000
32.719101
79
0.623126
false
3.827806
false
false
false
stvnrlly/thehichannel
thehichannel/settings.py
1
5597
""" Django settings for thehichannel project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
cc0-1.0
8,814,266,770,792,973,000
26.038647
77
0.688762
false
3.444308
false
false
false
aapris/tilajakamo
tilajakamoweb/home/migrations/0007_auto_20160125_1803.py
1
1655
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-25 18:03 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0010_chan...
mit
-372,392,686,021,055,400
37.488372
149
0.623565
false
3.804598
false
false
false
DailyActie/Surrogate-Model
01-codes/tensorflow-master/tensorflow/python/platform/gfile.py
1
1093
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
mit
4,080,853,594,921,798,000
38.035714
80
0.704483
false
4.220077
false
false
false
NixaSoftware/CVis
venv/lib/python2.7/site-packages/jedi/evaluate/iterable.py
1
31332
""" Contains all classes and functions to deal with lists, dicts, generators and iterators in general. Array modifications ******************* If the content of an array (``set``/``list``) is requested somewhere, the current module will be checked for appearances of ``arr.append``, ``arr.insert``, etc. If the ``arr`...
apache-2.0
8,456,631,419,365,975,000
34.443439
99
0.591217
false
4.199437
false
false
false
jonaqp/heroku
apps/customer/forms.py
1
8456
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.utils.translation import ugettext_lazy as _ from core.utils import uploads from .models import ( User, UserProfile) class UserCreationAdminForm(forms.ModelForm): p...
mit
-7,085,380,980,025,459,000
37.611872
81
0.597327
false
4.318693
false
false
false
nschloe/maelstrom
experimental/dft.py
1
1428
# -*- coding: utf-8 -*- # import numpy def uniform_dft(time_interval_length, data): """Discrete Fourier Transform of real-valued data, interpreted for a uniform time series over an interval of length time_interval_length. The original data can be recovered from the output of this function by data = ...
mit
-5,939,839,511,653,715,000
34.7
78
0.633754
false
3.5086
false
false
false
HackersUOP/pythonTutes
lessons/lesson6_Task1.py
1
1525
''' * Copyright 2016 Hackers' Club, University Of Peradeniya * Author : Irunika Weeraratne E/11/431 * * 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-...
apache-2.0
-5,668,061,012,312,692,000
28.901961
115
0.694426
false
3.244681
false
false
false
aeolusproject/audrey
agent/src/audrey/user_data_rhev.py
1
3202
''' * * Copyright [2011] [Red Hat, 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 ag...
apache-2.0
-3,883,058,953,872,072,700
35.386364
76
0.58807
false
3.638636
false
false
false
cgarrard/osgeopy-code
Chapter11/chapter11.py
1
6239
import os import numpy as np from osgeo import gdal import scipy.stats import ospybook as pb # Set this variable to your osgeopy-data directory so that the following # examples will work without editing. We'll use the os.path.join() function # to combine this directory and the filenames to make a complete path. Of # ...
mit
2,006,938,838,761,321,000
24.674897
94
0.604584
false
2.594179
false
false
false
0todd0000/spm1d
spm1d/data/uv0d/anova3tworm.py
1
3255
import numpy as np from .. import _base class NYUHiringExperience(_base.DatasetANOVA3tworm): def _set_values(self): self.www = 'http://www.psych.nyu.edu/cohen/three_way_ANOVA.pdf' ### data: Table 22.4 (page 715) ### results: Table 22.5 (page 721) ### repeated-measures factors: B, C self.Y = ...
gpl-3.0
8,666,902,100,514,506,000
39.6875
233
0.494009
false
2.021739
false
false
false
dezede/dezede
libretto/migrations/0048_auto_20200302_1917.py
1
1160
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-03-02 18:17 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('libretto', '0047_source_t...
bsd-3-clause
-1,484,336,364,588,855,800
36.387097
181
0.643658
false
3.750809
false
false
false
eyes-0nly/python-url-base64-decoder-gui
coder.py
1
2941
# coding=<utf-8> from urllib import parse import base64 import binascii class Coder: @staticmethod def base64_decode(string): try: string = base64.b64decode(string) string = string.decode('utf-8') except ValueError: string = ("ValueError: The input string c...
gpl-3.0
-1,937,800,436,194,259,700
36.227848
167
0.508671
false
4.280932
false
false
false
GoogleCloudPlatform/declarative-resource-client-library
python/services/apigee/envgroup.py
1
4500
# Copyright 2021 Google LLC. 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 o...
apache-2.0
1,870,262,884,945,143,000
36.190083
81
0.680889
false
3.869304
false
false
false
kbourgoin/hiicart
hiicart/gateway/paypal2/views.py
1
3838
import logging import urllib from django.http import HttpResponse, HttpResponseRedirect from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_view_exempt from hiicart.gateway.base import GatewayError from hiicart.gateway.paypal2 import api from hiicart.gateway.paypal2.ipn i...
mit
-5,291,726,993,801,249,000
35.903846
78
0.661803
false
3.669216
false
false
false
RedHatInsights/insights-core
insights/client/phase/v1.py
1
11356
from __future__ import print_function import functools import json import logging import os import sys import runpy from insights.client import InsightsClient from insights.client.config import InsightsConfig from insights.client.constants import InsightsConstants as constants from insights.client.support import Insig...
apache-2.0
3,238,957,785,205,319,700
31.915942
125
0.60435
false
4.130957
true
false
false
danielfaust/AutobahnPython
examples/echo_tls/server.py
1
2037
############################################################################### ## ## Copyright 2011,2012 Tavendo GmbH ## ## 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:...
apache-2.0
-8,871,170,006,186,055,000
31.333333
79
0.59892
false
4.567265
false
false
false
gitChrisMoore/discoverio
discoverio/db.py
1
2156
from pymongo import MongoClient class DBClient(object): """ This provides a wrapper around the MongoClient package, and also allows for some default values to be added. test = DBClient('172.21.66.37', 'amwayio').main() print test.discovery_todo.find().count() """ def __init__(self...
mit
8,975,905,980,351,688,000
27
81
0.554267
false
3.654237
false
false
false
ziplokk1/python-amazon-mws-tools
tests/parsers/feeds/test_GetFeedSubmissionListResponse.py
1
2799
from unittest import TestCase from unittest import TestSuite from unittest import main from unittest import makeSuite from mwstools.parsers.feeds import GetFeedSubmissionListResponse, FeedSubmissionInfo class TestGetFeedSubmissionListResponseNoNextToken(TestCase): body = """ <GetFeedSubmissionListRespo...
unlicense
1,576,614,949,818,502,000
29.423913
90
0.66488
false
3.914685
true
false
false
watsonyanghx/CS231n
assignment1/cs231n/classifiers/softmax.py
1
3849
import numpy as np from random import shuffle def softmax_loss_naive(W, X, y, reg): """ Softmax loss function, naive implementation (with loops) Inputs have dimension D, there are C classes, and we operate on minibatches of N examples. Inputs: - W: A numpy array of shape (D, C) containing weights. - X:...
mit
1,709,612,362,439,225,600
34.971963
79
0.490517
false
3.915565
false
false
false