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
commaai/openpilot
selfdrive/car/subaru/interface.py
1
5355
#!/usr/bin/env python3 from cereal import car from selfdrive.car.subaru.values import CAR, PREGLOBAL_CARS from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint from selfdrive.car.interfaces import CarInterfaceBase class CarInterface(CarInterfaceBase): @staticmethod ...
mit
-7,624,755,513,610,014,000
41.84
150
0.664239
false
2.897727
false
false
false
bj015852/Syslog-Analysis-Platform
datadriver.py
1
6343
select_recog_info = ("select syslog_recognition.dev_file_name, header_re, tag_re from \ syslog_recognition join device_file on syslog_recognition.dev_file_name = device_file.dev_file_name") select_parsing_info = (" SELECT * FROM syslog_attr where dev_file_name=%s order by attr_order") select_storage_info = (" SE...
gpl-2.0
7,776,432,333,914,288,000
37.91411
125
0.557465
false
3.502485
false
false
false
Micronaet/micronaet-addons-private
intervention_report_analysis/wizard/extra_export_invoice_wizard.py
1
2365
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
5,172,167,679,241,973,000
38.416667
85
0.654545
false
4.307832
false
false
false
ioam/imagen
imagen/transferfn/__init__.py
1
9379
""" TransferFns: accept and modify a 2d array """ import numpy import copy import param class TransferFn(param.Parameterized): """ Function object to modify a matrix in place, e.g. for normalization. Used for transforming an array of intermediate results into a final version, by cropping it, normali...
bsd-3-clause
-6,840,308,023,312,082,000
29.953795
77
0.639194
false
4.053155
false
false
false
threedliteguy/General
tafl/Test.py
1
1288
import TaflGame import GameVariants from random import randint g = TaflGame.GameState() #g = TaflGame.GameState(GameVariants.ArdRi()) #g = TaflGame.GameState(GameVariants.Tablut()) #g = TaflGame.GameState(GameVariants.Tawlbwrdd()) #g = TaflGame.GameState(GameVariants.Hnefatafl()) #g = TaflGame.GameState(GameVariants...
mit
6,262,410,032,262,013,000
14.518072
63
0.626553
false
2.316547
false
false
false
chipaca/snapcraft
snapcraft/internal/build_providers/_multipass/_multipass_command.py
1
15672
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
7,227,901,746,630,709,000
36.492823
105
0.582057
false
4.512525
false
false
false
MartinHeroux/cumming_plot
cumming_plot.py
1
22010
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import t def _jitter(data, jit=None): """ Calculate y-axis jitter for two series of data. Parameters ---------- data : DataFrame Two series of data to which y-axis jitter wants to be added. jit : i...
gpl-3.0
-7,258,450,436,108,749,000
35.260297
119
0.538664
false
3.124202
false
false
false
joaojunior/exercise_sensor
api_energy_sensor/api/migrations/0001_initial.py
1
2655
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-16 17:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='SensorRe...
mit
7,901,040,071,769,904,000
40.484375
114
0.475706
false
4.666081
false
false
false
bottero/IMCMCrun
examples/Synthetic1/createSyntheticRandomProfile.py
1
6749
# -*- coding: utf-8 -*- """ Created on Wed Dec 9 21:31:53 2015 Create random synthetic velocity profile + linear first guesses @author: alex """ import random import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def savitzky_golay(y, window_size, order, deriv=0, rate=1): r...
mit
6,141,880,673,805,486,000
32.083333
89
0.650319
false
2.834523
false
false
false
vsajip/django
django/template/loaders/eggs.py
1
1199
# Wrapper for loading templates from eggs via pkg_resources.resource_string. try: from pkg_resources import resource_string except ImportError: resource_string = None from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.conf import settings class Loa...
bsd-3-clause
-5,587,145,202,576,219,000
35.333333
83
0.634696
false
4.558935
false
false
false
icyflame/batman
scripts/listpages.py
1
8220
#!/usr/bin/python # -*- coding: utf-8 -*- r""" Print a list of pages, as defined by page generator parameters. Optionally, it also prints page content to STDOUT or save it to a file in the current directory. These parameters are supported to specify which pages titles to print: -format Defines the output format. ...
mit
4,084,276,713,784,933,000
32.966942
80
0.58674
false
3.893889
false
false
false
yhd4711499/comic
libs/ComicInfo.py
1
1910
import json from datetime import datetime import pytz from tzlocal import get_localzone def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, datetime): # save in UTC serial = obj.astimezone(pytz.utc).strftime(ComicInfo.ISO_FORMAT) ...
mit
-4,577,526,107,229,109,000
29.31746
119
0.626702
false
3.866397
false
false
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/galaxy/datatypes/converters/fasta_to_tabular_converter.py
1
1245
#!/usr/bin/env python # This code exists in 2 places: ~/datatypes/converters and ~/tools/fasta_tools """ Input: fasta, minimal length, maximal length Output: fasta Return sequences whose lengths are within the range. """ import sys, os seq_hash = {} def __main__(): infile = sys.argv[1] outfile = sys.argv[2] ...
gpl-3.0
950,687,328,677,922,000
27.953488
78
0.538956
false
3.772727
false
false
false
hamonikr-root/system-config-printer-gnome
troubleshoot/ErrorLogCheckpoint.py
1
8211
#!/usr/bin/python ## Printing troubleshooter ## Copyright (C) 2008, 2009 Red Hat, Inc. ## Author: Tim Waugh <twaugh@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either versi...
gpl-2.0
3,772,168,062,145,335,000
34.392241
82
0.558397
false
4.481987
false
false
false
digitalbitbox/electrum
plugins/ledger/ledger.py
1
21756
from struct import pack, unpack import hashlib import sys import traceback from electrum import bitcoin from electrum.bitcoin import TYPE_ADDRESS, int_to_hex, var_int from electrum.i18n import _ from electrum.plugins import BasePlugin from electrum.keystore import Hardware_KeyStore from electrum.transaction import Tra...
mit
1,939,546,918,932,613,600
41.742633
242
0.569222
false
4.04537
false
false
false
asterix135/infonex_crm
marketing/views.py
1
26075
import codecs import csv import json import re import warnings import codecs from openpyxl import load_workbook, Workbook from time import strftime from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.http import JsonResponse, Http404, HttpResponse from django.shortcuts...
mit
-8,738,443,333,527,158,000
35.985816
90
0.575916
false
3.971215
false
false
false
mjn19172/Savu
savu/test/process_file_test.py
1
2920
# Copyright 2014 Diamond Light Source Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
-6,509,132,934,847,990,000
26.037037
98
0.696918
false
3.672956
true
false
false
Mstrodl/jose
ext/channel_logging.py
1
5884
import logging import asyncio import collections import json import zlib from discord.ext import commands from .common import Cog log = logging.getLogger(__name__) LOGGING_PERIOD = 5 PACKET_CHANNEL = 319540379495956490 LEVELS = { logging.INFO: 326388782829928448, logging.WARNING: 326388923116945408, ...
mit
6,600,729,814,505,464,000
28.273632
109
0.587525
false
3.896689
false
false
false
mr--dev/djbook
myreadings/ajax.py
1
1658
from datetime import datetime from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from myreadings.models import Book, ReadRate response_data = dict() def read_rate_book(request): try: b = Book.objects.get(pk=int(request.POST['book_id'])) rr = ReadRate() ...
mit
-7,326,487,876,103,184,000
29.722222
104
0.613993
false
3.717489
false
false
false
drunken-pypers/cloudlynt
cloudlynt/settings.py
1
5126
# Django settings for cloudlynt project. import os app_env = os.environ.get('APP_ENV', 'development') DEBUG = not (app_env == 'production') TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', ...
mit
1,771,910,634,111,725,800
28.976608
79
0.690597
false
3.612403
false
false
false
plecto/motorway
examples/app_slave.py
1
1637
import logging from motorway.grouping import HashRingGrouper from motorway.pipeline import Pipeline from examples.ramps import WordRamp from examples.intersections import SentenceSplitIntersection, WordCountIntersection, AggregateIntersection # logging.basicConfig(level=logging.INFO, format=) logging.config.dictCon...
apache-2.0
4,727,255,238,910,194,000
28.232143
116
0.591936
false
3.944578
false
false
false
bovee/planknn
scripts/train_nn.py
1
1492
#!/usr/bin/env python3 import os import random import numpy as np from pyplanknn.preprocess import read_train from pyplanknn.network import Network, load WEIGHTS_FILE = '../../test_dump.txt' N_TRAINS = 50 N_RANDS = 1 if __name__ == '__main__': if os.path.exists(WEIGHTS_FILE): model = load(WEIGHTS_FILE) ...
mit
414,150,342,522,962,900
32.909091
81
0.509383
false
3.485981
false
false
false
ocefpaf/ODM2-Admin
odm2admin/management/commands/preprocess_datalogger_file.py
1
2970
from __future__ import unicode_literals import argparse import os import io import itertools import csv import shutil from django.core.management.base import BaseCommand from django.core.management import settings from odm2admin.models import Dataloggerfiles os.environ.setdefault("DJANGO_SETTINGS_MODULE", "templat...
mit
1,438,177,301,294,737,400
35.219512
117
0.582492
false
3.944223
false
false
false
UbuntuBudgie/budgie-extras
budgie-wmover/set_keys.py
1
3622
#!/usr/bin/env python3 import ast import os import subprocess """ Budgie WindowMover Author: Jacob Vlijm Copyright © 2017-2021 Ubuntu Budgie Developers Website=https://ubuntubudgie.org This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published...
gpl-3.0
-544,738,862,693,497,660
31.621622
78
0.599834
false
3.691131
false
false
false
sebastian-code/system_overview
net_parser.py
1
1890
from collections import namedtuple import argparse ''' When you execute the program without any arguments, it returns RX and TX bytes for each of the network devices. However, you can also specify the network device you may be interested in. For example: $ ./net_devs_2.py --help usage: net_devs_2.py [-h] [-i IFACE] ...
mit
3,728,138,519,920,348,700
32.157895
94
0.539683
false
3.75
false
false
false
all-umass/metric-learn
setup.py
1
1748
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import os import io version = {} with io.open(os.path.join('metric_learn', '_version.py')) as fp: exec(fp.read(), version) # Get the long description from README.md with io.open('README.rst', encoding='utf-8') as f: long_description = f.re...
mit
-9,102,863,495,069,463,000
31.37037
73
0.594394
false
4.161905
false
false
false
robmcmullen/OWSLib
owslib/util.py
1
17949
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2008 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # # Contact email: tomkralidis@gmail.com # ============================================================================= fro...
bsd-3-clause
3,201,055,369,308,133,400
28.090762
134
0.599811
false
3.889274
false
false
false
raytung/DjangoGirls
mysite/settings.py
1
2114
""" Django settings for mysite project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
mit
-8,519,912,898,692,985,000
23.870588
71
0.723746
false
3.242331
false
false
false
Ghost-script/dyno-chat
kickchat/apps/pulsar/apps/data/odm/related.py
1
14411
from functools import partial from .model import class_prepared, create_model from .mapper import Manager, LazyProxy from .fields import FieldError, Field, CompositeIdField RECURSIVE_RELATIONSHIP_CONSTANT = 'self' pending_lookups = {} def load_relmodel(field, callback): relmodel = None relat...
gpl-2.0
6,000,387,075,464,586,000
37.160326
79
0.60884
false
4.290265
false
false
false
idlesign/django-sitegate
sitegate/admin.py
1
1044
from django.contrib import admin from .models import InvitationCode, BlacklistedDomain, EmailConfirmation @admin.register(InvitationCode) class InvitationCodeAdmin(admin.ModelAdmin): list_display = ('code', 'time_created', 'time_accepted', 'expired') list_display_links = ('code',) search_fields = ('code...
bsd-3-clause
-4,802,165,901,459,899,000
28.828571
72
0.678161
false
3.768953
false
false
false
zengchunyun/s12
day6/homework/core/main.py
1
9236
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ from core.userverify import UserVerify from core.MyServer import MyServer from core.game import Soldier, MagicMaster import shelve import logging import time host, port = "0.0.0.0", 9999 # 定义服务器监听端口 connect_database = shelve.open("../databas...
gpl-2.0
2,694,717,406,972,314,000
38.724138
121
0.572917
false
2.837438
false
false
false
dzamie/weasyl
weasyl/controllers/content.py
1
21369
import urlparse import web from libweasyl import ratings from libweasyl import staff from libweasyl.text import slug_for from weasyl import ( character, comment, define, errorcode, folder, journal, macro, profile, report, searchtag, shout, submission, orm) from weasyl.controllers.base import controller_base ...
apache-2.0
4,338,898,373,261,880,000
34.734114
118
0.593757
false
3.702824
false
false
false
aeolusproject/audrey
agent/src/audrey/user_data.py
1
6505
''' * * Copyright [2011] [Red Hat, Inc.] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
apache-2.0
3,062,520,903,908,795,000
32.530928
77
0.604458
false
4.080928
false
false
false
MDAnalysis/mdanalysis
testsuite/MDAnalysisTests/core/test_fragments.py
1
7995
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
gpl-2.0
-4,433,243,653,786,504,700
32.03719
79
0.584365
false
3.476087
true
false
false
shunw/pythonML_code
eg1_general.py
1
1749
from sklearn.datasets import make_classification from collections import Counter import matplotlib.pyplot as plt from sklearn.datasets import load_iris from imblearn.datasets import make_imbalance from imblearn.under_sampling import RandomUnderSampler print (__doc__) def plot_pie(y): target_stats = Counter(y) ...
mit
-6,444,983,043,663,888,000
30.232143
135
0.650658
false
3.337786
false
false
false
irmen/synthesizer
examples/drumkit/drumkit.py
1
7690
import sys import glob import os import random import itertools from synthplayer.sample import Sample from typing import Dict, Optional, List class Group: def __init__(self): self.volume = 0.0 self.amp_veltrack = 0 self.ampeg_release = 0.0 self.key = 0 self.group = 0 ...
lgpl-3.0
2,441,201,023,129,300,500
39.904255
120
0.528999
false
4.186173
false
false
false
kdrone/crazyflie-python-client
lib/cfclient/utils/pysdl2reader.py
1
7431
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___...
gpl-2.0
952,875,016,653,973,500
39.606557
149
0.518504
false
3.630191
false
false
false
Xokage/FaceFinder
Crawler/FaceFinder/items.py
1
1628
# -*- coding: utf-8 -*- ################################################################################# # Facefinder: Crawl pictures based on known faces and extract information. # # Copyright (C) 2016 Xoán Antelo Castro # # ...
gpl-3.0
481,055,148,980,587,900
57.107143
81
0.445605
false
5.387417
false
false
false
shomy4/SuperKamp
parameters/views.py
1
7272
# -*- coding: utf-8 -*- from django.shortcuts import render from django.core.urlresolvers import reverse from django.http import (HttpResponse,) from django.contrib import messages from django.contrib.auth.decorators import login_required from .models import ParTable from .models import ParLine from .forms import Sea...
gpl-3.0
5,330,505,862,305,437,000
38.102151
129
0.643289
false
3.646941
false
false
false
python/performance
pyperformance/benchmarks/bm_json_loads.py
1
2812
"""Script for testing the performance of json parsing and serialization. This will dump/load several real world-representative objects a few thousand times. The methodology below was chosen for was chosen to be similar to real-world scenarios which operate on single objects at a time. """ # Python imports import jso...
mit
7,438,840,384,057,088,000
25.528302
77
0.607397
false
2.991489
false
false
false
appleseedhq/cortex
python/IECore/SearchReplaceOp.py
2
4151
########################################################################## # # Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
bsd-3-clause
7,146,648,767,962,281,000
29.522059
95
0.671164
false
3.999037
false
false
false
Coconutcoo/LAURA
fi.py
1
3956
import recipy import db from os import path # The fiFitness handles iterating through the complete generation but passes # responsibility on actually generating the scores. It then returns a # dictionary of organism and score key-value pairs to the gaHandler function. def fiFitness(currentGen): fiConfig() sc...
gpl-3.0
366,879,805,070,354,240
34.00885
79
0.646866
false
3.844509
true
false
false
chartbeat-labs/swailing
swailing/logger.py
1
6337
import logging import json import threading from contextlib import contextmanager from swailing.token_bucket import TokenBucket PRIMARY = 10 DETAIL = 20 HINT = 30 class Logger(object): """A logging.Logger-like object with some swailing goodness. """ def __init__(self, name_or_logger...
apache-2.0
4,338,916,855,496,269,000
28.891509
80
0.555626
false
4.275978
false
false
false
PaddlePaddle/models
PaddleCV/tracking/pytracking/features/featurebase.py
1
5668
from paddle import fluid from paddle.fluid import layers from pytracking.libs import TensorList from pytracking.libs.paddle_utils import floordiv, n2p, broadcast_op import numpy as np class FeatureBase: """Base feature class. args: fparams: Feature specific parameters. pool_stride...
apache-2.0
-2,927,268,381,634,551,300
33.873418
121
0.511997
false
4.264861
false
false
false
HEPData/hepdata
hepdata/modules/records/utils/records_update_utils.py
1
7498
"""Update INSPIRE publication information.""" import datetime import math from hepdata.modules.records.utils.doi_minter import generate_dois_for_submission from hepdata.modules.submission.api import get_latest_hepsubmission from hepdata.modules.submission.models import DataSubmission from hepdata.modules.records.util...
gpl-2.0
-2,347,043,686,384,215,600
38.671958
125
0.671913
false
3.650438
false
false
false
KayJohnston/jackies-map
pgdata.py
1
62783
from __future__ import division import collections import re import sector import vector3 # "Imagine the galaxy is a giant slice of Battenberg # which for reasons beyond our ken has had small chunks # of carrot cake pushed into it all over the place..." # - CMDR Jackie Silver # This does not validate sector name...
bsd-3-clause
1,171,351,026,268,354,600
91.600295
161
0.674673
false
2.417334
false
false
false
jigarkb/Programming
LeetCode/278-E-FirstBadVersion.py
1
1324
# You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version # of your product fails the quality check. Since each version is developed based on the previous version, all the # versions after a bad version are also bad. # # Suppose you have n versions [1, 2, ..., ...
mit
-7,856,628,837,908,097,000
27.782609
116
0.61858
false
3.740113
false
false
false
formath/mxnet
python/mxnet/test_utils.py
1
60129
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-8,161,379,666,179,769,000
37.274348
98
0.586605
false
3.796262
true
false
false
walterbender/ruler
RulerActivity.py
1
12067
# Copyright (c) 2007 Mitchell N. Charity # Copyright (c) 2009-2012 Walter Bender # Copyright (c) 2012 Flavio Danesse # Copyright (c) 2013 Aneesh Dogra <lionaneesh@gmail.com> # # This file is part of Ruler. # # Ruler is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
gpl-3.0
-1,015,555,451,988,107,600
33.875723
79
0.566752
false
3.812638
false
false
false
kou/zulip
tools/documentation_crawler/documentation_crawler/spiders/common/spiders.py
1
9193
import json import os import re from typing import Callable, Iterator, List, Optional, Union import scrapy from scrapy.http import Request, Response from scrapy.linkextractors import IGNORED_EXTENSIONS from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor from scrapy.spidermiddlewares.httperror import HttpError...
apache-2.0
154,628,227,898,041,820
44.994975
159
0.611821
false
3.898211
false
false
false
klahnakoski/MySQL-to-S3
vendor/jx_elasticsearch/es52/expressions.py
1
42251
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mpl-2.0
6,931,293,654,759,702,000
30.366741
189
0.531372
false
3.535057
false
false
false
taligen/taligen
taligen/TaskListParameters.py
1
2738
#!/usr/bin/python # # Copyright (C) 2017 and later, taligen project. # All rights reserved. License: see package. # import re class TaskListParameters: """ Collection of name-value pairs used for parameterizing TaskLists when instantiating TaskListTemplates """ def __init__( self, pairs ): ...
gpl-3.0
-464,939,133,282,651,300
23.666667
89
0.497809
false
4.15478
false
false
false
akrherz/iem
scripts/iemre/init_hourly.py
1
5476
"""Generate the IEMRE hourly analysis file for a year""" import datetime import sys import os import geopandas as gpd import numpy as np from pyiem import iemre from pyiem.grid.zs import CachingZonalStats from pyiem.util import get_dbconn, ncopen, logger LOG = logger() def init_year(ts): """ Create a new Ne...
mit
3,265,568,525,044,312,000
30.291429
75
0.610847
false
2.929909
false
false
false
BarajasPaul/Aquatic-Pi
src/SonarMod/analog_input_MCP3008.py
1
1927
#!/usr/bin/env python import time import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) DEBUG = 1 def readadc(adcnum, clockpin, mosipin, misopin, cspin): if ((adcnum > 7) or (adcnum < 0)): return -1 GPIO.output(cspin, True) GPIO.output(clockpin, False) # start clock low ...
apache-2.0
5,881,801,986,191,694,000
25.763889
81
0.584328
false
3.368881
false
false
false
jcolekaplan/WNCYC
src/main/api/getBuildings.py
1
1867
import boto3 from decEncoder import * from fuzzywuzzy import fuzz from DynamoTable import * def handler(event, context): """Scan dynamo table""" buildingTable = DynamoTable('Buildings') return getBuildings(event, buildingTable) """Lambda handler function for /buildings API call Returns all the building...
mit
-5,268,934,866,074,050,000
39.586957
107
0.608998
false
4.609877
false
false
false
Subarno/MachineLearningPracticePrograms
simple_nnet.py
1
1385
#This is the siimplest neural network implementation #Its the point from where my neural network journey begins import numpy as np #using sigmoid activation function def activate(x,deriv=False): if(deriv==True): return x*(1-x) return 1/(1+np.exp(-x)) #toy data input_data = np.array([[0,0,1], [0,1,1],...
gpl-3.0
6,184,368,435,752,830,000
28.468085
64
0.674368
false
2.928118
false
false
false
Syralist/pixels_flappy
flappy/flappy.py
1
7269
import pygame, led, sys, os, random, csv from pygame.locals import * from bmpfont import bmpfont from led.PixelEventHandler import * """ A flappy bird clone """ random.seed() BLACK = pygame.Color(0,0,0) WHITE = pygame.Color(255, 255, 255) RED = pygame.Color(255, 0, 0) GREEN = pygame.Color(0, 255, 0) wing1font = bmp...
gpl-3.0
-5,764,301,791,192,496,000
26.638783
138
0.539689
false
3.723873
false
false
false
neuromusic/literature-forager
forager/settings.py
1
5374
# Django settings for forager project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'forage...
bsd-3-clause
1,999,849,258,034,014,200
33.448718
127
0.687756
false
3.711326
false
false
false
Cadair/penygader
penygader/plotting/publication.py
1
1157
# -*- coding: utf-8 -*- """ Created on Mon Dec 3 16:24:02 2012 @author: Stuart Mumford This module imports matplotlib with customisations I use when creating figures for inclusion in print publications. Usage ----- >>> from penygader.plotting.publication import * >>> plt.plot(x,y) >>> thick_ticks(plt.gca()) >>> p...
bsd-2-clause
5,687,942,328,894,777,000
24.711111
88
0.674157
false
2.870968
false
false
false
ENSTA-Bretagne-Guerledan-BoiteNoire/ROS_BUBBLE_Project
src/bubble_audio/src/AlgoMusicAuto.py
1
3957
import scipy.io.wavfile as sciwave from scipy.fftpack import fft import math import numpy as np import RecPing import time import pylab # ========= (1) ENREGISTREMENT ========== filename = time.strftime("%d%b%Y_%H%M%S.wav") # titre du fichier = date RecPing.recPing(filename) # enregistrement # ========= (2) RECEIV...
mit
3,658,791,199,915,934,000
30.404762
177
0.598686
false
2.896779
false
false
false
OCA/management-system
mgmtsystem_nonconformity/models/mgmtsystem_nonconformity_stage.py
1
1251
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, fields, models _STATES = [ ("draft", _("Draft")), ("analysis", _("Analysis")), ("pending", _("Action Plan")), ("open", _("In Progress")), ...
agpl-3.0
-5,752,582,672,339,954,000
32.810811
78
0.632294
false
3.690265
false
false
false
mhubig/borg
borg/testsuite/upgrader.py
1
6950
import os import pytest try: import attic.repository import attic.key import attic.helpers except ImportError: attic = None from ..upgrader import AtticRepositoryUpgrader, AtticKeyfileKey from ..helpers import get_keys_dir from ..key import KeyfileKey from ..archiver import UMASK_DEFAULT from ..repos...
bsd-3-clause
-1,327,743,266,926,538,200
32.413462
75
0.685899
false
3.742596
true
false
false
ic-hep/DIRAC
ConfigurationSystem/Client/Utilities.py
1
19647
######################################################################## # Author : Andrei Tsaregorodtsev ######################################################################## """ Utilities for managing DIRAC configuration: getCEsFromCS getUnusedGridCEs getUnusedGridSEs getSiteUpdates getSEUpdates """ _...
gpl-3.0
4,361,149,930,271,234,600
34.983516
105
0.617753
false
3.457761
true
false
false
Soncrates/stock-study
bin/cmd_Scrape_Stock.py
1
3126
#!/usr/bin/env python import logging import pandas as pd from libCommon import INI_BASE, INI_WRITE, INI_READ from libNASDAQ import NASDAQ from libBackground import EXTRACT_TICKER from libFinance import TRANSFORM_BACKGROUND from libDecorators import singleton, exit_on_exception, log_on_exception from libDebug import t...
lgpl-2.1
-8,062,814,803,809,579,000
31.905263
95
0.65611
false
3.427632
false
false
false
scribblemaniac/RenderChan
renderchan/cli.py
1
7785
__author__ = 'Konstantin Dmitriev' from gettext import gettext as _ from argparse import ArgumentParser from argparse import Action from argparse import SUPPRESS import os import sys from renderchan.core import RenderChan, __version__ class FormatsAction(Action): def __init__(self, option_string...
bsd-3-clause
-4,930,853,125,841,947,000
36.248804
134
0.575337
false
4.329811
false
false
false
carragom/modoboa
modoboa/admin/views/identity.py
1
8416
"""Identity related views.""" from django.shortcuts import render from django.utils.translation import ugettext as _, ungettext from django.views import generic from django.views.decorators.csrf import ensure_csrf_cookie from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ...
isc
-8,725,746,518,094,200,000
32.935484
79
0.62298
false
3.696091
false
false
false
leethargo/geonet
geonet/geosteiner.py
1
2459
''' Wrapper for GeoSteiner program ''' from itertools import dropwhile, takewhile, ifilter import os from subprocess import Popen, PIPE from geonet.network import SteinerTree # TODO: check if GeoSteiner is available def geosteiner(pos): '''Call geosteiner to compute and return''' def parse_ps(output): ...
mit
-9,134,390,542,548,134,000
31.786667
82
0.512403
false
3.56894
false
false
false
rpwagner/tiled-display
flapp/test/testNoBorder.py
1
2454
import sys, os sys.path = [os.path.join(os.getcwd(), "..", "..") ] + sys.path from flapp.app import App from flapp.glRenderer2D import glRenderer2D from flapp.texture import Texture, EasyTexture from flapp.pmath.rect import Rect from flapp.pmath.vec2 import Vec2 from OpenGL.GL import * from OpenGL.GLU import * def r...
apache-2.0
-820,731,440,590,849,500
29.675
125
0.586797
false
3.347885
false
false
false
masamitsu-murase/pausable_unittest
pausable_unittest/picklablelogger.py
1
4113
import logging import time import os.path import sys if isinstance(u"", str): # Python 3 codecs = None else: # Python 2 import codecs FORMAT = '[%(asctime)s] %(levelname)5s -- : %(message)s' DATE_FORMAT = '%Y-%m-%dT%H:%M:%S' class Logger(logging.Logger): def __reduce__(self): ...
mit
-4,303,814,017,334,457,300
29.396947
77
0.539995
false
3.951009
false
false
false
MengGuo/Jackal_Velodyne_Duke
navigation/amcl_pose_to_2D_Euler.py
1
1632
#!/usr/bin/env python import roslib, rospy roslib.load_manifest('jackal_velodyne_duke') import sys import time from geometry_msgs.msg import PoseWithCovarianceStamped, PoseStamped from math import pi as PI from math import atan2, sin, cos, sqrt from tf.transformations import euler_from_quaternion, quaternion_from_e...
gpl-2.0
4,832,500,443,278,755,000
25.322581
157
0.630515
false
3.193738
false
false
false
Crapworks/ceph-dash
app/influx/views.py
1
1380
#!/usr/bin/env python # -*- coding: UTF-8 -*- from flask import jsonify from flask import current_app from influxdb import InfluxDBClient from app.base import ApiResource class InfluxResource(ApiResource): endpoint = 'influxdb' url_prefix = '/influxdb' url_rules = { 'index': { 'rule...
bsd-2-clause
-1,869,436,108,161,769,200
30.363636
97
0.526812
false
4.408946
false
false
false
AechPro/Machine-Learning
Partners Healthcare/2016 Breast Cancer/dev/ReconNet/Recon_Processor.py
1
4357
""" Copyright 2017 Matthew W. Allen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
apache-2.0
2,937,833,611,369,025,000
32.307087
114
0.653661
false
3.527935
false
false
false
Inboxen/queue
delete/tasks.py
1
4037
import logging from datetime import datetime from itertools import izip_longest from celery import chain, chord, group, task from pytz import utc from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.db import IntegrityError, transaction from inboxen.mo...
agpl-3.0
4,133,517,724,570,323,500
29.816794
135
0.676245
false
3.415398
false
false
false
stanxii/indexRiver
data-lepus/lepus/include/lepus_oracle.py
1
4759
#!/bin/env python #-*-coding:utf-8-*- import MySQLdb import string import sys reload(sys) sys.setdefaultencoding('utf8') import ConfigParser def get_item(data_dict,item): try: item_value = data_dict[item] return item_value except: pass def get_parameters(conn): ...
apache-2.0
-7,655,192,725,967,334,000
22.035354
501
0.564825
false
3.90402
false
false
false
FuUuUuUoO/BWINF-2013-Runde2
Aufgabe 3 - Vortänzer Challenge/DanceProgram.py
1
2432
""" Instruction: 0 = Forwards 1 = Backwards 2 = left 3 = right 4 = pause 5 = finished """ class DanceProgram(object): instructionSequence = "" instructionPointer = 0 loopIterationCounters = [] loopLimits = [] loopJumpBackIndices = [] def __init__(self, instructionSequence): self.instr...
gpl-2.0
-1,074,016,148,981,586,000
32.791667
119
0.52426
false
5.056133
false
false
false
nickmilon/nmPyUtils
nmPyUtils/utils1.py
1
3274
''' Created on Nov 10, 2008 @author: nickmilon Defines some very simple classes and methods ''' # keep this simple no imports allowed in this module class Error(Exception): pass class DotDot(dict): """ A dictionary with dot notation example dd=DotDot() dd.a=1 dd.a ==>> 1 """ ...
agpl-3.0
-8,208,559,698,454,755,000
26.745763
93
0.555895
false
3.707814
false
false
false
j3ffhubb/pymarshal
pymarshal/bson.py
1
5059
""" """ # Prevent Python2 from getting confused about 'bson' and 'pymarshal.bson' from __future__ import absolute_import import datetime import time # Will raise an import error if the user hasn't installed 'bson' import bson from .json import JSON_TYPES from .util.marshal import * from .util.pm_assert import pm_ass...
bsd-2-clause
4,571,105,214,430,264,000
24.680203
73
0.505634
false
4.177539
false
false
false
sveetch/sveedocuments
sveedocuments/management/commands/documents.py
1
2003
# -*- coding: utf-8 -*- """ General Command line tool """ import StringIO from optparse import OptionValueError, make_option from django.conf import settings from django.core.cache import cache from django.core.management.base import CommandError, BaseCommand from sveedocuments.models import Page, Insert class Comm...
mit
4,301,455,581,453,693,400
33.534483
267
0.626061
false
4.207983
false
false
false
psychopy/psychopy
psychopy/tools/imagetools.py
1
1823
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """Functions and classes related to image handling""" from __future__ import absolute_imp...
gpl-3.0
6,034,602,306,879,109,000
25.42029
79
0.640154
false
3.375926
false
false
false
yephper/django
django/bin/minicms/DjangoUeditor/views.py
1
12693
# coding:utf-8 from importlib import import_module from django.http import HttpResponse from . import settings as USettings import os import json from django.views.decorators.csrf import csrf_exempt import datetime import random import urllib from django.utils import six if six.PY3: long = int de...
bsd-3-clause
-5,013,721,980,589,875,000
33.367953
151
0.585703
false
3.346154
false
false
false
hennykf/uwsummer
plothealpix.py
1
3110
from scipy.io.idl import readsav from netCDF4 import Dataset, num2date from mpl_toolkits.basemap import Basemap from astropy.io import fits import numpy as np import healpy as hp import scipy as sp import matplotlib import matplotlib.pyplot as plt import os import warnings import plothealpix_map def plothealpix(filen...
bsd-2-clause
8,715,731,331,701,402,000
39.38961
119
0.634727
false
4.007732
false
false
false
NeCTAR-RC/swift
swift/obj/diskfile.py
1
53613
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
apache-2.0
5,968,289,653,028,614,000
37.542775
79
0.593158
false
4.345708
false
false
false
ivanalejandro0/eip-fsm-test
eip/firewall/publisher.py
1
1287
#!/usr/bin/env python # -*- coding: utf-8 -*- import Queue import threading import time import zmq class ZMQPublisher(object): def __init__(self): self._worker_thread = threading.Thread(target=self._run) self._do_work = threading.Event() self._queue = Queue.Queue() def start(self): ...
mit
7,019,930,170,919,868,000
23.283019
74
0.532246
false
3.96
false
false
false
misztal/GRIT
GRIT/bin/tutorial_contact.py
1
7550
import pygrit as GRIT import numpy as np import math # Decide upon some names for creating user-custom attribute fields, # they can be anything you want as long as they are unique. refinement_attribute_name = 'my_refinement_values' coarsening_attribute_name = 'my_coarsening_values' def write_svg_files(engine, paramet...
mit
3,600,868,048,517,221,400
39.810811
115
0.645033
false
3.586698
false
false
false
repetilo-andrey/django-allauth
allauth/utils.py
1
6808
import re import unicodedata import json from django.core.exceptions import ImproperlyConfigured from django.core.validators import validate_email, ValidationError from django.core import urlresolvers from django.db.models import FieldDoesNotExist from django.db.models.fields import (DateTimeField, DateField, ...
mit
-9,222,803,510,552,390,000
33.211055
82
0.613837
false
4.202469
false
false
false
noba3/KoTos
addons/plugin.video.movie25/resources/libs/changelog.py
1
4985
import xbmc,xbmcgui,xbmcaddon,os,sys,main,re,time,calendar from datetime import datetime addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) def tosec(m): if m.group(1) == '-': pos = 1 else: pos = -1 sec = 0 sec += int(m.group(2)) * 3600 sec += int(m.group(3)) sec = sec ...
gpl-2.0
4,023,760,602,650,930,700
43.115044
167
0.51334
false
3.464211
false
false
false
faloi/pygobstones
gui/fileOption.py
1
12906
# -*- coding: utf-8 -*- import os import sys from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtGui import QMessageBox import PyQt4 import views.resources sys.path.append('..') from commons.i18n import * from commons.utils import root_path, user_path, clothing_for_file_exists, clothing_dir_for_file def gob...
gpl-3.0
7,369,661,647,063,693,000
40.76699
119
0.596389
false
4.016807
false
false
false
Stratoscale/yumcache
yumcache/bogusurls.py
1
1333
import time import requests class BogusURLs: def __init__(self, mirrors): self._mirrors = mirrors self._selected = {} def replace(self, hostname, pathInHost): if hostname not in self._mirrors: return hostname, pathInHost if not self._selectedRelevant(hostname): ...
apache-2.0
6,870,941,564,008,139,000
34.078947
94
0.588147
false
4.272436
false
false
false
mava-ar/sgk
src/consultorio/migrations/0001_initial.py
1
1965
# Generated by Django 2.2.1 on 2019-05-23 03:36 from django.db import migrations, models import django.db.models.deletion import django_tenants.postgresql_backend.base class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
apache-2.0
1,409,001,386,252,760,600
42.577778
165
0.580316
false
4.002041
false
false
false
fedora-infra/shumgrepper
shumgrepper/doc_utils.py
1
1983
import os import codecs import jinja2 import docutils import docutils.examples import markupsafe import shumgrepper def modify_rst(rst): """ Downgrade some of our rst directives if docutils is too old. """ try: # The rst features we need were introduced in this version minimum = [0, 9] ...
gpl-2.0
1,478,673,242,582,092,000
24.753247
78
0.630862
false
3.798851
false
false
false
taiwan-online-judge/taiwan-online-judge
src/py/problem.py
1
9966
from tojauth import TOJAuth from asyncdb import AsyncDB import mod import com import imc.async from imc.proxy import Proxy import config class ProblemMg: _accessid = 6 TITLE_LEN_MIN = 1 TITLE_LEN_MAX = 100 def __init__(self, mod_idendesc, get_link_fn): ProblemMg.db = AsyncDB(config.CORE_DBNAM...
mit
-4,573,826,940,243,780,600
29.108761
79
0.561007
false
3.376016
false
false
false
ROB-Seismology/oq-hazardlib
openquake/hazardlib/tests/gsim/youngs_1997_test.py
1
1668
# The Hazard Library # Copyright (C) 2012 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Th...
agpl-3.0
2,105,907,094,754,565,000
36.066667
74
0.730216
false
3.277014
true
false
false
rsling/cow
src/en/cow16-preproc-en.py
1
3049
# -*- coding: utf-8 -*- # Preprocesses ENCOW14 version for COW16 transformation. import argparse import os.path import sys import gzip import re CHUNK_TAGS = set(['<adjc>', '</adjc>', '<advc>', '</advc>', '<conjc>', '</conjc>', '<intj>', '</intj>', '<lst>', '</lst>', '<nc>', '</nc>', '<pc>', '</pc>', '<prt>', '</prt...
bsd-2-clause
-2,868,521,685,742,603,000
27.231481
193
0.513283
false
3.402902
false
false
false
jadnohra/connect
proto_3/ddq/util/print_tree.py
1
2653
from ddq.taxonomy.node import Node from pprint import pprint # from ddq.namer import Namer def print_tree(root, children_func=list, name_func=str): """Pretty print a tree, in the style of gnu tree""" # prefix components: space = ' ' branch = '│ ' # pointers: tee = '├── ' last = ...
unlicense
-1,217,428,759,989,133,300
33.038961
82
0.561999
false
3.971212
false
false
false
andrewf/fern
fern/ast/function.py
1
1659
from node import Node from let import Let from copy import deepcopy as copy from map import Map, KVPair from tools import ItemStream import fern class Function(Node): def __init__(self, child, args=None): Node.__init__(self) self.child = child self.reparent(child) self.args = args o...
mit
7,542,784,964,513,400,000
35.866667
125
0.611814
false
3.831409
false
false
false
takearest118/coconut
common/decorators.py
1
1909
# -*- coding: utf-8 -*- import functools from tornado.web import HTTPError import settings def admin_auth_async(method): @functools.wraps(method) async def wrapper(self, *args, **kwargs): self.current_user = await self.get_current_admin_async() if not self.current_user: raise HT...
gpl-3.0
3,970,466,122,936,480,000
29.790323
77
0.510215
false
4.470726
false
false
false
Tristan79/ComicStreamer
PyPDF2/generic.py
1
47533
# vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2006, Mathieu Fenniak # 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 copyrig...
apache-2.0
-1,235,080,043,736,905,500
35.790248
148
0.553868
false
3.867301
false
false
false
FNST-OpenStack/cloudkitty
cloudkitty/common/policy.py
1
2796
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-5,628,811,410,042,875,000
31.137931
78
0.663805
false
4.166915
false
false
false
llinder/gaeenv
gaeenv/virtualenv.py
1
2952
import os import sys import re import textwrap from utils import logger def add_gae_pth(env_dir): site_packages_dir = os.path.join( env_dir, 'lib', 'python{0}.{1}'.format(sys.version_info.major, sys.version_info.minor), 'site-packages') if not os.path.exists(site_packages_dir): logger.error('Python site p...
apache-2.0
-745,578,967,252,874,800
30.084211
106
0.647358
false
3.117212
false
false
false
uogbuji/amara3-xml
pylib/uxml/parser.py
1
17195
#amara3.uxml.parser ''' Hand-crafted parser for MicroXML [1], inspired to some extent by James Clark's Javascript work [2]. [1] https://dvcs.w3.org/hg/microxml/raw-file/tip/spec/microxml.html [2] https://github.com/jclark/microxml-js/blob/master/microxml.js ''' import re from enum import Enum #https://docs.python.or...
apache-2.0
-1,618,291,010,194,156,300
44.731383
159
0.470776
false
4.262519
false
false
false