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
kennedyshead/home-assistant
homeassistant/components/advantage_air/sensor.py
1
4827
"""Sensor platform for Advantage Air integration.""" import voluptuous as vol from homeassistant.components.sensor import SensorEntity from homeassistant.const import PERCENTAGE from homeassistant.helpers import config_validation as cv, entity_platform from .const import ADVANTAGE_AIR_STATE_OPEN, DOMAIN as ADVANTAGE_...
apache-2.0
373,923,090,265,001,540
32.520833
95
0.630412
false
3.667933
false
false
false
parrainc/jobs-portal-iso700
jobs_portal/settings.py
1
3615
""" Django settings for jobs_portal project. Generated by 'django-admin startproject' using Django 1.11. 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 ...
unlicense
3,272,112,202,115,496,000
24.638298
91
0.669986
false
3.403955
false
false
false
brachiel/rotcbot
jabberbot.py
1
22562
#!/usr/bin/python # -*- coding: utf-8 -*- # JabberBot: A simple jabber/xmpp bot framework # Copyright (c) 2007-2011 Thomas Perl <thp.io/about> # # 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; ...
gpl-3.0
938,640,651,225,199,000
36.919328
141
0.575614
false
4.105914
false
false
false
openstack/zaqar
zaqar/storage/redis/subscriptions.py
1
11355
# Copyright (c) 2015 Catalyst IT Ltd. # # 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 ...
apache-2.0
-2,472,054,833,630,128,000
40.900369
79
0.551035
false
4.615854
false
false
false
acgx/ooi-hack
oh_discussion/models.py
1
4592
from django.core.urlresolvers import reverse_lazy from django.conf import settings from django.db import models from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from django.utils import timezone from mptt.models import MPTTModel, TreeForeignKey class ONode(MPTTModel): ...
gpl-2.0
-1,767,600,785,363,577,000
32.920635
118
0.668226
false
3.037669
false
false
false
DemocracyClub/yournextrepresentative
ynr/apps/moderation_queue/management/commands/moderation_queue_detect_faces_in_queued_images.py
1
2409
import json import boto3 from django.core.management.base import BaseCommand, CommandError from moderation_queue.models import QueuedImage # These magic values are because the AWS API crops faces quite tightly by # default, meaning we literally just get the face. These values are about # right or, they are more righ...
agpl-3.0
-6,778,755,372,919,547,000
35.5
80
0.598589
false
3.860577
false
false
false
jolyonb/edx-platform
lms/djangoapps/course_goals/models.py
1
1260
""" Course Goals Models """ from __future__ import absolute_import from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices from opaque_keys.edx.django.models import CourseKeyField # Each goal is represented by a g...
agpl-3.0
-6,925,073,710,970,054,000
30.5
106
0.664286
false
3.684211
false
false
false
linuxm0nk3ys/conkyPress
py/mod_comments.py
1
1689
#! /usr/bin/env python2.7 from bs4 import BeautifulSoup def printStats(gl, soup, adminPageEx): if adminPageEx == 'true': print('${font Arial:bold:size=10}'+ gl.topicCol +'COMMENTS '+gl.topicLineCol+'${hr 2}') print('${color red}Error getting comment stats') print(gl.secOffset) else: #Private variables pend...
gpl-3.0
-8,220,707,289,308,061,000
27.627119
97
0.609236
false
2.777961
false
false
false
Cloudzero/cloudzero-reactor-aws
reactor/utils/decorators.py
1
5537
# -*- coding: utf-8 -*- # Copyright (c) 2016-present, CloudZero, Inc. All rights reserved. # Licensed under the BSD-style license. See LICENSE file in the project root for full license information. import multiprocessing import signal import sys import time from functools import wraps ###############################...
bsd-3-clause
744,318,115,019,031,800
35.913333
114
0.592379
false
4.71234
false
false
false
MD2Korg/CerebralCortex
jupyter_demo/demo_algorithm/gps_clustering.py
1
4106
# Copyright (c) 2019, MD2K Center of Excellence # - Nasir Ali <nasir.ali08@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above cop...
bsd-2-clause
7,539,623,679,772,456,000
37.735849
80
0.708719
false
3.921681
false
false
false
Wang-Sen/nqzx-backend
bootcamp/auth/views.py
1
1142
from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login from bootcamp.auth.forms import SignUpForm from django.contrib.auth.models import User from bootcamp.feeds.models import Feed from django.utils.translation import ugettext_lazy as _ def signup(request): if request.met...
gpl-3.0
-5,708,250,624,121,392,000
44.68
97
0.65324
false
4.107914
false
false
false
spasiva/pocztowy_konwerter
konwerter.py
1
7143
#!/usr/bin/python3 # # Copyright (C) 2017 Łukasz Kopacz # # This file is part of Pocztowy konwerter. # # Pocztowy konwerter 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 #...
gpl-3.0
-813,897,427,883,694,600
53.106061
118
0.623075
false
2.724914
false
false
false
tiankangkan/paper_plane
treasure/sync_db.py
1
1031
import sys import os def current_file_directory(): return os.path.dirname(os.path.realpath(__file__)) BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(BASE_DIR) from paper_plane import django_models_init from treasure.models import FileMapping from k_util.hash_util import...
gpl-3.0
-5,145,393,756,400,926,000
28.457143
76
0.634336
false
3.02346
false
false
false
gtsapelas/TRANSrisk_fcm_project
TRANSrisk_fcm_project/settings_management/base_settings.py
1
4279
""" Django settings for TRANSrisk_fcm_project project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ ...
mit
1,756,050,001,963,518,000
25.91195
103
0.696892
false
3.470397
false
false
false
lundjordan/slaveapi
slaveapi/web/__init__.py
1
1275
from flask import Flask from .results import Results from .slave import Reboot, Slave, ShutdownBuildslave, GetUptime, GetLastActivity from .slave import Disable, AWSTerminateInstance from .slaves import Slaves app = Flask(__name__) app.add_url_rule("/results", view_func=Results.as_view("results"), methods=["GET"]) a...
mpl-2.0
1,747,946,871,438,649,600
69.833333
149
0.727059
false
3.195489
false
true
false
JohnLunzer/flexx
docs/scripts/uiexample.py
1
6956
""" Small sphinx extension to show a UI example + result """ import os import sys import hashlib import warnings import subprocess import importlib.util from sphinx.util.compat import Directive from docutils import nodes from flexx import app THIS_DIR = os.path.abspath(os.path.dirname(__file__)) ROOT_DIR = os.path....
bsd-2-clause
-2,431,509,267,522,017,300
32.442308
118
0.594307
false
3.467597
false
false
false
OryanMo/itchy-broccoli
populatetables.py
1
3174
#!/usr/bin/python3 import selenium.webdriver.support.ui as ui from time import sleep from selenium import webdriver import sqlite3 from datetime import datetime from pyvirtualdisplay import Display from pathlib import Path db = sqlite3.connect('/root/itchy-broccoli/db/moviedb.db') cinemas = db.cursor() #cursor.execut...
gpl-3.0
5,235,147,248,176,388,000
29.815534
175
0.601449
false
3.598639
false
false
false
anybox/anybox.buildbot.odoo
anybox/buildbot/openerp/utils.py
1
3465
import os import hashlib import subprocess BUILD_UTILS_PATH = os.path.join(os.path.split(__file__)[0], 'build_utils') # can be overridden from command line tools such as update-mirrors, # for the version that has the buildbot hooks. vcs_binaries = dict(bzr='bzr', hg='hg', git='git') def ez_hash(url): """Return...
agpl-3.0
-462,754,591,610,683,900
32.317308
77
0.608369
false
3.837209
false
false
false
acercado/jd-ph-cms
jd-ph-cms/myuser/migrations/0001_initial.py
1
1377
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-29 10:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MyUser'...
bsd-3-clause
3,431,463,518,727,111,700
38.342857
114
0.573711
false
4.330189
false
false
false
manahl/arctic
arctic/chunkstore/tools/tools.py
1
1508
from itertools import groupby import pymongo from arctic.chunkstore.chunkstore import SYMBOL, SEGMENT, START def segment_id_repair(library, symbol=None): """ Ensure that symbol(s) have contiguous segment ids Parameters ---------- library: arctic library symbol: None, str, list of str ...
lgpl-2.1
5,661,819,244,783,407,000
29.77551
89
0.588859
false
4.422287
false
false
false
kebugcheckex/radon
apache_monitor/backend/logfilter.py
1
2862
# URL Filter for Log Monitor import urllib.parse import config import dbo import messaging import utils cacheable_params = None host_ignore_list = None url_ignore_pattern = None agent_ignore_pattern = None def load_cacheable_param(): global cacheable_params cacheable_params = dbo.load_string_list('cacheable...
gpl-3.0
-4,408,366,807,604,016,000
28.505155
100
0.604472
false
3.604534
false
false
false
mlabru/ptracks
model/newton/cine/prc_dir_ponto.py
1
3353
#!/usr/bin/env python # -*- coding: utf-8 -*- """ --------------------------------------------------------------------------------------------------- prc_dir_ponto revision 0.2 2015/nov mlabru pep8 style conventions revision 0.1 2014/nov mlabru initial version (Linux/Python) --------------------------------------...
gpl-3.0
-4,592,119,500,607,738,000
34.542553
130
0.548638
false
2.727347
false
false
false
shane-breeze/DMPlots
python/signalModel.py
1
1512
import os import glob import re from Utils import getLimitsFromFile class SignalModel: def __init__(self, path): """ Initalise: * _path = stats output for this signal model * _model = name of signal model (taken from the path) """ path = path.replace('\n','') ...
gpl-3.0
3,973,868,659,589,617,000
31.170213
72
0.52381
false
3.917098
false
false
false
andersroos/rankedftw
main/update.py
1
16666
import json import socket from collections import deque from datetime import timedelta from logging import getLogger, INFO, WARNING from time import sleep from django.db import transaction from common.utils import utcnow, to_unix, StoppableThread from main.battle_net import BnetClient, ApiLadder from main.client import...
agpl-3.0
1,096,104,690,824,885,500
40.769424
117
0.50144
false
4.419517
false
false
false
megmogmog1965/awscostchart
server/util.py
1
6428
#!/usr/bin/env python # encoding: utf-8 ''' Created on Aug 4, 2016 :author: Yusuke Kawatsu ''' # built-in modules. import os import copy import time import shutil import codecs import sqlite3 import tempfile import datetime # installed modules. from flask import request # my modules. from http_error import make_ht...
mit
2,187,536,141,951,111,700
25.320675
186
0.586085
false
3.203903
false
false
false
openbmc/openbmc-test-automation
lib/gen_plug_in_utils.py
1
23809
#!/usr/bin/env python r""" This module provides functions which are useful to plug-in call point programs. """ import sys import os import re import collections import gen_print as gp import gen_valid as gv import gen_misc as gm import gen_cmd as gc import func_args as fa PLUG_VAR_PREFIX = os.environ.get("PLUG_VAR_...
apache-2.0
944,438,229,631,471,100
39.629693
110
0.638498
false
3.694755
false
false
false
leandrodemarcovedelago/thesis-aco
CspAco.py
1
2628
#!/usr/bin/env python #-*- encoding: utf-8 -*- import time import networkx as nx from Functions import buildGraph, cost, updatePheromone, isSolution, \ buildSaturatedGraph, sensTotal import Ant import sys def runExperiment(samples, scenario1, tau_min, tau_max): g, numPaths, numSol...
gpl-3.0
-5,265,195,603,573,273,000
31.265823
80
0.552511
false
3.701408
false
false
false
ahmedaljazzar/edx-platform
openedx/features/enterprise_support/api.py
1
24868
""" APIs providing support for enterprise functionality. """ import logging from functools import wraps from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.urls import reverse from django.shortcuts import redirect from django.template.loader impo...
agpl-3.0
7,703,140,729,834,478,000
36.564955
118
0.626267
false
4.506705
false
false
false
django-extensions/django-extensions
tests/db/fields/test_uniq_field_mixin_compat.py
1
5584
# -*- coding: utf-8 -*- try: from unittest import mock except ImportError: import mock import six from django.db import models from django.test import TestCase from tests.testapp.models import ( DummyRelationModel, InheritedFromPostWithUniqFieldCompat, PostWithUniqFieldCompat, ReverseModelCompat, Secon...
mit
6,138,063,087,923,542,000
34.794872
97
0.637894
false
3.785763
true
false
false
greeenSY/Tstream
tstream-server/bin/jstorm.py
1
15194
#!/usr/bin/python import os import sys import random import subprocess as sub import getopt def identity(x): return x def cygpath(x): command = ["cygpath", "-wp", x] p = sub.Popen(command,stdout=sub.PIPE) output, errors = p.communicate() lines = output.split("\n") return lines[0] if sys.plat...
apache-2.0
1,662,608,393,907,917,000
38.984211
215
0.65822
false
3.33348
true
false
false
jaor/bigmler
bigmler/processing/samples.py
1
3680
# -*- coding: utf-8 -*- # # Copyright 2015-2020 BigML # # 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,280,145,822,054,038,000
33.392523
76
0.619837
false
4.16761
false
false
false
furious-luke/django-supertest
supertest/helpers.py
1
2189
import random import logging from selenium.common.exceptions import StaleElementReferenceException STRATEGIES = [ 'empty', 'long', 'text', 'integer', 'real', ] logger = logging.getLogger(__name__) def autofill(form): done = set() while 1: # Sometimes the form gets screwed up a...
bsd-3-clause
-3,196,331,769,195,174,400
23.595506
98
0.574235
false
3.881206
false
false
false
Recoskie/netrealms
client/source/engine/network.py
1
1511
class Connection(): import socket import netcmd def __init__(address, port): connect(address, port) def connect(self, address, port): self.sock = socket.socket() self.sock.connect((address, port)) def disconnect(self): self.sock.close() pass def recieve(self, data): data = self.sock.re...
mit
2,866,098,681,061,454,000
30.5
104
0.512244
false
3.597619
false
false
false
MickSandoz/compassion-switzerland
child_sync_typo3/model/project_compassion.py
1
3722
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: David Coninckx # # The licence is in the file __openerp__.py # #######...
agpl-3.0
6,883,415,528,850,355,000
38.021505
78
0.49597
false
3.913775
false
false
false
getsentry/freight
migrations/versions/106230ad9e69_migrate_task_to_deploy.py
1
3895
""" migrate task to deploy Revision ID: 106230ad9e69 Revises: 16c1b29dc47c Create Date: 2016-02-17 00:43:21.608658 """ # revision identifiers, used by Alembic. revision = "106230ad9e69" down_revision = "16c1b29dc47c" from alembic import op import sqlalchemy as sa MIGRATE_TASK_TO_DEPLOY = """ INSERT INTO deploy (ta...
apache-2.0
833,459,868,892,859,900
27.224638
86
0.653915
false
3.369377
false
false
false
hoechenberger/psychopy
changelogUpdateMD.py
1
1949
#!/usr/bin/env python # this script replaces hashtags with a sphinx URL string (to the github issues or pull request) # written by Jon with regex code by Jeremy import re input_path = 'psychopy/CHANGELOG.txt' output_path = 'docs/source/changelog.md' def repl_link(match): name = match.group('name').strip() ...
gpl-3.0
4,051,621,068,185,614,000
27.246377
117
0.620318
false
2.718271
false
false
false
nucleron/IDE
yaplcide.py
1
1737
#!/usr/bin/env python # -*- coding: utf-8 -*- __version__ = "$Revision$" import __builtin__ import gettext import os import sys gettext.install('yaplcide') # this is a dummy to prevent gettext falling down _dist_folder = os.path.split(sys.path[0])[0] _beremiz_folder = os.path.join(_dist_folder, "beremiz") #Ensure ...
gpl-3.0
5,156,411,548,361,681,000
28.440678
78
0.635003
false
3.439604
false
false
false
cemoody/lda2vec
tests/test_topics.py
1
1528
from lda2vec import topics import numpy as np def exp_entropy(log_p): return -np.nansum(np.exp(log_p + 1e-12) * (log_p + 1e-12)) def test_prob_words(): context = np.random.randn(3) vocab = np.random.randn(10, 3) lo = topics.prob_words(context, vocab, temperature=1) hi = topics.prob_words(contex...
mit
376,136,370,618,247,040
30.833333
76
0.587042
false
2.972763
false
false
false
bgoli/pysces
pysces/core2/PyscesCore2Modules.py
1
25156
""" PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net) Copyright (C) 2004-2019 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved, Brett G. Olivier (bgoli@users.sourceforge.net) Triple-J Group for Molecular Cell Physiology Stellenbosch University, South Africa. Permission to us...
bsd-3-clause
-2,331,998,692,438,089,700
32.541333
123
0.550246
false
3.766432
false
false
false
timpalpant/KaggleTSTextClassification
scripts/plot_feature_label_correlations.py
1
1976
#!/usr/bin/env python ''' Compute mutual information between individual features and labels ''' import argparse import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from common import * def opts(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('feat...
gpl-3.0
3,468,496,245,411,220,000
30.380952
74
0.550101
false
3.366269
false
false
false
googleapis/python-aiplatform
samples/snippets/get_model_evaluation_image_object_detection_sample.py
1
1553
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
3,884,235,382,905,818,000
39.868421
89
0.745654
false
3.844059
false
false
false
jedie/django-cms-tools
django_cms_tools/fixture_helper/page_utils.py
1
1256
""" :created: 17.09.2018 by Jens Diemer :copyleft: 2018 by the django-cms-tools team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ from cms.models import Page def get_public_cms_app_namespaces(): """ :return: a tuple() with all cms app namespaces ...
gpl-3.0
8,869,463,960,109,359,000
29.634146
79
0.65207
false
3.912773
false
false
false
DemocracyClub/UK-Polling-Stations
polling_stations/apps/addressbase/migrations/0006_auto_20170927_1215.py
1
2374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("addressbase", "0005_auto_20170927_1128")] operations = [ migrations.CreateModel( name="Onsud", fields=[ ...
bsd-3-clause
7,401,187,087,500,244,000
48.458333
87
0.540859
false
3.780255
false
false
false
MannyGrewal/Manny.CIFAR
Manny.CIFAR/CIFAR/CIFARPlotter.py
1
1321
import math import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pylab ######################################################################## # 2017 - Manny Grewal # Purpose of this class is to visualise a list of images from the CIFAR dataset # How many columns to show...
mit
-463,534,109,181,192,960
33.789474
94
0.655564
false
3.689944
false
false
false
smarx/dropbox-sdk-python
setup.py
1
1572
# Don't import unicode_literals because of a bug in py2 setuptools # where package_data is expected to be str and not unicode. from __future__ import absolute_import, division, print_function # Ensure setuptools is available import sys try: from ez_setup import use_setuptools use_setuptools() except ImportErr...
mit
8,640,483,616,557,169,000
31.081633
75
0.640585
false
3.881481
false
true
false
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/jpype/_gui.py
1
1291
#***************************************************************************** # Copyright 2004-2008 Steve Menard # # 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....
gpl-3.0
-4,746,054,084,462,884,000
34.861111
78
0.604183
false
4.191558
false
false
false
Tisseo/navitia
source/jormungandr/jormungandr/street_network/geovelo.py
1
14245
# Copyright (c) 2001-2017, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public t...
agpl-3.0
8,930,032,594,090,224,000
46.168874
125
0.600351
false
4.072327
false
false
false
mrukhlov/gamesagent
app.py
1
3157
#!/usr/bin/env python '''used as webhook''' import os from flask import ( Flask, request, make_response, jsonify ) app = Flask(__name__) log = app.logger def index_getter(letter): index = 0 index_list = [] for i in 'kitten'.upper(): if i == letter: index_list.append(index) index+=1 return index_list...
apache-2.0
-1,465,702,173,131,409,000
18.861635
104
0.633513
false
2.85443
false
false
false
Sensorino/SensorinoServer-legacy
server/coreEngine.py
1
7965
#!/usr/bin/python3 import logging import threading from threading import Timer import datetime import ConfigParser import sensorino import common import json import mqttThread from errors import * import singleton import traceback # create logger with 'spam_application' logger = logging.getLogger('sensorino_coreEngine...
gpl-2.0
-8,180,565,745,539,014,000
33.781659
162
0.635405
false
4.146278
false
false
false
HazardSJ/HazardBot
enwiki/cfdMultipleMerger.py
1
2343
import re import mwparserfromhell import pywikibot pywikibot.config.family = "wikipedia" pywikibot.config.mylang = "en" site = pywikibot.Site() #site.login() class CFDMultipleMergeBot(object): def __init__(self): self.getMerges() def getMerges(self): page = pywikibot.Page(site, "Wikipedia:...
mit
302,481,474,932,378,500
31.541667
94
0.510883
false
4.110526
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/pornhub.py
1
26854
# coding: utf-8 from __future__ import unicode_literals import functools import itertools import operator import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urllib_request, ) from .openload import PhantomJSwrapper from ..utils import ( determine_ext...
unlicense
5,983,129,461,800,056,000
35.916094
173
0.509278
false
3.570782
false
false
false
ghchinoy/tensorflow
tensorflow/python/autograph/impl/api.py
1
24373
# Copyright 2016 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 applica...
apache-2.0
-3,444,612,548,841,354,000
33.719373
80
0.678579
false
3.950243
false
false
false
reizencroft/euler_project_solutions
python/euler0004.py
1
1218
# Largest palindrome product # https://projecteuler.net/problem=4 # A palindromic number reads the same both ways. # The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. # Find the largest palindrome made from the product of two 3-digit numbers. def get_digits_array(num): q1 = nu...
unlicense
429,094,698,983,628,160
22.423077
88
0.583402
false
2.925481
false
false
false
rlugojr/rekall
version.py
1
6722
#!/usr/bin/python """Global version file. This program is used to manage versions. Prior to each release, please run it with update. """ import argparse import json import os import yaml _VERSION_CODE = ''' import json import os import subprocess try: # We are looking for the git repo which contains this file....
gpl-2.0
-6,194,861,238,376,707,000
29.834862
79
0.626302
false
3.659227
false
false
false
ohmu/poni
poni/colors.py
1
2220
""" ANSI color code escapes for output Copyright (c) 2010-2012 Mika Eloranta See LICENSE for details. """ from __future__ import print_function CODES = { 'reset': '\033[0;m', 'gray' : '\033[1;30m', 'red' : '\033[1;31m', 'green' : '\033[1;32m', 'yellow' : '\033[1;33m', 'blue' : '\033[1;34m', ...
apache-2.0
4,784,208,169,511,834,000
27.101266
71
0.471622
false
2.875648
false
false
false
jasonlingo/StreetViewRoadSafety
src/coverageMap.py
1
1734
""" These functions are used to plot the points on google map by years or road types. """ from util import plotSampledPointMap from config import CONFIG def readDatePoints(filename): f = open(filename, 'r') yearPoints = {} for line in f.readlines(): point, info = line.strip("\n").split("==") ...
mit
-4,551,314,453,734,043,000
24.880597
81
0.612457
false
3.802632
false
false
false
xgds/xgds_sample
xgds_sample/defaultSettings.py
1
4284
#__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance ...
apache-2.0
8,533,889,340,458,262,000
62
345
0.537582
false
3.977716
false
false
false
admiyo/python-nss
doc/examples/httplib_example.py
1
12989
#!/usr/bin/python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla....
gpl-2.0
4,361,818,222,161,771,500
35.485955
100
0.619524
false
3.764928
false
false
false
erybak90/Szkolenie-python
fixture/contact.py
1
6261
from model.contact import Contact import re class ContactHelper: def __init__(self, app): self.app = app def modify_contact_by_index(self, index, new_contact_data): wd = self.app.wd self.select_contact_by_index(index) wd.find_elements_by_css_selector("img[alt='Edit']")[index]....
apache-2.0
5,498,002,403,207,368,000
39.4
126
0.610605
false
3.515441
false
false
false
kilon/sverchok
nodes/matrix/shear.py
1
3309
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
-7,398,982,043,408,580,000
35.766667
94
0.60955
false
3.825434
false
false
false
ff0000/red-fab-deploy2
fab_deploy2/operating_systems/smartos/hiredis.py
1
2151
import os from fab_deploy2 import functions from fab_deploy2.tasks import ContextTask from fabric.api import run, sudo, settings from fabric.contrib.files import exists from fabric.context_managers import cd class HiRedisSetup(ContextTask): """ Setup hiredis """ context_name = 'hiredis' default_...
mit
106,749,202,448,571,200
44.765957
123
0.58252
false
2.883378
false
false
false
uclouvain/osis
base/tests/views/test_learning_unit_deletion.py
1
12652
############################################################################## # # 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 ...
agpl-3.0
1,301,374,154,574,752,000
47.471264
114
0.684373
false
3.889026
true
false
false
GNS3/gns3-server
gns3server/main.py
1
2494
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 GNS3 Technologies Inc. # # 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 optio...
gpl-3.0
-8,854,599,558,480,229,000
27.666667
87
0.665196
false
3.813456
false
false
false
arenadata/ambari
contrib/version-builder/version_builder.py
1
16382
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
apache-2.0
6,374,317,724,062,182,000
32.638604
159
0.685508
false
3.752176
false
false
false
davidwtbuxton/captain-pasty
pasty/tasks.py
1
2309
import datetime from djangae.db.migrations import mapper_library from google.appengine.api import datastore from google.appengine.ext import ndb from . import index from .models import Paste, make_relative_path def entity_to_instance(entity): """Returns an ndb model instance for the datastore entity.""" key...
mit
-7,775,970,714,760,951,000
25.238636
84
0.624513
false
3.395588
false
false
false
rbuffat/pyidf
tests/test_surfacepropertyheattransferalgorithmsurfacelist.py
1
1610
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.advanced_construction import SurfacePropertyHeatTransferAlgorithmSurfaceList log = logging.getLogger(__name__) class TestSurfacePropertyHeatTransferAlgorithmSurfaceList(unittest...
apache-2.0
-8,604,033,729,887,504,000
31.877551
124
0.691925
false
3.870192
false
false
false
jimsize/PySolFC
pysollib/tile/tkhtml.py
1
5073
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
gpl-3.0
-7,982,178,499,061,527,000
33.746575
79
0.528878
false
4.064904
false
false
false
danielfrg/jupyterhub-kubernetes_spawner
kubernetes_spawner/swagger_client/models/v1_security_context.py
1
8371
# coding: utf-8 """ Copyright 2015 SmartBear Software 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 applica...
apache-2.0
3,674,519,270,394,965,000
38.116822
421
0.644487
false
4.398844
false
false
false
jmoh/WADRC_DWI_Processing
archive/determineIncludedVolumes.py
1
2771
import string, os, sys, subprocess #Use MRIConvert to convert images to nifti format. Images will be saved as a 4D file and then split into separate flip angles if len(sys.argv[1:]) < 1: print 'Correct Usage: python determineIncludedVolumes.py <Path to DTIPrep QC Report (.txt) > <output root directory> <dwi file> ...
gpl-3.0
9,062,283,979,012,112,000
25.902913
219
0.723926
false
2.79899
false
false
false
bikalabs/bika.wine
bika/wine/controlpanel/bika_storageconditions.py
1
3289
from AccessControl.SecurityInfo import ClassSecurityInfo from bika.wine import bikaMessageFactory as _ from bika.wine.config import PROJECTNAME from bika.wine.interfaces import IStorageConditions from bika.lims import bikaMessageFactory as _b from bika.lims.browser.bika_listing import BikaListingView from plone.app.con...
agpl-3.0
-562,998,938,167,335,300
37.244186
73
0.595318
false
4.142317
false
false
false
Nevtep/omniwallet
api/properties_service.py
1
8154
import urlparse import os, sys, re import time from flask import Flask, request, jsonify, abort, json, make_response from msc_apps import * #tools_dir = os.environ.get('TOOLSDIR') #lib_path = os.path.abspath(tools_dir) #sys.path.append(lib_path) data_dir_root = os.environ.get('DATADIR') app = Flask(__name__) app.debu...
agpl-3.0
-4,500,479,646,738,443,000
32.694215
217
0.597743
false
3.971749
false
false
false
stuart-knock/tvb-framework
tvb/core/adapters/abcadapter.py
1
57742
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
gpl-2.0
-6,758,727,984,573,712,000
45.379116
120
0.590974
false
4.276552
false
false
false
paulcwatts/drf-json-schema
tests/dummy/settings.py
1
2773
"""Django settings for drf_json_schema project.""" import os from typing import List # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.django...
mit
-8,205,143,553,688,864,000
25.663462
90
0.706455
false
3.349034
false
false
false
cwurld/django_tracker
django_tracker/utils.py
1
1774
import os import codecs import csv from collections import namedtuple import dateutil.parser Record = namedtuple('Record', 'datetime url email ip') def read_tracker_file(tracker_dir: str, the_date: str, target: str, exclude_anonymous: bool = False): """ :param tracker_dir: :param the_date: :p...
mit
-7,564,037,313,264,648,000
27.15873
101
0.562007
false
3.839827
false
false
false
edermartioli/fotometria
photUtils.py
1
2674
# -*- coding: iso-8859-1 -*- """ Created on Wed Jul 12, 2017 @author: Eder Martioli & Janderson Oliveira Laboratorio Nacional de Astrofisica, Brazil """ from astropy.io.fits import getheader import astropy.io.fits as fits import photlib import numpy as np ########### READ TABLE OF COORDINATES #########...
gpl-3.0
-5,199,300,578,352,715,000
24.711538
121
0.615557
false
3.149588
false
false
false
vinc456/coala
coalib/processes/Processing.py
1
28893
import multiprocessing import os import platform import queue import subprocess from itertools import chain from coalib.collecting import Dependencies from coalib.collecting.Collectors import collect_files from coalib.misc.StringConverter import StringConverter from coalib.output.printers.LOG_LEVEL import LOG_LEVEL fr...
agpl-3.0
-7,423,959,529,669,435,000
39.924929
80
0.534559
false
4.955068
false
false
false
KlubbAlfaRomeoNorge/members
admin/__init__.py
1
5300
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # Portello membership system # Copyright (C) 2014 Klubb Alfa Romeo Norge # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
gpl-2.0
-6,283,368,510,747,206,000
35.054422
99
0.562264
false
4.604692
false
false
false
freeflightsim/ffs-app-engine
freeflightsim.appspot.com/distlib/tipfy/__init__.py
1
41328
# -*- coding: utf-8 -*- """ tipfy ~~~~~ Minimalist WSGI application and utilities for App Engine. :copyright: 2010 by tipfy.org. :license: BSD, see LICENSE.txt for more details. """ import logging import os from wsgiref.handlers import CGIHandler # Werkzeug swiss knife. # Need to import werkzeug ...
gpl-2.0
-5,686,333,359,332,392,000
32.356739
96
0.591754
false
4.40738
true
false
false
tylerwmarrs/single-artist-lyric-analysis
lyricanalysis/utils.py
1
1576
import unicodedata import sys from nltk.stem import PorterStemmer def split_sentences(text): sentences = [] for sentence in text.split('\n'): sentence = sentence.strip() if sentence: sentences.append(sentence) return sentences stemmer = PorterStemmer() def stem_...
mit
-4,943,583,380,357,310
25.283333
77
0.645305
false
4
false
false
false
blueshed/blueshed-py
src/blueshed/fling/fling_rpc.py
1
1225
''' Created on Nov 12, 2013 @author: peterb ''' import logging import time from blueshed.fling.fling_client import FlingClient from tornado.ioloop import IOLoop class FlingRPC(FlingClient): def __init__(self, target, url="ws://localhost:7777/ws", reconnect=1): FlingClient.__init__(self, url=url) ...
mit
6,750,943,200,508,859,000
25.652174
85
0.585306
false
3.926282
false
false
false
sclooney94/example-avi-gaiadr1-magnitude-distribution
views.py
1
2732
""" GAVIP Example AVIS: Simple AVI @req: SOW-FUN-010 @req: SOW-FUN-040 @req: SOW-FUN-046 @req: SOW-INT-001 @comp: AVI Web System This is a simple example AVI which demonstrates usage of the GAVIP AVI framework Here in views.py, you can define any type of functions to handle HTTP requests. Any of these functions can ...
lgpl-3.0
-8,593,449,538,297,468,000
29.032967
101
0.711933
false
3.711957
false
false
false
ErwinRieger/ddprint
host/intmath.py
1
5070
# -*- coding: utf-8 -*- # #/* # This file is part of ddprint - a 3D printer firmware. # # Copyright 2021 erwin.rieger@ibrieger.de # # ddprint 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-2.0
-6,284,402,136,257,748,000
27.627119
139
0.546675
false
3.468172
false
false
false
grezesf/Research
Reservoirs/Task0_Replication/code/preprocessing/feat_extract.py
1
2574
#!/usr/bin/python import os import sys import datetime # README # reads the TIMIT dataset, copies the directory structure # performs a mffc extraction on the audio files # input: # TIMITPath: path to the base of the dataset directory # SMILExtractPath: path to SMILExtract executable # ConfPath: path to the SMILExtract...
mit
3,095,255,279,587,556,400
31.582278
141
0.674825
false
3.078947
false
false
false
aitjcize/PyTox
setup.py
1
1268
from distutils.core import setup, Extension from subprocess import Popen, PIPE def supports_av(): h = Popen("ld $LDFLAGS -ltoxav", shell=True, stderr=PIPE) out, err = h.communicate() return 'toxav' not in str(err) sources = ["pytox/pytox.c", "pytox/core.c", "pytox/util.c"] libraries = [ "opus", "sodi...
gpl-3.0
-2,171,528,531,317,965,000
20.491525
63
0.608044
false
2.908257
false
false
false
WaveBlocks/WaveBlocks
src/WaveBlocks/TimeManager.py
1
7218
"""The WaveBlocks Project Provides several computation routines for handling time and timesteps. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011 R. Bourquin @license: Modified BSD License """ from scipy import floor class TimeManager: r""" This class performs several computation with time, timest...
bsd-3-clause
1,664,457,358,564,621,800
30.246753
109
0.584927
false
4.153049
false
false
false
simonemainardi/LSHash
tests/test_lsh.py
1
4542
import random import string from unittest import TestCase from redis import StrictRedis from pprint import pprint import sys import os # add the LSHash package to the current python path sys.path.insert(0, os.path.abspath('../')) # now we can use our lshash package and not the standard one from lshash import LSHash ...
mit
2,219,903,868,623,740,700
34.76378
102
0.547776
false
3.50463
true
false
false
stevshil/PiMediaPlayer
PiGUI/example.py
1
1068
#move the GUI-window from its initial position to see how it stays there only with the new version #note also the flickering happens only in the old version # comment out and in as necessary ################################# easygui with callback import easygui_callback def controller(user_input): print "controller...
apache-2.0
-4,630,286,491,995,790,000
27.864865
98
0.645131
false
3.445161
false
false
false
gkc1000/pyscf
pyscf/fci/direct_uhf.py
1
14649
#!/usr/bin/env python # 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 # # U...
apache-2.0
5,878,243,789,563,975,000
41.46087
89
0.564271
false
2.68789
false
false
false
shaz13/oppia
core/controllers/learner_playlist.py
1
2096
# Copyright 2017 The Oppia 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
7,436,396,985,364,026,000
42.666667
79
0.722328
false
4.069903
false
false
false
MissionCriticalCloud/marvin
marvin/cloudstackAPI/stopVirtualMachine.py
1
24289
"""Stops a virtual machine.""" from baseCmd import * from baseResponse import * class stopVirtualMachineCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """The ID of the virtual machine""" """Required""" self.id = None self.typeInfo['id'] = 'uuid'...
apache-2.0
5,430,298,847,573,778,000
37.800319
145
0.572276
false
4.402574
false
false
false
Mutiny-Games/unicorn-hat-hd
examples/snake.py
1
5313
#!/usr/bin/env python import curses import os import random import time import unicornhathd CONTROLS = { ord('w'): 'up', ord('s'): 'down', ord('a'): 'left', ord('d'): 'right', curses.KEY_UP: 'up', curses.KEY_DOWN: 'down', curses.KEY_LEFT: 'left', curses.KEY_RIGHT: 'right' } class Sn...
mit
2,677,595,456,128,741,000
22.50885
76
0.472238
false
3.434389
false
false
false
GreatEmerald/geoscripting
Assignment1/Complete.py
1
3661
import os os.chdir('/home/tim/geoscripting/lesson11') print os.getcwd() os.chdir('data') ## Loading osgeo try: from osgeo import ogr, osr print 'Import of ogr and osr from osgeo worked. Hurray!\n' except: print 'Import of ogr and osr from osgeo failed\n\n' ## Is the ESRI Shapefile driver available? driverName...
apache-2.0
-55,867,917,027,162,376
26.533835
84
0.749795
false
3.248447
false
false
false
pli3/e2-openwbif
plugin/controllers/views/web/parentcontrollist.py
1
5525
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
gpl-2.0
7,711,901,379,807,445,000
35.111111
199
0.635113
false
3.65894
false
false
false
andymitchhank/bessie
bessie/base.py
1
2160
from functools import partial import requests try: import urlparse as parse except: from urllib import parse class InvalidEndpointException(Exception): pass class BaseClient(object): endpoints = [] separator = '/' base_url = '' def __init__(self, path='', path_params=None, **kwargs): self.path = path ...
mit
4,279,400,171,414,058,000
23.545455
81
0.688426
false
3.2287
false
false
false
x10an14/Programming_Practice
project_euler/9/python/solution.py
1
1427
#!/usr/bin/env python3.7 from math import floor from typing import Tuple from functools import reduce from itertools import combinations_with_replacement def factors( n: int # Number to factorize ) -> Tuple[int]: return tuple( reduce( list.__add__, ( [i, f...
mit
-4,583,035,532,445,794,000
23.186441
94
0.529783
false
3.206742
false
false
false
cranes-bill/cedit
tools/generate-plugin.py
1
5946
#!/usr/bin/env python # -*- coding: utf-8 -*- # generate-plugin.py - cedit plugin skeletton generator # This file is part of cedit # # Copyright (C) 2006 - Steve Frécinaux # # cedit 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...
gpl-2.0
-9,085,646,997,685,193,000
31.664835
95
0.584861
false
3.681115
true
false
false
jdepoix/goto_cloud
goto_cloud/migration_commander/device_identification.py
1
4673
from command.public import SourceCommand from .mountpoint_mapping import MountpointMapper class DeviceIdentificationCommand(SourceCommand): """ takes care of identifying, which of the targets devices, should replicated, which device of the source system """ class NoMatchingDevicesException(SourceComm...
mit
-253,590,842,994,977,500
38.601695
116
0.577573
false
4.720202
false
false
false
rocktavious/pyul
pyul/xmlUtils.py
1
7272
from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl from xml.dom.minidom import parseString try: from cStringIO import StringIO except ImportError: try: from StringIO import StringIO except ImportError: from io import StringIO ...
mit
3,095,048,240,525,451,000
32.205479
72
0.582508
false
4.287736
false
false
false
benosteen/mypaint
lib/brush.py
1
14425
# This file is part of MyPaint. # Copyright (C) 2007 by Martin Renold <martinxyz@gmx.ch> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) ...
gpl-2.0
3,792,774,296,780,017,700
34.972569
112
0.552236
false
4.012517
false
false
false
Musaka96/FB-Chat-Toolkit
chat.py
1
2494
import fbchat def login(): username = input("Enter your id --> ") password = input("Enter your password --> ") try: client = fbchat.Client(username, password) except: print("id or password is wrong") login() menu(client) def menu(client): print("1.Messenger") print("2.Spammer") print("3.Log out") c...
gpl-3.0
1,108,275,265,305,331,300
16.206897
91
0.607458
false
2.893271
false
false
false