repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
jfrygeo/solutions-geoprocessing-toolbox
data_management/toolboxes/scripts/LineFeatureAngle.py
2
4563
#------------------------------------------------------------------------------ # Copyright 2013 Esri # 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/LICENS...
apache-2.0
7,598,028,985,885,510,000
39.026316
142
0.586895
false
3.627186
false
false
false
sergiosuarez/MapTweets
mysite/models.py
1
1918
from django.db import models import string class Tweet(models.Model): user = models.BigIntegerField() tid = models.BigIntegerField() lat = models.FloatField() lon = models.FloatField() text = models.TextField(max_length=256) time = models.DateField() kwd = models.CharField(max_length=50) ...
mit
792,373,430,063,922,400
32.068966
64
0.684046
false
3.455856
false
false
false
araksin/leandiary
diary/models.py
1
1148
from django.db import models from django.contrib.auth.models import User class Product(models.Model): """ A product is an entity related to any food having nutritional consistency """ id = models.AutoField(primary_key=True) name = models.CharField(max_length=30) # Proteins/fats/carbohydrat...
mit
-669,879,884,202,535,700
28.435897
86
0.699477
false
3.891525
false
false
false
ASKBOT/python-import-utils
import_utils/__init__.py
1
1790
"""Utilities for loading modules, supporting programmatic imports of types:: >>>from import_utils import import_module_from, import_module >>>import x as mod_x >>>mod_x = import_module('x') >>> >>>import x.y as mod_xy >>>mod_xy = import_module('x.y') >>> >>>from x.y import z >>>z = ...
bsd-2-clause
-4,917,323,192,772,831,000
24.942029
86
0.575978
false
3.594378
false
false
false
avanzosc/event-wip
event_registration_analytic/models/event.py
1
12735
# -*- coding: utf-8 -*- # (c) 2016 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api, _ class EventEvent(models.Model): _inherit = 'event.event' no_employee_registration_ids = fields.One2many( comodel_name='event.r...
agpl-3.0
6,228,787,012,194,687,000
39.557325
79
0.573773
false
4.000943
false
false
false
Maspear/odoo
addons/mass_mailing/models/mass_mailing.py
68
27592
# -*- coding: utf-8 -*- from datetime import datetime from dateutil import relativedelta import json import random from openerp import tools from openerp.exceptions import Warning from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.translate import _ from openerp.tools import ustr from openerp.os...
agpl-3.0
5,891,476,312,638,237,000
43.938111
189
0.56038
false
3.95641
true
false
false
nansencenter/nansat
nansat/mappers/mapper_radarsat2.py
1
15452
# Name: mapper_radarsat2 # Purpose: Nansat mapping for Radarsat2 data # Authors: Morten W. Hansen, Knut-Frode Dagestad, Anton Korosov # Licence: This file is part of NANSAT. You can redistribute it or modify # under the terms of GNU General Public License, v.3 # http:/...
gpl-3.0
174,930,700,646,732,770
45.402402
101
0.533135
false
4.330717
false
false
false
gkoh/pynab
pynab/ids.py
2
14902
import unicodedata import regex import roman import datetime import pytz import time from pynab import log import pynab.util from pynab.interfaces.movie import INTERFACES as MOVIE_INTERFACES from pynab.interfaces.tv import INTERFACES as TV_INTERFACES from pynab.db import db_session, windowed_query, Release, MetaBlack,...
gpl-2.0
5,586,043,542,865,554,000
38.62766
167
0.483657
false
3.689698
false
false
false
apaksoy/automatetheboringstuff
practice projects/chap 16/umbrella_reminder.py
1
3075
#!/usr/bin/env python3 ''' Chapter 11 showed you how to use the requests module to scrape data from http://weather.gov/. Write a program that runs just before you wake up in the morning and checks whether it’s raining that day. If so, have the program text you a reminder to pack an umbrella before leaving the house. T...
mit
-5,161,179,202,040,499,000
29.89899
74
0.691729
false
3.143885
false
false
false
OCA/l10n-italy
assets_management/models/asset_depreciation_line_type.py
1
1809
# Author(s): Silvio Gregorini (silviogregorini@openforce.it) # Copyright 2019 Openforce Srls Unipersonale (www.openforce.it) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models from odoo.exceptions import ValidationError class DepLineType(models.Model): _name ...
agpl-3.0
7,932,399,071,929,598,000
26.409091
76
0.559425
false
3.699387
false
false
false
thopiekar/Cura
plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py
1
1249
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from ..BaseModel import BaseModel ## Model for the types of changes that are needed before a print job can start class ClusterPrintJobConfigurationChange(BaseModel): ## Creates a new print...
lgpl-3.0
8,741,208,696,800,755,000
45.259259
115
0.671737
false
3.784848
false
false
false
kpreid/shinysdr
shinysdr/plugins/simulate.py
1
10793
# Copyright 2013, 2014, 2015, 2016, 2017 Kevin Reid and the ShinySDR contributors # # This file is part of ShinySDR. # # ShinySDR 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 Licens...
gpl-3.0
6,109,872,255,961,333,000
34.620462
149
0.60706
false
3.648749
false
false
false
meee1/ardupilot
Tools/scripts/rcda_decode.py
22
1487
#!/usr/bin/env python ''' decode RCDA messages from a log and optionally play back to a serial port. The RCDA message is captures RC input bytes when RC_OPTIONS=16 is set ''' import struct from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--condition", default=None...
gpl-3.0
85,140,476,076,589,260
28.156863
94
0.652993
false
3.085062
false
false
false
OpenTrading/OpenTrader
OpenTrader/OTCmd2_utils.py
1
3890
# -*-mode: python; py-indent-offset: 4; indent-tabs-mode: nil; encoding: utf-8-dos; coding: utf-8 -*- import sys from optparse import OptionParser, make_option from OpenTrader.deps.cmd2plus import remaining_args, ParsedString lOPTIONS_DEFINED = [] def options(option_list, arg_desc="arg", usage=None): '''Used as ...
lgpl-3.0
3,259,144,815,768,460,300
41.282609
101
0.542931
false
4.445714
false
false
false
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosgraph/src/rosgraph/rosgraph_main.py
2
3474
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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: # # * Redistributions of source code...
bsd-3-clause
1,588,533,345,502,253,300
32.728155
85
0.609384
false
4.190591
false
false
false
TheAlgorithms/Python
machine_learning/logistic_regression.py
1
2480
#!/usr/bin/python # Logistic Regression from scratch # In[62]: # In[63]: # importing all the required libraries """ Implementing logistic regression for classification problem Helpful resources: Coursera ML course https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac """ import nu...
mit
-6,395,101,424,357,179,000
27.505747
87
0.612903
false
3.061728
false
false
false
aipescience/django-daiquiri
daiquiri/oai/renderers.py
1
7874
from daiquiri.core.renderers import XMLRenderer from daiquiri.core.renderers.datacite import DataciteRendererMixin from daiquiri.core.renderers.dublincore import DublincoreRendererMixin from daiquiri.core.renderers.voresource import VoresourceRendererMixin class OaiRenderer(DublincoreRendererMixin, DataciteRendererMi...
apache-2.0
-2,084,496,972,795,742,200
41.793478
141
0.625476
false
3.826045
false
false
false
alainr85/bio_primers
find_differential_primers/find_differential_primers.py
1
83235
#!/usr/bin/env python # find_differential_primers.py # # A Python script that identifies pairs of forward and reverse primers which # are capable of amplifying either individual organisms, or a particular # family of organisms, from a set of genome sequences. Primers are expected # to be located within CDS features, i...
gpl-3.0
1,479,732,124,699,790,600
47.392442
79
0.609431
false
4.033485
false
false
false
RedHatQE/cfme_tests
cfme/tests/cloud_infra_common/test_provisioning.py
1
23712
# -*- coding: utf-8 -*- # These tests don't work at the moment, due to the security_groups multi select not working # in selenium (the group is selected then immediately reset) from textwrap import dedent import fauxfactory import pytest from riggerlib import recursive_update from widgetastic_patternfly import Checkab...
gpl-2.0
935,850,192,545,471,500
38.785235
100
0.61568
false
4.19014
true
false
false
pythonalliance/uno2bot
settings.py
3
3597
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Telegram bot to play UNO in group chats # Copyright (c) 2016 Jannes Höke <uno@jhoeke.de> # # 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 Foundatio...
agpl-3.0
-8,267,733,360,761,920,000
32.669811
77
0.591482
false
3.808965
false
false
false
MicroPyramid/MicroSite
micro_blog/tasks.py
1
5094
from celery.decorators import task import sendgrid from django.conf import settings from micro_blog.models import Subscribers, Post, Category from .send_grid import * import datetime from micro_admin.models import User from django.template import loader @task def create_contact_in_category(category_name, email_addres...
gpl-2.0
-5,380,669,181,917,490,000
47.990385
228
0.672163
false
3.662114
false
false
false
wiredrive/wtframework
wtframework/wtf/utils/file_utils.py
1
4013
########################################################################## # This file is part of WTFramework. # # WTFramework 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 L...
gpl-3.0
8,690,845,209,346,460,000
31.362903
98
0.622228
false
3.922776
false
false
false
mondwan/ProjectCUWG
cuwg/xss/sanitization.py
1
5666
""" - `File`: sanitization.py - `Description`: xss challenge 1: How importatn to do sanitization """ import webapp2 from google.appengine.ext.webapp import template import re import os import constants import random import logging import urlparse import urllib class ResultVerifyHandler(webapp2.RequestHandler): ...
mit
-6,960,506,244,541,080,000
28.821053
77
0.465055
false
4.543705
false
false
false
kevinkahn/softconsole
githubutil.py
1
3389
import datetime import os import requests import shutil import subprocess import time """ NOTE: This gets used in initial setup of console by the setup program ** Don't add any dependencies on other parts of the console (E.g., no logging """ def StageVersion(vdir, tag, label): logf = open('stagelog.log', 'w') prin...
apache-2.0
-4,751,111,268,660,103,000
32.22549
131
0.676011
false
2.872034
false
false
false
wa4557/chromecast-player
playlist_manager.py
1
22058
from gi import require_version require_version("Gtk", "3.0") from gi.repository import Gtk, GdkPixbuf, GLib, Gdk import helpers from stream_select import FileChooserWindow, NetworkStream class PlaylistManager(Gtk.Window): def __init__(self, playlist, enable_web, transcoder, probe, preferred_transcoder, counter):...
gpl-3.0
2,185,413,142,309,863,700
36.072269
125
0.582102
false
3.781588
false
false
false
aa403/betfair.py
betfair/exceptions.py
1
1112
# -*- coding: utf-8 -*- import bf_logging class BetfairError(Exception): def __init__(self, message): bf_logging.main_logger.exception(message) # pass pass class BetfairLoginError(BetfairError): def __init__(self, response, data): self.response = response self.message = d...
mit
5,364,621,063,707,154,000
28.263158
65
0.616906
false
3.821306
false
false
false
pstreck/django-videokit
example/media/migrations/0001_initial.py
1
1517
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-19 21:15 from __future__ import unicode_literals from django.db import migrations, models import media.models import videokit.models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migra...
mit
3,036,916,101,428,625,400
44.969697
278
0.626895
false
3.860051
false
false
false
pypa/virtualenv
src/virtualenv/activation/via_template.py
4
2372
from __future__ import absolute_import, unicode_literals import os import sys from abc import ABCMeta, abstractmethod from six import add_metaclass from virtualenv.util.six import ensure_text from .activator import Activator if sys.version_info >= (3, 7): from importlib.resources import read_binary else: f...
mit
8,950,317,815,485,758,000
34.402985
91
0.64629
false
4.19823
false
false
false
Frikster/Mesoscale-Brain-Explorer
src/plugins/scatterplot.py
1
2703
#!/usr/bin/env python3 import numpy as np import pyqtgraph.opengl as gl from pyqtgraph.Qt import QtCore w = gl.GLViewWidget() w.opts['distance'] = 20 g = gl.GLGridItem() w.addItem(g) ## ## First example is a set of points with pxMode=False ## These demonstrate the ability to have points with real size down to a ve...
mit
-5,207,972,922,242,495,000
23.572727
117
0.606363
false
2.383598
false
false
false
openplans/shareabouts-api
src/sa_api_v2/migrations/0001_initial.py
1
20388
# -*- coding: utf-8 -*- from django.db import models, migrations import sa_api_v2.models.caching import django.contrib.gis.db.models.fields import sa_api_v2.models.core import django.utils.timezone import sa_api_v2.models.mixins from django.conf import settings import sa_api_v2.apikey.models import django.core.files....
gpl-3.0
7,301,804,444,198,530,000
53.368
289
0.578428
false
4.260815
false
false
false
andrewyoung1991/abjad
abjad/tools/documentationtools/test/test_documentationtools_GraphvizGraph_pickle.py
1
1221
# -*- encoding: utf-8 -*- import pickle from abjad import * def test_documentationtools_GraphvizGraph_pickle_01(): graph = documentationtools.GraphvizGraph() graph.append(documentationtools.GraphvizSubgraph()) graph[0].append(documentationtools.GraphvizNode()) graph[0].append(documentationtools.Graph...
gpl-3.0
-7,160,647,781,701,008,000
30.333333
74
0.588862
false
3.815625
false
false
false
roofit-dev/parallel-roofit-scripts
scaling/unbinned_scaling_analysis.py
1
1300
# -*- coding: utf-8 -*- # @Author: Patrick Bos # @Date: 2016-11-16 16:23:55 # @Last Modified by: Patrick Bos # @Last Modified time: 2016-11-21 18:10:00 import pandas as pd # fn = "timings.json" # fn = "timings_stbc_20161117.json" fn = "timings_stbc_20161121.json" with open(fn, 'r') as fh: json_array_inside_t...
apache-2.0
3,840,109,117,953,163,300
26.083333
115
0.656923
false
2.480916
false
true
false
MrJohz/snooble
snooble/oauth.py
1
8536
from . import utils from .utils import cbc from requests.auth import HTTPBasicAuth from urllib.parse import urljoin __all__ = [ # constants 'SCRIPT_KIND', 'EXPLICIT_KIND', 'IMPLICIT_KIND', 'APPLICATION_INSTALLED_KIND', 'APPLICATION_EXPLICIT_KIND', 'ALL_SCOPES', # Classes 'OAuth', 'Authorization' ]...
mit
-891,335,432,208,975,000
43
89
0.63859
false
3.826087
false
false
false
markkness/ColorPy
colorpy/figures.py
1
2481
''' figures.py - Create all the ColorPy sample figures. Description: Creates the sample figures. This can also create the figures with some non-default initialization conditions. Functions: figures() - Create all the sample figures. figures_clip_clamp_to_zero () - Adjust the color clipping method, and cre...
lgpl-2.1
-6,055,264,009,291,869,000
27.517241
85
0.727529
false
3.664697
false
false
false
oostende/dvbapp2-gui-egami
tests/events.py
80
1670
import time import tests recorded_events = [ ] def event(self, name, args, kwargs): global recorded_events print "*EVENT*", time.time(), self, name, args, kwargs recorded_events.append((time.time(), self, name, args, kwargs)) def eventfnc(f): name = f.__name__ def wrapper(self, *args, **kwargs): event(self, n...
gpl-2.0
433,176,637,897,280,260
22.194444
129
0.642515
false
2.751236
true
false
false
mbaumBielefeld/popkin
popkin/visualization/PlaceFieldVisualizer.py
1
2395
import matplotlib.pyplot as plt class PlaceFieldVisualizer: def __init__(self, fields): self.fields=fields self.callbacks={} fig=plt.figure() cid = fig.canvas.mpl_connect('button_press_event', self.onclick) cid_k=fig.canvas.mpl_connect('key_press_event', self.onKeyPress...
gpl-2.0
8,130,452,641,855,284,000
30.513158
103
0.608351
false
3.481105
false
false
false
thinkle/gourmet
gourmet/plugins/field_editor/__init__.py
1
1147
from gourmet.plugin import ToolPlugin from . import fieldEditor from gi.repository import Gtk from gettext import gettext as _ class FieldEditorPlugin (ToolPlugin): menu_items = '''<placeholder name="DataTool"> <menuitem action="FieldEditor"/> </placeholder> ''' def setup_action_groups (self): ...
gpl-2.0
2,432,208,913,031,276,500
30.861111
92
0.660854
false
3.928082
false
false
false
mrocklin/unification
unification/utils.py
1
2844
from functools import partial from toolz.compatibility import range, map def hashable(x): try: hash(x) return True except TypeError: return False def transitive_get(key, d): """ Transitive dict.get >>> d = {1: 2, 2: 3, 3: 4} >>> d.get(1) 2 >>> transitive_get(1, d...
bsd-3-clause
-734,053,786,170,655,100
23.101695
77
0.565401
false
3.45565
false
false
false
jnez71/demos
estimation/recursive_bayes.py
1
2129
#!/usr/bin/env python2 """ Recursive Bayes for POMDP belief-state tracking. Max-a-posteriori estimation. """ # Dependencies from __future__ import division import numpy as np; npl = np.linalg import matplotlib.pyplot as plt # State, action, measurement, and time cardinalities nS = 3; nA = 2; nM = 2; nT = 100 # Trans...
mit
4,669,991,582,916,422,000
26.649351
86
0.565993
false
2.586877
false
false
false
rogeriopradoj/SublimeLinter-phplint
linter.py
1
1574
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Aparajita Fishman # Copyright (c) 2015 The SublimeLinter Community # # License: MIT # """This module exports the PHPLint plugin class.""" from SublimeLinter.lint import Linter class PHPLint(Linter): """Provid...
mit
3,513,506,060,172,176,000
30.48
102
0.570521
false
3.553047
false
false
false
bswartz/manila
manila/share/drivers/netapp/dataontap/cluster_mode/drv_single_svm.py
1
12154
# Copyright (c) 2015 Clinton Knight. 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 requir...
apache-2.0
1,042,782,491,344,359,300
46.662745
79
0.60153
false
4.621293
false
false
false
jdfekete/progressivis
tests/test_00_file_buffer.py
1
1924
from progressivis.core.utils import filepath_to_buffer from . import ProgressiveTest, skip, skipIf import requests, tempfile, os HTTP_URL = ('http://s3.amazonaws.com/h2o-release/h2o/master' '/1193/docs-website/resources/publicdata.html') S3_URL = ('s3://h2o-release/h2o/master/1193/docs-website' ...
bsd-2-clause
7,882,744,153,001,346,000
33.981818
132
0.573285
false
3.206667
false
false
false
bgshih/tf_resnet_cifar
src/model_utils.py
1
2183
import tensorflow as tf def shape_probe(tensor): return tf.Print(tensor, [tf.shape(tensor)], message='Shape=', summarize=10) def min_max_probe(tensor): return tf.Print(tensor, [tf.reduce_min(tensor), tf.reduce_max(tensor)], message='Min, max=', summarize=10) def conv_map_montage(conv_maps): """ Montage of co...
mit
-4,850,249,143,528,783,000
35.383333
108
0.694457
false
3.263079
false
false
false
Caranarq/01_Dmine
Scripts/VarInt/VarInt.py
1
2170
# -*- coding: utf-8 -*- """ Created on Mon Oct 30 17:21:27 2017 @author: carlos.arana Descripcion: Procesa los datos del parámetro para regresar la variable de integridad. Si la Variable de Integridad es del tipo: Tipo 1 (Binaria), la funcion busca celdas vacías en una sola columna y regresa 0 si la celda esta v...
gpl-3.0
7,854,610,695,471,103,000
48.090909
116
0.7
false
2.954856
false
false
false
msteghofer/CSnake
src/csnVisualStudio2010.py
2
2413
## @package csnVisualStudio2010 # Definition of the csnVisualStudio2010 compilers. # \ingroup compiler import csnCompiler import os class Compiler(csnCompiler.Compiler): """ Abstract Visual Studio 2010 compiler. """ def __init__(self): csnCompiler.Compiler.__init__(self) self.postProcessor = P...
bsd-3-clause
-2,766,193,454,900,575,700
27.05814
101
0.62039
false
4.371377
true
false
false
mozilla/pulseguardian
pulseguardian/model/queue.py
2
1025
# 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/. from sqlalchemy import Boolean, Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship from pulseg...
mpl-2.0
-5,574,268,999,701,741,000
34.344828
79
0.707317
false
3.853383
false
false
false
butala/pyrsss
pyrsss/emission/v6300.py
1
2194
from __future__ import division import math from datetime import datetime from pyglow.pyglow import Point # using back-port for python2 (enum34 package) --- this is in the # python3 standard library (>=3.4) from enum import Enum class OplusType(Enum): ne = 1 charge_neutrality = 2 """ The following (alpha1...
mit
-2,333,410,579,308,403,700
19.314815
78
0.503646
false
2.510297
false
false
false
dimasad/ceacoest
examples/circular_orbit_min_time.py
2
5096
"""Limited-thrust circular orbit transfer.""" import functools import numpy as np import sympy from sympy import sin, cos from scipy import constants, integrate, interpolate import sym2num.model import sym2num.utils import sym2num.var from ceacoest import oc from ceacoest.modelling import symoc @symoc.collocate(o...
mit
7,281,658,488,657,289,000
32.526316
80
0.575746
false
2.81547
false
false
false
django/djangosnippets.org
cab/tests/tests.py
1
26406
from django.contrib.auth.models import AnonymousUser, User from django.template import Context, Template from django.test import SimpleTestCase, TestCase from django.urls import reverse from rest_framework import status from ..api.serializers import SnippetSerializer from ..models import Bookmark, Language, Snippet fr...
bsd-3-clause
3,212,347,291,658,060,000
39.376147
111
0.616564
false
3.698319
true
false
false
gforsyth/doctr_testing
doctr/tests/test_travis.py
1
4183
""" So far, very little is actually tested here, because there aren't many functions that can be tested outside of actually running them on Travis. """ import tempfile import os from os.path import join import pytest from ..travis import sync_from_log @pytest.mark.parametrize("src", ["src"]) @pytest.mark.parametriz...
mit
-4,881,216,847,673,967,000
28.048611
72
0.434616
false
4.045455
true
false
false
h2oai/h2o-3
h2o-py/h2o/automl/autoh2o.py
2
39006
# -*- encoding: utf-8 -*- import functools as ft from inspect import getdoc import re import h2o from h2o.automl._base import H2OAutoMLBaseMixin from h2o.automl._h2o_automl_output import H2OAutoMLOutput from h2o.base import Keyed from h2o.estimators import H2OEstimator from h2o.exceptions import H2OResponseError, H2OV...
apache-2.0
7,905,688,082,203,474,000
52.727273
184
0.602446
false
4.130241
false
false
false
hirunatan/anillo
anillo/middlewares/json.py
1
3579
import json import functools from cgi import parse_header def wrap_json(func=None, *, encoder=json.JSONEncoder): """ A middleware that parses the body of json requests and encodes the json responses. NOTE: this middleware exists just for backward compatibility, but it has some limitations in term...
bsd-2-clause
-8,240,903,876,236,988
35.896907
116
0.663593
false
4.10907
false
false
false
charettes/django-mutant
mutant/apps.py
1
2824
from __future__ import unicode_literals from django.apps import AppConfig from django.db import models from django.utils.module_loading import import_string from . import settings class MutantConfig(AppConfig): name = 'mutant' def ready(self): self.state_handler = import_string(settings.STATE_HANDL...
mit
4,812,761,891,276,211,000
37.162162
82
0.65262
false
4.36476
false
false
false
rafaelvasco/SpriteMator
src/model/application_settings.py
1
1601
from PyQt5.QtCore import QSettings class SettingData(object): def __init__(self, name, value, write_to_disk=False): self._name = name self._value = value self._writeToDisk = write_to_disk @property def name(self): return self._name @name.setter def name(self, va...
apache-2.0
-4,443,230,125,401,103,000
22.895522
84
0.580262
false
4.23545
false
false
false
jplitza/kino
kino/controller.py
1
5284
from flask import render_template, make_response, request, redirect, url_for, Response, g, jsonify from datetime import datetime from operator import attrgetter import json from . import app, db from .model import * @app.before_request def before_request(): """Ensures that user is authenticated and fills some glo...
mit
9,070,815,388,826,939,000
35.951049
106
0.604845
false
3.739561
false
false
false
patriczek/faf
src/pyfaf/storage/externalfaf.py
2
1039
# Copyright (C) 2014 ABRT Team # Copyright (C) 2014 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0
3,819,824,388,280,074,000
33.633333
70
0.739172
false
3.764493
false
false
false
superchilli/webapp
venv/lib/python2.7/site-packages/httpie/downloads.py
4
13054
# coding=utf-8 """ Download mode implementation. """ from __future__ import division import os import re import sys import mimetypes import threading from time import sleep, time from mailbox import Message from .output import RawStream from .models import HTTPResponse from .utils import humanize_bytes from .compat i...
mit
-292,126,573,933,683,100
29.571429
79
0.558909
false
4.242444
false
false
false
jedi22/osquery
tools/deployment/getfiles.py
6
1617
#!/usr/bin/env python # Copyright (c) 2014-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the Apache 2.0 license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree)...
bsd-3-clause
3,401,102,705,293,106,700
28.418182
86
0.63389
false
3.786885
false
false
false
lpryszcz/bin
plot_2d.py
1
4538
#!/usr/bin/env python desc="""2D plot""" epilog="""Author: l.p.pryszcz+git@gmail.com Barcelona, 10/05/2013 """ import argparse, math, os, sys from datetime import datetime import matplotlib.pyplot as plt import numpy as np def plot_2d(inputs, output, title, xlab, ylab, xmax, xmin, log, ndivide=20): """ """ ...
gpl-3.0
5,600,041,490,826,155,000
38.46087
178
0.538784
false
3.260057
false
false
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/traits-4.3.0-py2.7-macosx-10.10-x86_64.egg/traits/trait_base.py
1
19017
#------------------------------------------------------------------------------ # # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
gpl-2.0
5,830,377,283,160,393,000
34.813559
81
0.482989
false
5.132794
true
false
false
google/clif
clif/testing/python/classes_test.py
1
2595
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
1,566,296,594,970,974,700
31.4375
74
0.6921
false
3.405512
true
false
false
CI-WATER/gsshapy
gsshapy/modeling/model.py
1
14479
# -*- coding: utf-8 -*- # # model.py # GSSHApy # # Created by Alan D Snow, 2016. # BSD 3-Clause from datetime import timedelta import logging import uuid import os from gazar.grid import GDALGrid import geopandas as gpd from .event import EventMode, LongTermMode from ..orm import WatershedMaskFile, ElevationGrid...
bsd-3-clause
7,239,281,014,911,218,000
47.915541
199
0.537123
false
4.427829
false
false
false
naure/YaP
tests/test_lib.py
1
2568
#!/usr/bin/env python3 import unittest import sys sys.path.append('.') from yap import expand_env_soft from yap import call_lib escape_sh = None exec(call_lib) from yap import missing_lib exec(missing_lib) def B(s): " Avoid quoting backslashes all the time " return s.replace('B', '\\').replace('S', "'").re...
apache-2.0
4,114,828,465,400,979,500
26.913043
76
0.507399
false
3.832836
true
false
false
Jgarcia-IAS/SAT
openerp/addons-extra/res_partner_fiscal_document/res_partner.py
3
6596
# -*- encoding: utf-8 -*- # ############################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) Odoo Colombia (Community). # Author David Arnold (devCO) # # This program is free software: you can redistribute it and/or modify # it under the t...
agpl-3.0
-1,840,030,141,748,945,200
38.261905
80
0.541692
false
4.164141
false
false
false
jaufrec/ssn_names
import_names.py
1
3856
#!/usr/bin/python # -*- coding: utf-8 -*- import psycopg2 import sys import csv import glob import re def load_names(): """Import names from SSN data dump into database""" con = psycopg2.connect(database='ssn_names') cur = con.cursor() # for filename in glob.iglob('*1880.txt'): for filename in ...
gpl-2.0
-8,039,289,289,064,200,000
23.1
99
0.567427
false
3.689952
false
false
false
dhenrygithub/QGIS
python/plugins/processing/algs/qgis/ExtractByAttribute.py
1
5209
# -*- coding: utf-8 -*- """ *************************************************************************** ExtractByAttribute.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ******************...
gpl-2.0
3,841,475,093,909,727,700
41.696721
110
0.525821
false
4.881912
false
false
false
ricket1978/ggplot
ggplot/components/__init__.py
12
1402
from __future__ import (absolute_import, division, print_function, unicode_literals) from .aes import aes from . import colors, shapes, size, linetypes, alphas def assign_visual_mapping(data, aes, gg): """Assigns the visual mapping to the given data and adds the right legend Parameter...
bsd-2-clause
-4,193,330,693,419,276,000
34.05
77
0.639087
false
3.938202
false
false
false
peterdougstuart/PCWG
pcwg/core/benchmark.py
2
5616
import numpy as np from analysis import Analysis from corrections import PowerCalculator from corrections import TurbulencePowerCalculator from ..core.status import Status class BenchmarkAnalysis(Analysis): def __init__(self, analysis_config, baseLineMode): self.basePower = "Base Power" self.b...
mit
5,308,416,167,202,533,000
40.6
208
0.67183
false
4.028694
false
false
false
Mischback/django-oweb
oweb/views/tools.py
1
4779
"""Provides some general, account-related tools""" # Python imports from math import ceil # Django imports from django.core.urlresolvers import reverse from django.http import Http404 from django.shortcuts import redirect, render # app imports from oweb.exceptions import OWebDoesNotExist, OWebAccountAccessViolation fro...
mit
3,612,048,991,356,591,000
37.853659
146
0.650345
false
3.724864
false
false
false
nprapps/app-template
fabfile/flat.py
3
3778
#!/usr/bin/env python # _*_ coding:utf-8 _*_ import copy from cStringIO import StringIO from fnmatch import fnmatch import gzip import hashlib import logging import mimetypes import os from boto.s3.key import Key import app_config import utils logging.basicConfig(format=app_config.LOG_FORMAT) logger = logging.getLog...
mit
7,508,140,029,491,824,000
26.376812
86
0.561673
false
3.591255
false
false
false
drepetto/chiplotle
chiplotle/hpgl/abstract/arc.py
1
1046
from chiplotle.hpgl.abstract.positional import _Positional from chiplotle.hpgl.abstract.hpglprimitive import _HPGLPrimitive class _Arc(_Positional): def __init__(self, xy, angle, chordtolerance=None): self.angle = angle self.chordtolerance = chordtolerance _Positional.__init__(self, xy) ...
gpl-3.0
-3,849,194,101,199,761,000
33.866667
71
0.578394
false
3.70922
false
false
false
macky360/Bitcoin-Related_Addresses
relatedaddresses.py
1
7720
#!/usr/bin/env python import sys, os PY_VERSION = sys.version_info if PY_VERSION.major != 2 and PY_VERSION.minor != 7: print("This application requires Python 2.7. You are using Python %d.%d." % (PY_VERSION.major, PY_VERSION.minor)) sys.exit(1) from datetime import datetime from lib.blockchainquery ...
gpl-2.0
6,022,440,774,097,053,000
40.505376
173
0.587824
false
3.981434
false
false
false
sfu-fas/coursys
otp/models.py
1
5414
from . import auth_checks from django.db import models from django.contrib.sessions.models import Session from django.contrib.sessions.backends.db import SessionStore from django.contrib.auth.signals import user_logged_in, user_logged_out from django.db.models.signals import post_save from django.utils import timezon...
gpl-3.0
-6,296,844,271,298,977,000
32.018293
106
0.65737
false
3.889368
false
false
false
flopezag/fiware-management-scripts
HelpDesk/stackoverflowsync.py
1
8004
#!/usr/bin/env <PATH_HELPDESK>/env/bin/python # -*- encoding: utf-8 -*- ## # Copyright 2017 FIWARE Foundation, e.V. # 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 # # ...
apache-2.0
-4,770,620,268,501,498,000
35.04955
113
0.645383
false
4.110426
false
false
false
thebravoman/software_engineering_2016
hm_term2_rest_api_projects/11a_03_11/gpus/migrations/0001_initial.py
1
1229
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-27 07:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='GPU', ...
mit
-6,903,305,332,872,117,000
35.147059
114
0.554109
false
4.585821
false
false
false
LarryHillyer/PoolHost
PoolHost/nfl/division/viewmodels.py
1
12639
from datetime import datetime from django.db import models from app.models import SiteUser, NFL_Division, NFL_Conference, League, Sport, SuperUser from app.models import NFL_Conference_Choices from app.mixins import HelperMixins from nfl.division.forms import NFL_DivisionForm_Create, NFL_DivisionForm_Edit class La...
gpl-3.0
2,366,950,305,864,144,000
37.18429
122
0.638658
false
3.71626
false
false
false
gopal1cloud/neutron
neutron/db/migration/alembic_migrations/versions/33dd0a9fa487_embrane_lbaas_driver.py
5
1871
# Copyright 2014 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 ...
apache-2.0
-558,871,082,599,062,300
30.711864
78
0.687867
false
3.550285
false
false
false
rbaumg/trac
trac/wiki/intertrac.py
1
4800
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2019 Edgewall Software # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http...
bsd-3-clause
-6,706,267,280,268,340,000
36.5
76
0.575625
false
4.047218
false
false
false
arve0/leicascanningtemplate
leicascanningtemplate/template.py
1
13128
import time, re from lxml import objectify, etree from copy import deepcopy class ScanningTemplate(object): """Python object of Leica LAS Matrix Screener Scanning Template XML. Provides easy access to elements via attributes: >>> tmpl = ScanningTemplate('{ScanningTemplate}tmpl.xml') >>> # attr...
mit
-6,438,428,709,144,034,000
29.744731
89
0.58082
false
3.90598
false
false
false
Nithanaroy/DistributedDataPartitioning
MetaDataDAO.py
1
2144
""" Has the MetaData about the partitioning """ import Globals TABLENAME = 'patitionmeta' def create(conn): """ Create a MetaData table if it does not exist :param conn: open connection to DB :return:None """ with conn.cursor() as cur: cur.execute(""" CREATE TABLE IF NOT ...
mit
-7,550,101,559,104,451,000
31.014925
108
0.621269
false
3.702936
false
false
false
gasserma/dwr
strategies/hebeler_autopilot.py
1
2496
from strategies.strategy_base import StrategyBase # https://www.irs.gov/publications/p590b/index.html#en_US_2014_publink1000231236 # age................0.....1.....2.....3.....4.....5.....6.....7.....8.....9 lifeExpectancy = [82.4, 81.6, 80.6, 79.7, 78.7, 77.7, 76.7, 75.8, 74.8, 73.8, # x 0 72.8, 71...
gpl-3.0
-2,088,315,451,977,527,000
45.240741
91
0.542468
false
2.570546
false
false
false
Danielhiversen/home-assistant
homeassistant/components/melissa.py
1
1118
""" Support for Melissa climate. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/melissa/ """ import logging import voluptuous as vol from homeassistant.const import CONF_USERNAME, CONF_PASSWORD from homeassistant.helpers import config_validation as cv ...
mit
6,959,869,314,066,660,000
24.409091
74
0.711986
false
3.49375
true
false
false
janvc/utility-scripts
scripts/therm_crosscorr.py
1
5411
#!/usr/bin/env python3 # Copyright 2017 Jan von Cosel # # This file is part of utility-scripts. # # utility-scripts 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 yo...
gpl-3.0
-3,756,362,510,976,841,000
32.81875
98
0.634633
false
3.205569
false
false
false
francisc0garcia/autonomous_bicycle
src/classes/handlers/Vector3Handler.py
1
1848
import numpy as np import rospy from geometry_msgs.msg import Vector3Stamped class Vector3Handler(object): """ Handler for ROS topics of type: geometry_msgs/Vector3Stamped Args: topic_name: Name of ROS topic to be subscribed buffer_size: Variable buffer, depend on frame rate of topic, defa...
apache-2.0
-3,546,464,600,652,254,700
34.538462
95
0.576299
false
3.581395
false
false
false
soh-i/Ivy
src/Ivy/cli/edit_bench_cli_opts.py
1
2832
from argparse import ArgumentParser import os.path import sys from Ivy.version import __version__ from Ivy.analysis_settings import EDIT_BENCH_SETTINGS __program__ = 'ivy_benchmark' __author__ = 'Soh Ishiguro <yukke@g-language.org>' __license__ = '' __status__ = 'development' def parse_bench_opts(): desc = "Benc...
gpl-2.0
5,171,551,590,040,019,000
40.647059
111
0.447034
false
4.994709
false
false
false
flavour/eden
modules/s3/s3track.py
1
35210
# -*- coding: utf-8 -*- """ Simple Generic Location Tracking System @copyright: 2011-2019 (c) Sahana Software Foundation @license: MIT 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 ...
mit
7,700,843,623,012,400,000
36.497338
114
0.480858
false
4.747843
false
false
false
kervi/kervi
kervi-devices/kervi/devices/sensors/LSM9DS1.py
1
16858
# The MIT License (MIT) # # Copyright (c) 2017 Tony DiCola for Adafruit Industries # # 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 righ...
mit
6,231,677,979,859,471,000
36.793722
141
0.617288
false
2.871061
false
false
false
lebabouin/CouchPotatoServer-develop
libs/tmdb3/cache_file.py
10
13285
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------- # Name: cache_file.py # Python Library # Author: Raymond Wagner # Purpose: Persistant file-backed cache using /tmp/ to share data # using flock or msvcrt.locking to allow safe concurrent # access. #----------------------- import s...
gpl-3.0
894,537,346,810,222,000
32.976982
80
0.54332
false
4.348609
false
false
false
xesscorp/skidl
skidl/libs/siliconi_sklib.py
1
2245
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib SKIDL_lib_version = '0.0.1' siliconi = SchLib(tool=SKIDL).add_parts(*[ Part(name='D469',dest=TEMPLATE,tool=SKIDL,keywords='High-Current Driver',description='Quad High-Current Power Driver',ref_prefix='U',num_units=4,do_erc=True,pins=[ Pin(num='7...
mit
-4,694,984,533,232,278,000
59.675676
184
0.567929
false
2.669441
false
true
false
Samweli/inasafe
safe/utilities/i18n.py
2
2466
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid -**Internationalisation utilities.** The module provides utilities function to convert between unicode and byte string for Python 2.x. When we move to Python 3, this module and its usage should be removed as string in Python 3 is already stored in unic...
gpl-3.0
-7,313,340,112,255,717,000
32.324324
79
0.698297
false
3.9456
false
false
false
onepas/kodi-addons
plugin.video.vietmediaplay/uuid.py
16
17742
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
gpl-2.0
-4,095,845,845,809,557,000
36.273109
78
0.60416
false
3.526535
true
false
false
carlos-ferras/Sequence-ToolKit
controller/stk/assistant.py
1
2990
#!/usr/bin/python3 # -*- coding: utf-8 -*- from __future__ import unicode_literals import os import pickle from PyQt5 import QtWidgets, QtCore, QtNetwork class Assistant(QtWidgets.QApplication): timeout = 1000 def __init__(self, argv): QtWidgets.QApplication.__init__(self, argv) self.soc...
gpl-3.0
-3,806,706,311,854,687,700
34.595238
113
0.625084
false
4.084699
false
false
false
acrellin/mltsp
cesium/features/tests/util.py
5
1685
import dask import numpy as np from cesium.features import generate_dask_graph def generate_features(t, m, e, features_to_use): """Utility function that generates features from a dask DAG.""" graph = generate_dask_graph(t, m, e) values = dask.get(graph, features_to_use) return dict(zip(features_to_us...
bsd-3-clause
-2,430,628,174,755,432,400
34.104167
82
0.678932
false
3.303922
false
false
false
fy0/my-leetcode
126.word-ladder-ii/main.py
1
3073
class Solution: def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]: # 首先,获取一个字符对应wordList index的映射 word_dict = {} wordListSet = set(wordList) if endWord not in wordListSet: return [] for val in wordList: for in...
apache-2.0
-8,953,778,943,092,849,000
27.635417
96
0.427792
false
3.385468
false
false
false
david-mateo/marabunta
marabunta/models/HeadingConsensusRobot.py
1
2310
from marabunta import BaseRobot from math import sin,cos,pi class HeadingConsensusRobot(BaseRobot): """Robot model for heading consensus. By iteratively calling the update() method, this robot will communicate with the rest of the swarm and align its heading to the swarm's mean heading. Obstacl...
gpl-3.0
-5,241,920,178,329,342,000
32
59
0.576623
false
4.074074
false
false
false
ksrajkumar/openerp-6.1
openerp/addons/base_crypt/crypt.py
2
9810
# Notice: # ------ # # Implements encrypting functions. # # Copyright (c) 2008, F S 3 Consulting Inc. # # Maintainer: # Alec Joseph Rivera (agi<at>fs3.ph) # # # Warning: # ------- # # This program as such is intended to be used by professional programmers # who take the whole responsibility of assessing all potential...
agpl-3.0
3,774,015,161,033,898,500
31.919463
100
0.566667
false
3.70049
false
false
false
RedHenLab/Audio
GSoC2015/CommercialDetection/src/web/output/views.py
1
6235
from django.shortcuts import render, render_to_response from django.http import HttpResponse from django.template import Template, Context, RequestContext from django.template.loader import get_template from web.settings import BASE_DIR import sys sys.path.append(BASE_DIR + "/../") #Shift one higher up the parent direc...
gpl-2.0
2,963,164,279,370,545,700
33.071038
125
0.643304
false
4.038212
false
false
false
njbbaer/unicorn-remote
app/programs/hd/candle.py
1
2458
#!/usr/bin/env python import colorsys import math import time from random import randint import unicornhathd def run(params): width, height = unicornhathd.get_shape() # buffer to contain candle "heat" data candle = [0] * 256 # create a palette for mapping heat values onto colours palette = [0] * 256 fo...
mit
8,055,438,462,381,919,000
24.340206
88
0.478438
false
2.874854
false
false
false
ktok07b6/polyphony
polyphony/compiler/deadcode.py
1
1652
from .env import env from .ir import * from logging import getLogger logger = getLogger(__name__) class DeadCodeEliminator(object): def process(self, scope): if scope.is_namespace() or scope.is_class(): return usedef = scope.usedef for blk in scope.traverse_blocks(): ...
mit
-2,885,627,664,183,240,700
39.317073
113
0.452785
false
3.980723
false
false
false
ThomasYeoLab/CBIG
stable_projects/predict_phenotypes/Nguyen2020_RNNAD/cbig/Nguyen2020/hord_base.py
1
1312
#!/usr/bin/env python from __future__ import print_function import csv import os import threading class OptimBase(object): def __init__(self, executable, fixed_args, log_file): self.executable = executable self.fixed_args = fixed_args self.log_file = log_file assert not os.path.isf...
mit
2,659,299,299,542,736,000
31
101
0.60747
false
3.517426
false
false
false