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
liZe/Mailanie
mailanie/folder.py
1
3506
# Mailanie - Cute Mailbox Explorator # Copyright 2009 Guillaume Ayoub <guillaume.ayoub@kozea.fr> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation # Mailanie is distributed in the hope ...
gpl-3.0
5,270,585,255,919,672,000
31.766355
83
0.60097
false
3.856986
false
false
false
flywalk/arcoin-abe
tools/namecoin_dump.py
2
5192
#!/usr/bin/env python # Dump the Namecoin name data to standard output. # Copyright(C) 2011 by John Tobey <John.Tobey@gmail.com> # 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 v...
agpl-3.0
-8,135,155,456,383,940,000
34.806897
79
0.576656
false
3.666667
false
false
false
cocrawler/cocrawler
tests/warc/test-warc.py
1
2012
import hashlib import socket import unittest.mock as mock from cocrawler.warc import CCWARCWriter from cocrawler.urls import URL serials = {} def get_serial(name): serial = serials.get(name, 0) + 1 serials[name] = serial return '{:05}'.format(serial) prefix = 'CC-TEST-01' subprefix = 'FOO' max_size = ...
apache-2.0
7,130,431,656,061,292,000
33.689655
106
0.66004
false
3.062405
false
false
false
guoxu3/oms_backend
oms/handlers/check/check_user_input.py
1
1202
#!/usr/bin/env python # -*- coding:utf-8 -*- from lib import verify def check_user_input(user_dict): """ check user input info format @parm user_dict: Dictionary, an user info dictionary @return ok: Boolean , info check pass or not @return info: String, message return to user ...
mit
2,033,750,513,010,724,600
28.317073
87
0.600666
false
3.889968
false
false
false
jourzero/AdvisoryEmail
vulnerabilities.py
1
18983
#!/usr/bin/python #-------------------------------------------------------------------------------------------------- # vulnerabilities.py: Python module used by CveAdvisory.py #-------------------------------------------------------------------------------------------------- #import sqlite3 as lite #from vfeed import ...
mit
-6,675,970,663,002,118,000
37.661914
798
0.597166
false
3.172823
false
false
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_vpn_gateways_operations.py
1
32616
# 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 may ...
mit
4,182,380,463,459,013,600
47.608048
188
0.63429
false
4.247428
true
false
false
kata198/indexedredis
IndexedRedis/fields/compressed.py
1
6418
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.compressed - Some types and objects related to compressed fields. Use in place of IRField ( in FIELDS array to activate functionality ) # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab ...
lgpl-2.1
-1,738,514,993,853,213,700
34.458564
387
0.718916
false
3.316796
false
false
false
pjuu/pjuu
scripts/key_migrate_04_to_05.py
1
5466
# -*- coding: utf8 -*- """Migrate the Redis key names from version before and including 0.4 to the new naming conversion used by 0.5. The only changes are that keys related are key spaced using Redis hashtags. For example; user:1 would become {user:1} user:1:followers would become {user:1}:followers post...
agpl-3.0
4,722,508,495,406,022,000
35.198675
79
0.43981
false
4.207852
false
false
false
rubenvillegas/iclr2017mcnet
src/BasicConvLSTMCell.py
1
4385
""" Convolutional LSTM cell implementation from https://github.com/loliverhennigh """ import tensorflow as tf class BasicConvLSTMCell(object): """Basic Conv LSTM recurrent network cell. """ def __init__(self, shape, filter_size, num_features, forget_bias=1.0, input_size=None, state_is_tuple=False...
mit
6,455,835,358,366,756,000
37.80531
80
0.630331
false
3.559253
false
false
false
deliarusu/text-annotation
annotation/annotate.py
1
2700
import numpy as np MEDIAN = 'median' AVERAGE = 'average' def annotate_token(current_token_id, window_tokens, \ token_concepts, relatedness, rel_concepts): ''' Annotate the tokens in a given token window. :param current_token_id: token to be annotated :param window_tok...
apache-2.0
4,469,924,775,189,018,600
29.693182
76
0.542593
false
4.347826
false
false
false
tcezard/RADmapper
lib/utils/utils_commands.py
1
6623
''' Created on 8 Apr 2010 @author: tcezard ''' from threading import Thread import logging from subprocess import Popen, PIPE import os ################################### # Command utilities # ################################### class Output_Logger(Thread): """Close the stdin and log the s...
mit
-2,029,656,377,923,653,000
32.12
130
0.608939
false
3.651047
false
false
false
vectorijk/servo
components/script/dom/bindings/codegen/CodegenRust.py
1
230667
# 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/. # Common codegen classes. import operator import re import string import textwrap import functools from WebIDL import ...
mpl-2.0
-6,487,346,425,059,309,000
37.748026
117
0.571018
false
4.216639
false
false
false
jbsouvestre/challengr
Challengr/apps/player/models.py
1
1473
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.db import IntegrityError from django.db.utils import OperationalError # Create your models here. PLAYER_TYPES = (("program", "program"), ("user", "user")) def program_...
mit
5,291,961,127,999,379,000
29.061224
91
0.632043
false
4.232759
false
false
false
artisavotins/ccy
ccy/dates/converters.py
1
3457
import time from datetime import datetime, date from dateutil.parser import parse as dateFromString __all__ = ['todate', 'date2timestamp', 'timestamp2date', 'yyyymmdd2date', 'date2yyyymmdd', 'juldate2date', 'date2juldate', 'dateFromString',...
bsd-3-clause
97,443,634,314,731,100
25.79845
72
0.544981
false
3.681576
false
false
false
deo1/deo1
Legacy/MitAiCourse/lab0/algebra.py
1
6287
# Section 3: Algebraic simplification # This code implements a simple computer algebra system, which takes in an # expression made of nested sums and products, and simplifies it into a # single sum of products. The goal is described in more detail in the # problem set writeup. # Much of this code is already implement...
mit
6,333,654,353,752,018,000
34.519774
83
0.649276
false
4.236523
false
false
false
mobarski/sandbox
kv/kvm_x1.py
1
2033
import marshal from time import time class KVM: def __init__(self,data=None): self.data = data or {} ### WRITE ### def set(self,k,v): self.data[k] = v def __setitem__(self,k,v): self.set(k,v) def __delitem__(self,k): if k in self.data: del self.data[k] def update(self,items): self.data.update(it...
mit
-8,253,145,672,350,263,000
15.801653
39
0.598131
false
2.350289
false
false
false
cmjatai/cmj
sapl/lexml/views.py
1
1094
from django.http import HttpResponse from django.shortcuts import render from sapl.crud.base import CrudAux, Crud from sapl.lexml.OAIServer import OAIServerFactory, get_config from sapl.rules import RP_DETAIL, RP_LIST from .models import LexmlProvedor, LexmlPublicador LexmlPublicadorCrud = CrudAux.build(LexmlPublica...
gpl-3.0
-3,706,877,878,139,658,000
30.257143
88
0.731261
false
3.107955
false
false
false
hickeroar/project-euler
020/solution026-2.py
1
1169
""" See solution026-1.py for problem explanation. References: http://mathworld.wolfram.com/DecimalExpansion.html http://mathworld.wolfram.com/MultiplicativeOrder.html Rules (from references): 1) The number of digits in the repeating portion of the decimal expansion of a rational number can also be found d...
mit
7,295,006,581,488,347,000
40.785714
175
0.678358
false
3.72293
false
false
false
fungibit/chainscan
chainscan/utils.py
1
5364
""" Miscellaneous convenience functions for iterating over blocks, txs, etc. """ import time import threading from .scan import LongestChainBlockIterator, TxIterator from .track import TrackedSpendingTxIterator, UtxoSet from .blockchain import BlockChainIterator #####################################################...
mit
-557,028,056,106,505,150
35.489796
106
0.617823
false
4.411184
false
false
false
love436053/repos
python/wxpython/grid_create.py
1
9662
#!/usr/bin/python # coding:utf-8 import wx import os import sys import wx.grid class GridWindow(wx.Frame): def __init__(self, parent, title): ''' wx.DEFAULT_FRAME_STYLE : 这是每个窗口的缺省风格,包含标题、可调节大小的边框,最大最小化按钮、关闭按钮和系统菜单。 wx.CAPTION : 在框架上增加一个标题栏,它显示该框架的标题属性。 wx.CLOSE_BO...
gpl-3.0
6,086,107,053,101,528,000
42.286486
144
0.602522
false
2.303797
false
false
false
gkc1000/pyscf
pyscf/nao/m_xjl.py
1
1736
# Copyright 2014-2018 The PySCF Developers. 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 appl...
apache-2.0
-5,040,592,721,812,872,000
25.30303
74
0.585253
false
2.598802
false
false
false
Aalto-LeTech/a-plus
threshold/models.py
1
4854
from django.db import models from django.utils.translation import ugettext_lazy as _ from course.models import ( CourseInstance, CourseModule, LearningObjectCategory, ) from exercise.cache.hierarchy import NoSuchContent from exercise.models import BaseExercise class Threshold(models.Model): """ C...
gpl-3.0
-1,269,372,744,768,430,000
35.496241
85
0.55686
false
4.314667
false
false
false
baliscope/periapi
periapi/broadcast.py
1
6670
#!/usr/bin/env python3 """ Periscope API for the masses """ import os from dateutil.parser import parse as dt_parse class BroadcastDownloadInfo: """Contains information about the broadcast's download but not about the broadcast itself""" def __init__(self): self.dl_info = dict() self.dl_info...
mit
-5,962,531,069,159,558,000
32.019802
99
0.609745
false
4.232234
false
false
false
AmilaViduranga/FDDS
index.py
1
7138
import sys, os from PyQt5.QtWidgets import QApplication, QWidget,QFileDialog, QPushButton, QLabel, QPlainTextEdit from PyQt5.QtGui import QPixmap import cv2 # # -- import src packages -- # from src.VideoController import VideoController from src.CharacterController import CharacterController from src.EmblemController ...
mit
-6,152,628,030,452,315,000
35.989637
129
0.620902
false
4.154831
false
false
false
tonygalmiche/is_pg_partner
is_pg_partner.py
1
4611
# -*- coding: utf-8 -*- from datetime import datetime, timedelta import time from openerp import pooler from openerp.osv import fields, osv from openerp.tools.translate import _ class is_secteur_activite(osv.osv): _name = 'is.secteur.activite' _description = u"Secteurs d'activités" _columns = { ...
mit
-8,098,809,116,232,233,000
32.532847
148
0.625599
false
3.07291
false
false
false
alexgorban/models
research/slim/nets/mobilenet_v1_test.py
1
27151
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-4,490,367,478,805,748,700
49.560521
80
0.584214
false
3.440755
true
false
false
weissercn/MLTools
Dalitz/gaussian_samples/double_gauss/generate_gaussian_samples.py
1
2009
#!/usr/bin/env python #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # # Name: generate_gaussian_samples.py # # Author: Constantin Weisser (weisser@mit.edu) # # Purpose: This is a python script to write a file containing 10000 data points # sampled from a 2D Gaussian # #-#-...
mit
-981,662,563,116,352,500
25.090909
234
0.643106
false
2.609091
false
false
false
gczuczy/aegir
aegir-api/lib/aegir/zmq.py
1
1426
''' ZMQ handling, takes care of the per-flask-instance initialization, and provides a highlevel communication API for the app ''' import zmq import json from pprint import pprint import aegir.config _ctx = None _socket_pr = None def init(app): app.before_first_request(instance_init) pass def instance_init(...
bsd-3-clause
8,179,812,162,841,017,000
22.766667
82
0.624123
false
3.363208
false
false
false
bhedayat/Neural-Nets
lstm.py
1
2769
# coding: utf-8 # In[1]: from __future__ import print_function import numpy as np import theano import theano.tensor as T import lasagne from process import load_data #x = T.tensor4() N_HIDDEN = 100 LEARNING_RATE = .001 GRAD_CLIP = 100 NUM_EPOCHS = 20 BATCH_SIZE = 200 vocab_size = 9 inp_t,inp_v,output_t,o...
apache-2.0
-3,341,208,781,151,528,000
25.625
154
0.63597
false
2.714706
false
false
false
DezerteR/PMK-Blender-Scripts
PMK_PBRMaterialProperties.py
1
2250
import os import bpy from bpy.props import * bl_info = { "name": "PMK PBR Materials", "author": "Karol Wajs", "version": (0, 0, 1), "blender": (2, 7, 6), "location": "Viewport", "description": "Adds panel in material properties that allows editing material PBR properties.", "category": "Mat...
mit
-4,388,128,225,458,695,000
39.909091
105
0.659111
false
3.094911
false
false
false
jpetto/olympia
src/olympia/api/views_drf.py
1
17761
""" This view is a port of the views.py file (using Piston) to DRF. It is a work in progress that is supposed to replace the views.py completely. """ import urllib from datetime import date, timedelta from django.conf import settings from django.core.urlresolvers import reverse from django.http import Http404 import ...
bsd-3-clause
-3,295,860,933,266,782,700
36.234801
108
0.595293
false
4.163385
false
false
false
GuillaumeDD/AdventOfCode2016
day19.py
1
3977
import io # --- Day 19: An Elephant Named Joseph --- # # The Elves contact you over a highly secure emergency channel. Back at # the North Pole, the Elves are busy misunderstanding White Elephant # parties. # # Each Elf brings a present. They all sit in a circle, numbered starting # with position 1. Then, starting w...
gpl-3.0
2,337,229,793,990,142,000
27.611511
94
0.602716
false
3.042846
false
false
false
e-democracy/edem.group.about
setup.py
1
1472
# -*- coding=utf-8 -*- import os from setuptools import setup, find_packages from version import get_version version = get_version() setup(name='edem.group.about', version=version, description="Customization of the GroupServer About Group box", long_description=open("README.txt").read() + "\n" + ...
gpl-3.0
-9,093,244,308,163,042,000
31
83
0.60462
false
3.863517
false
false
false
uetke/experimentor
experimentor/models/_session.py
1
5062
""" UUTrack.Model._session ====================== Best place to store variables that can be shared between different classes. It defines an object that inherits from QObject, mainly to be able to emit signals. It overwrites the :meth:`~UUTrack.Model._session.__setattr__` for functionality, as well as t...
mit
9,198,025,318,882,467,000
32.973154
290
0.513433
false
4.039904
false
false
false
zepto/webbrowser
webbrowser/browser_nodbus.py
1
9685
# This file is part of browser, and contains the BrowserTab class for a tab # that does not use dbus. # # Copyright (C) 2009-2010 Josiah Gordon <josiahg@gmail.com> # # browser 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 Soft...
gpl-3.0
6,196,327,851,353,816,000
32.863636
133
0.617966
false
3.70505
false
false
false
log2timeline/dftimewolf
dftimewolf/lib/collectors/grr_hunt.py
1
13256
# -*- coding: utf-8 -*- """Definition of modules for collecting data from GRR Hunts.""" import os import tempfile import zipfile import yaml from grr_response_proto import flows_pb2 as grr_flows from dftimewolf.lib.collectors import grr_base from dftimewolf.lib.containers import containers from dftimewolf.lib.module...
apache-2.0
-3,696,852,360,777,645,000
34.538874
80
0.662945
false
3.790678
false
false
false
zrzka/blackmamba
blackmamba/script/drag_and_drop.py
1
20784
#!python3 import os import ui from objc_util import ns, ObjCClass, ObjCInstance, ObjCBlock, create_objc_class, on_main_thread from blackmamba.log import error, issue import blackmamba.util.runtime as runtime import editor import ctypes import zipfile from blackmamba.uikit.keyboard import ( register_key_event_handl...
mit
5,802,085,496,307,951,000
29.385965
116
0.598201
false
3.821993
false
false
false
helixyte/everest
everest/views/static.py
1
1208
""" Static view. This file is part of the everest project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Jun 22, 2010. """ from pyramid.static import static_view from pyramid.threadlocal import get_current_registry __docformat__ = 'reStructuredText en' __all__ = ['public_vie...
mit
4,380,250,419,365,776,000
29.2
78
0.615894
false
3.871795
false
false
false
Birion/python-ffdl
pyffdl/sites/ao3.py
1
4804
import re from typing import List, Optional, Tuple, Union import attr import pendulum # type: ignore from bs4 import BeautifulSoup # type: ignore from bs4.element import Tag # type: ignore from furl import furl # type: ignore from requests import Response from pyffdl.sites.story import Story from pyffdl.utilities...
mit
5,863,220,613,961,227,000
35.671756
92
0.567444
false
3.924837
false
false
false
JimmyMow/OpenBazaar-Server
openbazaard.py
1
7846
__author__ = 'chris' import sys import argparse import platform from twisted.internet import reactor from twisted.python import log, logfile from twisted.web.server import Site from twisted.web.static import File from daemon import Daemon import stun import requests from autobahn.twisted.websocket import listenWS imp...
mit
8,430,160,181,667,933,000
36.009434
115
0.596865
false
3.77393
true
false
false
Kilo59/xml_cowboy
csv_joiner/misc/csv_j2.py
1
1949
# csv_j2.py # Protoype the joining of 2 different CSV files based on a common item. import csv import collections import pprint ############ # Functions ############ # TODO: Check for key_field # TODO: Automaticly parse CSV files that have the key_field # TODO: Add key_name field name as key_name : key_field def re...
mit
-2,103,915,480,704,504,800
23.3625
98
0.62391
false
3.216172
false
false
false
Schevo/schevo
schevo/script/db_repair.py
1
2665
"""Repair database command.""" # Copyright (c) 2001-2009 ElevenCraft Inc. # See LICENSE for details. import os from schevo.label import label import schevo.database import schevo.repair from schevo.script.command import Command from schevo.script import opt usage = """\ schevo db repair [options] URL URL: URL of...
mit
-4,536,812,584,036,547,000
26.474227
72
0.546717
false
4.243631
false
false
false
Nolski/airmozilla
airmozilla/new/views.py
1
26462
import json import os from cStringIO import StringIO from xml.parsers.expat import ExpatError from django import http from django.shortcuts import render, get_object_or_404, redirect from django.db import transaction from django.conf import settings from django.utils import timezone from django.db.models import Count ...
bsd-3-clause
-1,090,913,362,043,321,500
31.114078
79
0.581249
false
4.172501
false
false
false
flightgong/scikit-learn
sklearn/utils/validation.py
1
12187
"""Utilities for input validation""" # Authors: Olivier Grisel # Gael Varoquaux # Andreas Mueller # Lars Buitinck # Alexandre Gramfort # Nicolas Tresegnie # License: BSD 3 clause import warnings import numbers import numpy as np import scipy.sparse as sp from ..externals ...
bsd-3-clause
-8,586,548,242,897,285,000
34.530612
80
0.609912
false
3.991811
false
false
false
nbeaver/numpy
numpy/core/tests/test_umath.py
1
70895
from __future__ import division, absolute_import, print_function import sys import platform import warnings from numpy.testing.utils import _gen_alignment_data import numpy.core.umath as ncu import numpy as np from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert...
bsd-3-clause
-5,292,647,673,291,529,000
35.07888
135
0.521052
false
3.052398
true
false
false
QISKit/qiskit-sdk-py
docs/conf.py
1
4087
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
166,957,794,955,868,640
33.897436
80
0.68577
false
3.826617
false
false
false
moiseslorap/RIT
Computer Science 1/Labs/lab8/main.py
1
3396
from rit_lib import * from train import * from trainCar import * from Location import * from map import * from mapCursor import * def processCommand(myTrain, myMap, args): """ This function processes the commands inputed. :param myTrain: the train created :param myMap: the map created ...
mit
7,737,047,427,435,983,000
34.12766
112
0.553887
false
3.916955
false
false
false
ndm25/notifyable
src/renderers/github.py
1
1311
from flask import Blueprint from models import db, GithubRepo, GithubRepoEvent import json gh_renderer = Blueprint('github', __name__) @gh_renderer.route('/github/<int:repo_id>') def get_gh_entry(repo_id): entry = db.session.query(GithubRepoEvent)\ .filter_by(repo_id = repo_id)\ .order_by(...
mit
-5,153,784,212,065,753,000
35.416667
86
0.487414
false
3.682584
false
false
false
Tsumiki-Chan/Neko-Chan
commands/massban.py
1
2009
from functions import groups,search,logger,config import re import discord import pprint DESC="Ban many members at once with id's" USAGE="massban [list of id's (separated with space or new line)]" async def init(bot): chat=bot.message.channel try: if len(bot.args)>0: uid = ' '.join(bot.arg...
gpl-3.0
1,216,288,242,205,326,800
41.744681
162
0.512195
false
4.405702
false
false
false
lukas2511/FlederSchranke
3g/checkweb.py
1
1274
import urllib2 import os import time import datetime delay = 180 # seconds => 3 minutes max_fails = 4 # * 3 minutes => 12 minutes max_hard_fails = 960 # * 3 minutes => 2 days check_url = "http://pass.telekom.de/home?continue=true" second_check_url = "http://test.kurz.pw/test.html" # just in case pass.telekom.de is do...
gpl-3.0
7,380,309,444,456,692,000
22.163636
92
0.594192
false
3.352632
false
false
false
alextricity25/parse_apache_configs
parse_apache_configs/test/test_get_apache_config.py
1
1281
from os import listdir from os.path import isfile, join import unittest from parse_apache_configs import parse_config import pprint class testGetApacheConfig(unittest.TestCase): #print "ENTERING TEST_PARSE_CONFIG" + "-"*8 def test_get_apache_config(self): test_files = [ f for f in listdir("./test_conf...
apache-2.0
-7,637,990,461,558,620,000
44.75
108
0.608899
false
3.670487
true
false
false
telefonicaid/fiware-orion
scripts/monit_log_processing.py
1
3921
#!/usr/bin/env python2 # -*- coding: latin-1 -*- # Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by t...
agpl-3.0
2,232,152,707,891,156,000
39.010204
152
0.628921
false
3.748566
false
false
false
clu8/2048
app.py
1
1043
from flask import Flask from flask import render_template from flask import Response from flask import request import time import random import json import sys import play app = Flask(__name__) record = [] last_score = 0 @app.route("/") def display(): return render_template('index.html') @app.route("/move", methods...
gpl-2.0
-2,256,614,903,028,836,600
19.470588
75
0.652924
false
2.98
false
false
false
ajenhl/django-tmapi
tmapi/models/typed.py
1
2022
# Copyright 2011 Jamie Norrish (jamie@artefact.org.nz) # # 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
-1,128,230,644,496,320,600
32.7
76
0.66815
false
4.151951
false
false
false
ericmok/eri53
learn/svm.py
1
8701
#!/usr/local/bin/ python from ctypes import * from ctypes.util import find_library import sys import os # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': li...
unlicense
-3,970,419,336,261,983,700
28.900344
122
0.636593
false
2.645485
false
false
false
ludoo/wpkit
attic/wpfrontman/wp_frontman/templatetags/wpf_tags.py
1
4333
# encoding: utf8 import re from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from wp_frontman.lib.utils import previous_next register = template.Library() widont_re = re.compile(r'''(?<!>)\s+(?!<)''', re.U|re.M|re.S) @register.simple...
bsd-3-clause
-4,530,859,104,753,082,400
33.388889
138
0.567967
false
3.738568
false
false
false
mdtux89/amr-eager
buftoken.py
1
1140
#!/usr/bin/env python #coding=utf-8 ''' Definition of BufToken class. It represents a token in the buffer of the transition system. MWEs are stored in a single token (taken care during preprocessing). 'nodes' is the list of objects of class Nodes that this token is aligned to; it contains 'None' if alignments are not ...
bsd-2-clause
-1,288,537,625,211,057,000
34.625
171
0.634211
false
3.275862
false
false
false
pmla/hyperspherical-coverings
main.py
1
4411
from __future__ import print_function import os import sys import struct import numpy as np import argparse import quat_utils import generators def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def read_points(path): s = open(path, 'rb').read() if len(s) % 20 != 0: raise Exce...
mit
2,627,106,988,501,275,000
31.19708
121
0.622081
false
3.462323
false
false
false
mabdrabo/GEWB
GEWB_app/views.py
1
2736
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, redirect, render from django.template import RequestContext from django.utils import simplejson from collections import OrderedDict from GEWB_app.models import * # Create your views here. def master(request): ...
mit
-1,386,273,158,595,536,600
43.852459
121
0.666301
false
4.145455
false
false
false
pinkdawn/ssh-sync
lib/cache.py
1
1168
import os, tempfile, pickle from copy import deepcopy class ModifyCache(): def __init__(self, fname): self.f = fname self.cache = ModifyCache.load(self.f) self._cache = deepcopy(self.cache) @staticmethod def load(fname): try: f = os.path.join(tempfile.gettempdi...
mit
5,320,713,003,720,767,000
23.354167
59
0.544521
false
3.906355
false
false
false
emilydolson/forestcat
pyrobot/plugins/brains/FSMPushPop.py
2
2783
# A FSM sequencing sample # D.S. Blank # This Pyrobot example will go (roughly) in a square # This example has two states, "edge" that goes straight, and "turn" # that turns 90 degrees to the left. It bounces back and forth between # these two states. # Note how it uses onActivate() to remember where it was when it ...
agpl-3.0
-2,256,426,161,763,091,700
30.988506
70
0.623787
false
3.470075
false
false
false
mpetazzoni/ptftpd
ptftplib/proto.py
1
16003
# coding=utf-8 # Author: Maxime Petazzoni # maxime.petazzoni@bulix.org # # This file is part of pTFTPd. # # pTFTPd 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 Licens...
gpl-3.0
-2,560,477,084,450,712,600
29.137476
78
0.567519
false
3.776074
false
false
false
wangsheng1001/incubator-singa
examples/cifar10/download_data.py
1
2286
#!/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 # "...
apache-2.0
-5,637,095,100,357,602,000
31.657143
78
0.663605
false
3.605678
false
false
false
krsarmiento/curavi-applet
project/files/applet.py
1
8872
#!/usr/bin/python2 # This file is part of Curavi Applet. # Copyright (C) 2011 Kevin Rafael Sarmiento Mendoza # Curavi Applet 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...
gpl-3.0
-1,330,847,291,603,002,000
33.792157
157
0.518823
false
3.698208
false
false
false
intel-hpdd/intel-manager-for-lustre
chroma_core/services/queue.py
1
3738
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. """Chroma services may subscribe to named queues using this module. The `ServiceQueue` class is a wrapper around an AMQP queue.""" import threading from chroma_core....
mit
4,780,016,716,756,602,000
32.675676
109
0.608882
false
4.306452
false
false
false
eduherraiz/foowill
app/migrations/0007_auto__add_field_customuser_photo__chg_field_tweet_pub_date.py
1
7045
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CustomUser.photo' db.add_column('app_customuser', 'photo', self.gf('dj...
mit
-5,812,860,092,917,307,000
67.407767
182
0.555287
false
3.733439
false
false
false
Clever/ebs-snapshots
setup.py
1
1087
#!/usr/bin/env python import os import sys from setuptools import setup, find_packages from pip.req import parse_requirements import version import pkg_resources here = os.path.abspath(os.path.dirname(__file__)) try: with open(os.path.join(here, '../README.md')) as f: README = f.read() with open(os.path.join(...
apache-2.0
8,049,202,458,838,889,000
28.378378
75
0.660534
false
3.244776
false
false
false
theJenix/ino
ino/commands/build.py
1
18182
# -*- coding: utf-8; -*- import re import os.path import inspect import subprocess import platform import jinja2 import shlex from jinja2.runtime import StrictUndefined import ino.filters from ino.commands.base import Command from ino.environment import Version from ino.filters import colorize from ino.utils import...
mit
-2,527,513,253,944,615,400
41.680751
120
0.534045
false
4.10707
false
false
false
techdragon/nikola
nikola/plugins/task/indexes.py
1
13960
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights t...
mit
5,615,433,160,921,696,000
48.676157
191
0.510925
false
4.527733
true
false
false
rvianello/rdkit
rdkit/Chem/Pharm3D/EmbedLib.py
4
40110
# # Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # from __future__ import print_f...
bsd-3-clause
-4,721,125,467,867,855,000
30.483516
99
0.611618
false
3.067686
false
false
false
samluescher/django-user-profiles
user_profiles/managers.py
1
2383
""" django-user-profiles includes a few model managers for commonly used tasks, for instance to retrieve all objects created by a specific user. """ from user_profiles.middleware import CurrentUserMiddleware from django.db import models class ByUserManager(models.Manager): """ A manager for accessing all obj...
bsd-3-clause
8,584,654,940,002,204,000
33.042857
93
0.663449
false
4.26297
false
false
false
ericgarig/runner_tracker
db_repository/versions/025_migration.py
1
1386
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() athlete = Table('athlete', post_meta, Column('id', Integer, primary_key=True, nullable=False), Column('name_first', String(length=64)), Column('name_last', String(length=64)), ...
mit
-5,500,755,886,849,022,000
32.804878
68
0.676768
false
3.618799
false
false
false
CSC-IT-Center-for-Science/grumpy-inspect
grumpy_inspect/tasks.py
1
4776
import datetime import logging import ldap3 from celery import Celery from flask import render_template from flask.ext.mail import Message from grumpy_inspect.app import app as flask_app from grumpy_inspect.connectors import process_connectors from grumpy_inspect.models import db, VirtualMachine, Notification from g...
mit
-1,315,231,969,751,596,800
38.8
94
0.623534
false
4.291105
true
false
false
qTipTip/Python-Fractal-Coloring
src/fractal_visualizer/fractal_vis.py
1
1533
""" This script reads one of the .dat files generated by the fractal generator, iterates over each point in the complex grid and assigns each complex point a color based on a color_function and a color_palette. """ from PIL import Image import sys sys.path.append('../color_functions/') from color_func import ColorFunc...
mit
-376,647,344,606,233,540
41.583333
92
0.674494
false
3.303879
false
false
false
systers/vms
vms/pom/pages/jobSearchPage.py
1
1959
# Django from pom.pages.basePage import BasePage # local Django from pom.locators.jobSearchPageLocators import JobSearchPageLocators from pom.pages.authenticationPage import AuthenticationPage from pom.pageUrls import PageUrls class JobSearchPage(BasePage): job_search_page = PageUrls.job_list_page def __in...
gpl-2.0
-8,279,148,092,140,151,000
32.775862
73
0.700357
false
3.389273
false
false
false
robotenique/mlAlgorithms
supervised/logRegression/ex2_reg.py
1
2841
# Logistic Regression from matplotlib import use use('TkAgg') import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize import pandas as pd from ml import mapFeature, plotData, plotDecisionBoundary from matplotlib.pyplot import show from costFunctionReg import costFunctionReg from gradie...
unlicense
7,527,500,478,585,976,000
23.704348
77
0.680042
false
3.447816
false
false
false
nadako/pyrogue
creatures.py
1
23981
"creatures.py - Pyro creatures" from util import * import items import dungeons import astar class Bite(items.MeleeAttackType): name = "bite" verbs = lang.verbs_bite # no damage, hit, crit verbs_sp = lang.verbs_bite_2p damage = "1d4" class Claw(items.MeleeAttackType): name = "claw" ve...
mit
8,646,245,276,011,085,000
36.237578
97
0.55127
false
3.59697
false
false
false
wkh124/wkh124
ace2concensus.py
1
4794
#!/usr/bin/env python # -*- coding: utf-8 -*- # ace2fasta.py # From ACE format to FASTA format # Eric Normandeau # 2010 04 15 # Create an output_file.fasta containing contig sequences alignements from # an input_file.ace # Clean each contig by removing insertions '*' in the contig consensus and # all the sequences i...
gpl-3.0
-6,648,650,208,581,988,000
30.748344
79
0.603045
false
3.368939
false
false
false
genomics-geek/cookiecutter-django-reactjs
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py
1
3199
{% if cookiecutter.use_celery == 'y' %} import os from celery import Celery from django.apps import apps, AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_config.set...
bsd-3-clause
3,372,133,122,932,286,000
38.012195
103
0.639575
false
3.763529
true
false
false
chacoroot/planetary
addons/stock/product.py
1
30770
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
8,539,623,704,671,473,000
54.441441
307
0.587098
false
3.961633
false
false
false
rocky/python3-trepan
trepan/inout/tcpfns.py
1
1519
# -*- coding: utf-8 -*- # Copyright (C) 2009-2017, 2021 Rocky Bernstein <rocky@gnu.org> # # 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
2,950,238,071,869,725,000
34.325581
73
0.653061
false
3.204641
false
false
false
jswanljung/iris
lib/iris/analysis/__init__.py
1
83652
# (C) British Crown Copyright 2010 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
254,953,413,684,909,500
34.702945
82
0.61182
false
4.42182
false
false
false
taojy123/ClassmateParty
classmate_party/models.py
1
1200
# -*- coding: utf-8 -*- import json from django.db import models class Person(models.Model): ACTIVITY_1 = 'activity_1' ACTIVITY_2 = 'activity_2' HOTEL_56 = 'hotel_56' HOTEL_57 = 'hotel_57' CATEGORY_CHOICE = ( (ACTIVITY_1, u'活动一'), (ACTIVITY_2, u'活动二'), (HOTEL_56, u'5月6日住...
mit
-7,556,119,838,146,016,000
29.842105
71
0.641638
false
2.908189
false
false
false
Norpadon/tornado-httpclient-session
httpclient_session/sessions.py
1
1773
from tornado.httpclient import HTTPRequest, AsyncHTTPClient from httpclient_session.mocks import MockRequest from httpclient_session.cookies import extract_cookies_to_jar from httpclient_session.contrib.cookies import RequestsCookieJar class Session(object): def __init__(self, httpclient_class=None, **kwargs): ...
mit
-7,981,688,388,893,353,000
29.050847
76
0.624929
false
4.665789
false
false
false
Chiheb-Nexus/Proxies-Check
proxy_list.py
1
4895
# #!/usr/bin python3 import urllib.request as Request import sqlite3 import os.path as Path class ProxyHandlerStatus(): """ Check IP Proxy status and check if a string is in the HTML output """ def run(self, url, proxy_ip_port, word): """ Main function """ error = "ERROR" try: print("[+] Setup proxy...
gpl-3.0
-1,734,788,578,719,948,500
24.628272
114
0.60858
false
3.111888
false
false
false
jamontes/plugin.video.filmsforaction
default.py
1
5898
# -*- coding: utf-8 -*- ''' KODI Films For Action video add-on. Copyright (C) 2014 José Antonio Montes (jamontes) 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 t...
gpl-2.0
-1,952,171,376,768,138,800
32.505682
173
0.591318
false
3.704146
false
false
false
CalthorpeAnalytics/urbanfootprint
footprint/main/models/presentation/layer/layer.py
1
2521
# coding=utf-8 # UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANT...
gpl-3.0
5,308,384,177,669,069,000
39.66129
114
0.723522
false
3.976341
false
false
false
GrossfieldLab/loos
Packages/PyLOOS/cylindrical-density.py
1
3734
#!/usr/bin/env python3 """ cylindrical-density.py : compute the density of atoms ("targets") around a centering selection, output a 2D histogram in r,z The expected use-case for this is looking at lipid packing around a membrane protein, when for whatever...
gpl-3.0
-1,450,995,328,572,587,000
30.644068
108
0.67354
false
3.301503
false
false
false
deapplegate/wtgpipeline
interpolatemodel.py
1
1318
#!/usr/bin/env python ######################### # Make Illumination correction images ########################## import astropy, astropy.io.fits as pyfits, illummodels, os.path, sys, re from numpy import * ######################## __cvs_id__ = "$Id: interpolatemodel.py,v 1.3 2009-04-20 23:09:43 dapple Exp $" ######...
mit
-7,970,648,896,864,802,000
22.963636
78
0.594841
false
3.533512
false
false
false
raultron/ivs_sim
python/old_experiments/pose_sim.py
1
5879
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 11 16:23:20 2017 @author: lracuna """ import numpy as np import cv2 import matplotlib.pyplot as plt import error_functions as ef from ippe import homo2d from vision.camera import Camera from vision.plane import Plane from vision.camera_distributi...
mit
8,674,549,900,663,099,000
32.988439
121
0.655213
false
3.099104
false
false
false
Azure/azure-sdk-for-python
sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py
1
15891
# 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 may ...
mit
-457,797,476,921,704,260
46.154303
210
0.62828
false
4.18956
true
false
false
oudalab/phyllo
phyllo/extractors/tibullusDB.py
1
3901
import sqlite3 import urllib from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger def getBooks(soup): siteURL = 'http://www.thelatinlibrary.com' textsURL = [] # get links to books in the collection for a in soup.find_all('a', href=True): ...
apache-2.0
-8,358,872,412,484,795,000
38.216495
111
0.483978
false
4.432955
false
false
false
patrick-winter-knime/mol-struct-nets
molstructnets/steps/evaluation/shared/roc_curve.py
1
2908
import random import numpy from matplotlib import pyplot from util import logger, progressbar, file_util def plot(predictions_list, prediction_names, classes, roc_curve_plot_file, shuffle=True, seed=42): actives_list = [] inactives_list = [] auc_list = [] for i in range(len(predictions_list)): ...
gpl-3.0
-8,506,648,301,944,247,000
38.297297
98
0.625516
false
3.62142
false
false
false
mpbraendli/dab-autocorrelation
correlate_with_ref.py
1
6924
#!/usr/bin/env python # # Find NULL symbols in file, then correlate with the phase reference symbol and # plot the resulting correlation result. # # This will display the Channel Impulse Reference # # Copyright (C) 2016 # Matthias P. Braendli, matthias.braendli@mpb.li # http://www.opendigitalradio.org # Licence: The MI...
mit
5,335,406,212,402,760,000
35.634921
125
0.613663
false
3.595016
false
false
false
RIOT-OS/riot_job_manager
vcs/git.py
1
6122
"""Provides an abstraction layer to pygit2""" from os.path import join as path_join, isdir import pygit2 from . import Repository, Commit, Tree, Blob class GitRepository(Repository): """A basic Git repository""" def __init__(self, directory, url=None, default_branch='master'): try: self.dir...
gpl-2.0
8,624,118,001,476,154,000
32.453552
86
0.562725
false
4.001307
false
false
false
kmolab/kmolab.github.io
data/Brython-3.3.4/Lib/traceback.py
1
1353
import sys from browser import console def _restore_current(exc): """Restore internal attribute current_exception, it may have been modified by the code inside functions of this module. """ __BRYTHON__.current_exception = exc def print_exc(file=sys.stderr): exc = __BRYTHON__.current_exception ...
agpl-3.0
-2,767,024,463,012,012,500
29.088889
78
0.570584
false
3.40806
false
false
false
shree-shubham/Unitype
The Hidden Message.py
1
1670
# Didn't pass testcase 11, 15 import sys def dfs(p, s, dic, ind, path): global cost global r global ncr if r: return if len(path) > len(ncr): ncr = path[:] if ind == len(p): delete = 0 add = 0 path.pop(0) pathcopy = path[:] stack = [...
gpl-3.0
6,179,828,717,420,863,000
21.567568
70
0.410778
false
3.019892
false
false
false
arminnh/c-to-p-compiler
src/VisitorDeclarationProcessor.py
1
3603
from antlr4 import * from AbstractSyntaxTree import * from VisitorSymbolTable import * class VisitorDeclarationProcessor(VisitorSymbolTable): def __init__(self, symbolTable, errorHandler): super(VisitorDeclarationProcessor, self).__init__(symbolTable, errorHandler) self.mainFunctionDefined = False ...
mit
-8,998,582,801,746,729,000
34.323529
110
0.642798
false
4.3462
false
false
false
akshmakov/Dolfin-Fijee-Fork
test/unit/function/python/FunctionAssigner.py
1
6254
"""Unit tests for the FunctionAssigner class""" # Copyright (C) 2013 Johan Hake # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Licen...
gpl-3.0
-4,560,434,575,751,486,500
36.22619
90
0.543172
false
3.413755
true
false
false
south-coast-science/scs_core
src/scs_core/osio/data/user_metadata.py
1
3498
""" Created on 30 Apr 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) example: { "id": "southcoastscience-dev", "name": "South Coast Science - Dev", "month": "2016-11", "gravatar-hash": "07f512e9fe64863039df0c0f1834cc25", "topics": [ { "topic": "/orgs/south-coast-science-dev/user/d...
mit
-3,796,951,891,901,695,500
28.15
118
0.44311
false
4.072177
false
false
false