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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rustychris/stompy | stompy/grid/front.py | 1 | 109620 | """
An advancing front grid generator for use with unstructured_grid
Largely a port of paver.py.
"""
from __future__ import print_function
import math
import numpy as np
from collections import defaultdict
import time
from scipy import optimize as opt
import pdb
import logging
log=logging.getLogger(__name__)
from s... | mit | 6,816,814,694,789,307,000 | 36.425743 | 118 | 0.534702 | false | 3.777525 | false | false | false |
jbdubois/obus | python/obus/looper.py | 1 | 3841 | #===============================================================================
# obus-python - obus client python module.
#
# @file protocol.py
#
# @brief obus python looper
#
# @author yves-marie.morgan@parrot.com
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistribution and use in source and bina... | lgpl-2.1 | 6,982,514,743,527,212,000 | 37.79798 | 80 | 0.51523 | false | 4.962532 | false | false | false |
jfkirk/tensorrec | tensorrec/prediction_graphs.py | 1 | 5042 | import abc
import tensorflow as tf
from .recommendation_graphs import relative_cosine
class AbstractPredictionGraph(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def connect_dense_prediction_graph(self, tf_user_representation, tf_item_representation):
"""
This method is respon... | apache-2.0 | -5,519,003,016,839,481,000 | 42.094017 | 120 | 0.688021 | false | 3.825493 | false | false | false |
michaelneuder/image_quality_analysis | bin/nets/wip/ms_ssim_nets/structure_net.py | 1 | 9207 | #!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import matplotlib as mpl
import pandas as pd
import numpy as np
mpl.use('Agg')
import time
import matplotlib.pyplot as plt
def convolve_inner_layers(x, W, b):
'''
inner layers of network --- tanh activation
'''
... | mit | -9,039,136,241,680,621,000 | 42.023364 | 168 | 0.652221 | false | 3.397417 | true | false | false |
nakulm95/team_swag | test2.py | 1 | 2257 | import RPi.GPIO as GPIO
import time
import os
import RPIO
SPICLK = 15
SPIMISO = 13
SPIMOSI = 11
SPICS = 7
IRRX = 15
IRTX = 11
def main():
init()
while True:
print(GPIO.input(IRRX))
## GPIO.output(IRTX, True)
## time.sleep(.000013)
## GPIO.output(IRTX, False)
## time.sleep... | mit | -6,307,853,393,377,386,000 | 26.192771 | 62 | 0.519273 | false | 3.314244 | false | false | false |
MTgeophysics/mtpy | mtpy/gui/SmartMT/Components/PlotParameter/station_selection.py | 1 | 1034 | # -*- coding: utf-8 -*-
"""
Description:
Usage:
Author: YingzhiGou
Date: 24/10/2017
"""
from qtpy.QtCore import Signal
from qtpy.QtWidgets import QGroupBox
from mtpy.gui.SmartMT.ui_asset.groupbox_station_select import Ui_GroupBox_Station_Select
class StationSelection(QGroupBox):
def __init__(s... | gpl-3.0 | 5,908,322,875,758,642,000 | 24.85 | 91 | 0.646035 | false | 3.423841 | false | false | false |
anderfosca/contextbroker | code/virtualenv/broker/broker.py | 1 | 10285 | #!flask/bin/python
from flask import Flask, jsonify, request, render_template
import modules.getProviders as getProviders
import modules.advertisement as adv
import modules.getContext as getContext
import modules.subscription as subscription
import modules.update as update
import modules.contextml_validator as contextm... | gpl-2.0 | -6,344,407,240,051,767,000 | 37.811321 | 120 | 0.6737 | false | 3.546552 | false | false | false |
HewlettPackard/python-proliant-sdk | examples/Rest/ex33_set_bios_service.py | 1 | 1873 | # Copyright 2016 Hewlett Packard Enterprise Development, LP.
#
# 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 req... | apache-2.0 | 6,621,441,918,202,101,000 | 37.851064 | 78 | 0.649226 | false | 3.77621 | false | false | false |
tartavull/google-cloud-python | pubsub/google/cloud/pubsub/_gax.py | 1 | 30972 | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | 1,538,807,644,575,028,000 | 37.763454 | 103 | 0.62521 | false | 4.306452 | true | false | false |
AndreasMadsen/course-02456-sparsemax | python_reference/sparsemax.py | 1 | 2098 | import numpy as np
def forward(z):
"""forward pass for sparsemax
this will process a 2d-array $z$, where axis 1 (each row) is assumed to be
the the z-vector.
"""
# sort z
z_sorted = np.sort(z, axis=1)[:, ::-1]
# calculate k(z)
z_cumsum = np.cumsum(z_sorted, axis=1)
k = np.arange... | mit | 6,878,382,542,096,882,000 | 27.739726 | 100 | 0.596282 | false | 2.992867 | false | false | false |
gustavo94/UVaProblems | 573-The snail.py | 1 | 3092 | from sys import stdin
from math import floor
# exapmle input:
ex_in = "6 3 1 10\n10 2 1 50\n50 5 3 14\n50 6 4 1\n50 6 3 1\n1 1 1 1\n97 56 3 10\n56 3 1 5\n0 0 0 0"
def cal_limit_day(U,D,fatigue):
limit_day = floor((U-D)/fatigue)
if limit_day <= 0:
limit_day = 1
return limit_day
def total_down_by_fatigue(day, fat... | mit | -5,461,073,765,344,389,000 | 29.313725 | 143 | 0.67238 | false | 2.34776 | false | false | false |
rbarrois/djadmin_export | dev/settings.py | 1 | 4794 | # Django settings for dev project.
import os
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
ADMIN_EXPORTERS = (
'djadmin_export.exporters.xlsx.XLSXExporter',
)
DATABASES = {
'default': ... | lgpl-3.0 | -7,371,711,069,494,227,000 | 30.333333 | 88 | 0.698164 | false | 3.580284 | false | false | false |
james-pack/ml | pack/ml/nodes/hinge_loss_node.py | 1 | 3718 | import numpy as np
from pack.ml.nodes.hinge_loss_node_pb2 import HingeLossNodeProto
class HingeLossNode(object):
class Hyperparameters(object):
def __eq__(self, other):
return self.__dict__ == other.__dict__
def generate_random_hyperparameters(self):
pass
def __init__(... | mit | -8,466,301,796,413,677,000 | 37.729167 | 111 | 0.605702 | false | 3.747984 | false | false | false |
RetailMeNotSandbox/dart | src/python/dart/engine/redshift/add_engine.py | 1 | 5627 | import logging
import os
from dart.client.python.dart_client import Dart
from dart.config.config import configuration
from dart.engine.redshift.metadata import RedshiftActionTypes
from dart.model.engine import Engine, EngineData
_logger = logging.getLogger(__name__)
def add_redshift_engine(config):
engine_config... | mit | -3,486,965,417,809,789,000 | 38.907801 | 115 | 0.460992 | false | 4.396094 | true | false | false |
azumimuo/family-xbmc-addon | plugin.video.bubbles/resources/lib/sources/german/hoster/open/tata.py | 1 | 7065 | # -*- coding: utf-8 -*-
"""
Bubbles Addon
Copyright (C) 2016 Viper2k4
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any... | gpl-2.0 | 4,262,739,806,493,651,500 | 39.83815 | 174 | 0.539561 | false | 3.599083 | false | false | false |
benjamin9999/python-stix | stix/incident/property_affected.py | 1 | 7575 | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import stix
from stix.common import VocabString, StructuredText
import stix.bindings.incident as incident_binding
from stix.common.vocabs import LossProperty, LossDuration
from stix.common.vocabs import Availabilit... | bsd-3-clause | 5,678,507,531,601,564,000 | 37.846154 | 121 | 0.639736 | false | 3.755578 | false | false | false |
zvolsky/codex2020 | controllers/sysadmin.py | 1 | 1299 | # -*- coding: utf-8 -*-
'''
def __xxx():
# alexandermendes/marc2excel
def __xxx2():
# Flask-Z3950
# github.com/alexandermendes/Flask-Z3950
# pythonhosted.org/Flask-Z3950/
# apt install libxml2-dev libxslt-dev python-dev lib32z1-dev
# pip install Flask-Z3950
from flask_z3950 import Z395... | agpl-3.0 | -4,096,058,870,002,447,400 | 27.23913 | 131 | 0.631255 | false | 3.339332 | false | false | false |
sserrot/champion_relationships | venv/Lib/site-packages/prompt_toolkit/input/posix_pipe.py | 1 | 1989 | import os
from typing import ContextManager, TextIO, cast
from ..utils import DummyContext
from .base import PipeInput
from .vt100 import Vt100Input
__all__ = [
"PosixPipeInput",
]
class PosixPipeInput(Vt100Input, PipeInput):
"""
Input that is send through a pipe.
This is useful if we want to send t... | mit | 1,297,950,809,711,393,500 | 24.831169 | 83 | 0.575163 | false | 3.683333 | false | false | false |
TheAlgorithms/Python | maths/series/p_series.py | 1 | 1255 | """
This is a pure Python implementation of the P-Series algorithm
https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)#P-series
For doctests run following command:
python -m doctest -v p_series.py
or
python3 -m doctest -v p_series.py
For manual testing run:
python3 p_series.py
"""
def p_series(nth_term: int... | mit | 918,317,342,096,124,200 | 25.145833 | 72 | 0.583267 | false | 2.911833 | false | false | false |
hacktyler/hacktyler_crime | config/settings.py | 1 | 4568 | #!/usr/bin/env python
import os
import django
# Base paths
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# Debugging
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS =... | mit | -6,037,910,759,668,532,000 | 23.169312 | 77 | 0.586471 | false | 3.432006 | false | false | false |
RealTimeWeb/wikisite | MoinMoin/web/utils.py | 1 | 10269 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - Utility functions for the web-layer
@copyright: 2003-2008 MoinMoin:ThomasWaldmann,
2008-2008 MoinMoin:FlorianKrupicka
@license: GNU GPL, see COPYING for details.
"""
import time
from werkzeug import abort, redirect, cookie_date, Response
from Mo... | apache-2.0 | -8,713,514,694,004,186,000 | 38.045627 | 141 | 0.612328 | false | 4.009762 | false | false | false |
daeilkim/refinery | refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/HDPHardMult.py | 1 | 5496 | import numpy as np
from .HDPModel import HDPModel
from bnpy.suffstats import SuffStatBag
from bnpy.util import NumericUtil, NumericHardUtil
import scipy.sparse
import logging
Log = logging.getLogger('bnpy')
class HDPHardMult(HDPModel):
######################################################### Local Params
#####... | mit | -3,765,823,403,857,338,000 | 38.264286 | 79 | 0.55313 | false | 3.489524 | false | false | false |
xgt001/uav_msr_ip14 | experimental/battousai.py | 1 | 11871 | # -*- coding: utf-8 -*-
'''
BEGIN OF PROGRAM
----------------------------------------------------------------------------
AUTHOR : Alex Gamas
MAIN GOAL : Open an Image file and display this!
VERSION : 0.1.2
USAGE TIPS :
----------------------------------------------------------------------------
'''
from PyQ... | mit | 1,616,732,287,557,768,000 | 30.793566 | 127 | 0.53841 | false | 3.743371 | false | false | false |
doraemonext/DEOnlineJudge | app/problem/views.py | 1 | 4398 | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import TemplateView
from django.http import Http404
from django.db.models import Count
from app.problem.models import Problem, Category
from app.recor... | mit | -8,724,756,005,441,914,000 | 39.275229 | 129 | 0.647153 | false | 4.122066 | false | false | false |
ClearCorp/account-financial-tools | account_general_ledger_fix/wizard/account_report_general_ledger.py | 1 | 1241 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models
class account_report_... | agpl-3.0 | 991,391,364,290,018,600 | 46.730769 | 119 | 0.554392 | false | 4.339161 | false | false | false |
thundernet8/Plog | app/core/api/post.py | 1 | 2783 | # coding=utf-8
from flask import request
from flask import jsonify
from flask import g
from flask import url_for
from . import api
from ..api import auth
from .errors import action_failed
from app.core.models.posts import Post
@api.route('/posts', methods=['POST'])
@auth.login_required
def add_post():
if not g.... | gpl-3.0 | 5,375,873,227,232,528,000 | 44.949153 | 120 | 0.600148 | false | 3.380299 | false | false | false |
anisyonk/pilot | FileHandling.py | 1 | 40618 | # This module contains functions related to file handling.
import os
from commands import getoutput
from pUtil import tolog, convert, readpar
def openFile(filename, mode):
""" Open and return a file pointer for the given mode """
# Note: caller needs to close the file
f = None
if os.path.exists(file... | apache-2.0 | -7,112,027,889,522,221,000 | 38.434951 | 161 | 0.587498 | false | 4.143425 | false | false | false |
anish/buildbot | master/setup.py | 1 | 21649 | #!/usr/bin/env python
#
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# A... | gpl-2.0 | 154,408,006,337,735,580 | 37.867145 | 130 | 0.57684 | false | 3.936182 | true | false | false |
memsharded/conan | conans/paths/__init__.py | 1 | 1885 | # coding=utf-8
import os
import platform
if platform.system() == "Windows":
from conans.util.windows import conan_expand_user, rm_conandir
else:
from conans.util.files import rmdir
conan_expand_user = os.path.expanduser
rm_conandir = rmdir
def get_conan_user_home():
user_home = os.getenv("CONAN... | mit | -6,278,964,964,823,793,000 | 29.901639 | 78 | 0.710875 | false | 2.843137 | false | false | false |
JoshLabs/django-allauth | allauth/socialaccount/south_migrations/0001_initial.py | 1 | 4750 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.conf import settings
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
def get_user_model():
return User
cl... | mit | 2,162,468,607,797,285,600 | 56.228916 | 182 | 0.576632 | false | 3.833737 | false | false | false |
Narrato/mongotron | mongotron/Document.py | 1 | 21266 |
from __future__ import absolute_import
import logging
import warnings
from bson.objectid import ObjectId, InvalidId
from .exceptions import ValidationError
from .ConnectionManager import GetConnectionManager
from .Cursor import Cursor
from . import field_types
LOG = logging.getLogger('mongotron.Document')
class ... | bsd-2-clause | 4,267,603,442,421,332,500 | 34.443333 | 93 | 0.582009 | false | 4.206924 | false | false | false |
puiterwijk/LocalBadge | setup.py | 1 | 1188 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Patrick Uiterwijk <patrick@puiterwijk.org>
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v2, or (at your option) any ... | gpl-2.0 | -4,144,431,248,314,628,600 | 38.566667 | 71 | 0.711879 | false | 3.756329 | false | false | false |
dims/cinder | cinder/backup/driver.py | 2 | 15981 | # Copyright (C) 2013 Deutsche Telekom AG
# 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 r... | apache-2.0 | 1,127,676,597,813,030,800 | 39.153266 | 79 | 0.592203 | false | 4.604149 | false | false | false |
bschug/bindirpatch | utils.py | 1 | 2756 | import os
import subprocess
import sys
SEVENZIP_EXE = os.path.join('.', '7zip', 'x64', '7za.exe')
BSDIFF_EXE = os.path.join('.', 'bsdiff', 'bsdiff.exe')
BSPATCH_EXE = os.path.join('.', 'bsdiff', 'bspatch.exe')
def bsdiff(oldFile, newFile, patchFile, silent=False):
"""Creates a binary diff between <oldFile> and <... | mit | -1,957,813,704,073,503,700 | 33.024691 | 103 | 0.62627 | false | 3.709287 | false | false | false |
shownotes/snotes20-restapi | snotes20/models/nuser.py | 1 | 6848 | import random
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.db import models, transaction
from django.core.mail import send_mail
from django.core import validators
from django.utils import timezone
from django.core.validators import RegexValidator, ValidationError
f... | agpl-3.0 | -1,066,422,913,424,071,600 | 31.923077 | 128 | 0.630111 | false | 3.725789 | false | false | false |
YannChemin/distRS | scripts/readNESZ.py | 1 | 5155 | #!/usr/bin/env python3
###########################################################
# Use of this file is strictly forbidden !!!!!!!!!!!!!!!!!#
# Copyright Yann Chemin, Freelancer, France, 2016 #
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
import xml.etree.ElementTree as ET
from osgeo import gd... | unlicense | 1,387,791,122,149,264,400 | 34.308219 | 106 | 0.546848 | false | 3.340894 | false | false | false |
mnpiozhang/DocumentSearch | backend/tests.py | 1 | 1877 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.test import TestCase
'''
from pdfminer.pdfpage import PDFPage
from pdfminer.layout import LAParams
from pdfminer.pdfinterp import PDFResourceManager,PDFPageInterpreter
from pdfminer.converter import TextConverter
from cStringIO import StringIO
# Create your test... | mit | 1,547,040,591,628,544,300 | 43.714286 | 454 | 0.73788 | false | 2.277913 | false | false | false |
magahet/peon | peon/entity.py | 1 | 3494 | from types import (MobTypes, ObjectTypes)
import numpy as np
import utils
class BaseEntity(object):
'''Prototype class with position methods'''
def __init__(self, eid, x, y, z, pitch, yaw):
self.eid = eid
self.x = x
self.y = y
self.z = z
self.pitch = pitch
self... | mit | 2,511,374,138,964,423,000 | 27.876033 | 83 | 0.554379 | false | 3.483549 | false | false | false |
ForestClaw/forestclaw | applications/geoclaw/tohoku/setrun.py | 1 | 17915 | """
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
from pdb import *
# import topotools
try:
FCLAW = os.environ['FCLAW']
except:
raise Exception("*** Must F... | bsd-2-clause | -2,912,893,298,897,029,600 | 32.674812 | 94 | 0.553893 | false | 3.354869 | false | false | false |
BrunoEV/shutdown-dialog | shutdown-menu-deb.py | 1 | 3499 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: Bruno Expósito
#Contact: bruno.exposito@openmailbox.org
#License: GPL 3
#Original design: http://hxmarius.deviantart.com/art/Elementary-Shutdown-Dialog-Mockup-V2-359472999
import sys, os
from PyQt4 import QtCore
from PyQt4.QtGui import *
class HoverButton(QToolButto... | gpl-3.0 | 829,175,310,360,148,500 | 31.388889 | 175 | 0.658376 | false | 3.595067 | false | false | false |
PatrickLib/captcha_recognize | captcha_model.py | 1 | 4268 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import captcha_input
import config
IMAGE_WIDTH = config.IMAGE_WIDTH
IMAGE_HEIGHT = config.IMAGE_HEIGHT
CLASSES_NUM = config.CLASSES_NUM
CHARS_NUM = config.CHARS_NUM
def inputs(train, b... | apache-2.0 | -2,014,430,384,479,142,000 | 34.865546 | 84 | 0.685567 | false | 3.145173 | false | false | false |
twilio/twilio-python | twilio/rest/serverless/v1/service/asset/__init__.py | 1 | 15604 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | mit | -2,923,306,765,211,523,600 | 33.219298 | 97 | 0.616188 | false | 4.35501 | false | false | false |
bluephlavio/latest | test/test_core.py | 1 | 2596 | import pytest
import yaml
from latest.core import Grammar, contextify
from latest.exceptions import PyExprSyntaxError, ContextError
@pytest.fixture(scope='module')
def grammar():
return Grammar()
@pytest.fixture(scope='module')
def context(data_file):
with open(data_file, 'r') as f:
data = yaml.loa... | mit | 1,981,273,305,531,651,800 | 25.489796 | 104 | 0.611325 | false | 3.277778 | true | false | false |
Ederson77/Inverter | inverter.py | 1 | 6853 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import pygtk
pygtk.require("2.0") #Essa linha define a versão do pygtk a ser importado
import gtk, gobject, cairo, gio, pango, atk, pangocairo
#Criando a Classe do Programa
class InverterApp(object):
def __init__(self):
#Agora como eu havia dito vamos utilizar ... | gpl-2.0 | -8,796,580,482,553,545,000 | 45.784722 | 79 | 0.59902 | false | 3.331355 | false | false | false |
emilybache/texttest-runner | src/main/python/storytext/lib/storytext/gtktoolkit/simulator/filechooserevents.py | 1 | 5112 |
""" Event-handling around gtk.FileChoosers of various sorts """
from baseevents import StateChangeEvent
from storytext.definitions import UseCaseScriptError
import gtk, os
# At least on Windows this doesn't seem to happen immediately, but takes effect some time afterwards
# Seems quite capable of generating too many... | mit | -6,649,561,579,554,173,000 | 37.727273 | 115 | 0.669797 | false | 4.263553 | false | false | false |
niavok/perroquet | perroquetlib/gui/gui_sequence_properties_advanced.py | 1 | 18351 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 Frédéric Bertolus.
#
# This file is part of Perroquet.
#
# Perroquet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | gpl-3.0 | -2,187,032,419,098,357,800 | 44.083538 | 255 | 0.695733 | false | 3.873549 | false | false | false |
picrin/PredictiveCollision | src/Numerical.py | 1 | 1775 | import math
class Numerical:
@staticmethod
def pointAtAngle(coords, angle, distance):
return (coords[0] + math.sin(angle)*distance, coords[1] + math.cos(angle)*distance)
@staticmethod
def solveQuadraticPrune(equation): # choose the fastest
delta = equation[1]**2 - 4*equation[0]*equation[2]
if delta < 0:
... | bsd-2-clause | 3,502,172,420,127,385,000 | 28.583333 | 145 | 0.668732 | false | 3.125 | false | false | false |
impactlab/eemeter | eemeter/ee/derivatives.py | 1 | 4412 | from datetime import datetime
import pandas as pd
import pytz
def annualized_weather_normal(formatter, model, weather_normal_source):
''' Annualize energy trace values given a model and a source of 'normal'
weather data, such as Typical Meteorological Year (TMY) 3 data.
Parameters
----------
for... | mit | 5,515,248,473,266,296,000 | 38.392857 | 78 | 0.653445 | false | 4.047706 | false | false | false |
codelieche/codelieche.com | apps/account/views/page/user.py | 1 | 1944 | # -*- coding:utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.views.generic import View
from account.forms import LoginForm
class LoginPageView(View):
"""
用户登陆
"""
# print(... | mit | -1,653,475,500,208,617,000 | 33.679245 | 80 | 0.536453 | false | 4.03956 | false | false | false |
ellipsis14/dolfin-adjoint | dolfin_adjoint/newton_solver.py | 1 | 1424 | import dolfin
import solving
import libadjoint
import adjglobals
import adjlinalg
import utils
class NewtonSolver(dolfin.NewtonSolver):
'''This object is overloaded so that solves using this class are automatically annotated,
so that libadjoint can automatically derive the adjoint and tangent linear models.'''
d... | lgpl-3.0 | 6,464,112,461,163,999,000 | 34.6 | 118 | 0.706461 | false | 3.718016 | false | false | false |
StefanoD/ComputerVision | Uebung/Uebung2/src/exercise2.py | 1 | 1858 | import numpy as np
from scipy.misc import imsave
from libcore import Img
from libcore import DistortionCorrection, DistortionCorrectionPoint
image_path = '../schraegbild_tempelhof.jpg'
def main():
b1()
def b1():
image = Img.load_image(image_path)
target_image_size_height = 900
target_image_size_w... | apache-2.0 | 4,719,558,664,374,528,000 | 28.03125 | 145 | 0.664693 | false | 2.88958 | false | false | false |
miacro/pkget | pkget/test/test_basic_config.py | 1 | 4954 | import unittest
from pkget import BasicConfig, PkgetError
class BasicConfigTest(unittest.TestCase):
def setUp(self):
self.basic_config = BasicConfig(
attributes={"installprefix": None,
"pkginfoprefix": "",
"recipepaths": [],
... | gpl-3.0 | 5,959,843,345,818,618,000 | 47.568627 | 78 | 0.582963 | false | 3.837335 | true | false | false |
kalikaneko/leap_mail | src/leap/mail/imap/mailbox.py | 1 | 29101 | # *- coding: utf-8 -*-
# mailbox.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This... | gpl-3.0 | 1,271,742,720,128,985,300 | 32.069318 | 79 | 0.595821 | false | 4.279559 | false | false | false |
maxive/erp | addons/event_sale/models/sale_order.py | 1 | 3358 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.multi
def action_confirm(self):
self.ensure_one()
res = super(SaleOrder, self).action_confirm()
# confirm registration if it was free (otherwise it will be con... | agpl-3.0 | -8,398,201,484,374,660,000 | 48.382353 | 161 | 0.650387 | false | 3.964581 | false | false | false |
lem9/weblate | weblate/trans/tests/test_models.py | 1 | 12835 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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 by
# the Free Software Foundation, eith... | gpl-3.0 | 6,715,203,728,136,511,000 | 31.160401 | 77 | 0.616661 | false | 4.120745 | true | false | false |
yekaylee/capstone | capstoneRepo/SpeakerRecognition/Python/speakerTest.py | 2 | 6969 | # SpeakerTest.py
# Group 7 ECE 4900
# Edward Reehorst w/ help from
# http://minhdo.ece.illinois.edu/teaching/speaker_recognition/
# Text independent speaker recognition system based on mel frequency coeffiecient
# features and vector quantization
import numpy as np
import scipy.fftpack as fft
import scipy.io.wavfile ... | bsd-3-clause | 603,974,829,431,584,400 | 27.329268 | 104 | 0.630363 | false | 2.813484 | true | false | false |
mhvis/solar | setup.py | 1 | 1056 | #!/usr/bin/env python
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="samil",
version="2.1.0",
author="Maarten Visscher",
author_email="mail@maartenvisscher.nl",
description="Samil Power inverter tool",
long_description=long_descrip... | mit | -512,019,954,847,332,600 | 28.333333 | 84 | 0.60322 | false | 3.428571 | false | false | false |
toros-astro/corral | tests/settings.py | 1 | 2497 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Cabral, Juan; Sanchez, Bruno & Berois, Martín
# 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 sourc... | bsd-3-clause | -382,187,832,002,934,850 | 35.173913 | 79 | 0.654647 | false | 4.363636 | true | false | false |
evandrix/Splat | code/mypkg/gui/GraphicsView.py | 1 | 2008 | import sys
from PyQt4 import QtGui, QtCore
class GraphicsView(QtGui.QGraphicsView):
def __init__(self, pixmap, scene, parent, *args):
print >> sys.stderr, "GraphicsView::init()"
QtGui.QGraphicsView.__init__(self, scene)
self.scene = scene
self.pixmap = pixmap
self.win... | mit | 1,430,356,780,869,776,100 | 37.615385 | 82 | 0.59512 | false | 3.598566 | false | false | false |
sdlarsen1/CMPUT291 | prjcode/Doctor.py | 1 | 9331 | import os
from LogInOut import logout
def doctorCommands(cursor, conn, staff_id):
loggedOut = False
while not loggedOut:
os.system("clear")
choice = int(raw_input('''Type integer value of desired task:
1. Get patient chart info.
2. Rec... | gpl-3.0 | 7,187,887,561,044,244,000 | 27.978261 | 129 | 0.574429 | false | 3.654916 | false | false | false |
ArdanaCLM/ardana-service | ardana_service/packages.py | 1 | 9927 | # (c) Copyright 2018-2019 SUSE 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 writ... | apache-2.0 | -1,367,693,469,405,626,400 | 35.362637 | 79 | 0.56573 | false | 3.810749 | false | false | false |
singingwolfboy/flask-dance | flask_dance/consumer/storage/session.py | 1 | 1085 | from flask_dance.consumer.storage import BaseStorage
import flask
class SessionStorage(BaseStorage):
"""
The default storage backend. Stores and retrieves OAuth tokens using
the :ref:`Flask session <flask:sessions>`.
"""
def __init__(self, key="{bp.name}_oauth_token"):
"""
Args:
... | mit | 3,112,623,158,917,967,400 | 32.90625 | 83 | 0.611982 | false | 4.22179 | false | false | false |
DBrianKimmel/PyHouse | Project/src/Modules/House/Family/Reolink/reolink_device.py | 1 | 1201 | """
@name: /home/briank/workspace/PyHouse/Project/src/Modules/House/Family/Reolink/reolink_device.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2019 by D. Brian Kimmel
@license: MIT License
@note: Created on Jan 26, 2020
@summary:
"""
__updated__ = '2020-01-26'
__... | mit | -2,093,959,987,469,830,700 | 21.240741 | 101 | 0.606994 | false | 3.05598 | false | false | false |
perkinsbt/cse-6242 | get word lists.py | 1 | 1354 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 12 14:41:27 2016
@author: Perk
"""
import requests
import json
from progressbar import ProgressBar
pbar = ProgressBar()
with open('sunlight API.txt','r') as api_file:
api_key = api_file.read()
dem_word_lst = []
rep_word_lst = []
phrase_url='http://capito... | mit | 9,195,303,648,708,260,000 | 30.285714 | 61 | 0.598227 | false | 2.930736 | false | false | false |
aswolf/xmeos | xmeos/models/old/eoslib_old.py | 1 | 11165 | import numpy as np
import scipy as sp
#====================================================================
# EOSMod: Equation of State Model
# eoslib- library of common equation of state models
#====================================================================
# mgd_ref_model()
# ref_model: BM3, ... | mit | 6,840,345,582,503,291,000 | 32.93617 | 82 | 0.43708 | false | 3.05472 | false | false | false |
webclub/CFI | Django/food/views.py | 1 | 10085 | import datetime
import json
import traceback
from django.shortcuts import render
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone
from django.http import HttpResponse
from django.contrib.auth.models import User
# from models i... | apache-2.0 | -817,404,798,504,317,700 | 37.200758 | 117 | 0.521864 | false | 4.452539 | false | false | false |
seneubert/LHCbPsi2spipi | DaVinci/psi2spipi.py | 1 | 3152 | from GaudiConf import IOHelper
from Configurables import DaVinci, DecayTreeTuple
from DecayTreeTuple.Configuration import *
# Stream and stripping line we want to use
stream = 'Dimuon'
line = 'FullDSTDiMuonPsi2MuMuDetachedLine'
rootInTES = '/Event/{0}'.format(stream)
tesLoc = '/Event/{0}/Phys/{1}/Particles'.format(str... | gpl-2.0 | -8,127,897,114,153,845,000 | 36.975904 | 138 | 0.668782 | false | 2.602808 | false | false | false |
bluesquall/rotpy | rotpy/random.py | 1 | 2344 | #!/usr/bin/env python
"""
Random submodule for `rotpy`
============================
This module provides methods for generating random rotations.
note: Methods defined here _may_ be moved to separate modules corresponding
to each rotation parametrization in the future. That will depend on where we
take the overall pa... | mit | -5,706,193,940,483,044,000 | 22.918367 | 76 | 0.570819 | false | 3.7504 | false | false | false |
mirrorcoloured/slcypi | MA/draw_matches.py | 1 | 2544 | def draw_matches(img1, kp1, img2, kp2, matches, color=None):
"""Draws lines between matching keypoints of two images.
Keypoints not in a matching pair are not drawn.
Places the images side by side in a new image and draws circles
around each keypoint, with line segments connecting matching pairs.
... | mit | -8,938,002,548,867,191,000 | 48.901961 | 100 | 0.65173 | false | 3.334207 | false | false | false |
openstack/senlin | senlin/common/service.py | 1 | 2623 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | 5,670,647,009,074,642,000 | 29.5 | 78 | 0.60732 | false | 3.974242 | false | false | false |
eHanlin/csv-map-converter | csv_map_converter/converter.py | 1 | 2150 | # -*- coding: utf-8 -*-
from .parsers.parser import CsvMapParser
from .models.fields.base import ListField
from .models.fields import ModelDescriptor
class ConvertResult(object):
def __init__(self, map_result, models = None):
self.__map_result = map_result
self.__models = models
@property
... | mit | 5,686,770,578,526,899,000 | 28.054054 | 115 | 0.568837 | false | 4.07197 | false | false | false |
Pyfa-fit/EVE_Gnosis | examples/Vengeance.py | 1 | 2031 | # noinspection PyPackageRequirements
from EVE_Gnosis.simulations.capacitor import Capacitor
from EVE_Gnosis.formulas.formulas import Formulas
from datetime import datetime
module_list = []
capacitor_amount = 375
capacitor_recharge = 105468.75
print("Start time: ", datetime.now().time())
module_list.append(
{
... | gpl-3.0 | -3,939,051,601,150,690,300 | 22.616279 | 115 | 0.677006 | false | 3.017831 | false | true | false |
geomagpy/MARTAS | libmqtt/mysqlprotocol.py | 1 | 15238 | from __future__ import print_function
from __future__ import absolute_import
# ###################################################################
# Import packages
# ###################################################################
import re # for interpretation of lines
import struct # for binary representati... | gpl-3.0 | 1,586,417,300,568,176,400 | 40.747945 | 365 | 0.533863 | false | 4.19664 | false | false | false |
praekelt/seed-identity-store | identities/serializers.py | 1 | 1946 | from django.contrib.auth.models import Group, User
from rest_framework import serializers
from rest_hooks.models import Hook
from .models import Identity, OptIn, OptOut
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ("url", "username", "email", "groups")
cl... | bsd-3-clause | -5,285,397,995,805,764,000 | 23.024691 | 55 | 0.554985 | false | 4.402715 | false | false | false |
khchine5/lino-welfare | lino_welfare/modlib/debts/models.py | 1 | 25056 | # -*- coding: UTF-8 -*-
# Copyright 2012-2017 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare 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 y... | agpl-3.0 | -3,078,532,575,331,789,000 | 33.927476 | 100 | 0.593419 | false | 3.74167 | false | false | false |
senior-zero/metanet | metanet/networks/nodes/node.py | 1 | 4115 | # @file node.py
# Node implementation
## @package networks
# @author Evtushenko Georgy
# @date 05/03/2015 17:19:00
# @version 1.1
## @mainpage Metanet documentation
# @section intro_sec Introduction
# Short script to demonstrate the use of doxygen.
#
# @section license_sec License
#\verbatim This file is pa... | gpl-3.0 | -4,998,955,900,014,196,000 | 31.43 | 76 | 0.694016 | false | 2.027517 | false | false | false |
bfalacerda/strands_executive | task_executor/scripts/fifo_task_executor.py | 2 | 1910 | #!/usr/bin/env python
import rospy
from Queue import Queue, Empty
from strands_executive_msgs.msg import Task
from task_executor.base_executor import BaseTaskExecutor
from task_executor.sm_base_executor import AbstractTaskExecutor
class FIFOTaskExecutor(AbstractTaskExecutor):
def __init__(self):
# init n... | mit | -8,832,723,550,932,087,000 | 33.107143 | 195 | 0.580628 | false | 4.207048 | false | false | false |
softinus/IMDB_DataMiner | kobis.or.kr/AllMovies_kobis.py | 1 | 5363 | # written by python 2.*
#-*- coding: utf-8 -*-
import urllib2
import string
import os
from shutil import move
import re
import sys
import time
import glob
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
... | apache-2.0 | 2,587,069,389,925,057,000 | 31.509091 | 151 | 0.655044 | false | 3.575333 | false | false | false |
XereoNet/SpaceGDN | loader/resources/mojang_loader.py | 1 | 2189 | import requests
import json
import datetime
import re
import math
from ..resource_bases import Downloader
class Mojang(Downloader):
url = 'http://s3.amazonaws.com/Minecraft.Download/versions/versions.json'
download_url_base = 'https://s3.amazonaws.com/Minecraft.Download/versions/{0}/minecraft_server.{0}.jar'... | agpl-3.0 | 8,281,218,096,187,848,000 | 29.402778 | 107 | 0.454545 | false | 4.334653 | false | false | false |
hmml/ev3 | source/conf.py | 1 | 8346 | # -*- coding: utf-8 -*-
#
# Lego Mindstorms EV3 documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 7 20:37:24 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | apache-2.0 | -1,305,270,725,964,522,000 | 30.617424 | 79 | 0.708603 | false | 3.66696 | true | false | false |
rishirajsinghjhelumi/Entity-Mining | assets/omdb.py-master/setup.py | 1 | 1127 | """
omdb
----
Python wrapper for OMDbAPI.com.
Documentation: https://github.com/dgilland/omdb.py
"""
from setuptools import setup
setup(
name='omdb',
version='0.1.1',
description='Python wrapper for OMDb API: http://www.omdbapi.com/',
long_description=__doc__,
author='Derrick Gilland',
autho... | gpl-2.0 | 4,260,000,430,900,551,000 | 27.897436 | 71 | 0.605146 | false | 3.859589 | false | false | false |
schef/schef.github.io | source/16/mc-16-01-03-emajor-1black.py | 1 | 1566 | #!/usr/bin/python3
#import time
import random
import imp
modl = imp.load_source('ppFunctions', '../00/ppFunctions.py')
import os
from ppFunctions import *
from termcolor import colored, cprint
#sleep becouse of loading midi modules
print("Are you ready?")
time.sleep(1)
print_status = lambda x: cprint(x, 'white', 'on_b... | mit | 3,745,416,500,357,742,600 | 27.472727 | 70 | 0.590677 | false | 3.559091 | false | false | false |
misaksen/umediaproxy | mediaproxy/scheduler.py | 1 | 1397 | # Copyright (C) 2007-2008 Dan Pascu <dan@ag-projects.com>
#
"""Schedule calls on the twisted reactor"""
__all__ = ['RecurrentCall', 'KeepRunning']
from time import time
class KeepRunning:
"""Return this class from a recurrent function to indicate that it should keep running"""
pass
class RecurrentCall(o... | gpl-2.0 | -3,097,894,996,152,195,000 | 28.104167 | 93 | 0.58912 | false | 4.049275 | false | false | false |
zpincus/RisWidget | ris_widget/async_texture.py | 1 | 7054 | # This code is licensed under the MIT License (see LICENSE file for details)
import contextlib
import threading
import queue
# import weakref
import ctypes
import numpy
from OpenGL import GL
from PyQt5 import Qt
from . import shared_resources
IMAGE_TYPE_TO_GL_FORMATS = {
'G': (GL.GL_R32F, GL.GL_RED),
'Ga': ... | mit | 8,384,180,688,210,497,000 | 38.858757 | 108 | 0.594982 | false | 3.687402 | false | false | false |
gem/oq-engine | openquake/commonlib/source_reader.py | 1 | 14907 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2019, GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, ... | agpl-3.0 | 4,829,314,217,559,910,000 | 36.08209 | 79 | 0.572483 | false | 3.634081 | false | false | false |
alexdu/robot-sandbox | sim-files/geom.py | 1 | 2503 | # geom.py
#
# Copyright 2010 Alex Dumitrache <alex@cimr.pub.ro>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... | gpl-3.0 | 400,059,909,724,239,170 | 26.123596 | 76 | 0.499001 | false | 2.857306 | false | false | false |
oisinmulvihill/JSONP_PostPutGetDelete_With_Tornado | restserver/pp/jsonpcrud/service/jquery_unparam.py | 1 | 1716 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
From:
https://bitbucket.org/k_bx/jquery-unparam/src
"""
import re
from urllib import unquote_plus
def parse_key_pair(keyval):
keyval_splitted = keyval.split('=', 1)
if len(keyval_splitted) == 1:
key, val = keyval_splitted[0], ''
else:
key, ... | mit | -1,928,941,578,323,037,400 | 25.4 | 65 | 0.565851 | false | 3.338521 | false | false | false |
SEL-Columbia/commcare-hq | corehq/apps/callcenter/signals.py | 1 | 1701 | from __future__ import print_function
import sys
import logging
from couchdbkit.exceptions import ResourceNotFound
from django.conf import settings
from django.db.models import signals
from requests.exceptions import RequestException
from corehq.apps.callcenter.utils import sync_user_cases, bootstrap_callcenter, get_ca... | bsd-3-clause | 7,144,069,088,647,544,000 | 32.352941 | 103 | 0.685479 | false | 3.805369 | false | false | false |
Diwahars/pycon | pycon/tests/factories.py | 1 | 2068 | import random
import factory
import factory.django
import factory.fuzzy
from django.contrib.auth import models as auth
from pycon.models import PyConProposalCategory, PyConProposal, \
PyConTalkProposal, PyConTutorialProposal, ThunderdomeGroup
from symposion.proposals.tests.factories import ProposalKindFactory, ... | bsd-3-clause | -1,816,251,246,539,717,600 | 25.857143 | 78 | 0.699226 | false | 3.946565 | false | false | false |
astr93/c_sghmc | c_sghmc/projectcode.py | 1 | 21329 | import numpy as np
import numpy.random
import sympy as sp
import seaborn as sns
import matplotlib.pyplot as plt
def hmc(U, gradU, M, epsilon, m, theta, mhtest=1):
"""Hamiltonian Monte-Carlo algorithm with an optional Metropolis-Hastings test
U is potential energy as a callable function
gradU is its gradien... | mit | -5,523,963,265,161,026,000 | 30.977511 | 312 | 0.638755 | false | 2.811627 | false | false | false |
tomashaber/raiden | raiden/tasks.py | 1 | 3782 | # -*- coding: utf-8 -*-
import time
from ethereum import slogging
import gevent
from gevent.event import AsyncResult
from gevent.queue import (
Queue,
)
REMOVE_CALLBACK = object()
log = slogging.get_logger(__name__) # pylint: disable=invalid-name
class Task(gevent.Greenlet):
""" Base class used to created... | mit | -6,795,903,697,622,932,000 | 29.015873 | 79 | 0.557377 | false | 4.302617 | false | false | false |
mganeva/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py | 1 | 33315 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=no-init,invalid-name,too-ma... | gpl-3.0 | -8,269,240,477,197,982,000 | 44.636986 | 140 | 0.540807 | false | 4.100308 | false | false | false |
pienkowb/omelette | omelette/fromage/qfromage.py | 1 | 4327 | #!/usr/bin/env python
import sys, os
script_path = os.path.dirname(os.path.realpath(__file__))
modules_path = os.path.normcase("../../")
modules_directory = os.path.join(script_path, modules_path)
sys.path.append(modules_directory)
from PyQt4 import QtGui, QtCore
from omelette.fromage.ui import Ui_MainWindow
#from om... | gpl-3.0 | -519,461,222,744,091,100 | 44.547368 | 117 | 0.692628 | false | 3.65765 | false | false | false |
dhague/vpower | SpeedCadenceSensorRx.py | 1 | 5424 | from ant.core import event, message, node
from ant.core.constants import *
from constants import *
from config import NETKEY, VPOWER_DEBUG
# Receiver for Speed and/or Cadence ANT+ sensor
class SpeedCadenceSensorRx(event.EventCallback):
def __init__(self, antnode, sensor_type, sensor_id):
self.sensor_type... | mit | -1,974,359,766,318,043,600 | 35.897959 | 101 | 0.620391 | false | 3.99117 | false | false | false |
ajdawson/biggus | biggus/__init__.py | 1 | 104004 | # (C) British Crown Copyright 2012 - 2015, Met Office
#
# This file is part of Biggus.
#
# Biggus is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) a... | gpl-3.0 | -5,203,147,137,453,390,000 | 33.830543 | 79 | 0.574641 | false | 4.278943 | false | false | false |
MichaelGuarin0/DocumentClassification | src/han.py | 1 | 7468 | """
@author: Michael Guarino
"""
import numpy as np
np.set_printoptions(threshold=np.nan)
import tensorflow as tf
from tensorflow.contrib import rnn
import tensorflow.contrib.layers as layers
class HAN:
def __init__(self, max_seq_len, max_sent_len, num_classes,
vocab_size, embedding_size, max_grad_n... | mit | -6,694,304,337,271,059,000 | 47.810458 | 119 | 0.547402 | false | 4.374927 | false | false | false |
nirea/collardata | freebielist.py | 1 | 4787 | from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from model import FreebieItem, Distributor, Contributor
import datetime
import logging
head = '''
<html>
<head>
<title>%s</title>
<script src="/static/sorttable.js"></script>
<style>
body {
background-c... | gpl-2.0 | -5,281,383,379,673,156,000 | 32.702899 | 320 | 0.577815 | false | 3.285518 | false | false | false |
larioandr/pyons | pyons/sim.py | 1 | 16159 | #
# File: sim.py
#
# Provides simulation kernel (queues, simulation objects, etc.). It is not intended to be called directly,
# the API layer is given in a separate module.
#
from enum import Enum
from decimal import Decimal
import pyons.queues as queues
class Singleton(type):
"""
Metaclass for all singleto... | mit | -8,448,115,932,783,224,000 | 33.900648 | 120 | 0.607463 | false | 4.299894 | false | false | false |
dhrone/pydPiper | displays/luma_i2c.py | 1 | 6449 | #!/usr/bin/python
# coding: UTF-8
# Driver for SSD1306 OLED display on the RPi using I2C interface
# Written by: Ron Ritchey
#
# Enabled by Richard Hull's excellent luma.oled project (https://github.com/rm-hull/luma.oled)
#
from __future__ import unicode_literals
import time, math,logging
import lcd_display_driver
... | mit | 163,339,184,375,251,800 | 24.59127 | 175 | 0.649248 | false | 2.635472 | false | false | false |
charanpald/APGL | apgl/__init__.py | 1 | 2494 |
from apgl.version import __version__
def checkImport(name):
"""
A function to check if the given module exists by importing it.
"""
try:
import imp
imp.find_module(name)
return True
except ImportError as error:
return False
def getPythonVersion():
"""
Get ... | bsd-3-clause | 5,971,958,496,822,752,000 | 28.341176 | 152 | 0.64595 | false | 4.277873 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.