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
andybalaam/pepper
old/pepper1/src/libpepper/languagevalues.py
1
5754
# Copyright (C) 2011-2012 Andy Balaam and The Pepper Developers # Released under the MIT License. See the file COPYING.txt for details. from all_known import all_known from pepinterface import implements_interface from values import PepArray from values import PepBool from vals.numbers import PepInt from values impo...
mit
-1,338,129,985,425,157,000
31.88
76
0.582204
false
3.800528
false
false
false
mediatum/mediatum
web/ftree/ftree.py
1
2139
""" mediatum - a multimedia content repository Copyright (C) 2010 Arne Seifert <seiferta@in.tum.de> 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...
gpl-3.0
-1,403,158,157,199,159,800
33.5
94
0.649836
false
4.020677
false
false
false
Desolace/LudumDare32
game_loop.py
1
4227
import pygame from pygame.locals import * from input_manager import InputManager, Actions import screens, menu from game_instance import GameInstance from ui_overlay import UIOverlay, TextElement from pyconsole import Console class Game(object): def __init__(self, config): self.max_fps = config.get("max_...
mit
8,239,904,623,314,838,000
36.078947
133
0.610599
false
3.80468
true
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage.py
1
1905
# 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
1,272,538,325,083,842,600
33.017857
76
0.571654
false
4.233333
false
false
false
Hernrup/django-wsgiserver3
django_wsgiserver/wsgiserver/wsgiserver3.py
1
77873
"""A high-speed, production ready, thread pooled, generic HTTP server. Simplest example on how to use this module directly (without using CherryPy's application machinery):: from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('Cont...
bsd-3-clause
-1,554,800,382,253,655,600
36.206402
143
0.550114
false
4.316207
false
false
false
InUrSys/PescArt2.0
src/Fichas_src/dialog_AmostEspecificaEspe.py
1
2223
''' Created on 05/09/2017 @author: chernomirdinmacuvele ''' from ui_AmostEspeEspecie import Ui_frmAmostEspeEspecieAmost import GenericAmostrasQDialog class dialog_AmostEspecificaEspe(GenericAmostrasQDialog.CustomForm_Amostras, Ui_frmAmostEspeEspecieAmost): def __init__(self, parent=None, TblName=None, dbcon=None...
gpl-3.0
-8,490,004,312,691,807,000
37.344828
166
0.536662
false
3.608766
false
false
false
AntoineAugusti/katas
codingame/medium/heat_detector.py
1
1370
def packBounds(xMin, xMax, yMin, yMax): return [[xMin, xMax], [yMin, yMax]] def unpackBounds(bounds): xMin, xMax = bounds[0] yMin, yMax = bounds[1] return [xMin, xMax, yMin, yMax] def nextMove(width, height, x, y, direction, bounds): xMin, xMax, yMin, yMax = unpackBounds(bounds) if direction == "U": yMax = y...
mit
-7,396,484,664,308,771,000
22.637931
91
0.624818
false
2.513761
false
false
false
esnet/graphite-web
webapp/graphite/util.py
1
6838
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
8,822,200,391,569,881,000
28.474138
130
0.674612
false
3.664523
false
false
false
unbit/django-uwsgi
django_uwsgi/stats.py
1
1477
import os import time from datetime import datetime from django.utils.translation import ugettext_lazy as _ from . import uwsgi def get_uwsgi_stats(): uwsgi_stats = {} workers = uwsgi.workers() total_load = time.time() - uwsgi.started_on for w in workers: w['running_time'] = w['running_time'] ...
mit
-3,016,437,870,239,516,000
35.02439
96
0.546378
false
3.491726
false
false
false
SecondLiners/GO2
band.py
1
8429
# # band class for Gig-o-Matic 2 # # Aaron Oppenheimer # 24 August 2013 # from google.appengine.ext import ndb import debug import assoc import gig import plan import stats def band_key(band_name='band_key'): """Constructs a Datastore key for a Guestbook entity with guestbook_name.""" return ndb.Key('Band'...
gpl-3.0
6,071,294,075,494,389,000
29.650909
119
0.660577
false
3.215948
false
false
false
gdsfactory/gdsfactory
pp/components/cdc.py
1
3052
from typing import Optional, Tuple import numpy as np import picwriter.components as pc import pp from pp.cell import cell from pp.component import Component from pp.components.waveguide_template import strip from pp.picwriter_to_component import picwriter_to_component from pp.types import ComponentFactory @cell de...
mit
-7,344,208,948,851,704,000
32.173913
86
0.647772
false
3.5
false
false
false
neuroo/equip
tests/test_control_flow.py
1
7408
import pytest from itertools import tee, izip from testutils import get_co, get_bytecode from equip import BytecodeObject from equip.bytecode.utils import show_bytecode import equip.utils.log as logutils from equip.utils.log import logger logutils.enableLogger(to_file='./equip.log') from equip.analysis import Control...
apache-2.0
2,534,338,296,392,331,300
21.313253
130
0.620545
false
3.239178
true
false
false
windelbouwman/ppci-mirror
ppci/utils/bitfun.py
1
6113
""" Module full of bit manipulating helper classes. """ def rotate_right(v, n): """ bit-wise Rotate right n times """ mask = (2 ** n) - 1 mask_bits = v & mask return (v >> n) | (mask_bits << (32 - n)) def rotate_left(v, n): assert n >= 0 assert n < 32 return rotate_right(v, 32 - n) def...
bsd-2-clause
-2,151,311,591,168,351,700
24.684874
77
0.495501
false
3.686972
false
false
false
lancekrogers/music-network
cleff/cleff/settings.py
1
4462
""" Django settings for cleff project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
apache-2.0
-182,834,558,739,971,970
24.352273
122
0.665397
false
3.283297
false
false
false
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/win/winpdh.py
1
11346
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import time from collections import defaultdict import win32pdh from six import iteritems, text_type from six.moves import winreg DATA_TYPE_INT = win32pdh.PDH_FMT_LONG DATA_TYPE_DOUBLE = win32pdh.PDH_FMT...
bsd-3-clause
7,040,604,954,250,838,000
42.638462
119
0.581438
false
4.254218
false
false
false
readw/210CT-Coursework
Basic-Py/6-Reverse.py
1
3321
# Week 3 - 6) Write the pseudocode and code for a function that reverses the # words in a sentance. Input: "This is awesome" Output: "awesome # this Is". Give the Big O notation. ''' PSEUDOCODE - ITERATIVE ---------------------- REVERSE_ORDER(s) rev <- SPLIT s BY " " reversed <- "" ...
gpl-3.0
7,979,030,324,996,267,000
44.493151
100
0.428184
false
4.549315
false
false
false
PaulWay/insights-core
insights/core/archives.py
1
4729
#!/usr/bin/env python import logging import os import shlex import subprocess import tempfile from insights.core.marshalling import Marshaller from insights.util import subproc, fs try: import insights.contrib.magic as magic except Exception: raise ImportError("You need to install the 'file' RPM.") else: ...
apache-2.0
1,995,818,427,947,127,800
26.817647
99
0.601819
false
3.64892
false
false
false
bundlewrap/bundlewrap
bundlewrap/items/svc_openrc.py
1
3360
from shlex import quote from bundlewrap.exceptions import BundleError from bundlewrap.items import Item from bundlewrap.utils.text import mark_for_translation as _ def svc_start(node, svcname): return node.run(f"rc-service {quote(svcname)} start", may_fail=True) def svc_running(node, svcname): result = nod...
gpl-3.0
7,016,225,537,355,085,000
31
99
0.54881
false
3.929825
false
false
false
sekikn/ambari
ambari-server/src/main/python/ambari_server/setupActions.py
2
1913
#!/usr/bin/env python ''' 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")...
apache-2.0
5,927,159,286,697,128,000
35.09434
72
0.765813
false
3.298276
false
false
false
ornlneutronimaging/ResoFit
ResoFit/data/IPTS_20439/ipts_20439_lead_partial.py
1
3265
import numpy as np import pprint import matplotlib.pyplot as plt from ResoFit.experiment import Experiment import peakutils as pku from ResoFit.simulation import Simulation from scipy import signal import scipy folder = 'data/IPTS_20439/reso_data_20439' sample_name = ['No Pb', '10mm Pb'] data_file = ['Ta.csv', 'Ta_Pb_...
bsd-3-clause
5,409,193,133,953,388,000
33.368421
106
0.634916
false
2.711794
false
false
false
GammaC0de/pyload
src/pyload/plugins/decrypters/FilerNetFolder.py
1
1050
# -*- coding: utf-8 -*- from ..base.simple_decrypter import SimpleDecrypter class FilerNetFolder(SimpleDecrypter): __name__ = "FilerNetFolder" __type__ = "decrypter" __version__ = "0.48" __status__ = "testing" __pyload_version__ = "0.5" __pattern__ = r"https?://filer\.net/folder/\w{16}" ...
agpl-3.0
1,552,273,822,165,763,600
27.378378
85
0.532381
false
3.153153
false
false
false
kizniche/Mycodo
mycodo/inputs/sht2x.py
1
4086
# coding=utf-8 # From https://github.com/ControlEverythingCommunity/SHT25/blob/master/Python/SHT25.py import time import copy from mycodo.inputs.base_input import AbstractInput from mycodo.inputs.sensorutils import calculate_dewpoint from mycodo.inputs.sensorutils import calculate_vapor_pressure_deficit # Measuremen...
gpl-3.0
8,223,683,000,269,916,000
31.688
150
0.572687
false
3.436501
false
false
false
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/87_SagaOfEvasSaint/__init__.py
1
2329
# Made by Emperorc import sys from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from quests.SagasSuperclass import Quest as JQuest qn = "87_SagaOfEvasSaint" qnu = 87 qna = "Saga of Eva's Saint" class Quest (JQuest) : def __init__(self,id,name,descr): ...
gpl-3.0
-5,054,227,852,129,113,000
60.315789
231
0.670245
false
3.05643
false
false
false
rwisecar/data-structures
src/dll.py
1
3472
"""Create a Doubly linked list.""" class Node(object): """Create node to push into Doubly link list.""" def __init__(self, value=None, next_node=None, previous_node=None): """Create node to push into Doubly link list.""" self.value = value self.next_node = next_node self.previ...
mit
-5,819,471,569,239,234,000
32.708738
89
0.528226
false
4.323786
false
false
false
evrenesat/genesis
genesis/com/views.py
1
3447
# -*- coding: utf-8 -*- from decimal import Decimal from django.contrib.auth.decorators import login_required from django.db import connection from django.http import HttpResponse from django.http import JsonResponse from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ # Create yo...
gpl-3.0
227,998,289,184,827,260
31.828571
92
0.664056
false
3.620798
false
false
false
davidbroadwater/nyc-subway-datascience-project
project_2/fix_turnstile_data/fix_turnstile_data.py
1
2150
import csv import pandas as pd def fix_turnstile_data(filenames): ''' Filenames is a list of MTA Subway turnstile text files. A link to an example MTA Subway turnstile text file can be seen at the URL below: http://web.mta.info/developers/data/nyct/turnstile/turnstile_110507.txt As you can see...
mit
8,711,111,627,422,009,000
36.068966
86
0.625116
false
3.484603
false
false
false
ONEcampaign/humanitarian-data-service
resources/data/raw/example/transform_scripts/parse_acled_all_africa.py
1
1542
import re import pandas as pd ACLED_FILE = 'ACLED-All-Africa-File_20170101-to-20170429.csv' def clean_and_save(): encoding_key = 'iso-8859-1' df = pd.read_csv(ACLED_FILE, encoding=encoding_key) print df.head() print df.columns print df.describe() cleaned_file = 'cleaned_{}'.format(ACLED_FILE)...
mit
-3,997,759,721,461,324,300
28.653846
75
0.616732
false
3.488688
false
false
false
mortentoo/tools
pipeline/prman_jobTime.py
1
1815
''' Sums the total elapsed time of all rendered images of a Pixar Renderman batch job. It reads the data from the job XML files, so these are required! Run in command line: python prman_jobTime.py /path/to/jobFolder ''' import os, sys import xml.etree.ElementTree as ET args = sys.argv[1:] def readRenderTime(file)...
gpl-3.0
-5,149,303,020,670,490,000
22.571429
83
0.608815
false
2.908654
false
false
false
tboyce1/home-assistant
homeassistant/components/cover/tahoma.py
2
2534
""" Support for Tahoma cover - shutters etc. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.tahoma/ """ import logging from datetime import timedelta from homeassistant.components.cover import CoverDevice from homeassistant.components.tahoma impor...
apache-2.0
1,365,016,466,210,322,000
28.126437
74
0.617206
false
4.047923
false
false
false
cristianav/PyDEX
share/lib/pydex/pydex_dialogs.py
1
15248
# -*- coding: utf-8 -*- # # pydex_dialogs.py # # Copyright Cristian Navalici ncristian [at] lemonsoftware.eu # # 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; eith...
gpl-3.0
8,644,906,239,336,999,000
35.295943
141
0.555957
false
3.751357
false
false
false
felipenaselva/felipe.repository
script.module.resolveurl/lib/resolveurl/plugins/lib/helpers.py
1
9811
""" ResolveURL Addon for Kodi Copyright (C) 2016 t0mm0, tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later...
gpl-2.0
2,584,517,304,195,607,000
41.656522
205
0.537458
false
3.387776
false
false
false
cgrebeld/pymel
pymel/core/windows.py
1
30564
""" Functions for creating UI elements, as well as their class counterparts. """ import re, sys, functools, traceback import pymel.util as _util import pymel.internal.pmcmds as cmds import pymel.internal.factories as _factories import pymel.internal as _internal import pymel.versions as _versions from language impor...
bsd-3-clause
-7,241,206,425,842,282,000
35.779783
142
0.584348
false
3.933591
false
false
false
qxf2/qxf2-page-object-model
utils/gmail/message.py
1
7976
import datetime import email import re import time import os from email.header import decode_header, make_header from imaplib import ParseFlags class Message(): def __init__(self, mailbox, uid): self.uid = uid self.mailbox = mailbox self.gmail = mailbox.gmail if mailbox else None ...
mit
-7,371,277,480,869,057,000
33.08547
127
0.589895
false
3.638686
false
false
false
darbula/django-onlinejudge
onlinejudge/middleware.py
1
1419
from __future__ import absolute_import from django.http import HttpResponseForbidden from .settings import OJ_IP_FILTER, OJ_USERS_IPS, OJ_PROXY_SIGNATURE, \ OJ_REMOTE_ADDR def get_ip(request): return request.META.get("HTTP_X_FORWARDED_FOR", "").strip().split(',')[0] def get_proxy(request): return reques...
bsd-3-clause
1,660,031,398,861,833,200
32
77
0.631431
false
3.685714
false
false
false
devs1991/test_edx_docmode
common/djangoapps/student/views.py
1
102710
""" Student Views """ import datetime import logging import uuid import json import warnings from collections import defaultdict from urlparse import urljoin from pytz import UTC from requests import HTTPError from ipware.ip import get_ip from django.conf import settings from django.contrib.auth import logout, authen...
agpl-3.0
-8,384,127,725,916,845,000
40.182839
150
0.646169
false
4.25353
false
false
false
marcosgabbardo/nbaPredictor
lib/nba_csvgenerator.py
1
4987
import pymysql.cursors import csv # CSV file generator to upload in amazon machine learning with some statistics to use # in multiclass, binary or regression analisys def csvGenerator(league, now, cvs_file): connection = pymysql.connect(host='192.168.99.100', user='root', ...
mit
-3,788,412,098,069,962,000
38.587302
124
0.569882
false
2.792273
false
false
false
llambiel/cloud-canary
api-canary.py
1
4241
#!/usr/bin/python # -*- coding: utf-8 -*- # Loic Lambiel © # License MIT import sys import argparse import logging import logging.handlers import time import socket try: from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver except ImportError: print ("It look like l...
mit
7,910,202,042,723,865,000
34.041322
240
0.579245
false
4.030418
true
false
false
alexisbellido/django-vodkamartini-qa
vodkamartiniqa/views/answers.py
1
1248
from django.http import HttpResponse from vodkamartiniqa.views.helpers import get_answers from vodkamartiniqa.views.helpers import get_questions import json #from django.core.serializers.json import DjangoJSONEncoder # TODO get answers via ajax with start and end def get_answers_ajax(request, question_id, start=0, end...
bsd-3-clause
1,810,627,598,814,073,600
47
97
0.596955
false
4.348432
false
false
false
romasch/estudioctl
elogger.py
1
2910
# ---------------------------------------------------------------------------- # Helper functions for logging and printing. # #For a systemwide unique logger, import the module like this: #from logger import SystemLogger # # ---------------------------------------------------------------------------- import os import ...
bsd-3-clause
7,431,526,109,932,331,000
25.697248
128
0.627148
false
3.156182
false
false
false
simsong/grr-insider
lib/rdfvalues/client_test.py
1
4020
#!/usr/bin/env python """Test client RDFValues.""" from grr.lib import rdfvalue from grr.lib.rdfvalues import test_base from grr.proto import jobs_pb2 class UserTests(test_base.RDFValueTestCase): """Test the User ProtoStruct implementation.""" rdfvalue_class = rdfvalue.User USER_ACCOUNT = dict( userna...
apache-2.0
-8,004,924,776,507,574,000
33.956522
79
0.642289
false
3.557522
true
false
false
jmankiewicz/odooAddons
hr_attendance_new_check/models/hr_attendance.py
1
2297
# -*- coding: utf-8 -*- from openerp import models, fields, api from openerp.exceptions import ValidationError class Attendance(models.Model): _inherit="hr.attendance" validate = fields.Boolean(string='Validate', help='Check to let Odoo validate if this attendance-event is plausible.', default=True) valid = field...
agpl-3.0
-6,385,415,243,148,886,000
43.173077
164
0.670004
false
3.15956
false
false
false
wazo-pbx/wazo-plugind
wazo_plugind/root_worker.py
1
4066
# Copyright 2017 The Wazo Authors (see the AUTHORS file) # SPDX-License-Identifier: GPL-3.0-or-later import logging import signal import os import sys from multiprocessing import Event, Process, Queue from queue import Empty from threading import Lock from .helpers import exec_and_log logger = logging.getLogger(__na...
gpl-3.0
4,388,545,950,319,832,000
29.118519
92
0.589769
false
3.890909
false
false
false
Eric89GXL/vispy
examples/basics/scene/modular_shaders/editor.py
1
7039
# -*- coding: utf-8 -*- # vispy: testskip # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------...
bsd-3-clause
6,342,080,126,043,699,000
34.913265
79
0.516124
false
4.187388
false
false
false
Canpio/Paddle
python/paddle/fluid/tests/unittests/testsuite.py
1
6629
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
apache-2.0
-5,607,755,067,677,922,000
35.423077
80
0.557701
false
3.52794
false
false
false
zebMcCorkle/ZeroNet
src/Test/conftest.py
1
5367
import os import sys import urllib import time import logging import json import pytest import mock def pytest_addoption(parser): parser.addoption("--slow", action='store_true', default=False, help="Also run slow tests") # Config if sys.platform == "win32": PHANTOMJS_PATH = "tools/phantomjs/bin/phantomjs.ex...
gpl-2.0
4,731,466,866,487,467,000
27.854839
104
0.65027
false
3.325279
true
false
false
google/nerfies
nerfies/utils.py
1
14210
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
2,626,745,283,115,632,600
29.55914
80
0.660591
false
3.229545
false
false
false
infolock/My-Sublime
JSHint Gutter/JSHint.py
1
10626
# 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://mozilla.org/MPL/2.0/. import sublime, sublime_plugin import os, sys, subprocess, codecs, re, webbrowser from threading import Timer try: im...
mit
-8,686,644,277,519,501,000
33.72549
101
0.665443
false
3.503462
false
false
false
Nithanaroy/SemanticMachineTranslation
py-aligner/align.py
1
1079
import nltk import os from nltk.corpus.util import LazyCorpusLoader from nltk.corpus.europarl_raw import german, english from nltk.corpus.reader import AlignedCorpusReader from nltk.translate import AlignedSent, Alignment from nltk.corpus.reader.plaintext import PlaintextCorpusReader def align(filename): files = fi...
mit
3,444,761,004,346,962,400
28.162162
121
0.716404
false
2.817232
false
false
false
benkhlifafahmi/funnycode
bot/fb_happy_eid/fb_bot.py
1
1999
import re from bs4 import * import mechanize def login(br): user = "[YOUR LOGIN]" pwd = "[YOUR PASS]" br.open('https://m.facebook.com/') br.select_form(nr=0) br.form['email'] = user br.form['pass'] = pwd br.submit() return br def get_friends_list(br): res = [] i = 1 while(True): br.open('https://m.face...
mit
5,665,094,342,824,357,000
29.287879
212
0.635818
false
2.626807
false
false
false
nschloe/meshio
src/meshio/xdmf/common.py
1
5448
import numpy as np from .._exceptions import ReadError from .._mesh import CellBlock numpy_to_xdmf_dtype = { "int8": ("Int", "1"), "int16": ("Int", "2"), "int32": ("Int", "4"), "int64": ("Int", "8"), "uint8": ("UInt", "1"), "uint16": ("UInt", "2"), "uint32": ("UInt", "4"), "uint64": ("...
mit
3,061,314,807,218,892,300
30.131429
116
0.570668
false
2.665362
false
false
false
emlprime/fantasyx
fantasyx/game.py
1
10240
import json from models import Character, User, Draft, DraftTicket, Episode, DraftHistory, Rubric, Score from sqlalchemy import or_, exc from sqlalchemy.orm import lazyload from datetime import timedelta, datetime import pandas as pd import numpy as np def handle_event(msg_type, msg, db_session=None): print("hand...
mit
-8,171,953,140,849,885,000
43.329004
178
0.660742
false
3.69009
false
false
false
gomezgoiri/reusingWebActuatorsFromSemanticSpace
actuation/scenarios/mixed_space_rest.py
1
2861
# -*- coding: utf-8 -*- ''' Copyright (C) 2013 onwards University of Deusto All rights reserved. This software is licensed as described in the file COPYING, which you should have received as part of this distribution. This software consists of contributions made by many individuals, listed below: @auth...
apache-2.0
9,016,202,217,310,364,000
34.320988
100
0.603147
false
4.333333
false
false
false
spatialaudio/panorama
Python/python_core_components/ptfile_creator.py
1
1819
class PtCreator: ''' Create the PTSticher-input-file''' def __init__(self, output_dir, a, b, c): self.output_dir = output_dir # Disortion a, b, c self.a = a self.b = b self.c = c def init_file(self): # return first block of PTSticher-file string ...
mit
-5,853,065,582,672,730,000
30.362069
91
0.503024
false
3.202465
false
false
false
ChameleonCloud/horizon
openstack_dashboard/dashboards/project/floating_ips/views.py
1
5125
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
apache-2.0
-6,416,642,596,869,219,000
36.683824
78
0.626927
false
4.410499
false
false
false
glyphobet/pottymouth
python/setup.py
1
2371
#!/usr/bin/env python try: from setuptools import setup except ImportError: from distutils.core import setup from pottymouth import __version__ import os import os.path import shutil setup(name='PottyMouth', py_modules=['pottymouth'], version=__version__, data_files=[('share/doc/python-pott...
bsd-3-clause
1,629,577,475,898,001,200
49.446809
355
0.568536
false
4.838776
false
false
false
a-nai/django-wiki
wiki/decorators.py
1
8825
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseNotFound, \ HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import redirect, get_object_or_404, get...
gpl-3.0
7,039,904,762,252,002,000
39.668203
185
0.586742
false
4.470618
false
false
false
appanacca/tutmom
check_env.py
1
3306
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2015-2016 California Institute of Technology. # Copyright (c) 2016-2018 Mike McKerns. # License: 3-clause BSD. """ check environment scipt """ import sys # requirements has = dict( # optimization scipy='0.6.0',...
bsd-3-clause
4,444,178,281,737,537,500
24.828125
80
0.594676
false
3.52452
false
false
false
billowen/pygds
pygds/canvas.py
1
3240
from PySide.QtGui import * from polygon import Polygon from path import Path from aref import ARef from sref import SRef from graphicsitems import * import os class MyRect(QGraphicsRectItem): def __init__(self, x, y, w, h, scene=None): super().__init__(x, y, w, h, scene) def paint(self, painter, opti...
lgpl-3.0
-2,588,883,861,483,748,400
33.084211
69
0.598826
false
3.538798
false
false
false
jbarriosc/ACSUFRO
LGPL/CommonSoftware/acspycommon/src/Acspy/Common/Log.py
1
30655
# @(#) $Id: Log.py,v 1.3 2012/04/23 22:46:03 javarias Exp $ # # ALMA - Atacama Large Millimiter Array # (c) Associated Universities, Inc. Washington DC, USA, 2001 # (c) European Southern Observatory, 2002 # Copyright by ESO (in the framework of the ALMA collaboration) # and Cosylab 2002, All rights rese...
lgpl-2.1
-5,513,897,463,931,724,000
32.872928
116
0.54487
false
4.653864
false
false
false
tcpcloud/contrail-controller
src/opserver/stats.py
1
6625
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # stats # # Query StatsOracle info from analytics # import sys import os import argparse import json import datetime from opserver_util import OpServerUtils from sandesh_common.vns.ttypes import Module from sandesh_common.vns.co...
apache-2.0
-4,580,797,401,921,861,600
34.427807
97
0.535245
false
3.899353
false
false
false
shepilov-vladislav/Flask-Restless-Restangular-with-JWT-auth
server/models.py
1
3081
# -*- coding: utf-8 -*- from __future__ import absolute_import from flask.ext.security import UserMixin, RoleMixin from flask.ext.sqlalchemy import SQLAlchemy from savalidation import ValidationMixin from flask.ext.security.utils import encrypt_password, verify_password from datetime import datetime from .errors_hand...
mit
-8,428,511,970,630,879,000
32.129032
77
0.636806
false
3.734545
false
false
false
nds/bio_assembly_refinement
bio_assembly_refinement/contig_overlap_trimmer.py
1
6984
''' Class to find and trim overlapping ends of a contig Attributes: ----------- fasta_file : input fasta file working_directory : path to working directory (default to current working directory) contigs : dict of contigs (instead of fasta file) trim : trim overlaps (default true) trim_reversed_overlaps: trims overlaps...
gpl-3.0
-150,525,826,035,892,580
37.379121
152
0.70146
false
3.151625
false
false
false
jucimarjr/IPC_2017-1
lista07/lista07_lista02_questao08.py
1
1156
#---------------------------------------------------------------------------------------------------------------------- # Introdução a Programação de Computadores - IPC # Universidade do Estado do Amazonas - UEA # Prof. Jucimar Jr # Alexandre Marques Uchôa 1715310028 # Carlos Eduardo Tapudima de Olive...
apache-2.0
-2,453,688,487,153,752,600
23.978261
119
0.497387
false
2.701176
false
false
false
bitmazk/cmsplugin-accordion
setup.py
1
1844
# -*- encoding: utf-8 -*- """ Python setup file for the cmsplugin_accordion app. In order to register your app at pypi.python.org, create an account at pypi.python.org and login, then register your new app like so: python setup.py register If your name is still free, you can now make your first release but first...
mit
7,873,863,813,639,560,000
26.522388
79
0.713124
false
3.651485
false
false
false
ptphp/PyLib
src/tornado/demos/lihuashu/test/serviceUpload.py
1
1648
#!user/bin/env python # -*- coding: utf8 -*- ''' Created on Jul 11, 2012 @author: joseph ''' import urllib,urllib2 import mimetypes def uploadfile(fields, files): BOUNDARY = '----------267402204411258' CRLF = '\r\n' L = [] for (key, value) in fields: L.append('--' + BOUNDARY) L.appen...
apache-2.0
2,198,703,158,033,846,500
28.981818
104
0.555825
false
3.370143
false
false
false
cylc/cylc
cylc/flow/loggingutil.py
1
9067
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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,...
gpl-3.0
4,419,167,219,824,265,700
36.466942
79
0.618286
false
3.985495
false
false
false
eblade/radiant
radiant/tk.py
1
2650
#!/usr/bin/env python3 try: # Python 3 import tkinter as tk from tkinter import ttk from tkinter import filedialog except ImportError: # Python 2 import Tkinter as tk import ttk import tkFileDialog as filedialog import os class Dialog(tk.Toplevel): def __init__(self, parent, tit...
mit
-5,054,887,378,133,606,000
21.457627
83
0.568679
false
3.879941
false
false
false
LaboratoireMecaniqueLille/crappy
crappy/tool/videoextenso.py
1
12062
# coding: utf-8 from multiprocessing import Process, Pipe import numpy as np from .._global import OptionalModule try: import cv2 except (ModuleNotFoundError, ImportError): cv2 = OptionalModule("opencv-python") try: from skimage.filters import threshold_otsu from skimage.morphology import label from skimage...
gpl-2.0
-2,730,020,175,331,654,700
32.22865
78
0.577019
false
3.224272
false
false
false
wangheda/youtube-8m
youtube-8m-wangheda/all_frame_models/cnn_lstm_memory_multitask_model.py
1
4575
import sys import models import model_utils import math import numpy as np import video_level_models import tensorflow as tf import utils import tensorflow.contrib.slim as slim from tensorflow import flags FLAGS = flags.FLAGS class CnnLstmMemoryMultiTaskModel(models.BaseModel): def cnn(self, model_input,...
apache-2.0
3,650,115,153,585,511,400
38.102564
105
0.609617
false
3.571429
false
false
false
shweta97/pyta
nodes/AsyncFor.py
1
1115
""" AsyncFor astroid node Subclass of For astroid node. This node iterates over async code with a for-loop like syntax. Asynchronous code doesn't wait for an operation to complete, rather the code executes all operations in one go. Only valid in body of an AsyncFunctionDef astroid node. Attributes: - target (...
gpl-3.0
-8,221,801,120,053,697,000
31.794118
80
0.600897
false
3.766892
false
false
false
protonyx/labtronyx-gui
labtronyxgui/widgets/__init__.py
1
1053
import Tkinter as Tk __all__ = ["vw_entry", "vw_info", "vw_plots", "vw_state"] class vw_Base(Tk.Frame): PIXELS_PER_X = 30 PIXELS_PER_Y = 40 def __init__(self, master, units_x=8, units_y=1): Tk.Frame.__init__(self, master, padx=2, pady=2, bd=1) width = units_x * self.PIXELS_PE...
mit
230,870,695,671,665,180
26.025641
61
0.51567
false
3.707746
false
false
false
YeEmrick/learning
stanford-tensorflow/2017/examples/02_lazy_loading.py
1
1199
""" Example to demonstrate how the graph definition gets bloated because of lazy loading Author: Chip Huyen Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research" cs20si.stanford.edu """ import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf ########################################...
apache-2.0
-5,410,750,033,911,517,000
26.906977
71
0.582152
false
3.171958
false
false
false
awagner83/doctools
doctools.py
1
1692
"""Docblock manipulation utilities.""" from pprint import pformat def append_to_docs(fn, text): """Append text to a functions existing docblock.""" if not text: return if fn.__doc__: min_indent = _getindent(fn.__doc__) fn.__doc__ = '%s\n\n%s' % (fn.__doc__, _indent(text, min_inden...
bsd-3-clause
-1,254,345,515,311,567,600
25.857143
73
0.575059
false
3.854214
false
false
false
shomy4/SuperKamp
reports/views.py
1
20515
from django.contrib.auth.decorators import login_required from datetime import datetime from django.shortcuts import render, redirect from reports.forms import ReportChildrenPerMentorAndDestinationForm, ReportChildrenPerSchoolByDestinationAndShiftForm, \ ReportPaymentsByDateAndTypeForm, SumsByDestinationForm, \ ...
gpl-3.0
-6,745,491,547,197,507,000
38.990253
157
0.624275
false
3.36919
false
false
false
mareknetusil/twist
cbc/twist/problem_definitions.py
1
7987
__author__ = "Harish Narayanan" __copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__ __license__ = "GNU GPL Version 3 or any later version" import fenics from cbc.common import CBCProblem from cbc.twist.solution_algorithms_static import StaticMomentumBalanceSolver_U from cbc.twist.soluti...
gpl-3.0
-8,395,993,149,155,302,000
31.336032
83
0.608614
false
4.194853
false
false
false
wellflat/cat-fancier
tools/clipper/clipper.py
1
3809
#!/usr/local/bin/python # -*- coding: utf-8 -*- from flask import Flask, jsonify, g, request, render_template import json import os import re import sqlite3 import time from pprint import pprint app = Flask(__name__) app.config.update( DATABASE = 'db/samples.db', #DATABASE = 'db/catcafe.db', DEBUG = True ...
mit
-6,340,766,683,487,394,000
25.089041
149
0.615647
false
3.41921
false
false
false
ImaginaryLandscape/iscape-jobboard
jobboard/models.py
1
9517
################################################################################ # JobBoard: a simple Django-based job board # Copyright (c) 2009, Imaginary Landscape # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided...
bsd-3-clause
-3,085,676,571,152,319,000
35.745174
81
0.609436
false
4.584297
false
false
false
MadeInHaus/django-social
social/services/facebook.py
1
2384
import requests import logging log = logging.getLogger(__name__) def get_id_from_username(username): url = 'http://graph.facebook.com/{}'.format(username) r = requests.get(url) return r.json()['id'] def get_username_from_id(fb_id): url = 'http://graph.facebook.com/{}'.format(fb_id) r = requests.g...
mit
1,045,508,686,747,079,000
33.057143
97
0.536913
false
3.639695
false
false
false
masschallenge/impact-api
web/impact/impact/v0/api_data/startup_list_data.py
1
2231
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from impact.api_data import APIData from accelerator.models import ProgramStartupStatus class StartupListData(APIData): ALPHA_ASC_ORDER = "AlphaAsc" ALPHA_DSC_ORDER = "AlphaDsc" RANDOM_ORDER = "Random" ORDER_BY_VALUES = [ALPHA_ASC_ORDER, ALPHA_DS...
mit
-3,941,520,739,259,218,000
38.140351
76
0.601076
false
3.820205
false
false
false
jperla/webify
tests/apps/layouts/__init__.py
1
1053
#!/usr/bin/env python from __future__ import with_statement import webify from webify.templates.helpers import html # Layout template @webify.template() def page_layout(p, title, inside): with p(html.html()): with p(html.head()): p(html.title(title)) with p(html.body()): p.s...
mit
65,411,416,033,112,240
24.071429
72
0.643875
false
3.097059
false
false
false
scylladb/scylla-cluster-tests
upgrade_test.py
1
55768
#!/usr/bin/env python # 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 License, or # (at your option) any later version. # # This program is distributed in the hop...
agpl-3.0
-2,831,030,781,541,779,500
53.62096
140
0.623171
false
3.65548
true
false
false
whitehaven/Undulation-Devastation
Undulation-Devastation.py
1
2482
from __future__ import division from random import uniform from pyglet import clock, window from pyglet.gl import * import primitives class Entity(object): def __init__(self, id, size, x, y, rot): self.id = id self.circle = primitives.Circle(x=0, y=0, z=0, width=100, color=(1, 0, 0, 1), stroke=5...
gpl-2.0
-2,792,811,881,816,028,000
22.638095
96
0.556003
false
3.367707
false
false
false
auag92/n2dm
Asap-3.8.4/Projects/NanoparticleMC/resume_amc_vac.py
1
2344
#PBS -l nodes=20:ppn=4:opteron4 #PBS -q verylong #PBS -N amc_n100_conv1 #PBS -m ae import os from montecarlo import SurfaceMonteCarloData from ase.cluster.cubic import FaceCenteredCubic from ase.cluster import data from asap3.MonteCarlo.Metropolis import Metropolis from asap3.MonteCarlo.Moves import SurfaceMove from as...
mit
8,054,333,485,439,922,000
31.109589
108
0.709471
false
3.112882
false
false
false
test-pipeline/orthrus
orthrus/commands.py
1
66101
''' Orthrus commands implementation ''' import os import sys import shutil import re import subprocess import random import glob import webbrowser import tarfile import time import json import string from orthrusutils import orthrusutils as util from builder import builder as b from job import job as j from spectrum.af...
gpl-3.0
6,888,073,941,601,113,000
44.650552
128
0.535408
false
3.874392
true
false
false
karih/Flask-HTTPAuth
setup.py
1
1090
""" Flask-HTTPAuth -------------- Basic and Digest HTTP authentication for Flask routes. """ from setuptools import setup setup( name='Flask-HTTPAuth', version='3.0.1', url='http://github.com/miguelgrinberg/flask-httpauth/', license='MIT', author='Miguel Grinberg', author_email='miguelgrinber...
mit
-3,904,473,348,168,233,500
27.684211
72
0.620183
false
4.176245
false
false
false
hhanh/column-generation-framework
examples/survivable-net/report_ini.py
1
2799
import os import ConfigParser import glob from prettytable import PrettyTable import re inputdir = "ini/N*s[2,3,4,5]*.ini" inputdir = "ini/NSF*s1*.ini" #inputdir = "ini/24NET-s1*.ini" #inputdir = "ini/E*s1*.ini" #inputdir = "ini/24NET-s*e90*.ini" #inputdir = "ini/24NET-hs*e120*.ini" def atoi(text): retur...
mit
3,862,890,060,105,415,700
31.172414
142
0.586281
false
2.918665
true
false
false
google/grr
colab/grr_colab/representer.py
1
10790
#!/usr/bin/env python """Module that contains representers for values returned by Python API.""" import ipaddress import os from typing import Dict, Text, List, Optional, Any, Union import humanize import IPython from IPython.lib import pretty from grr_colab import convert from grr_colab._textify import client from g...
apache-2.0
1,675,262,207,874,269,000
27.394737
80
0.626599
false
3.510085
false
false
false
charlesthk/python-mailchimp
mailchimp3/entities/storecartlines.py
3
5203
# coding=utf-8 """ The E-commerce Store Cart Lines endpoint API endpoint Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/carts/lines/ Schema: https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Carts/Lines/Instance.json """ from __future__ import unicode_literals fro...
mit
-7,206,840,209,417,515,000
34.868966
118
0.578158
false
3.584425
false
false
false
bnewbold/diffoscope
diffoscope/comparators/__init__.py
1
6526
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2014-2015 Jérémy Bobbio <lunar@debian.org> # © 2015 Helmut Grohne <helmut@subdivi.de> # # diffoscope is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
gpl-3.0
-3,211,255,412,202,578,000
34.639344
93
0.702239
false
3.439873
false
false
false
redhat-openstack/trove
trove/tests/unittests/guestagent/test_couchbase_manager.py
1
6387
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-17,181,326,834,153,800
36.350877
78
0.616878
false
4.188197
true
false
false
magestik/TuxStereoViewer
src/lib_freeview.py
1
2380
#!/usr/bin/python # -*- coding:utf-8 -*- import functions import Image import math class Simple: "FreeView support class" def __init__(self): self.vergence = 0 # Horizontal separation self.vsep = 0 # Vertical separation self.left = self.right = '' self.height = self.width = 0 def __del__(self): ...
gpl-3.0
5,778,927,667,350,664,000
33.492754
132
0.659244
false
2.726231
false
false
false
NCIP/python-api
pycabio/trunk/cabig/cabio/CaBioWSQueryService_server.py
1
17682
#L # Copyright SAIC # # Distributed under the OSI-approved BSD 3-Clause License. # See http://ncip.github.com/python-api/LICENSE.txt for details. #L ################################################## # file: CaBioWSQueryService_server.py # # skeleton generated by "ZSI.generate.wsdl2dispatch.ServiceModuleWriter" # ...
bsd-3-clause
-7,140,755,335,672,836,000
53.239264
555
0.723561
false
3.662386
false
false
false
zephyru5/pythonchallenge
18/18.py
1
1079
#!/bin/bash/python #coding=utf-8 ''' #first try start from PIL import Image im=Image.open('balloons.jpg','wb') w,h=im.size diff=Image.new(im.mode,(w/2,h),0) for i in range(w/2): for j in range(h): diff.putpixel((i,j),tuple([x[0]-x[1] for x in zip(im.getpixel((i,j)),im.getpixel((i+w//2,j)))])) diff.s...
mit
6,806,134,189,498,601,000
22.977778
104
0.522706
false
2.657635
false
false
false
egustafson/sandbox
Python/sqlalchemy-core/table.py
1
1551
# -*- coding: utf-8 -*- # from sqlalchemy import create_engine from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.sql import select, func metadata = MetaData() users = Table('users', metadata, Column('id', Integer, primary_key=True), Column('usernam...
apache-2.0
5,134,627,254,167,216,000
24.85
76
0.617021
false
3.379085
false
false
false
dragondjf/musicplayer
gui/mainwindow/simplewindow.py
1
1875
#!/usr/bin/python # -*- coding: utf-8 -*- from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from gui.menus import SettingsMenu from gui.dwidgets import DMainFrame from gui.functionpages import SimpleTitleBar, SimpleMusicBottomBar from gui.utils import collectView, setSkinForApp from ...
gpl-2.0
-500,907,304,614,135,500
25.408451
80
0.690667
false
3.964059
false
false
false
BovineJoni/WikidumpParser
article.py
1
1662
# -*- coding: utf-8 -*- # WikidumpParser, Copyright 2014 Daniel Schneider. # schneider.dnl(at)gmail.com # 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 # (a...
gpl-3.0
-2,410,109,321,182,158,300
34.382979
81
0.634777
false
4.19697
false
false
false
liw/daos
src/tests/ftest/pool/create_capacity_test.py
1
2623
#!/usr/bin/python3 """ (C) Copyright 2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import time from pool_test_base import PoolTestBase from server_utils import ServerFailed class PoolCreateTests(PoolTestBase): # pylint: disable=too-many-ancestors,too-few-public-methods """Pool cre...
apache-2.0
-8,870,181,680,351,674,000
34.445946
80
0.614945
false
4.023006
true
false
false
frmdstryr/enamlx
examples/occ_viewer/occ/algo.py
1
12047
''' Created on Sep 28, 2016 @author: jrm ''' from atom.api import ( Instance, ForwardInstance, Typed, ForwardTyped, ContainerList, Enum, Float, Bool, Coerced, observe ) from enaml.core.declarative import d_ from .shape import ProxyShape, Shape def WireFactory(): #: Deferred import of wire from .draw imp...
mit
-3,666,099,048,140,562,000
28.748148
139
0.650618
false
4.200488
false
false
false
lluxury/pcc_exercise
learning_logs/learning_logs/views.py
1
3388
from django.shortcuts import render from django.http import HttpResponseRedirect, Http404 #from django.core.ulresolvers import reverse from django.core.urlresolvers import reverse #form django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required from .models import To...
mit
-28,531,902,864,089,668
31.701031
89
0.648802
false
3.280248
false
false
false
mifads/pyscripts
emxemis/mkFFrescale.py
1
1712
#!/usr/bin/env python3 """ mkFFscale.py simply.... emissions given in eg moles/day or kg/hr, since we don't need to allow for grid area. UNFINISHED!! """ import argparse import numpy as np import netCDF4 as cdf import os import sys #------------------ arguments ----------------------------------------------...
gpl-3.0
4,669,483,891,239,769,000
26.612903
106
0.643692
false
2.797386
false
false
false