repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
HackerEarth/django-allauth
allauth/socialaccount/providers/twitter/views.py
1
1820
from django.utils import simplejson from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, OAuthCallbackView) ...
mit
985,280,656,928,123,300
36.916667
75
0.636813
false
skibaa/smart-sweeper
game/dbext.py
1
2811
import logging from google.appengine.ext import db from google.appengine.api import datastore_errors import cPickle logger=logging.getLogger("smartSweeper.dbext") class PickledProperty(db.Property): data_type = db.Blob def __init__(self, force_type=None, *args, **kw): self.force_type=force_type ...
apache-2.0
-9,060,400,630,525,390,000
37.506849
91
0.626467
false
allynt/tings
T/tings/views/api/views_api_users.py
1
1138
from rest_framework import generics, permissions from django.contrib.auth.models import User # from T.tings.models.models_users import TUserProfile from T.tings.serializers.serializers_users import TUserSerializer class TUserPermission(permissions.BasePermission): """ Custom permission to only allow owners of...
mit
8,404,409,644,057,363,000
33.484848
89
0.742531
false
akx/gentry
gore/api/handlers/store.py
1
1862
import base64 import json import logging import zlib from datetime import datetime from django.conf import settings from django.db import transaction from django.http import JsonResponse from django.utils.encoding import force_str from django.utils.timezone import make_aware from pytz import UTC from gore.auth import...
mit
4,651,106,081,188,272,000
33.481481
104
0.6971
false
mazz/kifu
tests/tests.py
1
1568
import unittest import transaction from pyramid import testing from default.models.mymodel import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') ...
mit
-580,382,816,191,372,500
27.509091
52
0.621811
false
django-stars/dash2011
presence/apps/shout/views.py
1
2081
import logging import json from django.shortcuts import render_to_response from django.http import Http404 from django.template import RequestContext from django.http import HttpResponse from django.http import HttpResponseRedirect from django.http import HttpResponseForbidden from django.shortcuts import redirect fro...
bsd-3-clause
7,593,957,745,665,859,000
31.515625
134
0.682845
false
dprince/tripleo-heat-templates
extraconfig/post_deploy/clouds_yaml.py
1
2821
#!/usr/bin/env python import os import yaml AUTH_URL = os.environ['auth_url'] ADMIN_PASSWORD = os.environ['admin_password'] CLOUD_NAME = os.environ['cloud_name'] HOME_DIR = os.environ['home_dir'] IDENTITY_API_VERSION = os.environ['identity_api_version'] PROJECT_NAME = os.environ['project_name'] PROJECT_DOMAIN_NAME = ...
apache-2.0
-4,069,245,254,461,047,000
31.056818
74
0.621765
false
Tocknicsu/nctuoj
backend/test/api/bulletin/admin_cross.py
1
2124
#!/usr/bin/env python3 import sys import requests import json import unittest import datetime from util import TestCase import config import common class TestApiBulletinAdminCross(TestCase): url = '%s/api/groups/1/bulletins/'%(config.base_url) cross_url = None token = common.get_user_info({'account': confi...
mit
-9,101,086,923,572,818,000
28.915493
119
0.527778
false
JaviMerino/lisa
libs/utils/analysis/frequency_analysis.py
1
24894
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
apache-2.0
-7,015,758,231,730,057,000
37.180982
98
0.555676
false
cburmeister/flask-bones
app/commands.py
1
1163
from faker import Faker import click from app.database import db from app.user.models import User @click.option('--num_users', default=5, help='Number of users.') def populate_db(num_users): """Populates the database with seed data.""" fake = Faker() users = [] for _ in range(num_users): user...
mit
-36,645,924,411,596,520
21.803922
64
0.536543
false
rbuffat/pyidf
tests/test_shadingsite.py
1
2163
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.thermal_zones_and_surfaces import ShadingSite log = logging.getLogger(__name__) class TestShadingSite(unittest.TestCase): def setUp(self): self.fd, self.path = temp...
apache-2.0
-7,739,266,213,189,500,000
31.787879
101
0.645862
false
nlgcoin/guldencoin-official
test/functional/interface_rest.py
2
14644
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the REST API.""" import binascii from decimal import Decimal from enum import Enum from io import...
mit
-9,178,108,057,652,545,000
43.646341
153
0.631931
false
mitmedialab/MediaCloud-Web-Tools
server/views/topics/topiccreate.py
1
3535
import logging from flask import jsonify, request import flask_login import mediacloud.error from server import app, mc from server.auth import user_mediacloud_client from server.util.request import form_fields_required, api_error_handler, json_error_response, arguments_required from server.views.topics.topic import ...
apache-2.0
-6,057,934,450,072,376,000
48.788732
195
0.660255
false
jeffsilverm/presentation
whats_new_in_python_3.6/type_hints_complicated.py
1
1308
#! /usr/bin/python3.6 # -*- coding: utf-8 -*- import time import sys assert sys.version_info.major == 3 and sys.version_info.minor == 6, "Not running python 3.6, running {}".format( sys.version_info) class A(object): def __init__(self, instance_mark) -> None: self.instance_mark_A = instance_mark ...
gpl-2.0
859,038,877,987,351,700
22.357143
112
0.58104
false
Crowdcomputer/CC
crowdcomputer/init_db.py
1
1613
''' Created on Nov 26, 2012 @author: stefanotranquillini ''' from django.contrib.auth.models import User, Group from rest_framework.authtoken.models import Token from general.models import Application from uuid import uuid4 def init(): initAppsAndCC() def initAppsAndCC(): try: user, c = User.objects...
apache-2.0
-2,273,612,954,416,833,300
28.345455
126
0.588965
false
DailyActie/Surrogate-Model
01-codes/numpy-master/numpy/matrixlib/defmatrix.py
1
34262
from __future__ import division, absolute_import, print_function __all__ = ['matrix', 'bmat', 'mat', 'asmatrix'] import sys import numpy.core.numeric as N from numpy.core.numeric import concatenate, isscalar, binary_repr, identity, asanyarray from numpy.core.numerictypes import issubdtype # make translation table _n...
mit
-4,329,534,605,734,874,600
26.38769
89
0.471222
false
bloyl/mne-python
mne/__init__.py
1
5917
"""MNE software for MEG and EEG data analysis.""" # PEP0440 compatible formatted version, see: # https://www.python.org/dev/peps/pep-0440/ # # Generic release markers: # X.Y # X.Y.Z # For bugfix releases # # Admissible pre-release markers: # X.YaN # Alpha release # X.YbN # Beta release # X.YrcN # Rele...
bsd-3-clause
-6,323,858,588,769,140,000
44.515385
81
0.630218
false
Septima/qgis-qlrbrowser
src/QlrBrowser/mysettings/qgissettingmanager/types/bool.py
1
3112
#----------------------------------------------------------- # # QGIS setting manager is a python module to easily manage read/write # settings and set/get corresponding widgets. # # Copyright : (C) 2013 Denis Rouzaud # Email : denis.rouzaud@gmail.com # #-------------------------------------------------------...
gpl-2.0
4,159,583,462,942,297,000
36.506024
148
0.643959
false
vhernandez/pygtksheet
examples/complex_test.py
1
11754
import sys sys.path += ['/usr/local/lib/python2.6/dist-packages/gtk-2.0'] import gtk from gtk import gdk import pango import gtksheet from bordercombo import BorderCombo #from gtkextra import BorderCombo #import gtkextra class TestSheet(gtksheet.Sheet): def __init__(self): gtksheet.Sheet.__init__(self, 20,...
gpl-2.0
9,136,060,946,695,285,000
39.253425
90
0.561766
false
nash-x/hws
nova/huawei/scheduler/filters/disk_filter.py
1
2145
# Copyright (c) 2012 OpenStack Foundation # 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 ...
apache-2.0
-566,471,726,499,216,700
39.471698
79
0.660606
false
pglomski/shopnotes
drill_speed_chart.py
1
2778
#!/usr/bin/env python # -*- coding: UTF-8 -*- '''Produce a custom twist drill plot''' import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt plt.rc('text', usetex=True) # set some rcParams mpl.rcParams['font.weight'] = 'bold' mpl.rcParams['xtick.major.pad'] = 10 mpl.rcParams['xtick.direction'] =...
agpl-3.0
6,025,454,394,184,277,000
35.077922
102
0.569114
false
robertnishihara/ray
python/ray/dashboard/dashboard.py
1
37612
try: import aiohttp.web except ImportError: print("The dashboard requires aiohttp to run.") import sys sys.exit(1) import argparse import copy import datetime import errno import json import logging import os import platform import threading import time import traceback import yaml import uuid import g...
apache-2.0
-6,620,654,547,215,299,000
37.616016
79
0.58476
false
crmorse/weewx-waterflow
bin/weedb/mysql.py
1
9153
# # Copyright (c) 2012 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # # $Revision$ # $Author$ # $Date$ # """Driver for the MySQL database""" import decimal import MySQLdb import _mysql_exceptions from weeutil.weeutil import to_bool import weedb def connect(host='l...
gpl-3.0
4,721,289,113,010,788,000
36.979253
102
0.579919
false
papaloizouc/peacehack
peacehack/theapp/migrations/0001_initial.py
1
5492
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='CrazyObject', fields=[ ('id', models.AutoField(...
gpl-2.0
5,515,570,037,667,942,000
65.97561
114
0.599417
false
ashishtilokani/Cloaking-Detection-Tool
googleBot/googleBot/spiders/scrape2.py
1
1236
from scrapy.selector import HtmlXPathSelector from scrapy.spider import Spider import html2text import re import os.path class scrape(Spider): name = "googleBot2" start_urls = [] with open('/home/ashish/Desktop/CloakingDetectionTool/url.txt','r') as f: for line in f: l=line.replac...
mit
-6,094,454,040,259,034,000
29.146341
88
0.486246
false
mprinc/McMap
src/scripts/CSN_Archive/check_object_names.py
1
4677
#!/usr/bin/env python # Copyright (c) 2015, Scott D. Peckham #------------------------------------------------------ # S.D. Peckham # July 9, 2015 # # Tool to extract the object part of every CSDMS Standard # Variable Name and generate a list of objects that # includes those as well as all parent objects. # # Example...
mit
-1,015,613,779,617,027,700
32.407143
94
0.383579
false
PrFalken/exaproxy
lib/exaproxy/icap/response.py
1
2403
class ICAPResponse (object): def __init__ (self, version, code, status, headers, icap_header, http_header): self.version = version self.code = code self.status = status self.headers = headers icap_len = len(icap_header) http_len = len(http_header) icap_end = icap_len if http_header: http_len_s...
bsd-2-clause
-2,532,343,003,033,045,000
23.520408
133
0.714524
false
burntcustard/DeskBot-Zero
neural-net/keras/neuralNet.py
1
4088
''' How to run: $ source ~/Documents/tensorflow/bin/activate $ cd Documents/DeskBot-Zero/neural-net/keras $ python neuralNet.py Heavily based on: https://github.com/keras-team/keras/blob/master/examples/cifar10_cnn.py ''' import os import keras from keras.preprocessing.image import ImageDataGenerator from keras.model...
mit
-4,739,964,433,974,083,000
33.940171
86
0.687622
false
yoe/veyepar
dj/scripts/enc.py
1
23477
#!/usr/bin/python """ assembles raw cuts into final, titles, tweaks audio, encodes to format for upload. """ import re import os import sys import subprocess import xml.etree.ElementTree from mk_mlt import mk_mlt import pprint from process import process from main.models import Client, Show, Location, Episode, Raw_...
mit
2,883,326,822,299,327,000
35.06298
226
0.481407
false
GoodCloud/johnny-cache
johnny/backends/memcached.py
1
1842
#!/usr/bin/env python # -*- coding: utf-8 -*- """Infinite caching memcached class. Caches forever when passed a timeout of 0. For Django >= 1.3, this module also provides ``MemcachedCache`` and ``PyLibMCCache``, which use the backends of their respective analogs in django's default backend modules. """ from django....
mit
-7,832,698,847,422,093,000
46.230769
93
0.701412
false
freifunk-darmstadt/tools
update-telemetry.py
1
8987
#!/usr/bin/env python3 import psutil import os import json import re import itertools from contextlib import contextmanager import pprint import time import socket import subprocess import logging logger = logging.getLogger(__name__) def pairwise(iterable): "s -> (s0,s1), (s2,s3), (s4, s5), ..." a = iter(ite...
agpl-3.0
6,942,988,969,528,593,000
31.327338
182
0.516858
false
maferelo/saleor
saleor/account/migrations/0001_initial.py
3
19366
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("auth", "0006_require_contenttypes_0002")] replaces = [("userprofile", "0001_initial...
bsd-3-clause
2,425,811,758,527,500,300
42.617117
86
0.291748
false
ag-sc/QALD
4/scripts/Evaluation.py
1
26257
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.dom.minidom as dom import xml.dom from decimal import * import sys import os import datetime #from Numeric import * # Dokument erzeugen implement = xml.dom.getDOMImplementation() ###################Globale Variablen################### task=None choosen_tag={}...
mit
-724,464,349,123,768,700
42.688852
235
0.473778
false
Re4son/Kali-Pi
Menus/menu_pause.py
1
1785
#!/usr/bin/env python import pygame, os, sys, subprocess, time import RPi.GPIO as GPIO from pygame.locals import * from subprocess import * if "TFT" in os.environ and os.environ["TFT"] == "0": # No TFT screen SCREEN=0 pass elif "TFT" in os.environ and os.environ["TFT"] == "2": # TFT screen with mouse ...
gpl-3.0
3,545,909,162,319,380,500
28.262295
87
0.614566
false
foobarbazblarg/stayclean
stayclean-2016-april/serve-signups-with-flask.py
1
8086
#!/usr/bin/python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import markdow...
mit
8,488,130,493,691,722,000
40.255102
129
0.67351
false
zhibolau/webApp
www/models.py
1
1589
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Zhibo Liu' import time,uuid from transwarp.db import next_id # 直接from Import会出错 必须在那个目录下建立__init__.py 文件!!!!!!!! from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringF...
gpl-2.0
-8,860,960,697,945,917,000
35.162791
86
0.67717
false
thomaserlang/XenBackup
src/xenbackup/XenAPI.py
1
9750
# Copyright (c) Citrix Systems, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1) Redistributions of source code must retain the above copyright # notice, this list of conditions ...
mit
-7,467,321,875,946,531,000
38.156627
101
0.628205
false
volkandkaya/trader
trader/joins/migrations/0005_auto__add_unique_join_email_ref_id.py
1
1346
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'Join', fields ['email', 'ref_id'] db.creat...
mit
6,737,420,251,535,101,000
41.09375
114
0.572065
false
mohseniaref/PySAR-1
pysar/pysarApp.py
1
21751
#! /usr/bin/env python ############################################################################### # # Project: PySAR # Purpose: Python Module for InSAR Time-series Analysis # Author: Heresh Fattahi # Created: July 2013 # Modified: Yunjun Zhang, Feb 2015 ###########################################################...
mit
6,423,405,613,165,199,000
37.841071
157
0.507379
false
qbuat/rootpy
rootpy/tree/model.py
1
5162
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import import inspect from cStringIO import StringIO import types import ROOT from .. import log; log = log[__name__] from .treetypes import Column from .treebuffer import TreeBuffer...
gpl-3.0
1,867,577,259,396,475,100
31.465409
79
0.518016
false
jolid/script.module.donnie
lib/donnie/furk.py
1
6496
import urllib2, urllib, sys, os, re, random, copy from BeautifulSoup import BeautifulSoup, Tag, NavigableString import xbmc,xbmcplugin,xbmcgui,xbmcaddon from t0mm0.common.net import Net from t0mm0.common.addon import Addon from scrapers import CommonScraper net = Net() try: import json except: # pre-frodo and python...
gpl-2.0
5,660,529,019,860,364,000
28.935484
167
0.622229
false
twitterdev/twitter-leaderboard
services/migrations/0001_initial.py
1
1248
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-28 08:34 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
mit
-8,509,788,362,144,956,000
39.258065
145
0.63141
false
jayrumi/walmart-reviews
setup.py
1
1197
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name = 'walmart-reviews',...
mit
8,552,747,381,099,799,000
34.205882
211
0.634085
false
harrylewis/python-uinames
uinames/models.py
1
1384
from utils import PropertyUnavailable class People(object): """ A collection of people, represented by the Person class. """ def __init__(self, json=None): self._json = json or {} self.data = [Person(identity) for identity in self._json] def __str__(self): return self.__u...
mit
8,602,743,123,588,186,000
26.68
79
0.510116
false
digwanderlust/pants
tests/python/pants_test/base/test_payload_field.py
1
10723
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from hashlib import ...
apache-2.0
7,316,399,254,146,659,000
32.61442
98
0.633498
false
pinax/pinax-eventlog
pinax/eventlog/migrations/0001_initial.py
1
1443
# Generated by Django 3.1 on 2020-08-15 10:08 from django.conf import settings import django.core.serializers.json from django.db import migrations, models import django.db.models.deletion import django.utils.timezone from ..compat import JSONField class Migration(migrations.Migration): initial = True dep...
mit
8,742,902,873,296,838,000
38
152
0.634789
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py
1
1525
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-7,039,590,627,522,585,000
37.125
79
0.602623
false
bdh1011/wau
venv/lib/python2.7/site-packages/pandas/io/tests/test_sql.py
1
93879
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
mit
-1,394,526,819,625,852,700
36.581665
99
0.559241
false
NitrousPG/forkbot
server_events.py
1
4992
# LICENSE # 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 version. # # This program is distributed in the hope that it will be us...
gpl-3.0
-7,410,502,775,914,562,000
29.625767
80
0.527244
false
Pragmatismo/TimelapsePi-EasyControl
webcamcap_show_numpy.py
1
8684
#!/usr/bin/python import time import os import sys import pygame import numpy from PIL import Image, ImageDraw, ImageChops print("") print("") print(" USE l=3 to take a photo every 3 somethings, try a 1000 or 2") print(" t to take triggered photos ") print(" cap=/home/pi/folder/ to set caps path other than c...
gpl-2.0
-2,106,105,906,145,419,300
30.23741
168
0.539843
false
mbj4668/pyang
pyang/xpath.py
1
12087
from . import xpath_lexer from . import xpath_parser from .error import err_add from .util import prefix_to_module, search_data_node, data_node_up from .syntax import re_identifier core_functions = { 'last': ([], 'number'), 'position': ([], 'number'), 'count': (['node-set'], 'number'), 'id': (['object'...
isc
-2,654,624,637,892,220,000
41.410526
80
0.514933
false
simone-campagna/zapper
lib/python/zapper/lock_file.py
1
1913
#!/usr/bin/env python3 # # Copyright 2013 Simone Campagna # # 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
7,631,584,786,992,049,000
27.132353
74
0.590173
false
LinguList/server
app/settings/sound_classes/asjp/asjp.py
1
3293
#! /usr/bin/env python from __future__ import division,print_function from lingpy.data.derive import compile_model from scipy.spatial.distance import squareform from time import sleep from pickle import dump asjp = {} score = open('score','r').read() score = score.split('\n') del score[-1] dicto = {} for line in sco...
gpl-2.0
3,162,807,456,613,274,600
19.710692
66
0.54631
false
wevoice/wesub
dev_settings_test.py
1
2112
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 op...
agpl-3.0
-7,629,318,859,687,858,000
30.058824
78
0.69697
false
robotican/ric
ric_board/scripts/RiCConfigurator/GUI/SimulationWindow.py
1
5700
import GUI.MainWindow __author__ = 'tom' from PyQt4.QtGui import * from GUI.Schemes.gazeboGui import Ui_gazebo_gui from BAL.Interface.DeviceFrame import SERVO, BATTERY, SWITCH, IMU, PPM, GPS, RELAY, URF, CLOSE_LOP_ONE, CLOSE_LOP_TWO, \ OPEN_LOP, DIFF_CLOSE, DIFF_OPEN, EX_DEV, HOKUYO, OPRNNI, USBCAM, DIFF_CLOSE_FOU...
bsd-3-clause
-2,762,979,084,064,864,000
35.538462
126
0.542632
false
andrey-yemelyanov/competitive-programming
cp-book/ch1/adhoc/chess/10849_MoveTheBishop.py
1
1456
# Problem name: 10849 Move the bishop # Problem url: https://uva.onlinejudge.org/external/108/10849.pdf # Author: Andrey Yemelyanov import sys import math WHITE, BLACK = 0, 1 INFINITY = -1 def main(): n_test_cases = int(sys.stdin.readline().strip()) for i in range(n_test_cases): sys.stdin.readline() ...
mit
-4,838,296,833,532,812,000
27
95
0.56044
false
zfrxiaxia/Code-zfr
计蒜客/比赛/2015/light.py
1
1148
# -*- coding: utf-8 -*- """ Created on Sat May 28 19:17:42 2016 @author: AtoZ """ N,M = raw_input().split() N,M = int(N),int(M) while(1): i0 = 0 while(i0<2**(M*N)): bit = [0]*M*N t_bit = bin(i0) lt_bit = len(t_bit) for j0 in range(lt_bit-2): bit[j0] = int(t_bit[j0+2]) i0 +=1 print ...
gpl-3.0
7,432,343,685,599,265,000
16.953125
47
0.419861
false
linearb/mojo
rasppi/rasp.py
1
3195
#!/usr/bin/python """Sound an alarm if a raspberry pi hasn't been heard from lately To set an alarm for pi named 'pi', create a file in mmdata/pulse.d named pi.alarm """ import os.path import time pulse="/home/mojotronadmin/mmdata/pulse.d/" logfile="/home/mojotronadmin/mmdata/incoming.log" maxinterval = 15*60 # h...
mit
-2,364,741,625,820,722,000
37.035714
101
0.610329
false
garrettr/securedrop
securedrop/journalist_app/col.py
1
3264
# -*- coding: utf-8 -*- from flask import (Blueprint, redirect, url_for, render_template, flash, request, abort, send_file, current_app) from flask_babel import gettext from sqlalchemy.orm.exc import NoResultFound import crypto_util import store from db import db_session, Submission from journalis...
agpl-3.0
-8,452,638,703,044,574,000
36.090909
78
0.594975
false
Haizs/NEU-mathe
FILEtoCSV.py
1
1799
import os.path import csv import re headers = ['Id', 'KnowledgeId', 'Type', 'Src', 'Name', 'Count'] def doSubject(subject): idCount = 0 rows = [] for root, dirs, files in os.walk('ChoiceSource/' + subject): for name in files: if (name != '.DS_Store'): idCount += 1 ...
gpl-3.0
-2,962,789,084,758,935,600
35.645833
119
0.466742
false
obulpathi/poppy
poppy/manager/base/driver.py
1
2204
# Copyright (c) 2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
6,152,679,558,350,396,000
23.21978
71
0.640653
false
cheery/essence
essence3/renderer/patch9.py
1
2518
import pygame from texture import Texture def borders(surface): width, height = surface.get_size() y0 = 0 y1 = 0 x0 = 0 x1 = 0 i = 0 while i < height: r,g,b,a = surface.get_at((0,i)) if a > 0: y0 = i break i += 1 while i < height: ...
gpl-3.0
-2,208,417,184,195,690,200
32.573333
90
0.503971
false
amitay/samba
source4/scripting/python/samba/samdb.py
1
31787
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010 # Copyright (C) Matthias Dieter Wallnoefer 2009 # # Based on the original in EJS: # Copyright (C) Andrew Tridgell <tridge@samba.org> 2005 # Copyright (C) Giampaolo Lauria <lauria2@yahoo.com> 2011 # # This program is free softwa...
gpl-3.0
-3,569,424,283,100,842,500
36.091015
158
0.588542
false
eayunstack/python-neutronclient
neutronclient/shell.py
1
41584
# Copyright 2012 OpenStack Foundation. # 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 requ...
apache-2.0
2,772,146,299,183,681,000
40.459621
79
0.645897
false
mwrlabs/veripy
contrib/rfc3633/dr/renew_message.py
1
1596
from contrib.rfc3315.constants import * from contrib.rfc3633.dhcpv6_pd import DHCPv6PDHelper from scapy.all import * from veripy.assertions import * class RenewMessageTestCase(DHCPv6PDHelper): """ Requesting Router Initiated: Renew Message Verify that a device can properly interoperate while using DHCPv6...
gpl-3.0
802,280,280,625,709,000
41.026316
116
0.644737
false
fr34kyn01535/PyForum
server.py
1
2451
# coding:utf-8 import os.path import cherrypy import sys if sys.version[0] == '2': reload(sys) sys.setdefaultencoding("utf-8") from app import themen,diskussionen,beitraege,login,logout,administration,templates def error_page(status, message, traceback, version): return templates.RenderTemplate("error.html"...
gpl-2.0
7,957,577,721,202,830,000
30.423077
130
0.684619
false
CauldronDevelopmentLLC/buildbot
buildbot/status/web/slaves.py
1
6579
import time, urllib from twisted.python import log from twisted.web import html from twisted.web.util import Redirect from buildbot.status.web.base import HtmlResource, abbreviate_age, OneLineMixin, path_to_slave from buildbot import version, util # /buildslaves/$slavename class OneBuildSlaveResource(HtmlResource, O...
gpl-2.0
1,440,367,016,623,047,700
35.348066
98
0.495212
false
chop-dbhi/varify-data-warehouse
vdw/assessments/migrations/0005_copy_categories.py
1
21123
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.core.management import call_command class Migration(DataMigration): def forwards(self, orm): call_command("loaddata", "assessment_categories.json") f...
bsd-2-clause
3,351,375,113,810,633,000
80.555985
192
0.546561
false
watchtower/asynctest
asynctest/__init__.py
1
2295
import functools class TestStatus: # FIXME should really be an Enum pending = -1 failure = 0 success = 1 class Test: def __init__(self, func, description): self.func = func self.description = description self.status = TestStatus.pending self._callback = None sel...
mit
2,558,572,069,989,067,300
27.6875
97
0.578214
false
dahiro/shotgun-replica
shotgun_replica/python/tests/shotgun_replica_tests/sync/shotgun_to_local/test_link.py
1
10024
# -*- coding: utf-8 -*- ''' Created on 25.06.2012 @author: bach ''' from shotgun_replica.connectors import DatabaseModificator, PostgresEntityType from shotgun_replica.sync.shotgun_to_local import EventProcessor from shotgun_replica.entities import InOut from tests_elefant import testProjectID, testShotID, testTaskI...
bsd-3-clause
-2,459,416,019,199,603,000
41.295359
120
0.545192
false
linktlh/Toontown-journey
toontown/distributed/HoodMgr.py
1
13166
from direct.directnotify import DirectNotifyGlobal from direct.showbase import DirectObject from pandac.PandaModules import * import random from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals class HoodMgr(DirectObject.DirectObject): notify = DirectNotifyGlobal.directNotify.newCatego...
apache-2.0
-2,892,375,891,941,455,400
39.018237
228
0.478353
false
shiquanwang/numba
numba/control_flow/cfstats.py
1
4105
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import from numba import nodes from numba.reporting import getpos class StatementDescr(object): is_assignment = False class LoopDescr(object): def __init__(self, next_block, loop_block): self.next_block = next_block ...
bsd-2-clause
-3,426,023,315,412,407,300
27.908451
81
0.607065
false
endrebak/epic
tests/run/test_merge_chip_and_input.py
1
4225
import pytest import pandas as pd import numpy as np import logging from io import StringIO from joblib import delayed, Parallel @pytest.fixture def input_data(): pass @pytest.fixture def expected_result(): pass def merge_chip_and_input(windows, nb_cpu): """Merge lists of chromosome bin df chromosom...
mit
-4,803,652,179,347,965,000
23.005682
83
0.569704
false
pope/SublimeYetAnotherCodeSearch
tests/test_csearch.py
1
2481
import sublime import os.path import shutil import textwrap import time import uuid from YetAnotherCodeSearch.tests import CommandTestCase _NEEDLE_IN_HAYSTACK = 'cc5b252b-e7fb-5145-bf8a-ed272e3aa7bf' class CsearchCommandTest(CommandTestCase): def setUp(self): super(CsearchCommandTest, self).setUp() ...
mit
-3,462,537,003,884,839,400
32.527027
78
0.612253
false
awong1900/platformio
platformio/builder/scripts/frameworks/mbed.py
1
7172
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ mbed The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down...
mit
-7,872,972,686,760,434,000
29.134454
79
0.591049
false
cosmicAsymmetry/zulip
zerver/tests/test_signup.py
1
51499
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime from django.conf import settings from django.http import HttpResponse from django.test import TestCase from mock import patch from zerver.lib.test_helpers import MockLDAP from confirmation.models import Confirmation from zilencer.models i...
apache-2.0
-5,722,122,378,230,343,000
42.559222
114
0.574786
false
rlpy/rlpy
rlpy/Representations/LocalBases.py
1
7491
""" Representations which use local bases function (e.g. kernels) distributed in the statespace according to some scheme (e.g. grid, random, on previous samples) """ from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from ...
bsd-3-clause
6,855,771,218,240,773,000
39.058824
80
0.606595
false
kavigupta/61a-analysis
src/analytics.py
1
4920
""" A module containing a variety of functions for analyzing the data. This is supposed to be more data specific than statistics. """ import numpy as np from tools import cached_property def compensate_for_grader_means(evals, z_thresh=1): """ Compensates for grader means by subtracting each grader's avera...
gpl-3.0
-3,319,539,819,622,582,300
40.344538
100
0.607927
false
Vishakha1990/Lambdas
testing/digitalocean/test.py
1
2597
#!/usr/bin/python import os, requests, time, json, argparse API = "https://api.digitalocean.com/v2/droplets" DROPLET_NAME = "ol-tester" HEADERS = { "Authorization": "Bearer "+os.environ['TOKEN'], "Content-Type": "application/json" } def post(args): r = requests.post(API, data=args, headers=HEADERS) re...
apache-2.0
2,783,647,885,308,764,000
24.97
85
0.560647
false
klmitch/nova
nova/tests/functional/compute/test_resource_tracker.py
1
30750
# 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 # d...
apache-2.0
8,476,263,967,089,812,000
40.950887
79
0.597951
false
yehudagale/fuzzyJoiner
old/TripletLossFacenetLSTM-angular.py
1
21847
import numpy as np import tensorflow as tf import random as random # import cntk as C # """ # The below is necessary in Python 3.2.3 onwards to # have reproducible behavior for certain hash-based operations. # See these references for further details: # https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSE...
epl-1.0
8,191,197,515,958,977,000
37.395431
167
0.663249
false
samlaudev/LeetCode
Python/Insert Delete GetRandom O(1) - Duplicates allowed/Solution.py
1
2970
# Problem: Insert Delete GetRandom O(1) - Duplicates allowed # # Design a data structure that supports all following operations in average O(1) time. # # Note: Duplicate elements are allowed. # 1. insert(val): Inserts an item val to the collection. # 2. remove(val): Removes an item val from the collection if presen...
mit
-2,704,729,365,606,001,700
30.595745
199
0.624916
false
egabancho/invenio
invenio/legacy/search_engine/__init__.py
1
332135
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN. ## ## Invenio 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 Found...
gpl-2.0
3,541,788,180,805,324,000
45.394049
268
0.549861
false
mozman/ezdxf
tests/test_05_tools/test_510_byte_stream.py
1
1134
# Copyright (c) 2020, Manfred Moitzi # License: MIT License import pytest import struct from ezdxf.tools.binarydata import ByteStream def test_init(): bs = ByteStream(b'ABCDABC\x00') assert bs.index == 0 assert len(bs.buffer) == 8 def test_read_ps(): bs = ByteStream(b'ABCDABC\x00') s = bs.read_...
mit
846,370,826,801,595,800
21.235294
52
0.602293
false
alindt/Cinnamon
files/usr/lib/cinnamon-settings/modules/cs_default.py
1
14784
#!/usr/bin/env python from SettingsWidgets import * PREF_MEDIA_AUTORUN_NEVER = "autorun-never" PREF_MEDIA_AUTORUN_X_CONTENT_START_APP = "autorun-x-content-start-app" PREF_MEDIA_AUTORUN_X_CONTENT_IGNORE = "autorun-x-content-ignore" PREF_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER = "autorun-x-content-open-folder" CUSTOM_ITEM...
gpl-2.0
-4,939,759,339,208,699,000
39.952909
150
0.603084
false
bugzPDX/airmozilla
airmozilla/manage/views/dashboard.py
1
5401
import datetime from django.contrib.auth.models import User from django.shortcuts import render from django.utils import timezone from django.db.models import Sum from jsonview.decorators import json_view from airmozilla.main.models import ( Event, SuggestedEvent, Picture, EventRevision, ) from airmo...
bsd-3-clause
-7,759,845,208,928,086,000
29.514124
78
0.578967
false
sebastianwelsh/artifacts
tests/reader_test.py
1
8292
# -*- coding: utf-8 -*- """Tests for the artifact definitions readers.""" import io import os import unittest from artifacts import definitions from artifacts import errors from artifacts import reader class YamlArtifactsReaderTest(unittest.TestCase): """Class to test the YAML artifacts reader.""" def testRead...
apache-2.0
2,995,640,185,578,991,000
33.406639
80
0.721298
false
uclouvain/osis
ddd/logic/application/test/use_case/write/test_renew_multiple_attributions_service.py
1
9080
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
-76,823,991,052,303,460
48.342391
118
0.708007
false
matthewgall/dnsjson.com
app.py
1
5654
#!/usr/bin/env python3 import os, logging, argparse, json, datetime import requests import dns.resolver from bottle import route, request, response, redirect, hook, error, default_app, view, static_file, template def set_content_type(fn): def _return_type(*args, **kwargs): if request.headers.get('Accept') == "appl...
mit
-8,385,073,387,106,826,000
28.763158
150
0.67156
false
anirudhSK/chromium
tools/perf/benchmarks/page_cycler.py
1
3123
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import page_cycler from telemetry import test class PageCyclerBloat(test.Test): test = page_cycler.PageCycler page_set = 'page_se...
bsd-3-clause
-8,354,810,265,709,558,000
27.390909
77
0.706372
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/offline_user_data_job_service/transports/base.py
1
5564
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
6,447,268,863,987,547,000
38.183099
83
0.651689
false
harshadyeola/easyengine
ee/cli/plugins/stack_upgrade.py
1
12752
from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.core.logging import Log from ee.core.variables import EEVariables from ee.core.aptget import EEAptGet from ee.core.apt_repo import EERepo from ee.core.services import EEService from ee.core.fileutils import EEF...
mit
-3,016,983,847,023,325,700
44.870504
117
0.513018
false
noba3/KoTos
addons/plugin.video.filmibynaturex-2.5.7/mymoves/movie/Metadata.py
1
2017
from common import XBMCInterfaceUtils, Logger from metahandler import metahandlers # @UnresolvedImport import sys def retieveMovieInfoAndAddItem(request_obj, response_obj): items = response_obj.get_item_list() XBMCInterfaceUtils.callBackDialogProgressBar(getattr(sys.modules[__name__], '__addMovieInfo_i...
gpl-2.0
-5,643,942,562,608,663,000
42.847826
202
0.608825
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/soyuz/model/archivesubscriber.py
1
9106
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Database class for table ArchiveSubscriber.""" __metaclass__ = type __all__ = [ 'ArchiveSubscriber', ] from operator import itemgetter import pytz from storm.ex...
agpl-3.0
6,795,547,473,769,740,000
37.100418
78
0.639798
false
pnasrat/puppet-codereview
rietveld.py
1
6634
#!/usr/bin/python # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-6,787,070,875,122,825,000
28.484444
80
0.641091
false
F8LEFT/ART
KDE/share/ECM/find-modules/rules_engine.py
1
21090
#!/usr/bin/env python #============================================================================= # Copyright 2016 by Shaheed Haque (srhaque@theiet.org) # Copyright 2016 Stephen Kelly <steveire@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided th...
gpl-3.0
3,596,388,408,542,231,000
39.095057
144
0.600853
false
bsmithyman/pymatsolver
pymatsolver/Tests/test_Triangle.py
1
1715
import unittest import numpy as np, scipy.sparse as sp TOL = 1e-12 class TestMumps(unittest.TestCase): def setUp(self): n = 50 nrhs = 20 self.A = sp.rand(n, n, 0.4) + sp.identity(n) self.sol = np.ones((n, nrhs)) self.rhsU = sp.triu(self.A) * self.sol self.rhsL = sp...
mit
-503,422,981,200,351,500
34
68
0.602915
false
ric2b/Vivaldi-browser
chromium/components/policy/tools/make_policy_zip.py
1
2188
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Creates a zip archive with policy template files. """ import optparse import sys import zipfile def add_files_to_zip(zip_file,...
bsd-3-clause
-7,656,171,030,158,575,000
31.656716
76
0.679159
false
Solewer/vino-cave
vinocave/settings.py
1
3114
""" Django settings for vinocave project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import o...
mit
-9,186,155,754,209,220,000
24.735537
91
0.685613
false
toothris/toothris
src/bprofile.py
1
5189
# Copyright 2008, 2015 Oleg Plakhotniuk # # This file is part of Toothris. # # Toothris is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
8,399,911,232,193,724,000
31.841772
99
0.56639
false