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
zdomjus60/astrometry
tools.py
1
10051
# -*- coding: utf-8 -*- """ helper functions for time management """ import math def sin(x): return math.sin(math.radians(x)) def cos(x): return math.cos(math.radians(x)) def atan2(y , x): return math.degrees(math.atan2(y, x)) def reduce360(x): return x % 360.0 def dms2ddd(hour, minute, second): """...
cc0-1.0
-7,099,347,639,674,084,000
34.641844
111
0.594369
false
2.931175
false
false
false
stoeckli/iMatrixSpray
octoprint/printer.py
1
20362
# coding=utf-8 __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import time import datetime import threading import copy import os #import logging, logging.config import octoprint.util.comm as comm import octoprint.util as util from ...
agpl-3.0
2,885,922,597,023,972,000
28.379509
189
0.712525
false
3.325167
true
false
false
nimasmi/wagtail
wagtail/core/blocks/struct_block.py
1
8310
import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.functional import cached_property from django.utils.html import format_html, format_html_join from django.utils.s...
bsd-3-clause
7,582,453,976,146,293,000
37.472222
107
0.622262
false
4.229008
false
false
false
ypid/series60-remote
pc/devices/status_numbers.py
1
2071
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2010 Lukas Hetzenecker <LuHe@gmx.at> NUM_CONNECTED = 100 NUM_HELLO_REQUEST = 110 NUM_HELLO_REPLY = 111 NUM_QUIT = 120 NUM_PARTIAL_MESSAGE = 130 NUM_CONTACTS_REQUEST_HASH_ALL = 200 NUM_CONTACTS_REQUEST_HASH_SINGLE= 201 NUM_CONTACTS_REQUEST_CONTACT = 204 NUM_CONTACTS_REQU...
gpl-2.0
2,607,002,893,510,730,000
26.986486
59
0.759536
false
2.486194
false
true
false
ngmiller/mipsy
mipsy/encoder.py
1
8100
""" mipsy.encoder Instruction encoder. See README.md for usage and general information. """ # system imports import bitstring # application imports from mipsy.arch import MIPS from mipsy.util import LabelCache, ParseInfo class Encoder(object): """ Responsible for encoding individual instructions and qu...
mit
-3,993,751,590,257,310,700
38.512195
106
0.564691
false
4.236402
false
false
false
Akson/RemoteConsolePlus3
RemoteConsolePlus3/RCP3/Backends/Processors/Graphs/Plot1D.py
1
2341
#Created by Dmytro Konobrytskyi, 2014 (github.com/Akson) import numpy as np import matplotlib import matplotlib.pyplot from RCP3.Infrastructure import TmpFilesStorage class Backend(object): def __init__(self, parentNode): self._parentNode = parentNode def Delete(self): """ This method ...
lgpl-3.0
-487,449,994,099,500,860
29.415584
88
0.5912
false
4.383895
false
false
false
BarusXXX/K-Tree
TreeLogic.py
1
3884
import os from copy import deepcopy class RecursiveTree: def __init__(self, dir_name): self.dir_name = dir_name self.files = [] self.folders = [] #Tuple Absolute address, branch, level self.branches = [] self.children_n = [] self.currentlevel = 0 self.level=[...
mit
4,737,420,698,815,880,000
29.582677
156
0.511843
false
3.903518
false
false
false
ndparker/wolfe
wolfe/scheduler/_job_queue.py
1
4458
# -*- coding: ascii -*- r""" :Copyright: Copyright 2014 - 2016 Andr\xe9 Malo or his licensors, as applicable :License: 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....
apache-2.0
-4,326,341,695,374,241,300
25.855422
77
0.580978
false
4.270115
false
false
false
bvanrijn/debianpaste-clients
old-paste.py
1
7602
#!/usr/bin/python # Filename: paste # Purpose: XmlRpc interface client to paste.debian.net # Author: Copyright (C) 2007-2011 Michael Gebetsroither <michael@mgeb.org> # License: This file is licensed under the GPL v2+. Full license text in LICENSE # Modified original: No modificat...
gpl-2.0
4,928,760,378,934,636,000
35.373206
241
0.578269
false
3.934783
false
false
false
wjakob/layerlab
recipes/coated-gold-with-scatmedium.py
1
2082
# Creates a rough gold layer with a rough dielectric coating containing an # anisotropic scattering medium import sys sys.path.append('.') from utils.materials import gold from utils.cie import get_rgb import layerlab as ll eta_top = 1.5 # This step integrates the spectral IOR against the CIE XYZ curves to obtain ...
bsd-2-clause
-3,367,170,747,667,034,600
29.617647
79
0.713737
false
3.013025
false
false
false
plumer/codana
projectdata.py
1
5358
class VersionDataManager: """Manager of all the information of files and packages in a specific version Attributes: packages (list of str): List of packages name files (list of str): List of all the files in the project packagedict (dict): Map of packages(key) and filenames(value) ...
mit
-4,992,400,439,942,177,000
35.69863
102
0.601904
false
3.905248
false
false
false
chutsu/robotics
prototype/models/two_wheel.py
1
3500
from math import cos from math import sin import numpy as np import sympy from sympy import pprint def two_wheel_2d_model(x, u, dt): """Two wheel 2D motion model Parameters ---------- x : np.array Two Wheel model state vector (x, y, theta) u : np.array Input dt : float ...
gpl-3.0
2,906,790,711,327,816,000
19.833333
76
0.483714
false
2.470007
false
false
false
lingthio/Flask-User
flask_user/user_mixin.py
1
4450
"""This module implements the UserMixin class for Flask-User. This Mixin adds required methods to User data-model. """ from flask import current_app from flask_login import UserMixin as FlaskLoginUserMixin class UserMixin(FlaskLoginUserMixin): """ This class adds required methods to the User data-model. Exam...
mit
2,653,800,167,023,835,600
42.203883
106
0.602921
false
4.405941
false
false
false
abrt/faf
src/pyfaf/storage/migrations/versions/168c63b81f85_report_history_default_value.py
1
1945
# Copyright (C) 2014 ABRT Team # Copyright (C) 2014 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0
7,853,489,964,225,810,000
37.137255
82
0.731105
false
3.504505
false
false
false
sradevski/homeAutomate
scripts/laptop_on_network.py
1
1994
#!/usr/bin/python import remote_core as core import os import sys import nmap import datetime import time import re import go_to_sleep try: nm = nmap.PortScanner() # instance of nmap.PortScanner except nmap.PortScannerError: print('Nmap not found', sys.exc_info()[0]) sys.exit(0) exc...
mit
6,664,738,618,122,529,000
25.586667
110
0.61986
false
3.091473
false
false
false
JordanReiter/django-notification
notification/views.py
1
6596
from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, Http404 from django.template import RequestContext from django.contrib.auth.decorators import login_required try: from django.contrib.syndication.views impor...
mit
8,042,785,939,941,627,000
32.482234
89
0.622347
false
4.336621
false
false
false
alexwaters/python-readability-api
readability/models.py
1
5472
# -*- coding: utf-8 -*- """ readability.models ~~~~~~~~~~~~~~~~~~ This module provides the core Readability API models. """ from .helpers import to_python, to_api class BaseResource(object): """A Base BaseResource object.""" def __init__(self): super(BaseResource, self).__init__() self._rd...
mit
-2,055,132,855,764,576,500
22.088608
140
0.524671
false
4.01173
false
false
false
kaphka/catconv
convert.py
1
1091
import argparse import signal from tqdm import tqdm import catconv.operations as co import catconv.stabi as sb exit = False def signal_handler(signal, frame): print('You pressed Ctrl+C!') exit = True parser = argparse.ArgumentParser() parser.add_argument("source") parser.add_argument("target") parser.add_a...
apache-2.0
5,971,109,955,525,650,000
24.372093
92
0.669111
false
3.190058
false
false
false
alirizakeles/zato
code/zato-zmq/src/zato/zmq_/mdp/worker.py
1
9531
# -*- coding: utf-8 -*- """ Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging import time from datetime import datetime, timedelta # Z...
gpl-3.0
-5,260,113,745,436,168,000
37.587045
130
0.484
false
5.113197
false
false
false
antonygc/liblightbase
liblightbase/lbdoc/metaclass.py
1
6065
from liblightbase import lbutils from liblightbase.lbdoc.metadata import DocumentMetadata def generate_metaclass(struct, base=None): """ Generate document metaclass. The document metaclass is an abstraction of document model defined by base structures. @param struct: Field or Group object. @...
gpl-2.0
6,355,603,194,399,791,000
33.460227
76
0.588458
false
4.658218
false
false
false
aio-libs/aiozmq
examples/core_dealer_router.py
1
1579
import asyncio import aiozmq import zmq class ZmqDealerProtocol(aiozmq.ZmqProtocol): transport = None def __init__(self, queue, on_close): self.queue = queue self.on_close = on_close def connection_made(self, transport): self.transport = transport def msg_received(self, msg...
bsd-2-clause
-5,655,556,457,899,408,000
21.239437
86
0.621279
false
3.455142
false
false
false
pyfa-org/eos
eos/item/mixin/effect_stats/remote_repair.py
1
1829
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lgpl-3.0
-2,539,301,026,785,657,300
37.914894
80
0.636413
false
4.04646
false
false
false
bollu/polymage
sandbox/apps/python/img_proc/harris/init.py
1
1485
import sys import os.path from PIL import Image import numpy as np from arg_parser import parse_args from printer import print_header, print_usage, print_line def init_images(app_data): print("[init.py] : initializing images...") app_args = app_data['app_args'] # input image: img_path = app_args.im...
apache-2.0
-1,343,414,416,860,723,500
22.203125
66
0.630976
false
3.207343
false
false
false
Endika/mitmproxy
libmproxy/contentviews.py
1
16688
""" Mitmproxy Content Views ======================= mitmproxy includes a set of content views which can be used to format/decode/highlight data. While they are currently used for HTTP message bodies only, the may be used in other contexts in the future, e.g. to decode protobuf messages sent as WebSocket frames. Thus,...
mit
1,470,349,869,913,732,900
26.583471
98
0.54704
false
3.998083
false
false
false
dropbox/changes
changes/listeners/mail.py
1
8772
from __future__ import absolute_import, print_function from itertools import imap import logging import toronado from email.utils import parseaddr from flask import current_app, render_template from flask_mail import Message, sanitize_address from jinja2 import Markup from typing import List # NOQA from changes.con...
apache-2.0
7,238,504,638,627,023,000
35.39834
102
0.614683
false
4.35119
false
false
false
pidydx/grr
grr/lib/flows/general/audit.py
1
2003
#!/usr/bin/env python """This implements the auditing system. How does it work? Noteworthy events within the GRR system (such as approval granting, flow execution etc) generate events to notify listeners about the event. The audit system consists of a group of event listeners which receive these events and act upon ...
apache-2.0
4,533,730,079,903,174,000
30.793651
80
0.736895
false
3.489547
false
false
false
MicBrain/Tic_Tac_Toe
Tic_Tac_Toe.py
1
8653
################### ### DESCRIPTION ### ################### """ Tic-tac-toe (or Noughts and crosses, Xs and Os) is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game. ...
gpl-3.0
-7,830,777,343,375,921,000
37.620536
101
0.539475
false
3.309487
false
false
false
jpetto/bedrock
bedrock/firefox/helpers.py
1
8778
from collections import OrderedDict from django.core.cache import cache from django.conf import settings import jingo import jinja2 from bedrock.firefox.models import FirefoxOSFeedLink from bedrock.firefox.firefox_details import firefox_desktop, firefox_android, firefox_ios from bedrock.base.urlresolvers import reve...
mpl-2.0
5,004,060,017,684,913,000
35.728033
89
0.583276
false
4.00639
false
false
false
satish-avninetworks/murano
murano/dsl/murano_package.py
1
7758
# Copyright (c) 2014 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...
apache-2.0
3,568,733,459,473,349,000
35.252336
78
0.59603
false
4.10911
false
false
false
DevHugo/zds-site
zds/utils/tutorials.py
1
2669
# coding: utf-8 import os # Used for indexing tutorials, we need to parse each manifest to know which content have been published class GetPublished: published_part = [] published_chapter = [] published_extract = [] def __init__(self): pass @classmethod def get_published_content(cls...
gpl-3.0
-8,591,455,257,756,504,000
30.034884
103
0.59423
false
4.284109
false
false
false
Hubert51/AutoGrading
learning/number_recognization/test.py
1
1250
from pytesseract import image_to_string from PIL import Image import cv2 import numpy import sys if __name__ == '__main__': f = open("test1.txt") f = f.read() for element in f: str1 = element position = ((712, 571), (725, 587)) dh = position[1][1] - position[0][1] upper = position[0][...
mit
-715,447,482,893,040,000
26.777778
98
0.6064
false
2.82167
false
false
false
bblais/Tech-SIE
Estimating_Proportion/Estimating_Proportion.py
1
4755
# coding: utf-8 # #Statistical Inference for Everyone: Technical Supplement # # # # This document is the technical supplement, for instructors, for [Statistical Inference for Everyone], the introductory statistical inference textbook from the perspective of "probability theory as logic". # # <img src="http://web...
mit
8,721,158,606,299,497,000
33.708029
206
0.578549
false
2.258907
false
false
false
wylee/django-local-settings
src/local_settings/util.py
1
5070
import importlib import io import os import dotenv NO_DEFAULT = type( "NO_DEFAULT", (), { "__nonzero__": (lambda self: False), # Python 2 "__bool__": (lambda self: False), # Python 3 "__str__": (lambda self: self.__class__.__name__), "__repr__": (lambda self: str(self)),...
mit
-6,834,773,356,538,003,000
26.258065
82
0.622091
false
3.843821
false
false
false
ngageoint/scale
scale/data/models.py
1
24039
"""Defines the database models for datasets""" from __future__ import absolute_import, unicode_literals import copy import logging from collections import namedtuple import django.contrib.postgres.fields from django.db import models, transaction from django.db.models import Q, Count from data.data import data_util f...
apache-2.0
391,126,229,335,592,260
39.745763
146
0.650193
false
4.198952
false
false
false
alphatwirl/alphatwirl
alphatwirl/summary/Scan.py
1
1209
# Tai Sakuma <tai.sakuma@gmail.com> ##__________________________________________________________________|| import numpy as np import copy ##__________________________________________________________________|| class Scan: def __init__(self, val=None, weight=1, contents=None): if contents is not None: ...
bsd-3-clause
-5,268,649,975,022,638,000
28.487805
79
0.456576
false
4.428571
false
false
false
absperf/wagtailapproval
wagtailapproval/menu.py
1
3637
from __future__ import (absolute_import, division, print_function, unicode_literals) import itertools from django.contrib.auth import get_user from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import...
bsd-2-clause
-1,745,352,902,436,354,300
35.009901
78
0.587022
false
4.65685
false
false
false
lulivi/debate_bot
bot.py
1
5398
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- import sys import time import telebot # Librería de la API del bot. from telebot import types # Tipos para la API del bot. from priv.__init__ import token as tk bot = telebot.TeleBot(tk()) # Creamos el objeto de nuestro bot. ###############################################...
gpl-2.0
6,137,335,804,472,736,000
31.083333
232
0.520779
false
3.24113
false
false
false
chugunovyar/factoryForBuild
neuron/SaveClosedPossition.py
1
31069
# -*- coding: utf-8 -*- import logging from neuron.models import DataSet import dateutil.parser as DP loggermsg = logging.getLogger('django') def saveClosedPossition(jsondata): #loggermsg.info(len(jsondata)) # Проверяем есть ли такой ордер в БД ifExistOrdernum = DataSet.objects.filter(open_magicnum=j...
gpl-3.0
-1,601,113,315,527,009,800
49.413008
135
0.546768
false
3.238692
false
false
false
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/core/checks/model_checks.py
1
2454
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import types from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): errors = [] for model in apps.get_models(): ...
mit
6,105,422,011,354,093,000
36.34375
99
0.467808
false
5.155462
false
false
false
ahmetcemturan/SFACT
skeinforge_application/skeinforge_plugins/craft_plugins/limit.py
1
8282
#! /usr/bin/env python """ This page is in the table of contents. This plugin limits the feed rate of the tool head, so that the stepper motors are not driven too fast and skip steps. The limit manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Limit The maximum z feed rate is defined in speed...
agpl-3.0
246,727,834,341,910,940
40
180
0.781574
false
3.328778
false
false
false
mfnch/pyrtist
old/web/in/examples/create_example.py
1
2754
import sys, os, os.path, commands, re usage = "USAGE: python create_example.py box.example" if len(sys.argv) != 2: raise "Expected one argument.\n" + usage example_file = sys.argv[1] print "Working on '%s'..." % example_file # Default values for variables which may be changed inside example_file in_directory = "....
lgpl-2.1
1,265,988,056,238,007,300
24.738318
86
0.649601
false
2.932907
false
false
false
tkwon/dj-stripe
djstripe/migrations/0025_auto_20170322_0428.py
1
3906
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-22 04:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djstripe', '0024_auto_20170308_0757'), ] operations = [ migrations.AlterFie...
mit
8,493,379,797,407,598,000
30.248
58
0.536354
false
4.746051
false
false
false
eqcorrscan/ci.testing
eqcorrscan/utils/stacking.py
1
6254
""" Utility module of the EQcorrscan package to allow for different methods of \ stacking of seismic signal in one place. :copyright: EQcorrscan developers. :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from __future__ import absolute_import from __f...
lgpl-3.0
6,233,989,075,923,252,000
35.573099
79
0.624081
false
3.948232
false
false
false
gspilio/nova
nova/network/quantumv2/api.py
1
41934
# Copyright 2012 OpenStack Foundation # All Rights Reserved # Copyright (c) 2012 NEC Corporation # # 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/lic...
apache-2.0
8,649,179,692,638,891,000
43.374603
79
0.563147
false
4.311536
false
false
false
Chealion/yycbike
archive/weatherLoad.py
1
6271
#! /usr/bin/python # :set tabstop=4 shiftwidth=4 expandtab # Downoads Environment Canada data and sends the data to Graphite. Additionally logs the data to a file we can use to import later import csv import time import graphitesend import urllib2 from datetime import date, timedelta import datetime graphitesend.ini...
mit
2,237,672,961,989,469,700
39.986928
346
0.635784
false
3.267848
false
false
false
Ziqi-Li/bknqgis
bokeh/bokeh/server/server.py
1
10467
''' Provides a Server which instantiates Application instances as clients connect ''' from __future__ import absolute_import, print_function import atexit import logging log = logging.getLogger(__name__) import signal import tornado from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tor...
gpl-2.0
7,007,244,162,705,073,000
35.217993
129
0.572179
false
4.513583
false
false
false
jelly/calibre
src/calibre/db/cli/cmd_catalog.py
2
3866
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import os from calibre.customize.ui import available_catalog_formats, plugin_for_catalog_format from calibre.db.cl...
gpl-3.0
3,301,390,566,288,786,000
28.51145
85
0.579152
false
4.170442
false
false
false
geotagx/geotagx-pybossa-archive
pybossa/auth/task.py
1
1535
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
agpl-3.0
-5,745,328,043,428,878,000
29.098039
77
0.683388
false
3.725728
false
false
false
MasterGowen/moonrain
moonrain/accounts/models.py
1
2939
from django.db import models from django.contrib.auth.models import BaseUserManager, AbstractBaseUser from ..projects.models import Project class UserManager(BaseUserManager): def create_user(self, email, username, password=None): if not email: raise ValueError('Необходимо ввести электронный а...
gpl-2.0
7,740,447,189,795,986,000
23.070796
93
0.573005
false
3.433081
false
false
false
agaveapi/SC17-container-tutorial
content/images/jupyter/examples/setvars.py
1
2421
# Here we define some utility commands to simplify interaction with the shell. # You don't need to read or understand this, but it's here in case you want to. import re import os def repvar(v): """ repvar() is short for "Replace Variables." The idea is that this function looks for strings of the form $VAR o...
bsd-3-clause
6,554,591,777,941,709,000
31.28
80
0.523337
false
3.3625
false
false
false
Tilo15/PhotoFiddle2
PF2/Tools/HueEqualiser.py
1
5526
import cv2 import numpy import Tool class HueEqualiser(Tool.Tool): def on_init(self): self.id = "hueequaliser" self.name = "Hue Equaliser" self.icon_path = "ui/PF2_Icons/HueEqualiser.png" self.properties = [ Tool.Property("header", "Hue Equaliser", "Header", None, has_t...
gpl-3.0
7,938,162,124,587,179,000
35.361842
136
0.500181
false
3.139773
false
false
false
OCA/sale-workflow
sale_product_set/wizard/product_set_add.py
1
3428
# Copyright 2015 Anybox S.A.S # Copyright 2016-2018 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, exceptions, _ import odoo.addons.decimal_precision as dp class ProductSetAdd(models.TransientModel): _name = 'product.set.add' _rec_name ...
agpl-3.0
4,705,311,278,881,153,000
34.340206
74
0.574096
false
3.86036
false
false
false
wolfelee/luokr.com
www.luokr.com/app/ctrls/admin/posts.py
1
10035
#coding=utf-8 from admin import admin, AdminCtrl class Admin_PostsCtrl(AdminCtrl): @admin def get(self): pager = {} pager['qnty'] = min(int(self.input('qnty', 10)), 50) pager['page'] = max(int(self.input('page', 1)), 1) pager['list'] = 0; cur_posts = self.dbase('posts'...
bsd-3-clause
-2,849,066,017,734,671,000
38.519841
252
0.520835
false
3.517838
false
false
false
advancedplotting/aplot
python/plotserv/api_annotations.py
1
8009
# Copyright (c) 2014-2015, Heliosphere Research LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of c...
bsd-3-clause
3,550,723,003,300,049,000
25.611296
77
0.558122
false
3.680607
false
false
false
henriquegemignani/randovania
randovania/gui/main_window.py
1
25113
import functools import json import logging import os import platform import subprocess from functools import partial from pathlib import Path from typing import Optional, List from PySide2 import QtCore, QtWidgets, QtGui from PySide2.QtCore import QUrl, Signal, Qt from qasync import asyncSlot from randovania import ...
gpl-3.0
-1,612,572,667,298,678,800
44.330325
118
0.669454
false
3.87367
false
false
false
maltsev/LatexWebOffice
app/views/document.py
1
15983
# -*- coding: utf-8 -*- """ * Purpose : Dokument- und Projektverwaltung Schnittstelle * Creation Date : 19-11-2014 * Last Modified : Di 24 Feb 2015 15:46:51 CET * Author : mattis * Coauthors : christian, ingo, Kirill * Sprintnumber : 2, 5 * Backlog entry : TEK1, 3ED9, DOK8, DO14, KOL1 """ import os from djang...
gpl-3.0
953,337,725,685,583,200
42.63388
136
0.568503
false
3.9925
false
false
false
psyonara/agonizomai
sermons/models.py
1
5153
from __future__ import unicode_literals from django.db import models from django.template.defaultfilters import slugify from bible.models import BibleBook from useraccounts.models import UserAccount class Author(models.Model): name = models.CharField(null=False, blank=False, max_length=50) name_slug = model...
mit
-3,994,879,931,140,667,400
39.896825
100
0.663497
false
3.56609
false
false
false
funshine/rpidemo
mqtt_oled/oled_test_luma.py
1
1273
#!/usr/bin/python/ # coding: utf-8 import time import datetime from luma.core.interface.serial import i2c, spi from luma.core.render import canvas from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106 def do_nothing(obj): pass # rev.1 users set port=0 # substitute spi(device=0, port=0) below if using t...
mit
2,993,683,248,832,655,000
23.018868
70
0.671642
false
3.009456
false
false
false
jantman/nagios-scripts
check_icinga_ido.py
1
6939
#!/usr/bin/env python """ Script to check last update of core programstatus and service checks in Icinga ido2db Postgres database """ # # The latest version of this script lives at: # <https://github.com/jantman/nagios-scripts/blob/master/check_puppetdb_agent_run.py> # # Please file bug/feature requests and submit pat...
gpl-3.0
4,422,069,438,603,399,000
41.833333
222
0.608157
false
3.785597
false
false
false
3DLIRIOUS/BlendSCAD
examples/example014.scad.py
1
1763
# OpenSCAD example, ported by Michael Mlivoncic # a beautiful dice... # an interesting test case, to get the Boolean operations somehow fixed (TODO) #import sys #sys.path.append("O:/BlenderStuff") import blendscad #import imp #imp.reload(blendscad) #imp.reload(blendscad.core) #imp.reload(blendscad.primitives) ...
gpl-3.0
-6,193,139,217,817,806,000
26.546875
131
0.614861
false
3.234862
false
false
false
stackunderflow-stackptr/stackptr_web
crossbarconnect/client.py
1
8527
############################################################################### ## ## Copyright (C) 2012-2014 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 ## #...
agpl-3.0
3,583,649,226,256,367,000
32.108
126
0.587194
false
4.062411
false
false
false
VahidooX/DeepCCA
objectives.py
1
2281
import theano.tensor as T def cca_loss(outdim_size, use_all_singular_values): """ The main loss function (inner_cca_objective) is wrapped in this function due to the constraints imposed by Keras on objective functions """ def inner_cca_objective(y_true, y_pred): """ It is the loss ...
mit
6,360,399,072,148,163,000
34.640625
108
0.562034
false
2.809113
false
false
false
googleads/googleads-python-lib
examples/ad_manager/v202011/activity_group_service/get_active_activity_groups.py
1
1957
#!/usr/bin/env python # # Copyright 2016 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 requir...
apache-2.0
721,227,215,421,250,300
36.634615
74
0.709249
false
4.217672
false
false
false
macioosch/dynamo-hard-spheres-sim
convergence-plot.py
1
6346
#!/usr/bin/env python2 # encoding=utf-8 from __future__ import division, print_function from glob import glob from itertools import izip from matplotlib import pyplot as plt import numpy as np input_files = glob("csv/convergence-256000-0.*.csv") #input_files = glob("csv/convergence-500000-0.*.csv") #input_files = glo...
gpl-3.0
1,205,206,185,801,680,600
39.941935
101
0.601954
false
3.083576
false
false
false
amdouglas/OpenPNM
OpenPNM/Geometry/models/throat_misc.py
1
1124
r""" =============================================================================== throat_misc -- Miscillaneous and generic functions to apply to throats =============================================================================== """ import scipy as _sp def random(geometry, seed=None, num_range=[0, 1], **kwar...
mit
7,511,632,487,340,780,000
30.222222
79
0.536477
false
3.523511
false
false
false
Digmaster/TicTacToe
Agent.py
1
2030
from random import randint from random import getrandbits from copy import deepcopy # Agent that will either be the human player or a secondary agent for the dual agent play class DumbAgent: #initialize the board for the first player def __init__(self, board): self.board = board def __str__(self): return "Hi, ...
apache-2.0
287,197,937,694,822,820
25.363636
132
0.666995
false
3.142415
false
false
false
mfit/PdfTableAnnotator
script/csv-compare.py
1
8051
""" Copyright 2014 Matthias Frey 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 i...
apache-2.0
-7,229,538,163,487,513,000
29.044776
101
0.527264
false
3.549824
false
false
false
3dfxmadscientist/odoo-infrastructure
addons/infrastructure/hostname.py
1
1468
# -*- coding: utf-8 -*- ############################################################################## # # Infrastructure # Copyright (C) 2014 Ingenieria ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
2,010,866,711,856,777,500
27.784314
115
0.608311
false
4.242775
false
false
false
locke105/mclib
examples/wsgi.py
1
1781
import cgi import json from wsgiref import simple_server import falcon from mclib import mc_info class MCInfo(object): def on_get(self, req, resp): host = req.get_param('host', required=True) port = req.get_param_as_int('port', min=1024, max=65565) ...
apache-2.0
4,936,456,139,620,774,000
21.2625
77
0.521617
false
3.485323
false
false
false
Meertecha/LearnPythonTheGame
pyGameEngine.py
1
3565
### Imports import pickle, os, platform, random ### Functions def main(): curPlayer = loadPlayer( 'Tory' ) curGame = loadGame( 'Python_Tutorial' ) startGame(curPlayer, curGame) def banner(): ''' if platform.system() == "Windows": clearCmd = "cls" elif platform.system() == "Linux": clearCmd = "clear" ...
mit
4,891,151,655,040,956,000
31.409091
133
0.615708
false
3.229167
false
false
false
openbig/odoo-contract
partner_billing/wizard/sale_make_invoice_advance.py
1
1615
# -*- encoding: utf-8 -*- ############################################################################## # # partner_billing # (C) 2015 Mikołaj Dziurzyński, Grzegorz Grzelak, Thorsten Vocks (big-consulting GmbH) # All Rights reserved # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
-6,439,668,196,751,878,000
39.325
105
0.651581
false
3.751163
false
false
false
lipixun/pytest
rabbitmq/deadchannel/going2dead.py
1
2112
#!/usr/bin/env python # encoding=utf8 # The dead channel applicationn import sys reload(sys) sys.setdefaultencoding('utf8') from uuid import uuid4 from time import time, sleep from haigha.connections.rabbit_connection import RabbitConnection from haigha.message import Message class Client(object): """The RPC Cl...
gpl-2.0
-8,202,055,047,594,408,000
33.064516
149
0.606061
false
3.84
false
false
false
gf712/AbPyTools
abpytools/core/fab_collection.py
1
14123
from .chain_collection import ChainCollection import numpy as np import pandas as pd from .chain import calculate_charge from abpytools.utils import DataLoader from operator import itemgetter from .fab import Fab from .helper_functions import germline_identity_pd, to_numbering_table from .base import CollectionBase imp...
mit
-4,991,626,911,150,680,000
41.158209
120
0.593075
false
4.025941
false
false
false
jwill89/clifford-discord-bot
source/retired/main.py
1
31345
import discord from discord.ext import commands import random import MySQLdb # ********************************************** # # DEFINITIONS ********************************** # # ********************************************** # # Bot Description description = '''Official Zealot Gaming Discord bot!''' # Define Bot ...
gpl-3.0
2,852,675,339,850,913,300
33.866518
142
0.58759
false
3.716945
false
false
false
nicain/dipde_dev
dipde/interfaces/zmq/__init__.py
1
4371
import time import zmq import threading context = zmq.Context() class PublishCallback(object): def __init__(self, port, topic, message_callback): self.port = port self.topic = topic self.message_callback = message_callback self.socket = context.socket(zmq.PUB)...
gpl-3.0
-8,901,712,531,665,347,000
27.94702
111
0.577442
false
4.028571
false
false
false
yantrabuddhi/nativeclient
buildbot/buildbot_lib.py
1
21952
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 optparse import os.path import shutil import subprocess import stat import sys import time import traceback ARCH_MAP = { ...
bsd-3-clause
-6,223,911,041,280,375,000
30.722543
80
0.654246
false
3.708108
false
false
false
tjcsl/director
web3/apps/sites/migrations/0001_initial.py
1
1297
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-05 23:20 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '...
mit
-8,739,404,138,227,232,000
39.53125
156
0.596762
false
4.183871
false
false
false
TAMU-CPT/galaxy-tools
tools/gff3/gff3_filter.py
1
1553
#!/usr/bin/env python import sys import logging import argparse from cpt_gffParser import gffParse, gffWrite from gff3 import feature_lambda, feature_test_qual_value logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) def gff_filter(gff3, id_list=None, id="", attribute_field="ID", subfeatures=T...
gpl-3.0
2,550,448,760,510,067,700
31.354167
85
0.627817
false
3.688836
false
false
false
greggian/TapdIn
django/contrib/localflavor/us/models.py
1
1132
from django.conf import settings from django.db.models.fields import Field class USStateField(Field): def get_internal_type(self): return "USStateField" def db_type(self): if settings.DATABASE_ENGINE == 'oracle': return 'CHAR(2)' else: retu...
apache-2.0
2,579,539,055,631,886,000
30.342857
74
0.614841
false
4.337165
false
false
false
seraphlnWu/in_trip
in_trip/scripts/change_data_from_hbase_to_pg.py
1
1620
#coding=utf-8 import time import cPickle from in_trip.store_data.views import pg_db,conn import logging logger = logging.getLogger('parser') def creat_table(): sql_str = ''' create table "tmp_hbase_to_pg"( data text, timestamp float(24) ) ''' pg_db...
mit
5,948,230,377,055,756,000
22.478261
72
0.557407
false
3.347107
false
false
false
fallen/artiq
artiq/frontend/artiq_run.py
1
4103
#!/usr/bin/env python3 # Copyright (C) 2014, 2015 M-Labs Limited # Copyright (C) 2014, 2015 Robert Jordens <jordens@gmail.com> import argparse import sys import time from operator import itemgetter from itertools import chain import logging import h5py from artiq.language.environment import EnvExperiment from artiq....
gpl-3.0
-3,275,687,307,934,452,700
27.894366
75
0.58835
false
3.76077
false
false
false
vntarasov/openpilot
selfdrive/debug/get_fingerprint.py
1
1030
#!/usr/bin/env python3 # simple script to get a vehicle fingerprint. # Instructions: # - connect to a Panda # - run selfdrive/boardd/boardd # - launching this script # - turn on the car in STOCK MODE (set giraffe switches properly). # Note: it's very important that the car is in stock mode, in order to collect a co...
mit
-3,785,566,846,449,061,400
31.1875
103
0.695146
false
3.39934
false
false
false
vcoin-project/v
qa/rpc-tests/test_framework/bignum.py
1
1991
# # # bignum.py # # This file is copied from python-vcoinlib. # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" from __future__ import absolute_import, division, print_function, unicode_literals impor...
mit
-4,014,981,737,356,212,000
18.519608
82
0.52436
false
2.868876
false
false
false
ultimanet/nifty
rg/powerspectrum.py
1
26583
## NIFTY (Numerical Information Field Theory) has been developed at the ## Max-Planck-Institute for Astrophysics. ## ## Copyright (C) 2013 Max-Planck-Society ## ## Author: Marco Selig ## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/> ## ## This program is free software: you can redistribute it and/or mod...
gpl-3.0
8,155,718,674,426,123,000
33.703655
181
0.600271
false
3.52186
false
false
false
fnordahl/nova
nova/exception.py
1
56858
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
-6,969,698,482,296,145,000
28.09826
79
0.672852
false
3.944364
false
false
false
google/ion
ion/dev/doxygen_filter.py
1
8299
#!/usr/bin/python # # Copyright 2017 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...
apache-2.0
6,935,754,025,838,835,000
35.884444
80
0.662369
false
3.92017
false
false
false
FlannelFox/FlannelFox
tests/flannelfox/torrenttools/test_torrentQueue.py
1
1999
# -*- coding: utf-8 -*- import unittest from unittest.mock import patch import os from flannelfox.torrenttools.TorrentQueue import Queue from flannelfox.torrenttools import Torrents class TestTorrentQueue(unittest.TestCase): testDatabaseFile = 'ff.db' def removeDatabase(self): try: os.remove(self.testDataba...
mit
-7,580,618,446,876,378,000
29.753846
83
0.78039
false
3.39966
true
false
false
vhosouza/invesalius3
invesalius/gui/task_exporter.py
1
15556
#-------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU ...
gpl-2.0
-955,293,151,013,029,400
39.300518
98
0.509771
false
3.917401
false
false
false
bmya/tkobr-addons
tko_web_sessions_management/main.py
1
11671
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
-2,443,623,195,217,171,000
46.060484
154
0.476223
false
5.164159
false
false
false
limemadness/selenium_training
test_countries_sort.py
1
2050
import pytest from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC @pytest.fixture #def driver(request): # wd = webdriver.Firefox(firefox_binary="c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe") # print(w...
apache-2.0
-2,674,985,192,745,299,500
40
122
0.699024
false
3.693694
false
false
false
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/konlpy/corpus.py
1
1849
#! /usr/bin/python2.7 # -*- coding: utf-8 -*- import os from . import utils class CorpusLoader(): """Loader for corpora. For a complete list of corpora available in KoNLPy, refer to :ref:`corpora`. .. code-block:: python >>> from konlpy.corpus import kolaw >>> fids = kolaw.fileids(...
gpl-3.0
3,655,224,125,584,470,500
27.035088
171
0.58761
false
2.201102
false
false
false
ErickMurillo/aprocacaho
organizacion/admin.py
1
3456
from django.contrib import admin from .models import * # Register your models here. #organizacion class InlineEscuelaCampo(admin.TabularInline): model = EscuelaCampo extra = 1 class OrganizacionAdmin(admin.ModelAdmin): inlines = [InlineEscuelaCampo] list_display = ('id','nombre','siglas') list_dis...
mit
-7,994,590,496,220,483,000
26.648
94
0.712095
false
3.167736
false
false
false
srio/shadow3-scripts
transfocator_id30b.py
1
25823
import numpy import xraylib """ transfocator_id30b : transfocator for id13b: It can: 1) guess the lens configuration (number of lenses for each type) for a given photon energy and target image size. Use transfocator_compute_configuration() for this task 2) for a given tran...
mit
5,677,322,547,994,774,000
39.224299
162
0.584905
false
3.016001
true
false
false
jose187/gh_word_count
gh_word_count/__init__.py
1
2681
from ommit_words import list_ommited_words from re import sub import operator class _input_list: def __init__(self,list_TITLES): self.list_TITLES = list_TITLES self.list_remove = list_ommited_words() def _word_count(self): # these are all the words that are in t...
bsd-2-clause
-7,451,965,439,748,880,000
30.916667
69
0.497576
false
3.723611
false
false
false
CSD-Public/stonix
src/tests/rules/unit_tests/zzzTestRuleDisableOpenSafeSafari.py
1
4752
############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contract 89233218CNA000001 # ...
gpl-2.0
6,575,902,741,037,396,000
42.2
82
0.580177
false
4.277228
true
false
false
HomeRad/TorCleaner
wc/filter/rules/FolderRule.py
1
3945
# -*- coding: iso-8859-1 -*- # Copyright (C) 2000-2009 Bastian Kleineidam """ Group filter rules into folders. """ from ... import fileutil, configuration from . import Rule def recalc_up_down(rules): """ Add .up and .down attributes to rules, used for display up/down arrows in GUIs """ upper = le...
gpl-2.0
716,819,241,840,942,200
27.79562
78
0.509759
false
3.937126
true
false
false
RAJSD2610/SDNopenflowSwitchAnalysis
TotalFlowPlot.py
1
2742
import os import pandas as pd import matplotlib.pyplot as plt import seaborn seaborn.set() path= os.path.expanduser("~/Desktop/ece671/udpt8") num_files = len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))]) print(num_files) u8=[] i=0 def file_len(fname): with open(fname) as f: for i,...
gpl-3.0
3,297,434,910,053,564,400
24.388889
86
0.591174
false
2.515596
false
false
false
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/addons/io_scene_3ds/__init__.py
1
6950
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
gpl-3.0
-6,396,439,276,597,938,000
32.095238
79
0.496259
false
4.131986
false
false
false
HyperloopTeam/FullOpenMDAO
cantera-2.0.2/interfaces/python/MixMaster/Units/unit.py
1
2833
import operator class unit: _zero = (0,) * 7 _negativeOne = (-1, ) * 7 _labels = ('m', 'kg', 's', 'A', 'K', 'mol', 'cd') def __init__(self, value, derivation): self.value = value self.derivation = derivation return def __add__(self, other): if not self.derivati...
gpl-2.0
3,539,097,702,608,451,000
25.476636
81
0.570773
false
3.674449
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/windows_configuration_py3.py
1
2719
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
7,741,615,214,177,697,000
49.351852
180
0.670835
false
4.189522
false
false
false