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
deepfield/ibis
ibis/sql/mysql/compiler.py
1
6887
import pandas as pd import sqlalchemy as sa import sqlalchemy.dialects.mysql as mysql from ibis.sql.alchemy import (unary, fixed_arity, infix_op, _variance_reduction) import ibis.common as com import ibis.expr.types as ir import ibis.expr.datatypes as dt import ibis.expr.operations as ops...
apache-2.0
-8,932,553,061,287,775,000
25.590734
79
0.62422
false
3.281086
false
false
false
Cad/nameko-rethinkdb
test/test_nameko_rethinkdb.py
1
3632
import os import uuid import pytest from weakref import WeakKeyDictionary from nameko.testing.services import entrypoint_hook, dummy from nameko.testing.utils import get_extension from mock import Mock import rethinkdb as r from rethinkdb.errors import RqlRuntimeError from nameko_rethinkdb import RDB, RDB_KEY RDB_...
apache-2.0
-1,585,711,963,583,978,000
24.222222
75
0.609031
false
3.560784
true
false
false
AsgerPetersen/tiledrasterio
tiledrasterio/_virtualraster.py
1
8905
# coding: utf-8 # In[1]: import os import rasterio from math import floor, ceil import numpy as np # In[24]: class VirtualRaster(): def __init__(self, shape, transformation = None, proj4_crs = None): self.height = shape[0] self.width = shape[1] self.transform = transformation s...
mit
-6,827,677,199,476,705,000
41.004717
113
0.603593
false
3.580619
false
false
false
hustkerry/ML
src/ann/mlp.py
1
26672
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File Name: MLP.py Author: Kerry Mail: yuyao90@gmail.com Created Time: 2016年10月18日 星期二 11时28分14秒 Description: 多层感知器,一种监督式神经网络算法,可以用来做分类(2分类,多分类,多标签分类)和回归, 主要取决于在output layer使用的激活函数(logistic、softmax、identity)。参数优化的算法为误差反向传导 方法,具体的支持使用多种SGD方式(mini_batch)。 Referenc...
apache-2.0
-8,613,274,251,287,674,000
40.962756
100
0.555205
false
2.597879
false
false
false
ivoire/ReactOBus
reactobus/core.py
1
1772
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2016 Rémi Duraffort # This file is part of ReactOBus. # # ReactOBus 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, ...
agpl-3.0
-4,419,558,720,863,790,600
32.415094
77
0.671937
false
3.808602
false
false
false
opencivicdata/scrapers-ca
disabled/ca_nl_municipalities/people.py
1
3744
from utils import CanadianScraper, CanadianPerson as Person from pupa.scrape import Organization import os import re import subprocess from urllib.request import urlopen COUNCIL_PAGE = 'http://www.ma.gov.nl.ca/ma/municipal_directory/index.html' class NewfoundlandAndLabradorMunicipalitiesPersonScraper(CanadianScrape...
mit
-4,509,376,508,700,123,000
50.287671
153
0.545139
false
3.875776
false
false
false
bureaucratic-labs/pinkerton
pinkerton/tests/test_linker.py
1
1153
import pytest from pinkerton.linker import EntityLinker from pinkerton.extractor import EntityExtractor from pinkerton.similarity import LDASimilarity from pinkerton.providers import WikipediaProvider @pytest.fixture def history_text(): return ''' Иван Васильевич, царь всея руси, по историческим данным, был...
mit
-394,008,716,112,874,750
27.210526
134
0.663246
false
2.843501
false
false
false
trendelkampschroer/PyEMMA
pyemma/_base/progress/reporter.py
1
4786
''' Created on 16.07.2015 @author: marscher ''' from __future__ import absolute_import from pyemma.util.types import is_int from pyemma._base.progress.bar import ProgressBar as _ProgressBar from pyemma._base.progress.bar import show_progressbar as _show_progressbar class ProgressReporter(object): """ Derive from...
bsd-2-clause
-2,879,395,618,199,037,400
36.984127
91
0.624948
false
4.350909
false
false
false
openstack/rally
rally/common/db/migrations/versions/2016_01_ca3626f62937_init_migration.py
1
7920
# Copyright (c) 2016 Mirantis 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 require...
apache-2.0
6,561,320,124,382,621,000
40.684211
79
0.62399
false
3.839069
false
false
false
opesci/devito
devito/passes/iet/languages/openmp.py
1
6258
import cgen as c from sympy import Not from devito.arch import AMDGPUX, NVIDIAX from devito.ir import (Block, Call, Conditional, List, Prodder, ParallelIteration, ParallelBlock, PointerCast, While, FindNodes, Transformer) from devito.mpi.routines import IrecvCall, IsendCall from devito.passes.ie...
mit
9,140,172,263,593,566,000
31.092308
90
0.616012
false
3.66823
false
false
false
retr0h/ansible
test/TestRunner.py
1
25293
# tests are fairly 'live' (but safe to run) # setup authorized_keys for logged in user such # that the user can log in as themselves before running tests import unittest import getpass import ansible.runner import os import shutil import time import tempfile from nose.plugins.skip import SkipTest def get_binary(na...
gpl-3.0
2,774,080,525,903,675,400
39.339713
133
0.539675
false
4.087427
true
false
false
seecr/weightless-core
setup.py
1
2970
#!/usr/bin/env python ## begin license ## # # "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io # # Copyright (C) 2006-2011 Seek You Too (CQ2) http://www.cq2.nl # Copyright (C) 2011-2012, 2015, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl # # This file is part of "Weig...
gpl-2.0
-3,168,034,106,615,879,000
36.125
237
0.676768
false
3.970588
false
false
false
Reinaesaya/OUIRL-ChatBot
tests/training_tests/test_list_training.py
1
6825
# -*- coding: utf-8 -*- from tests.base_case import ChatBotTestCase from chatterbot.trainers import ListTrainer class ListTrainingTests(ChatBotTestCase): def setUp(self): super(ListTrainingTests, self).setUp() self.chatbot.set_trainer(ListTrainer) def test_training_adds_statements(self): ...
bsd-3-clause
5,038,697,892,158,376,000
30.36715
89
0.543662
false
3.297613
true
false
false
codeforamerica/comport
comport/department/views.py
1
21005
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, request, redirect, url_for, flash, Response, abort from .models import Department, Extractor from comport.data.models import DemographicValue, DenominatorValue from flask.ext.login import login_required from comport.decorators import admin_or_depart...
bsd-3-clause
-4,313,935,917,857,913,000
41.178715
174
0.733349
false
3.503169
false
false
false
orezpraw/estimate-charm
estimatecharm/pythonSource.py
1
3918
#!/usr/bin/python # Copyright 2013, 2014, 2015 Joshua Charles Campbell, Alex Wilson # # This file is part of EstimateCharm. # # EstimateCharm 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 Found...
agpl-3.0
4,989,256,644,889,786,000
31.122951
114
0.552578
false
3.844946
false
false
false
pelitweets/pelitweets-bot
TwitterBot.py
1
2586
# -*- coding: utf-8 -*- #!/usr/bin/python # Based on https://github.com/peterwalker78/twitterbot import tweepy import datetime import time from os import environ import pymongo # Twitter parameters try: consumer_key = environ['TWITTER_CONSUMER_KEY'] consumer_secret = environ['TWITTER_CONSUMER_SECRET'] ...
mit
6,031,489,597,193,782,000
30.536585
206
0.688322
false
3.302682
false
false
false
vls/cffi_re2
tests/TestBasicRegex.py
1
7832
#!/usr/bin/env python # -*- coding: utf-8 -*- import cffi_re2 import sys import re as pyre if sys.version_info < (2, 7): from nose.tools import raises from nose_extra_tools import assert_is_not_none, assert_is_none, assert_equal, assert_true, assert_false else: from nose.tools import raises, assert_is_not_n...
mit
6,689,135,428,112,306,000
38.438776
110
0.563907
false
2.884328
true
false
false
snyderr/robotframework
src/robot/running/userkeywordrunner.py
1
9358
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
3,379,643,884,879,973,000
39.686957
82
0.615409
false
4.376988
false
false
false
Opentrons/otone_frontend
scripts/zip_ot_app.py
1
7057
import sys import os import platform import re import subprocess import struct import time import zipfile script_tag = "[OT-App zipping] " script_tab = " " # The project_root_dir depends on this file location, assumed to be two levels # below project root, so it cannot be moved without updating ...
apache-2.0
-8,465,474,372,647,020,000
34.285
80
0.577157
false
3.618974
false
false
false
ptarroso/JoinSplit
JoinSplit_dialog.py
1
6960
# -*- coding: utf-8 -*- """ /*************************************************************************** JoinSplitDialog A QGIS plugin JoinSplit ------------------- begin : 2015-02-25 git sha : $Format:%H$ ...
gpl-3.0
-365,973,032,194,760,960
38.771429
119
0.572126
false
4.231003
false
false
false
deepmind/bsuite
bsuite/__init__.py
1
1081
# python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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...
apache-2.0
8,878,673,792,378,914,000
40.576923
78
0.704903
false
3.714777
false
false
false
karanchawla/CallistoRover
src/callisto_control/diffdrive_controller/src/diffdrive_controller.py
1
2557
#!/usr/bin/python import rospy import roslib # Messages from geometry_msgs.msg import Twist from std_msgs.msg import Float32 class CmdVelToDiffDriveMotors: def __init__(self): rospy.init_node('diffdrive_controller') self.cmdvel_sub = rospy.Subscriber('cmd_vel', Twist, self.twistCallback) self.lwheel_tan...
mit
5,752,347,480,478,748,000
34.027397
109
0.678138
false
3.125917
false
false
false
timbuchwaldt/bundlewrap
bundlewrap/deps.py
1
23872
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .exceptions import BundleError, ItemDependencyError, NoSuchItem from .items import Item from .items.actions import Action from .utils.text import bold, mark_for_translation as _ from .utils.ui import io class DummyItem(object): bundle = None ...
gpl-3.0
-2,515,795,947,550,293,000
34.418398
93
0.55496
false
4.259054
false
false
false
Karandash8/claude_reborn
claude_core/tools/messaging.py
1
5585
''' Created on Sep 4, 2015 @author: andrei ''' from kombu import Connection import time from Queue import Empty import ConfigParser import tools.auxiliary as auxiliary import logging import netifaces as ni supported_apps = ['grok', 'enkf'] msg_args = { 'retrieve_cli_output': ['app_id'], ...
gpl-2.0
-2,158,500,554,645,272,000
35.509804
129
0.506714
false
4.418513
false
false
false
zjutjsj1004/third
boost/tools/build/src/tools/builtin.py
1
32270
# Status: minor updates by Steven Watanabe to make gcc work # # Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, and ...
mit
3,333,964,424,337,424,400
40.741722
153
0.603843
false
3.955142
false
false
false
zak-k/iris
lib/iris/tests/test_coding_standards.py
1
17046
# (C) British Crown Copyright 2013 - 2017, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
2,708,981,606,005,563,000
40.373786
79
0.571688
false
3.994844
true
false
false
maikodaraine/EnlightenmentUbuntu
bindings/python/python-efl/examples/elementary/test_hoversel.py
1
3123
#!/usr/bin/env python # encoding: utf-8 import os from efl.evas import EVAS_HINT_EXPAND from efl import elementary from efl.elementary.window import StandardWindow from efl.elementary.box import Box from efl.elementary.hoversel import Hoversel, ELM_ICON_STANDARD, ELM_ICON_FILE from efl.elementary.icon import Icon EX...
unlicense
7,743,831,754,863,671,000
31.53125
79
0.649376
false
2.793381
false
false
false
StackStorm/mistral
mistral/utils/__init__.py
1
13815
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # Copyright 2016 - Brocade Communications Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License ...
apache-2.0
2,932,834,918,021,687,000
25.314286
78
0.603909
false
3.890453
false
false
false
stefanaspect/lovetz
orig/sc_parse_history.py
1
2221
import os from xml.etree.ElementTree import parse import re import sys if len(sys.argv) == 2: tree = parse(sys.argv[1]) else: sys.exit(0) target = "" domre = re.compile('HOST') secre = re.compile('[Ss][Ee][Cc][Uu][Rr][Ee];?') htore = re.compile('[Hh][Tt]{2}[Pp]-[Oo][Nn][Ll][Yy];?') class Hea...
mit
2,034,688,851,428,894,700
20.21
60
0.607384
false
2.869509
false
false
false
JervyShi/python-utils
fileEncodingChange/change.py
1
1853
# -*- coding:utf-8 -*- __author__ = 'jervyshi' import chardet import os class Change(object): def __init__(self, readPath, writePath, fromEncoding, toEncoding): self.readPath = readPath self.writePath = writePath self.fromEncoding = fromEncoding self.toEncoding = toEncoding ...
gpl-2.0
5,217,071,650,522,374,000
33.981132
197
0.571506
false
3.53626
false
false
false
jmakov/ggrc-core
src/ggrc_basic_permissions/__init__.py
1
24214
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: david@reciprocitylabs.com # Maintained By: david@reciprocitylabs.com import datetime from flask import Blueprint, session, g import sqlalchemy.orm ...
apache-2.0
-688,696,619,076,752,400
35.577039
127
0.669076
false
3.943648
false
false
false
Buntworthy/jowr
jowr/calibration.py
1
10814
import os import zipfile import pickle import glob import jowr import cv2 import numpy as np # TODO method to write the calibration to plain text class Calibrator(object): """ Class to help with camera calibration. Run calibration using a chequerboard pattern calibration can be performed on a jowr read...
agpl-3.0
4,572,051,952,089,296,000
35.657627
80
0.539023
false
4.576386
false
false
false
kevroy314/msl-iposition-pipeline
cogrecon/misc/heatmap_transform.py
1
1398
from matplotlib import pyplot as plt from matplotlib import cm as cm from matplotlib import mlab as ml import numpy as np from draggable_points import DraggablePoint import matplotlib.patches as patches def test_heatmap_transform(): """ This function test the dynamic heatmap module used to help perform 2D his...
gpl-3.0
-8,197,172,101,991,800,000
28.744681
99
0.620887
false
3.03913
false
false
false
AlexanderSk/fail2ban
config/action.d/smtp.py
1
6020
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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-2.0
407,124,162,790,699,600
25.875
81
0.683887
false
3.282443
false
false
false
OCA/event
website_event_questions_template/models/event_question_template.py
1
1480
# Copyright 2017 Tecnativa - Sergio Teruel # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models class TemplateEventQuestion(models.Model): _name = 'event.question.template' _description = 'Event questions template' name = fields.Char(required=True) question...
agpl-3.0
-1,958,689,535,332,021,500
28.019608
63
0.666892
false
3.834197
false
false
false
graphql-python/graphene
graphene/types/interface.py
1
2228
from .base import BaseOptions, BaseType from .field import Field from .utils import yank_fields_from_attrs # For static type checking with Mypy MYPY = False if MYPY: from typing import Dict # NOQA class InterfaceOptions(BaseOptions): fields = None # type: Dict[str, Field] class Interface(BaseType): "...
mit
-3,083,070,874,993,569,000
30.380282
99
0.639587
false
4.368627
false
false
false
digitie/magneto
db/schema.py
1
26888
# -*- coding: utf-8 -*- # to workaround sqlalchemy's get_characterset_info bug, which only applies to py2k. #import mysql.connector #mysql.connector.MySQLConnection.get_characterset_info=lambda cls:cls.charset from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema impo...
unlicense
2,794,319,458,875,567,600
34.707835
181
0.600863
false
3.147372
false
false
false
GianlucaBortoli/enhanced-clustering
src/graphics.py
1
3378
# coding: utf-8 from __future__ import print_function import numpy.random as rnd from dbb import get_EIA from matplotlib import pyplot as plt, transforms from matplotlib.patches import Ellipse from pylab import figure from scipy.interpolate import interp1d FIGSIZE = (20, 14) EXT = "png" def extract_dname(dname): ...
bsd-3-clause
-1,914,083,688,656,876,000
31.480769
73
0.583777
false
3.032316
false
false
false
reed-college/lemur
lemur/tests/helper_random.py
1
9341
# This file consists of the functions that generate random values or # create objects in db for testing import sys sys.path.append('../..') # Libraries # Standard library from random import choice, randint, shuffle from string import ascii_lowercase, ascii_uppercase, digits # Local from lemur import models as m from l...
mit
-3,815,309,735,058,515,000
35.488281
107
0.632588
false
3.717071
false
false
false
datawire/quark
quarkc/test/ffi/expected/py/signatures/inheritance/use_before_def/__init__.py
1
1353
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from builtins import str as unicode from quark_runtime import * _lazyImport.plug("inheritance.use_before_def") import quark.reflect class Bar(_QObject): def _init(s...
apache-2.0
-9,112,272,500,425,932,000
22.327586
83
0.63932
false
3.496124
false
false
false
KEMPtechnologies/python-kemptech-api
python_kemptech_api/objects.py
1
71363
import re import logging from collections import OrderedDict from python_kemptech_api.api_xml import ( get_data, is_successful, get_error_msg) from python_kemptech_api.exceptions import ( KempTechApiException, SubVsCannotCreateSubVs, RealServerMissingVirtualServiceInfo, RealServerMissingLoa...
apache-2.0
-1,186,749,965,522,894,800
31.720312
90
0.566694
false
4.094498
false
false
false
sug4rok/Servus
Servus/plugins/arduino_yl83/widget.py
1
2253
# coding=utf-8 from plugins.utils import get_used_plugins_by, get_latest_sensor_value from climate.models import RaindropValue def rain_level(sensor, number): """ Функция, определяющая 4 уровня осадков. Необходимо подстройка с учетом расположения, исполнения, угола наклона и пр. датчика дождя. Поэтом...
mit
283,418,469,228,938,800
34.82
99
0.680067
false
2.087413
false
false
false
Jindam/HPCGISLab
setup.py
2
1970
""" Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Authors and contributors: Eric Shook (eshook@kent.edu); Zhengliang Feng (odayfans@gmail.com, zfeng2@kent.edu) """ from set...
bsd-3-clause
3,017,802,232,708,107,300
40.041667
214
0.711168
false
3.621324
false
false
false
ilanschnell/ironpkg
enstaller/utils.py
1
3500
import sys import hashlib import urlparse import urllib2 from os.path import abspath, expanduser from egginst.utils import human_bytes, rm_rf from enstaller import __version__ from enstaller.verlib import NormalizedVersion, IrrationalVersionError def abs_expanduser(path): return abspath(expanduser(path)) def c...
bsd-3-clause
-8,809,423,909,564,426,000
25.717557
79
0.584
false
3.684211
false
false
false
OSSESAC/odoopubarquiluz
addons/account/account_cash_statement.py
1
21372
# encoding: utf-8 ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
-3,085,056,484,625,786,400
50.251799
254
0.586234
false
3.729192
false
false
false
scztt/sc-debug
windows/distrowin.py
2
8830
# distrowin.py # script to generate SuperCollider WIX (windows installer xml) source file from template # Copyright (c) 2008 Dan Stowell. All rights reserved. # # 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 F...
gpl-2.0
4,047,091,641,985,246,000
47.887006
197
0.675425
false
3.01571
false
false
false
iniverno/RnR-LLC
simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/sim_commands.py
1
344681
import sys, os, time, string, types if os.environ.has_key('SIMICS_PYCHECKER'): os.environ['PYCHECKER'] = ('--no-shadowbuiltin --no-argsused' + ' --no-implicitreturns --no-shadow') import pychecker.checker from cli import * from refmanual import * from re import * from string imp...
gpl-2.0
2,509,845,110,772,104,700
35.228821
230
0.563231
false
3.636911
false
false
false
weijia/object_view
object_view/operations_local.py
1
2265
import json import os import threading from django.http import HttpResponse import time from libtool import find_root_path from object_filter.operations import get_tag_info_for_obj from objsys.obj_tagging_local import UfsFilter from ufs_utils.django_utils import retrieve_param from ufs_utils.misc import ensure_dir from...
bsd-3-clause
-8,763,156,990,591,533,000
36.766667
95
0.60883
false
3.506192
false
false
false
galaxyproject/cargo-port
bin/verify.py
1
2061
#!/usr/bin/env python import os import sys # Conditional import to ensure we can run without non-stdlib on py2k. if sys.version_info.major > 2: from builtins import str from builtins import zip from builtins import object import json import subprocess import logging from cargoport.utils import (package_to_...
mit
-1,555,088,605,659,912,000
31.203125
103
0.614265
false
3.693548
false
false
false
s20121035/rk3288_android5.1_repo
external/lldb/examples/customization/bin-utils/binutils.py
2
3609
"Collection of tools for displaying bit representation of numbers.""" import StringIO def binary(n, width=None): """ Return a list of (0|1)'s for the binary representation of n where n >= 0. If you specify a width, it must be > 0, otherwise it is ignored. The list could be padded with 0 bits if width...
gpl-3.0
4,791,216,865,151,303,000
28.581967
194
0.559158
false
3.242588
false
false
false
andrew-lundgren/gwpy
gwpy/cli/coherencegram.py
1
4469
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) Joseph Areeda (2015) # # This file is part of GWpy. # # GWpy 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
-5,225,253,726,674,151,000
28.20915
77
0.586932
false
3.583801
false
false
false
thoma5B/Django-Wiki
wiki/views/mixins.py
1
1736
from __future__ import unicode_literals from __future__ import absolute_import import logging from django.views.generic.base import TemplateResponseMixin from wiki.core.plugins import registry from wiki.conf import settings log = logging.getLogger(__name__) class ArticleMixin(TemplateResponseMixin): """A mix...
gpl-3.0
2,542,029,970,468,408,300
35.93617
97
0.608871
false
4.383838
false
false
false
tynn/numpy
numpy/lib/histograms.py
4
34578
""" Histogram-related functions """ from __future__ import division, absolute_import, print_function import operator import numpy as np from numpy.compat.py3k import basestring __all__ = ['histogram', 'histogramdd', 'histogram_bin_edges'] # range is a keyword argument to many functions, so save the builtin so they ...
bsd-3-clause
-3,011,626,326,053,294,000
34.684211
93
0.596449
false
3.867353
false
false
false
johnkit/vtk-dev
Web/Python/vtk/web/wamp.py
1
9811
r"""wamp is a module that provide classes that extend any WAMP related class for the purpose of vtkWeb. """ import inspect, types, string, random, logging, six, json from threading import Timer from twisted.python import log from twisted.internet import reactor from twisted.internet import defer...
bsd-3-clause
-8,795,263,232,398,575,000
33.545775
111
0.59525
false
4.649763
false
false
false
bcgov/gwells
app/backend/wells/migrations/0081_update_well_disinfect_values.py
1
1097
from django.db import migrations # This can be deleted when doing next squash of migrations because it's a one time update def migrate_well_disinfected(apps, schema_editor): well = apps.get_model('wells', 'well') code = apps.get_model('wells', 'welldisinfectedcode') disinfected = code.objects.filter(well...
apache-2.0
-6,403,787,883,633,071,000
30.342857
90
0.714676
false
3.324242
false
false
false
JacobSheehy/pressureNETAnalysis
readings/models.py
1
2519
from django.db import models from readings import choices as readings_choices class DateLocationMeasurementModel(models.Model): """ Abstract base class for PressureNET measurements. """ date = models.DateTimeField(auto_now_add=True, null=True, blank=True) user_id = models.CharField(max_length=255...
gpl-3.0
2,577,059,662,120,520,000
31.294872
88
0.688765
false
3.845802
false
false
false
jtylers/tools
decrypt.py
1
10290
#!/usr/bin/python2.7 import re import sys from string import maketrans max_word_size = 25 offset = 65 solutions = [] maps = [] filename = "" cypher = "" known_letters = "" mapped_to = "" precise = False verbose = False thorough = False color = False blue = "" green = "" red = "" white = "" # Return letters in the str...
gpl-2.0
3,257,954,420,681,244,000
40.659919
182
0.538581
false
3.825279
false
false
false
NervanaSystems/coach
rl_coach/agents/cil_agent.py
1
3783
# # Copyright (c) 2017 Intel Corporation # # 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 t...
apache-2.0
-6,056,350,723,993,225,000
42.482759
141
0.716363
false
3.977918
false
false
false
LCAS/spqrel_tools
slu4p/speech_to_text/audio_recorder.py
1
3431
import pyaudio import wave import time class AudioRecorder(object): '''A recorder class for recording audio to a WAV file. Records in mono by default. ''' def __init__(self, channels=1, rate=44100, frames_per_buffer=1024): self.channels = channels self.rate = rate self.frames_p...
mit
837,996,950,919,042,400
32.637255
81
0.567182
false
4.194377
false
false
false
kerwinxu/barcodeManager
zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/mslink.py
1
10946
"""SCons.Tool.mslink Tool-specific initialization for the Microsoft linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ...
bsd-2-clause
6,870,829,008,940,624,000
39.150376
149
0.650466
false
3.686763
false
false
false
mbatchkarov/dc_evaluation
eval/pipeline/thesauri.py
1
1144
from random import sample from discoutils.thesaurus_loader import Thesaurus class DummyThesaurus(Thesaurus): """ A thesaurus-like object which return "b/N" as the only neighbour of every possible entry """ name = 'Constant' def __init__(self): pass def get_nearest_neighbours(self, fe...
bsd-3-clause
8,440,284,303,191,987,000
25
108
0.625874
false
3.563863
false
false
false
aaiijmrtt/MUSICALQA
code/query.py
1
2090
import sys import music, language _debug_ = False replacements = [('full note', 'semibreve'), ('whole note', 'semibreve'), ('half note', 'minim'), ('quarter note', 'crotchet'), ('eighth note', 'quaver'), ('sixteenth note', 'semiquaver'), ('32nd note', 'demisemiquaver'), ('sharp', '#'), ('flat', 'b')] translatetimes = ...
mit
-4,313,926,338,157,113,000
45.444444
251
0.669856
false
2.939522
false
false
false
mediafactory/tryton_core_daemon
trytond/ir/sequence.py
1
12626
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from string import Template import time from ..model import ModelView, ModelSQL, fields from ..tools import datetime_strftime from ..pyson import Eval, And from ..transaction imp...
gpl-3.0
-67,326,091,095,597,624
35.386167
78
0.562649
false
4.474132
false
false
false
miptliot/edx-platform
openedx/features/course_experience/plugins.py
2
2362
""" Platform plugins to support the course experience. This includes any locally defined CourseTools. """ from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from course_tools import CourseTool from courseware.courses import get_course_by_id from views.course_reviews import...
agpl-3.0
-1,128,624,673,592,773,600
27.457831
85
0.648603
false
4.263538
false
false
false
ktbs/ktbs
lib/ktbs/methods/abstract.py
1
8730
# This file is part of KTBS <http://liris.cnrs.fr/sbt-dev/ktbs> # Copyright (C) 2011-2012 Pierre-Antoine Champin <pchampin@liris.cnrs.fr> / # Universite de Lyon <http://www.universite-lyon.fr> # # KTBS is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General ...
lgpl-3.0
-3,967,442,504,605,612,500
36.956522
97
0.606186
false
4.252314
false
false
false
onyedikilo/tacotron
train.py
1
3723
# -*- coding: utf-8 -*- #/usr/bin/python2 ''' By kyubyong park. kbpark.linguist@gmail.com. https://www.github.com/kyubyong/tacotron ''' from __future__ import print_function import tensorflow as tf import numpy as np import librosa import os from tqdm import tqdm from hyperparams import Hyperparams as hp from prepr...
apache-2.0
-1,837,786,440,896,341,800
38.606383
120
0.53747
false
3.593629
false
false
false
tensorflow/agents
tf_agents/experimental/distributed/examples/sac/sac_collect.py
1
5592
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
3,883,808,191,007,981,000
36.28
80
0.711731
false
3.832762
false
false
false
petrjasek/superdesk-server
apps/packages/resource.py
1
1554
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superd...
agpl-3.0
-7,215,252,584,971,752,000
24.47541
96
0.596525
false
4.057441
false
false
false
chrislit/abydos
tests/distance/test_distance_clement.py
1
5010
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
gpl-3.0
2,676,999,604,259,894,000
38.761905
77
0.61497
false
3.176918
true
false
false
Johnzero/OE7
openerp/addons/mail/mail_thread.py
1
71162
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
-7,476,913,251,874,143,000
53.280702
238
0.56956
false
4.249746
false
false
false
Tefx/WINO
ec2.py
1
1626
#!/usr/bin/env python3 import scheduler as s import worker as w from cluster import Cluster from gevent import sleep from time import time class EC2Task(s.Task): def execute(self): self.machine.worker.execute(task=w.Task(self.runtime)) class EC2Comm(s.Comm): def execute(self): self.rproc = ...
gpl-3.0
-4,019,200,081,466,505,700
25.655738
84
0.612546
false
3.304878
false
false
false
google/turbinia
tools/turbinia_job_graph.py
1
3144
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
2,878,288,893,988,940,300
32.446809
78
0.69243
false
3.643105
false
false
false
mazz/kifu
lib/access.py
1
8825
"""Handle auth and authz activities in ~~~PROJNAME~~~""" import logging from decorator import decorator from pyramid.decorator import reify from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTPFound from pyramid.request import Request from pyramid.security import unauthenticated_user...
mit
4,950,611,689,445,477,000
31.326007
79
0.608725
false
4.39492
false
false
false
astrofra/amiga-experiments
game-shop-shop-galaxy/python-version/game_puck_player_racket.py
1
1183
import math import game_puck_board as board from utils import * racket_speed = 50 velocity_x = 0.0 velocity_z = 0.0 initial_pox_x = 0.0 initial_pox_z = 0.0 pos_x = 0.0 pos_z = 0.0 target_pos_x = 0.0 target_pos_z = 0.0 prev_pos_x = 0.0 prev_pos_z = 0.0 width = 2.0 length = 0.5 def setPosition(x,z): global pos_x...
mit
-3,492,901,453,538,054,700
19.050847
127
0.623838
false
2.120072
false
false
false
kayhayen/Nuitka
tests/standalone/LxmlUsing.py
1
1151
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
apache-2.0
-926,701,526,460,733,600
32.852941
78
0.710686
false
3.712903
false
false
false
sushant-hiray/teamflowy
project/views.py
1
35934
# Create your views here. from django.http import HttpResponse,HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from accounts.models import Employee, PhoneNo, Skill, HasSkill from django.core.urlresolvers import reverse from django.contrib.auth.hashers import make_password, check_password fro...
mit
5,414,454,718,698,807,000
35.817623
200
0.643346
false
3.925068
false
false
false
errantlinguist/tangrams-analysis
write_word_ra_latex_table.py
1
1522
#!/usr/bin/env python3 """ Reads in a vocabulary file from Gabriel containing referring ability (RA) scores and counts for each word and then writes it as a LaTeX tabular environment. The first column is the word, second is the count and third is the RA. """ __author__ = "Todd Shore <errantlinguist+github@gmail.co...
apache-2.0
5,994,214,878,504,431,000
27.185185
156
0.659658
false
2.972656
false
false
false
srgblnch/python-pylon
setup.py
1
4096
#!/usr/bin/env python #---- licence header ############################################################################### ## file : setup.py ## ## description : This file has been made to provide a python access to ## the Pylon SDK from python. ## ## project : pyth...
gpl-3.0
-1,005,211,932,998,684,400
41.226804
79
0.508301
false
4.654545
false
false
false
Art-SoftWare/ircbot
events/02-msgTrigger.py
1
3235
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Regular expression triggers on user messages.""" import re from random import randint import util.cfg bot = None triggers = {} def init(botInstance): """Inits the msgTrigger module""" global bot, triggers bot = botInstance util.cfg.default = trigge...
gpl-3.0
-176,986,693,126,925,700
34.163043
132
0.573725
false
3.482239
false
false
false
helixyte/TheLMA
thelma/repositories/rdb/schema/tables/rack.py
1
2753
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Rack table. """ from datetime import datetime from sqlalchemy import CHAR from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy impo...
mit
4,945,031,176,538,619,000
32.168675
80
0.639666
false
4.20948
false
false
false
minlexx/pyevemon
esi_client/models/get_characters_character_id_wallets_200_ok.py
1
3859
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetCharactersCharacterIdWallets200Ok(object): """ ...
gpl-3.0
-132,285,698,399,243,070
25.986014
85
0.550661
false
4.326233
false
false
false
mwaskom/lyman
lyman/frontend.py
1
14777
"""Forward facing lyman tools with information about ecosystem.""" import os import os.path as op import tempfile import re import sys import imp import shutil from textwrap import dedent import yaml import numpy as np import nipype from traits.api import (HasTraits, Str, Bool, Float, Int, Tup...
bsd-3-clause
1,358,385,128,766,538,500
30.984848
79
0.61589
false
4.238956
false
false
false
anneline/Bika-LIMS
bika/lims/utils/analysisrequest.py
1
4343
from Products.CMFCore.utils import getToolByName from bika.lims.interfaces import ISample from bika.lims.utils import tmpID from bika.lims.utils.sample import create_sample from bika.lims.utils.samplepartition import create_samplepartition from bika.lims.workflow import doActionFor from Products.CMFPlone.utils import _...
agpl-3.0
-847,201,544,666,750,600
36.439655
81
0.617776
false
4.245357
false
false
false
benschneider/Generic-Sweepscript
GsweepI1I1.py
1
6469
''' Generic Sweep script (currently setup for no more than 3 dims) 20/10/2015 - B ''' #import numpy as np from time import time, sleep from parsers import copy_file from ramp_mod import ramp from DataStorer import DataStoreSP # , DataStore2Vec, DataStore11Vec # Drivers from dummydriver import instrument as dummy from...
gpl-2.0
-669,917,950,247,425,500
28.013453
78
0.609059
false
2.633958
false
false
false
feedhq/feedhq
feedhq/feeds/management/commands/add_missing.py
1
1240
from django.conf import settings from . import SentryCommand from ...models import enqueue_favicon, Feed, UniqueFeed class Command(SentryCommand): """Updates the users' feeds""" def handle_sentry(self, *args, **kwargs): missing = Feed.objects.raw( """ select f.id, f.url ...
bsd-3-clause
-4,859,175,894,789,571,000
30
72
0.472581
false
4.69697
false
false
false
N07070/TelegramDTCBot
main.py
1
1648
#!/usr/bin/python # -*- coding: utf-8 -*- import telebot # https://github.com/eternnoir/pyTelegramBotAPI import random from token_file import token_var from DTCScrapper import DTCScrapper TOKEN = token_var bot = telebot.TeleBot(TOKEN) about_text_bot = "Hey !\nI am a telegram bot built by @n07070. I'm open source on...
gpl-3.0
-7,595,758,703,366,299,000
28.428571
183
0.589806
false
3.349593
false
false
false
stormi/tsunami
src/secondaires/rapport/commandes/rapport/editer.py
1
3588
# -*-coding:Utf-8 -* # Copyright (c) 2012 LE GOFF Vincent # 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, this # l...
bsd-3-clause
-8,267,727,388,092,427,000
45.467532
79
0.661543
false
3.826738
false
false
false
barbieauglend/Learning_python
Lvl02/WordGuess/WordGuess2.py
1
1661
# python 3.5 import getpass from random import shuffle def player_one(): docs = open('GPL.txt').read().split() shuffle(docs) wort = docs[1] return wort player_input = input('1 or 2 players?: ') player = int(player_input) word = '' while word == '': if player == 1: while len(word) < 3: ...
unlicense
817,038,441,491,924,100
24.553846
79
0.53221
false
3.809633
false
false
false
jgrantdev/AoC2015
day6/day6puzzle1.py
1
3295
def main(): input_file_name = "day6input.txt" with open(input_file_name) as input_file: lines = input_file.readlines() grid_width = 1000 grid_height = 1000 light_grid = LightGrid(grid_width, grid_height) for line in lines: command, top_left, bottom_right = parse_command(line) ...
mit
-5,473,235,493,828,304,000
32.969072
89
0.575417
false
3.236739
false
false
false
automl/HPOlib
HPOlib/wrapping.py
2
24657
## # wrapping: A program making it easy to use hyperparameter # optimization software. # Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer # # 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 Found...
gpl-3.0
1,399,030,148,345,264,600
41.148718
116
0.583769
false
4.341786
true
false
false
tri2sing/PyOO
patterns/command/invokers.py
1
1312
''' Created on Nov 29, 2015 @author: Sameer Adhikari ''' # Classes the initiate the chain that leads to the receivers doing their work. # These classes are only aware that they have to invoke the abstract command. # These classes have no visibility into how the commands connects to receivers. class ToolbarButton(obj...
gpl-2.0
8,838,153,321,956,066,000
31.8
81
0.653963
false
4.301639
false
false
false
benschneider/sideprojects1
hdf5_to_mtx/load_S1_511_shot.py
1
1651
import numpy as np from parsers import load_hdf5, dim from parsers import savemtx, make_header # import matplotlib.pyplot as plt # from changeaxis import interp_y # from scipy.constants import Boltzmann as Kb # from scipy.constants import h , e, pi filein = "S1_511_shot_100mV_4924_5217MHz" folder = "hdf5s//09//Data_0...
gpl-2.0
-2,156,807,183,853,500,700
28.482143
64
0.591763
false
2.274105
false
false
false
vied12/superdesk
server/superdesk/io/zczc.py
1
3409
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license*. from super...
agpl-3.0
6,435,283,647,622,846,000
33.434343
102
0.485186
false
4.438802
false
false
false
CDIPS-AI-2017/pensieve
pensieve/json_dump.py
1
3188
import json import os from datetime import datetime CONCEPT_MAP = {'people': 'Person', 'places': 'Place', 'things': 'Thing', 'activities': 'Activity', 'times': 'Time', 'mood_words': 'Mood'} def dump_mem_to_json(mem_dict, save=None): """ ...
apache-2.0
-978,367,820,116,201,100
37.409639
99
0.395859
false
4.490141
false
false
false
minggli/chatbot
chatbot/settings.py
1
6860
""" settings a repository to configure various parts of the app """ import os import sys import json import configparser os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' sys.setrecursionlimit(30000) def build_config(filename): """create a configparser object and write a ini file.""" config = configparser.C...
mit
-400,032,840,587,508,350
29.087719
76
0.529883
false
3.061133
true
false
false
cdw/d10_workloops
img_ave/mat_and_dir.py
1
1311
#!/usr/bin/env python # encoding: utf-8 """ mat_and_dir.py - reorganize directories and read in .MAT files Let's be honest here, this is storage for stuff we don't need in fn_parse_and_sort. Created by Dave Williams on 2014-11-03 """ import os from scipy.io import loadmat from fn_parse_and_sort import chchdir ## Po...
mit
-5,131,101,391,298,932,000
28.133333
77
0.652174
false
3.077465
false
false
false
david-hoffman/scripts
movie_converter.py
1
1698
#!/usr/bin/env python # -*- coding: utf-8 -*- # movie_converter.py """ Convert from shitty amira format to clean format Copyright David Hoffman, 2019 """ import cv2 import glob import dask import os new_ext = "_conv.mpg" def update_path(path): return path.replace(".mpg", new_ext) @dask.delayed def convert_fi...
apache-2.0
8,498,430,353,338,681,000
22.260274
95
0.59364
false
3.659483
false
false
false
dtnaylor/web-profiler
webloader/curl_loader.py
1
4321
import os import logging import traceback import shlex import subprocess import string from collections import defaultdict from loader import Loader, LoadResult, Timeout, TimeoutError CURL = '/usr/bin/env curl' class CurlLoader(Loader): '''Subclass of :class:`Loader` that loads pages using curl. .. note:...
mit
2,313,424,952,162,075,000
45.462366
148
0.601481
false
4.257143
false
false
false
rwl/PyCIM
CIM15/IEC61970/Informative/InfAssets/SubstationAsset.py
1
1963
# Copyright (C) 2010-2011 Richard Lincoln # # 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...
mit
3,252,123,477,085,998,600
44.651163
158
0.720326
false
4.194444
false
false
false
jbogaardt/chainladder-python
examples/plot_voting_chainladder.py
1
1193
""" ========================== Voting Chainladder Example ========================== This example demonstrates how you can can use the Voting Chainladder method. """ import numpy as np import pandas as pd import chainladder as cl # Load the data raa = cl.load_sample('raa') cl_ult = cl.Chainladder().fit(raa).ultimate_...
mit
-1,812,801,947,728,713,000
28.825
79
0.658005
false
2.705215
false
true
false