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
eugenekolo/project-euler
eulerlib.py
1
3556
#!/usr/bin/python3 # -*- coding: utf-8 -*- ################################################################################ # Commonly used functions for Euler Project (www.projecteuler.com) # Author: Eugene Kolo 2014 # Contact: www.eugenekolo.com ########################################################################...
mit
5,236,229,105,911,455,000
28.147541
80
0.541901
false
3.238616
false
false
false
jjdmol/LOFAR
CEP/GSM/bremen/src/pipeline.py
1
8042
#!/usr/bin/env python import logging import math import os import monetdb.sql as db from src.errors import SourceException, ImageStateError from src.gsmconnectionmanager import GSMConnectionManager from src.gsmlogger import get_gsm_logger from src.sqllist import get_sql, get_svn_version, GLOBALS from src.grouper impo...
gpl-3.0
-943,373,641,355,774,800
39.21
79
0.567645
false
3.928676
false
false
false
SBillion/timetableasy
src/Course.py
1
10584
# -*- coding: utf-8 -*- import gtk import os from random import randint from db import db from Timetableasy import app global interface_course class CourseInterface(object): def __init__(self): from GtkMapper import GtkMapper mapper = GtkMapper('graphics/dialog_course.glade', self, app.debug) self.action_ad...
agpl-3.0
-1,121,114,700,832,665,100
29.148148
104
0.679928
false
2.860773
false
false
false
Vagab0nd/SiCKRAGE
lib3/sqlalchemy/dialects/postgresql/base.py
1
125610
# postgresql/base.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php r""" .. dialect:: postgresql :name: PostgreSQL .. _postgresql_sequences: Se...
gpl-3.0
1,956,788,487,594,982,000
32.531767
96
0.56548
false
4.112967
false
false
false
zeitkunst/FluidNexus
FluidNexus/ui/FluidNexusAboutUI.py
1
8437
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'FluidNexus/ui/FluidNexusAbout.ui' # # Created: Sun Nov 13 17:16:26 2011 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.f...
gpl-3.0
-3,181,977,033,139,788,000
59.697842
186
0.73391
false
3.736492
false
false
false
cobbler/cobbler
cobbler/items/item.py
1
25418
""" Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundatio...
gpl-2.0
-5,420,789,716,813,880,000
32.400788
119
0.568888
false
4.472638
false
false
false
khedron/Plot
graph/line.py
1
1811
from PyQt4.QtCore import QObject, pyqtSignal, QVariant from base.property import prop_sig from style.style import LineStyle from graph.type import Type class Column(QObject): name, name_changed = prop_sig(str, "name") type, type_changed = prop_sig(QVariant.Type, "type") data, data_changed = prop_sig(list, "data") ...
gpl-3.0
-4,145,049,646,966,871,000
27.746032
81
0.712314
false
2.988449
false
false
false
Mazuh/Minerva
views/forms/content.py
1
14357
""" Forms about content editing. """ from flask_wtf import FlaskForm from wtforms import StringField, IntegerField,\ TextAreaField, DateTimeField, SubmitField,\ SelectField, DateField, BooleanField from flask_wtf.file import FileField, FileRequired from wtforms.fields.html5 impo...
gpl-3.0
-3,430,461,533,547,064,000
26.796477
213
0.64334
false
3.702815
false
false
false
devalfrz/django-activity-logger
setup.py
1
2759
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import shutil import sys from setuptools import setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.search("...
bsd-2-clause
-3,930,844,943,590,981,000
29.318681
75
0.614715
false
3.805517
false
false
false
beniwohli/apm-agent-python
elasticapm/metrics/base_metrics.py
1
13902
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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 copyright notice, t...
bsd-3-clause
-679,619,616,388,255,400
34.194937
119
0.593512
false
4.333541
false
false
false
RuthAngus/K2rotation
tests/fap.py
1
1301
import numpy as np # calculate the false alarm probability def fap(x, y, basis, fs, N, plot=False, sig=False): amp2s, s2n, _ = K2pgram(x, y, basis, fs) # 1st pgram if sig: power = s2n else: power = amp2s mf, ms2n = peak_detect(fs, power) # find peak AT = np.concatenate((basis, np.ones((3, len(y))...
mit
-6,241,883,900,449,100,000
35.138889
70
0.58186
false
2.693582
false
false
false
tomchristie/apistar
apistar/compat.py
1
1613
import collections import sys if sys.version_info < (3, 6): dict_type = collections.OrderedDict else: dict_type = dict try: import jinja2 except ImportError: jinja2 = None try: import pygments from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter ...
bsd-3-clause
-1,164,033,854,142,004,500
25.016129
77
0.66026
false
4.233596
false
false
false
absalon-james/python-blueflood
bluefloodclient/client.py
1
9568
import copy import json import logging import pprint import requests import utils from urlparse import urljoin class Datapoint(dict): """ Models a datapoint to be ingested into blueflood. """ logger = logging.getLogger('blueflood.client.Datapoint') def __init__(self, name, value, collection_time...
apache-2.0
-3,208,775,314,037,163,000
29.182965
79
0.559887
false
4.347115
false
false
false
betrisey/home-assistant
homeassistant/config.py
1
11429
"""Module to help with parsing and generating configuration files.""" import asyncio import logging import os import shutil from types import MappingProxyType # pylint: disable=unused-import from typing import Any, Tuple # NOQA import voluptuous as vol from homeassistant.const import ( CONF_LATITUDE, CONF_LONGI...
mit
-4,513,004,092,382,685,000
31.46875
79
0.636976
false
3.867682
true
false
false
zsdonghao/tensorlayer
tensorlayer/layers/extend.py
1
2630
#! /usr/bin/python # -*- coding: utf-8 -*- import tensorflow as tf from tensorlayer.layers.core import Layer from tensorlayer import logging from tensorlayer.decorators import deprecated_alias __all__ = [ 'ExpandDims', 'Tile', ] class ExpandDims(Layer): """ The :class:`ExpandDims` class inserts a...
apache-2.0
-4,437,717,608,415,178,000
26.113402
111
0.585932
false
3.539704
false
false
false
googlefonts/fontbakery-dashboard
containers/base/python/worker/diffenator.py
1
4902
#!/usr/bin/env python from __future__ import print_function, division, unicode_literals import os from .diff_tools_shared import ( DiffWorkerBase , on_each_matching_font ) import diffenator from diffenator.diff import Diff...
apache-2.0
-2,122,081,485,672,597,200
33.027778
110
0.618776
false
3.374656
false
false
false
selkhateeb/tic
docs/conf.py
1
8718
# -*- coding: utf-8 -*- # # Tic Toolkit documentation build configuration file, created by # sphinx-quickstart on Sun Jan 15 11:39:05 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
apache-2.0
8,012,013,657,169,049,000
32.022727
122
0.699587
false
3.767502
true
false
false
GyroscopeHQ/grpcat
hello_pb2.py
1
7371
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: hello.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflect...
mit
-1,346,464,413,731,646,000
33.605634
256
0.715507
false
3.643599
false
false
false
mpekalski/Y8M
video_level_code/xp_video_level_models.py
1
52274
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
5,253,891,996,855,866,000
35.683509
92
0.608237
false
3.665264
false
false
false
nerevu/riko
riko/modules/typecast.py
1
4059
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.modules.typecast ~~~~~~~~~~~~~~~~~~~~~ Provides functions for casting fields into specific types. Examples: basic usage:: >>> from riko.modules.typecast import pipe >>> >>> conf = {'type': 'date'} >>> next(pipe({'content':...
mit
2,967,422,950,843,804,700
29.75
79
0.573787
false
3.884211
false
false
false
paulproteus/tag-sandstorm-tarballs
script.py
1
2150
#!/usr/bin/python import datetime import email.utils import os import glob import pytz import re import subprocess import sys import tempfile DRY_RUN = False if os.environ.get('DRY_RUN', ''): DRY_RUN = True def handle_one(tar_filename): # We're already in a tmpdir, yay. But there might be other # people...
apache-2.0
-4,667,197,656,315,441,000
26.21519
86
0.62186
false
3.423567
false
false
false
samdroid-apps/something-for-reddit
redditisgtk/subentry.py
1
11419
# Copyright 2016 Sam Parkinson <sam@sam.today> # # This file is part of Something for Reddit. # # Something for Reddit 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 ...
gpl-3.0
2,170,667,786,260,079,000
32.585294
79
0.584815
false
3.715913
false
false
false
alpha-rain/zeromon
util/networkUtil.py
1
2991
import datetime import psutil # import cpuinfo import platform import json import re # import tojson def info(): jsondata = '"network":{"info":{' jsondata += '},"usage":{' jsondata += networkConnectionsInfo() jsondata += '}}' return jsondata def networkConnectionsInfo(): networkConnections = p...
lgpl-3.0
3,878,571,183,246,361,000
31.879121
112
0.554998
false
4.194951
false
false
false
ml-slac/deep-jets
viz/performance.py
2
4161
''' performance.py author: Luke de Oliveira (lukedeo@stanford.edu) Usage: >>> weights = np.ones(n_samples) >>> # -- going to match bkg to signal >>> weights[signal == True] = get_weights(sig_pt, bkg_pt) >>> discs = {} >>> add_curve(r'\tau_{32}', 'red', calculate_roc(signal, tau_32, weights=weights)) >>> fg = ROC_plo...
mit
-7,226,643,947,570,281,000
27.114865
128
0.66883
false
2.832539
false
false
false
blebo/pv
pv/__init__.py
1
1425
# Copyright (c) 2010-2011 Edmund Tse # # 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 to # use, copy, modify, merge, publish, dis...
mit
-3,173,980,225,585,122,300
34.625
81
0.74807
false
3.947368
false
false
false
brownharryb/erpnext
erpnext/regional/italy/utils.py
1
14732
from __future__ import unicode_literals import frappe, json, os from frappe.utils import flt, cstr from erpnext.controllers.taxes_and_totals import get_itemised_tax from frappe import _ from frappe.core.doctype.file.file import remove_file from six import string_types from frappe.desk.form.load import get_attachments ...
gpl-3.0
-7,337,605,459,802,171,000
37.165803
139
0.712802
false
3.109985
false
false
false
naterh/chipsec
source/tool/chipsec/utilcmd/pci_cmd.py
1
4384
#!/usr/local/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This pr...
gpl-2.0
8,458,805,531,248,735,000
30.488889
125
0.551323
false
3.349121
false
false
false
jakubbrindza/gtg
GTG/gtk/browser/tag_context_menu.py
1
3597
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
4,590,780,264,420,060,700
38.097826
79
0.582986
false
3.996667
false
false
false
creasyw/IMTAphy
modules/phy/imtaphy/testConfigs/imtaphyViewer/scenario/Probe.py
1
28585
#!/usr/bin/env python ################################################################################ # This file is part of IMTAphy # _____________________________________________________________________________ # # Copyright (C) 2012 # Institute of Communication Networks (LKN) # Department of Electrical Engineering ...
gpl-2.0
8,648,500,860,190,995,000
41.600596
136
0.576141
false
4.431783
false
false
false
billion57/lykos
src/messages.py
1
1332
import json import os import src.settings as var MESSAGES_DIR = os.path.join(os.path.dirname(__file__), "..", "messages") ROOT_DIR = os.path.join(os.path.dirname(__file__), "..") class Messages: def __init__ (self): self.lang = var.LANGUAGE self._load_messages() def get(self, key): i...
bsd-2-clause
7,753,922,367,016,149,000
30.714286
140
0.589339
false
3.542553
false
false
false
sdrogers/ms2ldaviz
ms2ldaviz/decomposition/migrations/0012_auto_20170228_0712.py
1
1821
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-02-28 07:12 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('decomposition', '0011_auto_20170221_1013'), ] operati...
mit
7,012,930,820,296,582,000
38.586957
126
0.610653
false
4.186207
false
false
false
ljjjustin/crystal
tools/gendiagram.py
1
2389
#!/usr/bin/env python import argparse import os import re import sys import string import traceback import urllib ALL_STYLES = [ 'default', 'earth', 'qsd', # traditional 'rose', 'napkin', 'mscgen', # traditional 'modern-blue', 'omegapple', 'roundgreen', # colourful ] WEBSITE...
apache-2.0
-4,146,312,819,985,038,300
25.544444
78
0.582671
false
3.709627
false
false
false
rspavel/spack
lib/spack/spack/test/llnl/util/cpu.py
1
10173
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import pytest import contextlib import os.path import jsonschema import llnl.util.cpu import llnl.util.cpu.detect impo...
lgpl-2.1
5,764,354,231,056,630,000
34.07931
79
0.65261
false
3.194035
true
false
false
patochectp/navitia
source/tyr/tyr/resources.py
1
64116
# coding: utf-8 # Copyright (c) 2001-2014, 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 a...
agpl-3.0
-2,032,189,975,541,319,000
34.818994
113
0.559392
false
4.13705
false
false
false
mvaled/sentry
src/sentry/models/projectoption.py
1
4011
from __future__ import absolute_import, print_function from celery.signals import task_postrun from django.core.signals import request_finished from django.db import models from sentry import projectoptions from sentry.db.models import Model, FlexibleForeignKey, sane_repr from sentry.db.models.fields import Encrypted...
bsd-3-clause
-3,860,437,345,849,938,000
32.705882
96
0.629519
false
3.860443
false
false
false
FIWARE-TMForum/business-ecosystem-charging-backend
src/wstore/store_commons/authentication.py
1
2520
# -*- coding: utf-8 -*- # Copyright (c) 2013 - 2015 CoNWeT Lab., Universidad Politécnica de Madrid # This file belongs to the business-charging-backend # of the Business API Ecosystem. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
-2,010,787,913,831,776,300
34.478873
109
0.662565
false
4.116013
false
false
false
gemfire/py-gemfire-rest
gemfire/Region.py
1
7643
''' Copyright (c) 2014 Pivotal Software, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or ...
apache-2.0
-7,803,278,751,868,218,000
42.180791
117
0.584718
false
3.925526
false
false
false
slkaczma/iot-foosball
table/table.py
1
1996
#!/usr/bin/env python # Modified from python program written by Vance Morris for IoT Foosball table import RPi.GPIO as GPIO import os,json import ibmiotf.application import ibmiotf.device from ibmiotf.codecs import jsonIotfCodec import uuid from time import sleep import signal import sys import logging # setup IoT Fo...
mit
5,044,002,817,899,014,000
25.613333
98
0.742986
false
3.085008
false
false
false
sigopt/sigopt-python
sigopt/runs/factory.py
1
2341
import contextlib from ..exception import RunException from ..interface import Connection from .context import LiveRunContext, NullRunContext class RunFactory(object): CONFIG_CONTEXT_KEY = 'run_connection' RUN_CONTEXT_KEY = 'run_context' _global_run_context = None _global_connection = None _null_run_conte...
mit
-8,505,193,482,968,139,000
26.541176
86
0.680906
false
3.640747
false
false
false
alessandrod/txloadbalancer
txlb/schedulers.py
1
3888
import random import itertools rand = 'rand' roundr = 'roundr' leastc = 'leastc' weightr = 'weightr' weightlc = 'weightlc' sticky = 'sticky' def schedulerFactory(lbType, tracker): """ A dispatch function for a service's scheduler. """ if lbType == rand: return RandomScheduler(tracker) el...
mit
3,526,978,727,571,597,300
26.188811
79
0.63786
false
4.353863
false
false
false
SEL-Columbia/commcare-hq
corehq/pillows/base.py
1
4512
from pillowtop.listener import AliasedElasticPillow from dimagi.utils.decorators.memoized import memoized from django.conf import settings VALUE_TAG = '#value' def map_types(item, mapping, override_root_keys=None): if isinstance(item, dict): return convert_property_dict(item, mapping, override_root_keys=...
bsd-3-clause
-1,508,023,410,971,384,000
35.983607
124
0.609707
false
4.094374
false
false
false
kapteyn-astro/kapteyn
doc/source/EXAMPLES/allskyf4.py
1
2216
from kapteyn import maputils import numpy from service import * fignum = 4 fig = plt.figure(figsize=figsize) frame = fig.add_axes(plotbox) mu = 2.0; phi = 180.0; theta = 60 title = r"""Slant zenithal perspective (SZP) with: ($\mu,\phi,\theta)=(2,180,60)$ with special algorithm for border (Cal. fig.7)""" header = {'NAX...
bsd-3-clause
-7,820,787,603,152,512,000
37.877193
80
0.630866
false
2.380236
false
false
false
simplicitylab/python-experiments
flask-scribus/app/api_resources/scribusjob.py
1
1806
# Import os, json, UUD import uuid, os, json # Import jsonify from flask import jsonify, request # Import resource from flask_restful import Resource # Import Redis from redis import Redis # Import rq from rq import Worker, Queue, Connection # Import buildPDF method which we will pass to our redis queue from app.m...
agpl-3.0
-5,209,896,729,705,639,000
25.558824
84
0.584164
false
4.058427
false
false
false
Zerknechterer/pyload
module/plugins/hoster/MultishareCz.py
1
1866
# -*- coding: utf-8 -*- import random import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" __version__ = "0.40" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P<ID>\d...
gpl-3.0
7,182,225,593,763,931
33.481481
132
0.583781
false
3.16129
false
false
false
common-workflow-language/cwltool
cwltool/builder.py
1
25085
import copy import logging import math from typing import ( IO, Any, Callable, Dict, List, MutableMapping, MutableSequence, Optional, Set, Tuple, Union, cast, ) from rdflib import Graph, URIRef from rdflib.namespace import OWL, RDFS from ruamel.yaml.comments import Comme...
apache-2.0
6,632,848,062,089,828,000
37.181126
127
0.467411
false
4.910924
false
false
false
krischer/prov
prov/tests/test_model.py
1
5958
""" Created on Jan 25, 2012 @author: Trung Dong Huynh """ from __future__ import (absolute_import, division, print_function, unicode_literals) import unittest import logging import os from prov.model import ProvDocument, ProvException from prov.tests import examples from prov.tests.attributes...
mit
3,401,653,147,550,091,000
34.891566
114
0.606747
false
4.006725
true
false
false
andymckay/zamboni
mkt/ratings/models.py
1
6186
import logging from datetime import datetime, timedelta from django.core.cache import cache from django.db import models import bleach from celeryutils import task from tower import ugettext_lazy as _ import amo.models from mkt.translations.fields import save_signal, TranslatedField from mkt.users.models import User...
bsd-3-clause
389,650,824,489,188,000
33.558659
79
0.626253
false
3.868668
false
false
false
lucacioria/socialplus-prototype
DJANGO_GAE/socialplus/routines/sync_people.py
1
2291
# -*- coding: UTF-8 -*- import httplib2 import json import logging from socialplus.utils import * from socialplus.api import create_plus_service from socialplus.routines import update_progress, mark_as_completed from socialplus.data.people import User, save_person from socialplus.data.domain import Domain from googl...
unlicense
-7,203,887,517,442,140,000
36.557377
123
0.637713
false
3.725203
false
false
false
ArionMiles/MIS-Bot
mis_bot/scraper/spiders/profile_spider.py
1
4860
from os import environ import base64 from multiprocessing import Process, Queue from scrapy.spiders.init import InitSpider from scrapy.http import Request, FormRequest from scrapy_splash import SplashRequest import scrapy.crawler as crawler from twisted.internet import reactor from misbot.mis_utils import solve_captc...
mit
-7,269,594,011,955,169,000
41.26087
148
0.626955
false
3.94801
false
false
false
dollarcoins/source
contrib/bitrpc/bitrpc.py
1
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8146") else: access = Ser...
mit
-4,328,271,154,730,532,400
23.185185
79
0.661774
false
3.058158
false
false
false
americanpezza/SecureBox
src/sync/actions.py
1
6989
import os, traceback, textwrap, shutil from settings import APP_PATH from dropbox.rest import ErrorResponse from repo.dropbox.wrapper import DropboxWrapper from cStringIO import StringIO from crypto.file import FileMeta from crypto.exceptions import AuthenticationException __author__ = 'pezza' class ActionFailedE...
mit
-4,650,268,618,778,500,000
34.120603
97
0.601087
false
4.300923
false
false
false
bmng-dev/PyBitmessage
src/helper_sql.py
1
1747
import Queue import threading sqlSubmitQueue = Queue.Queue() #SQLITE3 is so thread-unsafe that they won't even let you call it from different threads using your own locks. SQL objects can only be called from one thread. sqlReturnQueue = Queue.Queue() sqlLock = threading.Lock() def sqlQuery(sqlStatement, *args): s...
mit
7,283,002,600,752,957,000
24.318841
189
0.637092
false
3.91704
false
false
false
joshfalter/alexa-zillow-py
zillow.py
1
2977
import logging from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults from flask import Flask from flask_ask import Ask, request, session, question, statement zillow_data=ZillowWrapper('YOUR ZILLOW WEBSERVICES ID') app = Flask(__name__) ask = Ask(app, '/') logging.getLogger('flask_ask').setLev...
mit
-6,332,835,460,785,553,000
34.753086
307
0.701713
false
3.490035
false
false
false
gergo-/pylibjit
examples/classes.py
1
2076
# pylibjit can be used to statically resolve method calls in object-oriented # code. A call from a compiled method to a compiled method (in the same or # in a different class) bypasses all dynamic lookups if the dynamic type of # the receiver is declared. Note that all instances at runtime must be of # exactly the decl...
gpl-2.0
6,963,909,362,068,810,000
35.421053
78
0.632466
false
3.816176
false
false
false
libyal/esedb-kb
tests/catalog_extractor.py
1
2077
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the ESE database catalog extractor.""" import unittest from esedbrc import catalog_extractor from tests import test_lib class TestOutputWriter(object): """Test output writer.""" def Close(self): """Closes the output writer object.""" return ...
apache-2.0
9,209,506,612,418,782,000
26.328947
92
0.705826
false
4.129225
true
false
false
esacosta/u-mooc
models/courses.py
1
67128
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
801,299,094,941,830,500
34.955008
80
0.599079
false
3.900296
false
false
false
xccui/flink
flink-python/pyflink/common/typeinfo.py
1
30454
################################################################################ # 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...
apache-2.0
6,553,027,169,598,011,000
38.80915
100
0.645958
false
3.914396
false
false
false
timm/timmnix
pypy3-v5.5.0-linux64/lib_pypy/identity_dict.py
1
1502
try: from __pypy__ import identity_dict as idict except ImportError: idict = None from UserDict import DictMixin class IdentityDictPurePython(object, DictMixin): __slots__ = "_dict _keys".split() def __init__(self): self._dict = {} self._keys = {} # id(obj) -> obj def __getitem_...
mit
1,525,193,313,299,822,000
20.15493
48
0.548602
false
3.593301
false
false
false
thekatiebr/NEMO_II
Classifiers/ML_Controller.py
1
3672
from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier import pandas from pandas import DataFrame import pandas.io.sql as psql import KnowledgeBase import NeuralNetworkController import DecisionTreeController import RandomForestController import SVMController import random...
apache-2.0
4,953,417,685,003,964,000
36.479592
110
0.656046
false
3.639247
false
false
false
Florianboux/zds-site
zds/utils/templatetags/interventions.py
1
6597
# coding: utf-8 from datetime import datetime, timedelta import time from django import template from django.db.models import Q, F from zds.article.models import Reaction, ArticleRead from zds.forum.models import TopicFollowed, never_read as never_read_topic, Post, TopicRead from zds.mp.models import PrivateTopic, P...
gpl-3.0
-6,155,662,566,906,783,000
34.272727
102
0.568526
false
3.975889
false
false
false
guyuanlin/try-talk
trytalk/settings/local.py
1
1831
from default import * DEBUG = True TEMPLATE_DEBUG = DEBUG # Using SpatialLite backend DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'trytalk', 'USER': 'test', 'PASSWORD': 'test', 'HOST': '127.0.0.1', 'PORT': '5432', } } # settings for request application REQUE...
apache-2.0
4,495,261,597,991,617,500
22.792208
80
0.652649
false
2.962783
false
false
false
simone-f/qat_script
gui/QatMenu.py
1
7498
#! /usr/bin/env jython # # Copyright 2014 Simone F. <groppo8@gmail.com> # # This file is part of qat_script. # qat_script 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, o...
gpl-2.0
6,789,611,966,408,416,000
40.655556
87
0.555882
false
4.533253
false
false
false
habnabit/panglery
docs/conf.py
1
7868
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import vcversi...
mit
856,033,918,284,303,700
31.512397
81
0.706279
false
3.750238
false
false
false
google-research/google-research
ravens/ravens/tasks/align_box_corner.py
1
2639
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
-9,179,708,957,933,946,000
35.150685
79
0.638499
false
2.89364
false
false
false
stsouko/nmrdb
app/views.py
1
11753
# -*- coding: utf-8 -*- # # Copyright 2015 Ramil Nugmanov <stsouko@live.ru> # This file is part of nmrdb. # # nmrdb 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 # ...
agpl-3.0
2,158,832,724,887,687,400
33.255132
115
0.64866
false
3.392681
false
false
false
fraoustin/mail2blog
mail2blog/main.py
1
9106
#!/usr/bin/env python # -*- coding: utf-8 -*- """ save mail to file for ablog """ from __future__ import print_function # for pylint import sys import os import os.path import shutil import datetime import imaplib import getpass import email import smtplib try: from email.MIMEMultipart import MIMEMultipart ...
gpl-2.0
-1,194,266,685,859,457,000
40.20362
114
0.479025
false
4.470299
false
false
false
pferreir/indico
indico/core/signals/rb.py
1
1189
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from blinker import Namespace _signals = Namespace() booking_created = _signals.signal('booking-create...
mit
-5,946,231,696,676,463,000
32.027778
90
0.745164
false
3.581325
false
false
false
beiju/thekindleonthewall
src/python/web.py
1
13234
from flask import Flask, request, g, render_template, redirect, url_for, session, jsonify, json from apscheduler.scheduler import Scheduler from flask_oauth import OAuth import requests import arduino import time import pytz import datetime from dateutil.parser import parse from settings import * import logging import ...
mit
-4,555,791,068,157,134,000
35.15847
155
0.570198
false
3.726838
false
false
false
au9ustine/elrond
elrond/aliyun-oss-upload.py
1
1825
from __future__ import print_function from __future__ import division import oss2 import sys import datetime import math access_key_id = '<access_key_id>' access_key_secret = '<access_key_secret>' bucket_name = '<bucket_name>' bucket_endpoint = 'http://oss-cn-shanghai.aliyuncs.com' # endpoint name genesis =...
mit
1,349,357,877,743,282,700
35.244898
143
0.665205
false
3.354779
false
false
false
Countbasic/repository.mediabox.storage
plugin.video.burningseries/searchlist.py
1
1661
# -*- coding: utf-8 -*- import xbmc,xbmcaddon,xbmcgui import sys, os, random, json, zlib import urllib, urllib2, cookielib import string, re, base64 import contact SEP = os.sep addonInfo = xbmcaddon.Addon ('plugin.video.burningseries') dataPath = xbmc.translatePath(addonInfo.getAddonInfo('profile')) addonPath = addonI...
gpl-2.0
-6,174,330,035,613,720,000
24.553846
124
0.694762
false
2.791597
false
false
false
TODOTomorrow/qxpacker
qxpacker/TarContainer.py
1
2442
from qxpacker.Container import Container , ContainerFileType from qxpacker.DdContainer import DdContainer from qxpacker.EchoContainer import EchoContainer import os , tempfile import tarfile # OPTIONS: # name : possible values : description #------------------------------------------------------------ # ...
mit
3,619,203,423,904,631,000
38.387097
162
0.576167
false
3.932367
false
false
false
captiosus/treadmill
treadmill/runtime/linux/image/fs.py
1
1629
"""The base implementation for fs plugins.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import logging import six from treadmill import appcfg from treadmill import plugin_manager _LOGGER = loggin...
apache-2.0
-4,066,293,365,900,030,000
23.313433
63
0.644567
false
3.823944
false
false
false
vanceza/short-programs
budget_summary.py
1
1511
#!/usr/bin/python3 import datetime, re, sys if len(sys.argv) > 1: fp = sys.argv[1] else: current_date=str(datetime.date.today()) fp = "/home/zachary/blog2.za3k.com/_posts/{}-weekly-review.md".format(current_date) with open(fp, "r") as f: lines = list(line for line in f) budget_start = re.compile("^\\|...
cc0-1.0
8,097,837,572,993,923,000
42.171429
117
0.636664
false
3.034137
false
false
false
twitter/pants
tests/python/pants_test/engine/legacy/test_address_mapper.py
1
6949
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import object, str import mock from pants.base.specs import Sib...
apache-2.0
1,835,209,349,135,756,500
38.482955
100
0.659088
false
3.440099
true
false
false
scriptharness/python-scriptharness
scriptharness/os.py
1
1164
#!/usr/bin/env python # -*- coding: utf-8 -*- """Wrapping python os and related functions. Args: LOGGER_NAME (str): the default logging.Logger name """ from __future__ import absolute_import, division, print_function, \ unicode_literals import logging import os LOGGER_NAME = "scriptharness.co...
mpl-2.0
-1,072,963,174,791,318,500
24.304348
72
0.62457
false
3.76699
false
false
false
ikn/boom
game/engine/sched.py
1
33054
"""Event scheduler and interpolation.""" from time import time from bisect import bisect from math import cos, atan, exp from random import randrange, expovariate from functools import partial from pygame.time import wait from .conf import conf from .util import ir def _match_in_nest (obj, x): """Check if ever...
gpl-3.0
-880,562,481,323,498,800
33.288382
80
0.559569
false
3.953828
false
false
false
jsfenfen/senate_disbursements
112_sdoc4/read_pages.py
1
11367
import re, csv header_end = re.compile("\s+START\s+END\s+") five_data_re = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(\d\d\/\d\d\/\d\d\d\d)\s*(.+?)\s+([\d\.\-\,]+)\s*\Z") five_data_missing_date = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s{10,}(.*?)\s+([\d\...
bsd-2-clause
923,991,653,169,949,300
37.144295
250
0.568664
false
3.56109
false
false
false
Jan-zou/LeetCode
python/Stack/32_longest_valid_parentheses.py
1
1080
# !/usr/bin/env python # -*- coding: utf-8 -*- ''' Description: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", which has length = 2. Another example is ")()())",...
mit
6,137,508,830,261,811,000
27.421053
136
0.516667
false
4.268775
false
false
false
antoviaque/mail
lmtpd/lmtpd.py
1
1531
#!/usr/bin/python # Imports ########################################################### import asyncore import daemon from pymongo import Connection from smtpd import SMTPChannel, SMTPServer from config import settings from mail import Mail # Classes ########################################################### cl...
agpl-3.0
3,794,836,578,577,613,000
26.836364
91
0.558459
false
3.875949
false
false
false
gdietz/OpenMEE
common_wizard_pages/ui_bootstrap_page.py
1
4515
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'bootstrap_page.ui' # # Created: Wed Oct 16 14:56:05 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except...
gpl-3.0
-7,719,177,139,544,901,000
50.306818
103
0.709856
false
3.862275
false
false
false
sistason/pa3
src/pa3_recognizer/hw_watchdog/main.py
1
2092
import urequests import network import machine import ntptime import utime class Watchdog: NETWORK = ('pa-debug', 'ahchaiSaph6oomieN3oo') def __init__(self): self.downtime = 0 self.relay_powercut = machine.Pin(14, machine.Pin.OUT) self.relay_powercut.off() network.WLAN(netwo...
gpl-3.0
-5,140,031,006,544,024,000
24.82716
65
0.545889
false
3.715808
false
false
false
jantman/gw2copilot
setup.py
1
4102
""" setup.py The latest version of this package is available at: <https://github.com/jantman/gw2copilot> ################################################################################ Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com> This file is part of gw2copilot. gw2copil...
agpl-3.0
-4,623,683,879,201,383,000
36.290909
89
0.623111
false
3.914122
false
false
false
fedora-infra/hrf
hrf/hrf.py
1
4008
from flask import Flask, Response, request, jsonify import fedmsg.config import fedmsg.meta import json import datetime import pretty import requests from pytz import timezone, UnknownTimeZoneError meta_config = fedmsg.config.load_config([], None) fedmsg.meta.make_processors(**meta_config) app = Flask(__name__) app.d...
lgpl-2.1
776,196,798,319,913,500
29.830769
89
0.598303
false
3.872464
false
false
false
juancarlospaco/webutil
main.py
1
17750
# -*- coding: utf-8 -*- # PEP8:NO, LINT:OK, PY3:OK ############################################################################# ## This file may be used under the terms of the GNU General Public ## License version 2.0 or 3.0 as published by the Free Software Foundation ## and appearing in the file LICENSE.GPL includ...
gpl-3.0
-5,969,184,844,555,903,000
45.103896
134
0.614817
false
3.62171
false
false
false
arcosta/sci-synergy
code/web/scisynergy_flask/quiz_controller.py
1
1310
""" Created on 01/10/2018 @author: aurelio """ from flask import render_template, request, session, redirect, url_for from scisynergy_flask import app from .models import Researcher from flask.helpers import make_response def insert_answer(userid, idx, form): pass @app.route('/questionario', methods=['GET', ...
mit
-6,686,533,588,751,310,000
25.734694
72
0.607634
false
3.589041
false
false
false
arthurlogilab/taurus
tests/modules/test_GrinderExecutor.py
1
3707
''' Created on Mar 23, 2015 @author: Coeurl ''' import shutil import os from tests import setup_test_logging, BZTestCase, __dir__ from bzt.modules.grinder import GrinderExecutor from tests.mocks import EngineEmul from bzt.utils import BetterDict setup_test_logging() class TestGrinderExecutor(BZTestCase): def ...
apache-2.0
302,198,232,061,096,640
38.860215
114
0.622336
false
3.809866
true
false
false
Royce/GammaJS
support/web/cwf/urls/section.py
1
8769
from django.conf.urls.defaults import include, patterns from django.views.generic.simple import redirect_to class Section(object): def __init__(self, name, obj=None, target=None, redirectTo=None, match=None, values=None, new=None, valuesAsSet=True, compareFunc=None, needsAuth=False, perms=None, di...
mit
8,235,032,723,141,327,000
31.120879
100
0.430608
false
5.01659
false
false
false
TheEndarkenedOne/PrussianBlue
src/PrussianBlue/ccproto.py
1
13774
#!/usr/bin/env python # # This file is part of PrussianBlue. # Copyright 2016, William Ewing. All rights reserved. # # PrussianBlue 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 t...
agpl-3.0
-4,088,800,119,861,771,300
23.207381
79
0.524031
false
3.866929
false
false
false
jonasrothfuss/DeepEpisodicMemory
data_prep/model_input.py
1
5217
"""Convert data to TFRecords file format with example protos. An Example is a mostly-normalized data format for storing data for training and inference. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf from tensorflow....
mit
-3,275,228,045,268,129,300
33.098039
119
0.648074
false
3.899103
true
false
false
mbedmicro/pyOCD
src/analyzer/generate_python.py
1
1298
# pyOCD debugger # Copyright (c) 2006-2015 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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
-3,642,950,460,871,087,000
27.844444
74
0.670262
false
3.269521
false
false
false
gloaec/trifle
src/trifle/anyconfig/parser.py
1
3640
# # Copyright (C) 2011 - 2013 Satoru SATOH <ssato @ redhat.com> # License: MIT # """Misc parsers""" import re INT_PATTERN = re.compile(r"^(\d|([1-9]\d+))$") BOOL_PATTERN = re.compile(r"^(true|false)$", re.I) STR_PATTERN = re.compile(r"^['\"](.*)['\"]$") def parse_single(s): """ Very simple parser to parse e...
gpl-3.0
-2,545,860,632,176,178,000
23.931507
79
0.547802
false
3.148789
false
false
false
AnnieJumpCannon/RAVE
article/figures/plot_kordopatis_calibration_sample.py
1
3739
""" Plot giant abundances w.r.t. GES. """ import numpy as np import matplotlib.pyplot as plt from collections import OrderedDict from matplotlib.ticker import MaxNLocator from matplotlib.colors import LogNorm from mpl_toolkits.axes_grid1 import make_axes_locatable try: rave_cannon_dr1, kordopatis_comparisons ...
mit
6,726,250,664,844,613,000
27.112782
105
0.625836
false
2.501003
false
false
false
pombredanne/product-definition-center
pdc/apps/osbs/views.py
1
2944
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from rest_framework import mixins from rest_framework import viewsets from pdc.apps.common import viewsets as common_viewsets from pdc.apps.auth.permissions import APIPermission from . import filters from . imp...
mit
-6,829,052,093,177,501,000
27.582524
105
0.619905
false
4.117483
false
false
false
persandstrom/home-assistant
homeassistant/components/shell_command.py
2
3372
""" Exposes regular shell commands as services. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/shell_command/ """ import asyncio import logging import shlex import voluptuous as vol from homeassistant.exceptions import TemplateError from homeassistant....
apache-2.0
-705,549,576,785,525,800
31.737864
77
0.588078
false
4.472149
true
false
false
Barrog/C4-Datapack
data/jscript/quests/235_MimirsElixir/__init__.py
1
5604
# Mimir's Elixir version 0.1 # by Fulminus print "importing quests:", import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest #Quest info QUEST_NUMBER,QUEST_NAME,QUEST_DESCRIPTION ...
gpl-2.0
-8,237,252,240,355,856,000
37.383562
122
0.607602
false
3.021024
false
false
false
zycdragonball/tensorflow
tensorflow/python/profiler/tfprof_logger.py
1
6882
# Copyright 2015 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,209,182,756,314,235,400
35.802139
80
0.661
false
3.575065
false
false
false
juliogonzalez/ebs-tools
lib/dateutils.py
1
2873
# ebs-tools, a set of tools to manage EBS volumes and snapshots # # Copyright (C) 2014 Julio Gonzalez Gil <julio@juliogonzalez.es> # # This file is part of ebs-tools (http://github.com/juliogonzalez/ebs-tools) # # ebs-tools is free software: you can redistribute it and/or modify # it under the terms of the GNU General ...
gpl-3.0
-6,829,628,543,422,717,000
40.637681
76
0.661678
false
4.098431
false
false
false
srkiyengar/NewGripper
src/screen_print.py
1
1424
__author__ = 'srkiyengar' import pygame #Acknowledgement - code modified from http://www.pygame.org/docs/ sample # Define some colors BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) RED = (255, 0, 0) # This is a simple class that will help us print to the screen # It has nothing to do with the joyst...
mit
209,540,489,297,353,800
20.253731
72
0.582163
false
3.390476
false
false
false
cvium/Flexget
flexget/plugins/input/rss.py
1
21300
from __future__ import unicode_literals, division, absolute_import import os import logging import urlparse import xml.sax import posixpath import httplib from datetime import datetime import dateutil.parser import feedparser from requests import RequestException from flexget import plugin from flexget.config_schema...
mit
-5,759,711,510,930,233,000
43.747899
119
0.546432
false
4.557125
true
false
false
braddockcg/internet-in-a-box
iiab/kiwix.py
1
2600
#!/usr/bin/env python from xml.etree import ElementTree as etree from base64 import b64decode import iso639 import os def clean_book(book): """Fixes up the book data""" clean_book = {} for k, v in book.items(): if k == "favicon": v = b64decode(v) elif k == "mediaCount": ...
bsd-2-clause
-2,734,033,899,992,651,000
31.5
82
0.517308
false
4
false
false
false