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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tschellenbach/Snaptastic | snaptastic/cli.py | 1 | 4041 | import sys
import os
import logging
logger = logging.getLogger('snaptastic.cli')
path = os.path.abspath(__file__)
parent = os.path.join(path, '../', '../')
sys.path.append(parent)
from argh import command, ArghParser
from snaptastic import get_snapshotter
from snaptastic import settings
import json
def configure_sn... | bsd-3-clause | -3,086,959,665,133,703,000 | 30.325581 | 81 | 0.688196 | false | 3.703941 | true | false | false |
kirmizikaranfil/PyVakitci-Linux | src/moduller/IlceleriAl.py | 1 | 1469 | # -*- coding: utf-8 -*-
# Hazırlayan : Rahman Yazgan (rahmanyazgan@gmail.com)
# Lisans : GPL v.3
import json, requests
from PyQt4 import QtCore
from moduller.SiteyeBaglan import SiteyeBaglan
from moduller.DiyanetUlkeler import DiyanetUlkeler
class IlceleriAl:
ayarDosyasi = None
def __init__(self, sehirl... | gpl-3.0 | -1,324,103,694,516,343,300 | 27.803922 | 96 | 0.575613 | false | 3.366972 | false | false | false |
jfwood/keep | keep/model/base.py | 1 | 1196 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | apache-2.0 | -5,727,958,203,814,174,000 | 33.2 | 78 | 0.742475 | false | 4.109966 | false | false | false |
rochapps/django-secure-input | secure_input/widgets.py | 1 | 1254 | from django import forms
from django.template.loader import render_to_string
__all__ = ('WYSIWYGWidget', )
class WYSIWYGWidget(forms.Textarea):
"""Custom bootstrap-wysiwyg widget."""
template_name = 'secure_input/widgets/full_wysiwyg.html'
def render(self, name, value, attrs=None):
"""Include a ... | bsd-3-clause | 6,682,224,778,695,955,000 | 33.861111 | 75 | 0.618022 | false | 3.445055 | false | false | false |
testeddoughnut/opsy | opsy/rbac.py | 1 | 2332 | from functools import wraps
from flask import current_app, request
from flask_allows import allows, Or
def is_logged_in(user):
"""Checks if the user is logged in."""
if current_app.config.get('LOGIN_DISABLED') or \
(user.is_authenticated and user.is_active):
return True
return False
... | mit | -6,719,831,302,776,819,000 | 30.945205 | 79 | 0.593053 | false | 4.554688 | false | false | false |
DavidAndreev/indico | migrations/versions/201606061004_ff7e1027bd4_update_category_attachment_links.py | 1 | 2052 | """Update category attachment links
Revision ID: ff7e1027bd4
Revises: 58de7b79b532
Create Date: 2016-06-06 10:04:36.954487
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = 'ff7e1027bd4'
down_revision = '58de7b79b532'
def upgrade():
print 'Deleting orphaned attachments...'
op.... | gpl-3.0 | 6,573,027,570,184,369,000 | 42.659574 | 118 | 0.670565 | false | 4.204918 | false | false | false |
renalreg/radar | tests/api/fixtures.py | 1 | 7331 | from datetime import datetime
from radar.database import db
from radar.models.consents import Consent, CONSENT_TYPE
from radar.models.demographics import Ethnicity, Nationality
from radar.models.diagnoses import Diagnosis
from radar.models.groups import (
Group,
GROUP_CODE_NHS,
GROUP_CODE_RADAR,
GROUP_... | agpl-3.0 | -909,586,103,597,347,200 | 26.874525 | 116 | 0.698404 | false | 3.053311 | false | false | false |
bobintetley/asm3 | src/asm3/locales/locale_uk.py | 1 | 111432 | # uk.po
val = {" days." : "",
"(all)" : "",
"(any)" : "",
"(anyone)" : "",
"(available)" : "",
"(blank)" : "",
"(both)" : "",
"(everyone)" : "",
"(master user, not editable)" : "",
"(no change)" : "",
"(no deduction)" : "",
"(none)" : "",
"(unknown)" : "",
"(use system)" : "",
"({0} given, {1} remaining)" : "",
"1 tre... | gpl-3.0 | -5,386,815,408,650,606,000 | 31.78376 | 247 | 0.610794 | false | 3.008829 | false | false | false |
savoirfairelinux/project-addons | project_resource_calendar/tests/test_calendar_event.py | 1 | 8671 | # © 2018 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime, timedelta
from odoo import fields
from .common import TestCalendarEventCommon
from odoo.exceptions import ValidationError
class TestCalendarEvent(TestCalendarEventCommon):
def setUp(self):... | lgpl-3.0 | -1,150,936,475,300,871,700 | 42.787879 | 79 | 0.560438 | false | 4.026939 | true | false | false |
HaydenFaulkner/phd | caffe_code/vis_net.py | 1 | 4272 | __author__ = 'hayden'
import numpy as np
from matplotlib import pyplot as plt
import cv2
# Make sure that caffe is on the python path:
caffe_root = '/home/hayden/caffe-recurrent/' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
#plt.plot([1,2... | mit | -3,799,392,621,035,663,000 | 38.201835 | 125 | 0.67486 | false | 2.831014 | false | false | false |
saltstackme/salt-rocks | _modules/environ.py | 1 | 7603 | # -*- coding: utf-8 -*-
'''
Support for getting and setting the environment variables
of the current salt process.
'''
# Import python libs
import os
import logging
# Import salt libs
from salt._compat import string_types
log = logging.getLogger(__name__)
def __virtual__():
'''
No dependency checks, and no... | apache-2.0 | -8,778,197,881,904,198,000 | 26.748175 | 78 | 0.558464 | false | 4.297908 | false | false | false |
latture/dic | dic/frame_creators.py | 1 | 10529 | """
This submodule holds the frame creators that produce an image sequence that will be converted into a movie.
A frame creator is an object that when called with the frame number will return the corresponding frame as a
``matplotlib.figure.Figure`` object and has a length (i.e. ``__len__``) equal to the number of fram... | mit | -9,075,828,042,232,631,000 | 42.329218 | 143 | 0.613828 | false | 3.946402 | false | false | false |
Sabayon/entropy | lib/entropy/dep.py | 1 | 42090 | # -*- coding: utf-8 -*-
# Entropy miscellaneous tools module
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@author: Slawomir Nizio <slawomir.nizio@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani, Slawomir Nizio
@license: GPL-2
B{Entropy dependency functions module}.
... | gpl-2.0 | -5,689,866,344,184,998,000 | 29.280576 | 134 | 0.556094 | false | 3.828452 | false | false | false |
tczekajlo/ip-rotator | ip_rotator.py | 1 | 2163 | #!/usr/bin/python
from utils import l, params, setup_logging, __version__
from odl import opendaylight
import sys
import time
import re
ips = ( str(x) for x in params.ip_list )
def ip():
global ips
try:
return ips.next()
except StopIteration:
ips = ( str(x) for x in params.ip_list )
return ips.next()
def... | gpl-2.0 | -6,087,825,298,715,545,000 | 24.75 | 80 | 0.604716 | false | 2.942857 | false | false | false |
twosigma/beaker-notebook | beakerx/beakerx/button/button_widget.py | 1 | 1085 | # Copyright 2019 TWO SIGMA OPEN SOURCE, 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 agr... | apache-2.0 | -6,734,879,751,425,786,000 | 37.75 | 74 | 0.717972 | false | 3.780488 | false | false | false |
lexxodus/gacfacg | dummies/bqq_balanced/simulation.py | 1 | 3271 | from __future__ import unicode_literals
__author__ = 'lexxodus'
from datetime import datetime, timedelta
from dummies.bqq_balanced import event_handler
from dummies.bqq_balanced.bottle_quiz_quest import BottleQuizQuest
from random import choice, randint, random
class Simulation(object):
def __init__(self):
... | agpl-3.0 | -4,049,187,641,648,436,000 | 35.344444 | 74 | 0.557016 | false | 3.86643 | false | false | false |
aneumeier/category | oldcategory/views.py | 1 | 2206 | #! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
"""
from django.views.generic import CreateView, UpdateView
from django.views.generic import DetailView, ListView
from braces.views import LoginRequiredMixin, PermissionRequiredMixin
from models import Category, Tag
from forms import CategoryCreateForm, TagCreate... | bsd-3-clause | -5,070,276,836,657,988,000 | 21.979167 | 77 | 0.665911 | false | 4.146617 | false | false | false |
jdrumgoole/dejooper | filetools/treeutils.py | 1 | 4381 | '''
Created on 12 Jun 2009
@author: jdrumgoole
'''
import os
import itertools
from filetools.fileutils import FileOps
class TreeUtils :
def __init__(self ):
pass
def list(self, path, filesSelector=None, dirsSelector=None, topDown=True ):
if dir... | gpl-2.0 | -1,956,156,347,257,332,700 | 29.292857 | 112 | 0.461538 | false | 3.997263 | false | false | false |
cgwire/zou | zou/app/services/breakdown_service.py | 1 | 16869 | from slugify import slugify
from sqlalchemy import desc
from sqlalchemy.orm import aliased
from zou.app.models.asset_instance import AssetInstance
from zou.app.models.entity import Entity, EntityLink
from zou.app.models.entity_type import EntityType
from zou.app.utils import fields, events
from zou.app.services impo... | agpl-3.0 | 165,951,132,723,170,850 | 30.649156 | 80 | 0.601695 | false | 3.605258 | false | false | false |
psjinx/django-tastypie-custom-user-example | django_tastypie_example/user_management/models.py | 1 | 3603 | from __future__ import unicode_literals
from django.core.mail import send_mail
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self... | mit | -5,913,039,164,535,968,000 | 32.672897 | 77 | 0.605606 | false | 4.174971 | false | false | false |
mpenning/graphite-gardener | graphite-gardener/Gardener.py | 1 | 11935 | from multiprocessing import Process, Queue
from Queue import Empty, Full
from datetime import datetime
from copy import deepcopy
import json
import time
import re
from Snmp import SnmpWalkTask, GraphiteSnmpData
from polymer.Polymer import ControllerQueue, TaskMgr
""" Gardener.py - Prune unwanted interfaces from your ... | gpl-3.0 | 6,645,206,964,349,378,000 | 39.457627 | 90 | 0.534227 | false | 4.214336 | true | false | false |
legaultmarc/grstools | grstools/scripts/utils/correlation.py | 1 | 1351 | import scipy.stats
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from ...utils import parse_computed_grs_file
def correlation(args):
grs1 = parse_computed_grs_file(args.grs_filename)
grs1.columns = ["grs1"]
grs2 = parse_computed_grs_file(args.grs_filename2)
grs2.columns = ["... | mit | 7,787,878,352,030,704,000 | 24.980769 | 78 | 0.558105 | false | 3.035955 | false | false | false |
radjkarl/QtRec | examples/ui_rec.py | 1 | 4257 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_normal.ui'
#
# Created: Sun Jun 22 22:19:12 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from QtRec import QtGui as QtRecGui
try:
_fromUtf8 = ... | gpl-3.0 | 6,513,046,571,022,940,000 | 48.5 | 79 | 0.701198 | false | 3.855978 | false | false | false |
Attorney-Online-Engineering-Task-Force/tsuserver3 | start_server.py | 1 | 2068 | #!/usr/bin/env python3
# tsuserver3, an Attorney Online server
#
# Copyright (C) 2016 argoneus <argoneuscze@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | agpl-3.0 | -7,480,978,963,337,850,000 | 31.328125 | 80 | 0.641683 | false | 4.023346 | false | false | false |
syaning/zhihuapi-py | zhihuapi/answer.py | 1 | 1898 | import json
from .request import req
from .parser import answer as parser
class Answer(object):
def __init__(self, answer_id):
self.id = answer_id
def voters(self, offset=0):
"""Get voters of this answer.
Args:
offset: An integer.
Returns:
A list of... | mit | -2,030,698,601,071,986,200 | 21.86747 | 74 | 0.512118 | false | 3.954167 | false | false | false |
andyfangdz/turtlebot_tracking | src/new_calibrate.py | 1 | 1635 | #!/usr/bin/env python
import numpy as np
import cv2
import os
import sys, getopt
from glob import glob
img_set = 'frame*.jpg'
img_names = glob(img_set)
chessboard_size = (9, 6)
pattern_points = np.zeros( (np.prod(chessboard_size), 3), np.float32 )
pattern_points[:,:2] = np.indices(chessboard_size).T.reshape(-1, 2)
... | mit | -6,876,518,291,392,936,000 | 29.867925 | 98 | 0.661162 | false | 2.689145 | false | false | false |
mrotschi/googlemusic-xbmc | GoogleMusicActions.py | 1 | 11399 | import os, xbmc, xbmcgui, utils
import GoogleMusicApi
class GoogleMusicActions():
def __init__(self):
self.icon = utils.addon.getAddonInfo('icon')
self.song_url = utils.addon_url+"?action=play_song&song_id=%s&title=%s&artist=%s&albumart=%s"
self.api = GoogleMusicApi.GoogleMusicA... | gpl-3.0 | -4,942,829,903,776,638,000 | 44.779116 | 145 | 0.565927 | false | 3.586847 | false | false | false |
sussexstudent/falmer | falmer/schema/api.py | 1 | 1296 | from djangorestframework_camel_case.render import CamelCaseJSONRenderer
from rest_framework.permissions import AllowAny
from wagtail.api.v2.endpoints import PagesAPIEndpoint as WagtailPagesAPIEndpoint
from wagtail.api.v2.router import WagtailAPIRouter
from wagtail.images.api.v2.endpoints import ImagesAPIEndpoint
from w... | mit | 8,228,786,070,509,059,000 | 37.117647 | 80 | 0.785494 | false | 3.97546 | false | false | false |
ScholarTools/pypub | pypub/crossref_prefix_parse.py | 1 | 2647 | """
This function is to parse all of the DOI prefixes and their associated publishers from the table kept at
http://www.crossref.org/06members/50go-live.html
This program is accessing the table on May 12, 2016. Website states 'last updated on May 12, 2016.'
Creates and saves three things:
1) full_prefix_table.csv... | mit | -714,935,791,378,522,900 | 32.506329 | 104 | 0.701549 | false | 3.428756 | false | false | false |
renhaocui/activityExtractor | preprocess.py | 1 | 1524 | import json
import re
from utilities import tweetTextCleaner
regex_str = [
r'<[^>]+>', # HTML tags
r'(?:@[\w_]+)', # @-mentions
r"(?:\#+[\w_]+[\w\'_\-]*[\w_]+)", # hash-tags
r'http[s]?://(?:[a-z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-f][0-9a-f]))+', # URLs
r'(?:(?:\d+,?)+(?:\.?\d+)?)', # numbe... | mit | 1,654,955,046,734,635,800 | 29.5 | 94 | 0.506562 | false | 3.078788 | false | false | false |
HMSBeagle1831/rapidscience | rlp/newsfeed/migrations/0002_newsitem.py | 1 | 1231 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-18 00:19
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('newsfeed', '0001_initial'),
]
operations... | mit | 1,592,693,180,439,049,500 | 36.30303 | 114 | 0.570268 | false | 4.259516 | false | false | false |
bueaux/mri | mri/entropy.py | 1 | 1146 | from functools import partial
from mri import _entropy
BLOCK_LEN = _entropy.BLOCK_LEN
def entropy(data, **kwargs):
length = kwargs.get('length', 512)
index = kwargs.get('index', 0)
retsel = kwargs.get('retsel', 0)
return _entropy.entropy512(data, length, index, retsel)
def entropy_file(file_, **kwa... | mit | -2,215,082,857,306,535,700 | 27.675 | 76 | 0.657068 | false | 3.274286 | false | false | false |
offmessage/blackpearl | blackpearl/things/hardware/inputs/motion.py | 1 | 2052 | import math
from .base import FlotillaInput
class Motion(FlotillaInput):
"""
Motion sensor
=============
NB: This is hyper sensitive. Look at the recipes to see how to ignore some
of the noise this generates.
https://gadgetoid.gitbooks.io/flotilla-protocol/content/motion.html
... | mit | 6,470,909,130,914,282,000 | 30.569231 | 85 | 0.424464 | false | 4.248447 | false | false | false |
decvalts/landlab | landlab/grid/tests/test_raster_funcs/test_flux_divergence_at_nodes.py | 1 | 1744 | import numpy as np
from numpy.testing import assert_array_equal
try:
from nose.tools import assert_is
except ImportError:
from landlab.testing.tools import assert_is
from landlab import RasterModelGrid
def test_flux_from_south_to_north():
rmg = RasterModelGrid(4, 5)
active_link_flux = np.array([0., 0... | mit | -7,060,894,387,754,994,000 | 32.538462 | 71 | 0.427752 | false | 3.048951 | false | false | false |
ganeti/ganeti | test/py/ganeti.serializer_unittest.py | 1 | 8245 | #!/usr/bin/python3
#
# Copyright (C) 2006, 2007, 2008 Google 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | bsd-2-clause | -1,554,550,541,158,066,700 | 34.235043 | 80 | 0.632141 | false | 4.089782 | true | false | false |
CredoReference/edx-platform | cms/djangoapps/contentstore/views/item.py | 1 | 75206 | """Views for items (modules)."""
from __future__ import absolute_import
import hashlib
import logging
from collections import OrderedDict
from datetime import datetime
from functools import partial
from uuid import uuid4
from django.conf import settings
from django.contrib.auth.decorators import login_required
from d... | agpl-3.0 | 35,527,032,155,552,068 | 44.607035 | 137 | 0.633141 | false | 4.251328 | false | false | false |
hukoru/ikeabot | crow/spiders/seoulDetailSpider.py | 1 | 5294 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.spiders import CrawlSpider, Rule
from bson.objectid import ObjectId
from crow.items import RestaurantDetailItem
from scrapy.selector import HtmlXPathSelector
from pymongo import MongoClient
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
class TripSp... | unlicense | 629,639,702,787,897,000 | 44.321739 | 162 | 0.589409 | false | 3.106079 | false | false | false |
indictranstech/internal-erpnext | erpnext/hr/doctype/salary_structure/salary_structure.py | 1 | 3927 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
from frappe.model.naming import make_autoname
from frappe import _
from frappe.model.mapper import get... | agpl-3.0 | -5,959,843,045,476,819,000 | 30.669355 | 151 | 0.671505 | false | 2.966012 | false | false | false |
sk413025/tilitools | test_svdd.py | 1 | 1273 | import numpy as np
import pylab as pl
import matplotlib.pyplot as plt
import cvxopt as co
from svdd import SVDD
from kernel import Kernel
if __name__ == '__main__':
# kernel parameter and type
kparam = 0.1
ktype = 'rbf'
# generate raw training data
Dtrain = co.normal(2,100)
# build kernel
kernel = Kernel.get_... | mit | -7,653,018,579,141,717,000 | 24.979592 | 92 | 0.677141 | false | 2.420152 | true | false | false |
meta-it/misc-addons | ir_sequence_autoreset/ir_sequence.py | 1 | 5522 | # -*- coding: utf-8 -*-
#
#
# Auto reset sequence by year,month,day
# Copyright 2013 wangbuke <wangbuke@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either ... | lgpl-3.0 | 8,821,232,208,458,178,000 | 44.262295 | 202 | 0.608294 | false | 3.726046 | false | false | false |
CGATOxford/CGATPipelines | obsolete/pipeline_variants.py | 1 | 103742 | """===========================
Variant annotation pipeline
===========================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
The Variants pipeline attempts to annotate variants in
a :term:`vcf` formatted file. It computes
1. the effects of SNPs on transcripts and genes
This pipeline ... | mit | -7,170,703,611,820,490,000 | 31.705549 | 163 | 0.494159 | false | 3.838174 | false | false | false |
josephluck/gonglord | server.py | 1 | 1716 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 2014 Wells Riley
import os
import web
import json
import RPi.GPIO as GPIO
import pigpio
import time
urls = ('/.*', 'hooks')
app = web.application(urls, globals())
PIN = 17
LEFT = 500
RIGHT = 2700
CENTER = LEFT + ((RIGHT - LEFT)/2)
STEP = 100
SLEEP = 0.02
pigpio_instance =... | mit | 5,460,200,161,262,888,000 | 19.926829 | 146 | 0.654429 | false | 2.790244 | false | false | false |
mediachain/mediachain-client | mediachain/datastore/utils.py | 1 | 1436 | import base58
import cbor
from mediachain.proto import Types_pb2 # pylint: disable=no-name-in-module
from mediachain.datastore.data_objects import MultihashReference
def multihash_ref(ref):
if isinstance(ref, MultihashReference):
return ref
try:
ref = ref.reference
except AttributeError:... | mit | -3,624,047,414,320,575,000 | 19.811594 | 75 | 0.616295 | false | 3.902174 | false | false | false |
maybelinot/df2gspread | df2gspread/gfiles.py | 1 | 3251 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Eduard Trott
# @Date: 2018-05-02 13:53:10
# @Email: etrott@redhat.com
# @Last Modified by: maybelinot
# @Last Modified time: 2018-05-02 13:53:10
import re
from httplib2 import Http
from apiclient import discovery, errors
import gspread
from .utils import... | gpl-3.0 | 6,661,005,414,112,611,000 | 32.173469 | 116 | 0.602276 | false | 3.715429 | false | false | false |
knitori/shanghai | tests/test_config.py | 1 | 3673 |
import io
import os
import re
import tempfile
from unittest import TestCase
from ruamel import yaml as ryaml
from shanghai.config import Configuration, NamedConfig, ConfigurationError
SAMPLE_YAML = '''\
# set global logging level
logging:
level: INFO
networks:
GLOBAL:
nick: TestBot
user: Shanghai
r... | gpl-3.0 | -6,315,528,956,968,210,000 | 22.100629 | 80 | 0.562211 | false | 3.87039 | true | false | false |
JeunessesScientifiques/CTF-CampProg2014 | Challenges/8. Labyrinthe/generateur.py | 1 | 1113 | import random
links = ["5862"] # links comporte la liste des liens du labyrinthe (Commence a 5862)
i = 0
while i <= 100: # nombre de fichier a créer
ok = True
link = str(random.randint(1000,9999)); # genere un lien
for l in links:
if l == link:
ok = False # on vérifie que le lien que l'on vien de tirer n'a p... | agpl-3.0 | 836,709,339,544,848,900 | 51.333333 | 151 | 0.679417 | false | 2.44 | false | false | false |
jakirkham/lazyflow | tests/testOpSparseLabelArray.py | 1 | 4547 | ###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | lgpl-3.0 | 6,186,979,352,032,303,000 | 33.976923 | 94 | 0.615131 | false | 4.0097 | true | false | false |
ragupta-git/ImcSdk | imcsdk/mometa/lsboot/LsbootUefiShell.py | 1 | 4743 | """This module contains the general information for LsbootUefiShell ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class LsbootUefiShellConsts:
STATE_DISABLED = "Disabled"
STATE_ENABLED = "Enabled"
TYPE_UEFISHELL =... | apache-2.0 | 780,725,066,337,355,800 | 52.897727 | 231 | 0.580645 | false | 3.246407 | false | false | false |
adybbroe/atrain_match | atrain_match/reshaped_files_scr/pps_vrreport_print_cfc_pod_tables.py | 1 | 16408 |
"""Read all matched data and make some plotting
"""
import os
from glob import glob
import numpy as np
from matchobject_io import (readCaliopImagerMatchObj,
CalipsoImagerTrackObject)
import matplotlib.pyplot as plt
from utils.get_flag_info import (get_semi_opaque_info_pps2014,
... | gpl-3.0 | 7,327,992,838,358,484,000 | 49.486154 | 181 | 0.599403 | false | 2.75672 | false | false | false |
soutys/aorn | tests/generators.py | 1 | 1610 | # -*- coding: utf-8 -*-
'''Samples generators
'''
from __future__ import with_statement, division, absolute_import, print_function
from array import array
from math import pi, sin
from random import SystemRandom
# http://stackoverflow.com/a/5174008
def synth_complex(freqs=None, coefs=None, datasize=0, fname=''):
... | mit | -229,785,676,023,222,700 | 29.377358 | 80 | 0.620497 | false | 3.554084 | false | false | false |
RandyMoore/mySiteDjango | my_site_django/government_audit/consumers.py | 1 | 3831 | '''
Consumers for websocket traffic
The consumer runs on a single thread processing requests off a message queue. Django is NOT asyncio enabled.
The received messages are processed asynchronously in a 2nd thread.
'''
import json
from channels.generic.websocket import WebsocketConsumer
def get_year_set(message):
... | gpl-3.0 | 9,018,000,532,329,979,000 | 35.485714 | 109 | 0.647351 | false | 4.177754 | false | false | false |
milmazz/pygame-salud | src/painting.py | 1 | 7706 | # vim:ts=4:sts=4:et:nowrap:tw=77
# -*- coding: utf-8 -*-
import os
import pygame
from pygame.locals import *
import constants
import common
from activity import Activity
from icons import Icons
class Finger(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
path = os.p... | gpl-2.0 | 8,307,169,540,558,373,000 | 34.33945 | 119 | 0.584631 | false | 3.574942 | false | false | false |
ActiveState/code | recipes/Python/498223_group_and_partition/recipe-498223.py | 1 | 1515 | ### Here is my implementation to partition based on funct's evaluation.
def partition(iterable, func):
result = {}
for i in iterable:
result.setdefault(func(i), []).append(i)
return result
### Ian Bicking's Generalized group function
def group(seq):
'''seq is a sequence of tuple containing (it... | mit | 8,274,465,033,530,998,000 | 31.234043 | 84 | 0.577558 | false | 3.20296 | false | false | false |
chandler14362/panda3d | tests/display/test_glsl_shader.py | 1 | 9886 | from panda3d import core
import struct
import pytest
from _pytest.outcomes import Failed
# This is the template for the compute shader that is used by run_glsl_test.
# It defines an assert() macro that writes failures to a buffer, indexed by
# line number.
# The reset() function serves to prevent the _triggered varia... | bsd-3-clause | -5,905,291,411,902,991,000 | 28.867069 | 109 | 0.597107 | false | 3.002126 | true | false | false |
martijnvermaat/rpclib | src/rpclib/application.py | 1 | 5948 |
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This lib... | lgpl-2.1 | -6,187,352,084,702,178,000 | 35.268293 | 80 | 0.608776 | false | 4.625194 | false | false | false |
aurule/RandomSK | RandomSK.py | 1 | 2930 | #!/usr/bin/env python
from gi.repository import Gtk, Gdk
import pairdefs
class Picker:
'''RandomSK UI and related functions.'''
def pick_rand(self, widget=None, data=None):
'''Pick a random sequence from our current pairdict and set output text.'''
self.disp.set_text(self.pairdict.pick())
... | mit | 7,827,602,432,548,115,000 | 35.17284 | 92 | 0.615017 | false | 3.805195 | false | false | false |
labase/activnce | main/utils/convertfiles2fileregistry.py | 1 | 4946 | # -*- coding: utf-8 -*-
"""
################################################
Plataforma ActivUFRJ
################################################
:Author: *Núcleo de Computação Eletrônica (NCE/UFRJ)*
:Contact: carlo@nce.ufrj.br
:Date: $Date: 2009-2010 $
:Status: This is a "work in progress"
:Revision: $Revision: 0.0... | gpl-2.0 | -2,508,938,879,207,823,000 | 30.896104 | 84 | 0.496132 | false | 3.434965 | false | false | false |
croxis/SpaceDrive | spacedrive/renderpipeline/toolkit/day_time_editor/main.py | 1 | 11603 | """
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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 right... | mit | -6,205,540,215,421,011,000 | 37.736301 | 149 | 0.618375 | false | 4.111623 | false | false | false |
ingadhoc/odoo-expresso-corresponsales | expresso_nickel/actualizador_osv.py | 1 | 1304 | # -*- coding: utf-8 -*-
from openerp import models,pooler, api
import logging
import threading
import traceback
from actualizador.facade_actualizacion import Facade_Actualizacion
_logger = logging.getLogger(__name__)
class update_nickel(models.Model):
_name = 'expresso_nickel.update_nickel'
_description = '... | agpl-3.0 | 4,784,588,424,753,967,000 | 41.064516 | 128 | 0.717791 | false | 3.360825 | false | false | false |
BrainTech/pisak | pisak/audio/widgets.py | 1 | 1806 | """
Module containing widgets specific to the Pisak audio player application.
"""
from gi.repository import Mx, GObject
from pisak import res, widgets, configurator, properties, pager
from pisak.audio import db_manager
class FoldersSource(pager.DataSource):
"""
Data source that provides tiles representing di... | gpl-3.0 | -6,983,737,432,861,527,000 | 33.730769 | 84 | 0.640089 | false | 3.778243 | false | false | false |
atvcaptain/enigma2 | lib/python/Components/Renderer/RunningText.py | 1 | 15233 | from __future__ import absolute_import
################################################################################
# RunningText.py - Running Text Renderer for Enigma2
# Version: 1.5 (04.04.2012 23:40)
# Copyright (C) 2010-2012 vlamo <vlamodev@gmail.com>
#
# This program is free software; you can redis... | gpl-2.0 | 3,113,028,297,068,307,000 | 35.794686 | 144 | 0.62916 | false | 2.9238 | false | false | false |
mdesaive/admindb | admindb/itservices/systems/migrations/0017_auto_20160312_1026.py | 1 | 1231 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-12 10:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('systems', '0016_auto_20160312_0628'),
]
operations ... | gpl-3.0 | -5,135,927,844,788,185,000 | 25.76087 | 96 | 0.545085 | false | 4.525735 | false | false | false |
ressu/SickGear | sickbeard/properFinder.py | 1 | 13002 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | gpl-3.0 | -6,345,228,528,265,051,000 | 43.989619 | 161 | 0.594139 | false | 4.360161 | false | false | false |
pferreir/pyssb | ssb/muxrpc.py | 1 | 4081 | from functools import wraps
from async_generator import async_generator, yield_
from ssb.packet_stream import PSMessageType
class MuxRPCAPIException(Exception):
pass
class MuxRPCHandler(object):
def check_message(self, msg):
body = msg.body
if isinstance(body, dict) and 'name' in body and ... | mit | 4,173,779,786,143,383,600 | 28.15 | 92 | 0.611125 | false | 3.817587 | false | false | false |
emburse/python-quickbooks | quickbooks/objects/timeactivity.py | 1 | 1354 | from six import python_2_unicode_compatible
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin, AttachableRef
@python_2_unicode_compatible
class TimeActivity(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: The TimeActivity ent... | mit | -5,789,179,661,959,845,000 | 27.808511 | 106 | 0.605613 | false | 4.017804 | false | false | false |
google-research/google-research | saccader/model_utils_test.py | 1 | 8699 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | 3,383,872,531,906,152,400 | 31.218519 | 80 | 0.648006 | false | 3.516168 | true | false | false |
bollu/polymage | sandbox/apps/python/multigrid/NAS-PB-MG-3.2/polymage_residual.py | 1 | 1397 | from __init__ import *
import sys
sys.path.insert(0, ROOT)
from polymage_common import set_zero_ghosts
from compiler import *
from constructs import *
def residual(U, V, l, app_data, name):
pipe_data = app_data['pipe_data']
z = pipe_data['z']
y = pipe_data['y']
x = pipe_data['x']
extent = pipe_... | apache-2.0 | -1,396,241,297,626,847,700 | 22.283333 | 64 | 0.452398 | false | 2.47695 | false | false | false |
michal-ruzicka/archivematica | src/dashboard/src/components/administration/views_processing.py | 1 | 16955 | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | agpl-3.0 | -6,511,027,645,608,720,000 | 39.562201 | 144 | 0.585727 | false | 3.822999 | true | false | false |
hiteshgarg14/openstates | scrapers/fl/bills.py | 1 | 24952 | import re
import datetime
from urllib.parse import urlencode
from collections import defaultdict
from openstates.scrape import Scraper, Bill, VoteEvent
from openstates.utils import format_datetime
from spatula import Page, PDF, Spatula
# from https://stackoverflow.com/questions/38015537/python-requests-exceptions-ssle... | gpl-3.0 | -4,593,362,249,720,438,000 | 37.387692 | 104 | 0.493748 | false | 3.936889 | false | false | false |
Alexsaphir/TP_EDP_Python | TP2.py | 1 | 1398 | # -*- coding: utf-8 -*-
from numpy import * # importation du module numpy
from numpy.linalg import * # importation du module numpy.linalg
from numpy.random import *
from matplotlib.pyplot import *
from mpl_toolkits.mplot3d import Axes3D
Ns = 20
# Maillage
h = 1./(Ns + 1)
X = linspace(0,1,Ns+2)
Xh = X[1:Ns+1]
# M... | lgpl-3.0 | -8,020,853,754,216,729,000 | 19.202899 | 64 | 0.644189 | false | 2.17134 | false | false | false |
khchine5/lino | lino/modlib/notify/__init__.py | 1 | 5665 | # Copyright 2008-2018 Luc Saffre
# License: BSD (see file COPYING for details)
"""Adds functionality for managing notification messages.
See :doc:`/specs/notify`.
"""
from lino.api import ad, _
try:
import redis
except:
redis = False
class Plugin(ad.Plugin):
"See :class:`lino.core.plugin.Plugin`."
... | bsd-2-clause | 5,352,001,756,235,209,000 | 32.128655 | 83 | 0.544395 | false | 4.13202 | false | false | false |
wdxtub/Patriots | static/knowledgegraph/kg_preprocessing.py | 1 | 3957 | # -*- coding: utf-8 -*-
import jieba
import jieba.analyse
from entity import *
import sys
sys.path.append('../code')
import cPickle as pickle
from sentiment_lstm import predict_arr
faqtable = {}
iptable = {}
records = []
knodes = []
querys = []
def load_knowledge_dict():
# 从知识图谱中生成倒排索引,保存成词典
# 暂时简单粗暴从已有的词典载入
... | gpl-3.0 | 8,525,733,768,703,882,000 | 25.872 | 140 | 0.565942 | false | 2.136768 | false | false | false |
povellesto/blobygames | Blob Rage App/random/makehacks.py | 1 | 2559 | import random
import turtle
moveforward = ("Move forward")
turnleft = ("Turn Left")
movebackward = ("Move Backward")
turnright = ("Turn Right")
square = ("square")
circle = ("circle")
penUp = ("pen up")
penDown = ("pen down")
goto = ("go to")
house = ("house")
Instructions = ("Intructions")
def Instuctions():
p... | unlicense | -1,119,543,540,653,352,100 | 23.605769 | 70 | 0.575225 | false | 3.768778 | false | false | false |
xuweiliang/Codelibrary | openstack_dashboard/dashboards/admin/vgpu/forms.py | 1 | 30108 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | 1,335,338,142,973,503,200 | 43.538462 | 106 | 0.536037 | false | 4.6868 | false | false | false |
storborg/pyramid_frontend | pyramid_frontend/assets/asset.py | 1 | 2323 | from __future__ import absolute_import, print_function, division
import logging
import os
import tempfile
import io
from contextlib import contextmanager
from hashlib import sha1
import six
log = logging.getLogger(__name__)
class Asset(object):
"""
Generic superclass for other asset handler classes to in... | mit | -2,808,517,355,721,512,000 | 28.405063 | 76 | 0.593198 | false | 3.884615 | false | false | false |
YunoHost/yunohost | src/yunohost/certificate.py | 1 | 29963 | # -*- coding: utf-8 -*-
""" License
Copyright (C) 2016 YUNOHOST.ORG
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) a... | agpl-3.0 | -8,238,290,893,731,611,000 | 33.44023 | 228 | 0.612589 | false | 3.809663 | false | false | false |
jgardner1/JGRPGTools | jgrpg/CreateGroupWidget.py | 1 | 3623 | from PyQt5.uic import loadUiType
ui, base = loadUiType('ui/CreateGroupWidget.ui')
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtGui import QStandardItemModel
from PyQt5.QtWidgets import QDialog
from jgrpg.model import Groups, Characters
from jgrpg.GetItemDialog import GetItemDialog
from jgrpg.CreateCharacterWi... | gpl-2.0 | -6,394,984,819,544,933,000 | 28.455285 | 77 | 0.58653 | false | 4.380895 | false | false | false |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/subplots_axes_and_figures/axhspan_demo.py | 1 | 1686 | """
============
axhspan Demo
============
Create lines or rectangles that span the axes in either the horizontal or
vertical direction.
"""
import numpy as np
import matplotlib.pyplot as plt
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
inset ... | mit | 5,961,144,753,671,702,000 | 23.085714 | 82 | 0.620403 | false | 2.833613 | false | false | false |
Coelhon/MasterRepo.repository | plugin.video.specto/resources/lib/sources/disabled/kissanime_tv.py | 1 | 15152 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 | -5,844,635,350,303,957,000 | 32.301099 | 175 | 0.458025 | false | 4.283856 | false | false | false |
qedsoftware/commcare-hq | corehq/ex-submodules/fluff/sync_couchdb.py | 1 | 1133 | import os
from couchdbkit.ext.django.loading import get_db
# corehq dependency is simplest of a few annoying options
# - move this code into corehq
# - extract corehq.preindex into its own project
# - be ok with intentionally introducing this dependency
# for something that's pretty bound to our specific deploy work... | bsd-3-clause | -6,710,579,674,313,250,000 | 33.333333 | 69 | 0.66902 | false | 3.63141 | false | false | false |
sanjuro/RCJK | vendor/django/core/management/commands/loaddata.py | 2 | 9846 | import sys
import os
import gzip
import zipfile
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
try:
import bz2
has_bz2 = True
except I... | apache-2.0 | 7,562,914,255,925,756,000 | 42.955357 | 122 | 0.471156 | false | 5.424793 | false | false | false |
karlinjf/ChromiumXRefs | third_party/codesearch/test_codeblocks.py | 1 | 1550 | # Copyright 2018 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
import unittest
from .client_api import CsFile, CodeSearch
from .messages import FileInfo, TextRange, NodeEnumKi... | apache-2.0 | -7,734,996,983,216,193,000 | 32.695652 | 81 | 0.719355 | false | 3.725962 | true | false | false |
maschwanden/boxsimu | examples/scripts/boxmodelsystem1.py | 1 | 3253 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 23 10:45:10 2016
@author: Mathias Aschwanden (mathias.aschwanden@gmail.com)
Very simple test BoxModelSystem with only 2 boxes: An upper ocean box and a deep ocean box.
The upper ocean is connected to the land and atmosphere by two fluid flows: river inflow and evaporat... | mit | 6,086,834,829,034,004,000 | 25.447154 | 105 | 0.54565 | false | 3.598451 | false | false | false |
bigswitch/neutron | neutron/common/ipv6_utils.py | 1 | 3009 | # Copyright 2013 IBM Corp.
# 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 app... | apache-2.0 | 5,835,629,525,322,902,000 | 33.586207 | 78 | 0.647391 | false | 3.594982 | false | false | false |
0x0aNL/p2pool-0x0a | p2pool/bitcoin/helper.py | 1 | 5922 | import sys
import time
from twisted.internet import defer
import p2pool
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, jsonrpc
@deferral.retry('Error while checking Bitcoin connection:', 1)
@defer.inlineCallbacks
def check(bitcoind, net):
if not (yield net.PARENT.RPC_CHECK(bitc... | gpl-3.0 | -1,584,763,914,241,244,700 | 50.495652 | 209 | 0.678656 | false | 3.736278 | false | false | false |
adarob/magenta | magenta/common/tf_utils.py | 1 | 2528 | # Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | -4,731,689,935,395,695,000 | 35.114286 | 80 | 0.727453 | false | 3.901235 | false | false | false |
pquentin/libcloud | libcloud/compute/drivers/gce.py | 1 | 373722 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | -6,178,032,299,762,811,000 | 39.415486 | 79 | 0.544811 | false | 4.478072 | false | false | false |
Machyne/pal | pal/services/joke_service.py | 1 | 1326 | #!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2015, PAL Team.
# All rights reserved. See LICENSE for details.
import re
from os import path
from pal.services.base_service import Service
from pal.services.base_service import wrap_response
def get_jokes():
file_path = path.realpath(path.join(path.dirnam... | bsd-3-clause | -2,928,826,007,776,115,000 | 29.136364 | 67 | 0.568627 | false | 3.642857 | false | false | false |
CodeSelfStudy/Asteroid-API-Example | app.py | 1 | 2157 | import json
import requests
from flask import Flask, render_template, jsonify, url_for
# Create a Flask application
app = Flask(__name__)
# Define some routes
@app.route('/')
def index():
"""Renders the home page with some data."""
data = {}
data['title'] = 'Saluton, Mondo!'
data['body'] = """<p>Th... | mit | -5,862,970,784,039,419,000 | 33.790323 | 137 | 0.668057 | false | 3.637437 | false | false | false |
blmoore/blogR | blogpy/imdb_getActors.py | 1 | 3538 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import imdb
import sys, time
from itertools import chain
def getActor(name, count):
"""
For a given actor, get their film list from IMDb,
seek budget, gross, release date, then double-check
they are *in* the film, THEN print to stdout.
"""
print >>sys.stderr, "(%d... | mit | 1,859,716,508,948,116,200 | 31.75 | 70 | 0.563472 | false | 3.224248 | false | false | false |
olimastro/DeepMonster | deepmonster/nnet/nondeterministic.py | 1 | 4117 | import theano
import theano.tensor as T
from baselayers import RandomLayer
from deepmonster import config
floatX = config.floatX
class NonDeterministicLayer(RandomLayer):
"""
Any layer subclassing this class should have limited applications
such as dropout where it changes the theano graph only fo... | mit | 6,961,671,799,195,200,000 | 29.723881 | 112 | 0.594851 | false | 3.509804 | false | false | false |
RamZallan/conditional | conditional/util/member.py | 1 | 5379 | from functools import lru_cache
from datetime import datetime
from conditional.util.ldap import ldap_get_active_members
from conditional.util.ldap import ldap_get_intro_members
from conditional.util.ldap import ldap_get_current_students
from conditional.util.ldap import ldap_get_roomnumber
from conditional.util.ldap i... | mit | 4,904,626,894,726,201,000 | 37.421429 | 92 | 0.659602 | false | 3.659184 | false | false | false |
rwl/PyCIM | CIM15/CDPSM/Asset/IEC61968/AssetModels/WireType.py | 1 | 5786 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | -7,716,623,164,881,760,000 | 50.20354 | 242 | 0.68562 | false | 3.643577 | false | false | false |
madhusv/talkweb | talk/cparser.py | 1 | 4264 | """ cparser.py
Purpose - break a sequence for given set of chars
Date Started - Nov 19th
Copyright (c) Madhukumar Seshadri
All rights reserved
Known Issues
Changes
A copy of this code is mparser which is marker parser which can use this instead
Trademark is Letustalkweb
Licensing yet to be decided
"""
import... | gpl-2.0 | -240,195,254,792,518,000 | 20.535354 | 108 | 0.612805 | false | 2.733333 | false | false | false |
dayatz/taiga-back | tests/integration/test_memberships.py | 1 | 29702 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | agpl-3.0 | -1,173,703,126,873,026,000 | 36.881378 | 112 | 0.68504 | false | 3.477227 | true | false | false |
jendap/tensorflow | tensorflow/python/framework/tensor_util.py | 1 | 35006 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 8,329,718,497,193,013,000 | 35.69392 | 110 | 0.681312 | false | 3.605149 | false | false | false |
mywdka/grovepi_sensorlogger | sensorlogger.py | 1 | 6266 | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import os
import grove_128_64_oled as oled
import pynmea2 as nmea
import serial
import sys
from stat import *
from time import sleep
SENSOR = 'sound'
if sys.argv[1] != '':
SENSOR = sys.argv[1].strip().lower()
if SENSOR == 'sound':
fr... | gpl-3.0 | -2,930,723,413,099,842,000 | 33.054348 | 126 | 0.552825 | false | 3.372443 | false | false | false |
williamgilpin/pypdb | pypdb/clients/search/operators/sequence_operators.py | 1 | 2443 | """Search operator for searching sequences using MMseqs2 (BLAST-like)."""
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union
class SequenceType(Enum):
"""Type of sequence being searched."""
DNA = "pdb_dna_sequence"
RNA = "pdb_rna_sequence"
PROTEIN = "... | mit | 315,949,377,391,178,000 | 38.403226 | 79 | 0.651248 | false | 3.746933 | false | false | false |
doubleshot/server | generator/sources/python/KalturaClient/tests/test_uiconf.py | 1 | 3551 | import re
from utils import GetConfig
from utils import KalturaBaseTest
from KalturaClient.Plugins.Core import KalturaUiConf, KalturaUiConfObjType, KalturaUiConfFilter
from KalturaClient.Plugins.Core import KalturaUiConfListResponse
class UiConfTests(KalturaBaseTest):
def test_list(self):
resp = se... | agpl-3.0 | 8,188,966,472,901,735,000 | 30.714286 | 95 | 0.563503 | false | 4.162954 | true | false | false |
alejosanchez/CSVBenford | site/cgi-bin/csv-analyze.py | 1 | 5199 | #!/usr/bin/env python
# Check a CSV file for Benford's Law compliance
import csv
import sys
import codecs
import cgi
import os
import cgitb
from collections import defaultdict
from itertools import imap
CSV_DIR = '../csv/' # CSV upload directory
GROUPING_DEFAULT = 'todos' # No grouping column
# Decimal digits... | agpl-3.0 | -6,062,544,296,940,803,000 | 28.708571 | 86 | 0.549913 | false | 3.225186 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.