repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cvlab-epfl/multicam-gt | home/views.py | 1 | 1538 | from django.shortcuts import render
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
def index(request):
context = RequestContext(request)
return render(request, 'home/index.html',{},context)
def page_not_found(request):
context = RequestContext(request)... | gpl-3.0 | -963,507,133,711,761,700 | 31.041667 | 95 | 0.670351 | false | 4.225275 | false | false | false |
ctava/maps-angularjs-gae-python | tests.py | 1 | 8242 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2014 Christopher Tava
#
import webapp2
from google.appengine.ext import db
from google.appengine.api import memcache
import logging
import sys
import json
from appconfig import Test, Application, Experiment, Variation
apiKeys = ['your_key_here']
class TestsH... | mit | 201,936,481,206,945,950 | 46.367816 | 334 | 0.562364 | false | 4.568736 | false | false | false |
OliGon/pycurse | Version-0.3/game-0.3.py | 2 | 1711 |
def nextGen(currGen):#{
nextGen = [[' ' for k in range(0,len(currGen[0]))]for l in range(0,len(currGen))]
helpArray = [[' ' for j in range(0,len(currGen[0])+2)]for i in range(0,len(currGen)+2)]
helpArray[0][0] = '0'
helpArray[0][len(currGen[0])+1] = '0'
helpArray[len(currGen)+1][len(currGen[0])+1] = '0'
helpAr... | mit | -4,003,524,675,904,297,500 | 26.15873 | 151 | 0.544126 | false | 2.084044 | false | false | false |
bodokaiser/piwise | main.py | 1 | 5437 | import numpy as np
import torch
from PIL import Image
from argparse import ArgumentParser
from torch.optim import SGD, Adam
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision.transforms import Compose, CenterCrop, Normalize
from torchvision.transforms import ToTensor, ToPILIm... | bsd-3-clause | 9,015,745,471,185,760,000 | 32.361963 | 79 | 0.605113 | false | 3.521373 | false | false | false |
caperren/Archives | OSU Coursework/ROB 421 - Applied Robotics/software/windows_packages/denso_slave/Framework/arm_status_sender.py | 1 | 5848 | #####################################
# Imports
#####################################
# Python native imports
from PyQt5 import QtCore, QtWidgets
import pythoncom
import win32com.client
import time
from time import time
import json
import socket
#####################################
# Global Variables
################... | gpl-3.0 | -5,351,374,531,360,396,000 | 27.115385 | 129 | 0.524795 | false | 3.748718 | false | false | false |
klis87/django-cloudinary-storage | cloudinary_storage/app_settings.py | 1 | 4326 | import importlib
import os
import sys
from operator import itemgetter
import cloudinary
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.dispatch import receiver
from django.test.signals import setting_changed
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspa... | mit | 2,761,080,783,546,130,400 | 43.597938 | 115 | 0.4184 | false | 5.256379 | false | false | false |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/parallel/engine/engine.py | 2 | 13047 | """A simple engine that talks to a controller over 0MQ.
it handles registration, etc. and launches a kernel
connected to the Controller's Schedulers.
Authors:
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distr... | apache-2.0 | 5,054,244,083,947,806,000 | 41.777049 | 127 | 0.607803 | false | 4.021887 | true | false | false |
bcarr092/pyCovertAudio | src/pyCovertAudio/BaseReceiver.py | 1 | 4402 | from ModulatorFactory import ModulatorFactory
from ModifierFactory import ModifierFactory
from Base import Base
from Debug import Debug
from BitPacker import BitPacker
from BitStream import BitStream
from SymbolTracker import SymbolTracker
import sys
import time
from pyCovertAudio_lib import *
class BaseReceiver(Ba... | apache-2.0 | 6,801,913,167,713,349,000 | 26.341615 | 77 | 0.560881 | false | 4.290448 | false | false | false |
babaq/StiLib | Release/dBar.py | 1 | 1771 | ##############################################
# File: dBar.py
#
# Drifting Bar Stimulus
#
# Copyright (c) 2009-03-16 Zhang Li
##############################################
import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference("Microsoft.Xna.Framework.dll")
clr.AddReference("StiLib.dll")
from System i... | lgpl-2.1 | 7,400,455,784,134,515,000 | 40.186047 | 114 | 0.562394 | false | 3.592292 | false | false | false |
laDanz/Naschpunkte | NaschpunkteDP/NaschpunkteApp/django-crossdomainxhr-middleware.py | 1 | 1689 | import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
except:
XS_SHARING_... | apache-2.0 | -4,122,276,888,590,828,000 | 34.93617 | 94 | 0.66489 | false | 3.864989 | false | false | false |
jonathf/chaospy | tests/distributions/test_1d_dependencies.py | 1 | 2094 | """Test dependent distributions with 1-D components."""
from pytest import raises
import numpy
import chaospy
DIST1 = chaospy.Uniform(1, 2)
DIST2 = chaospy.Gamma(DIST1)
JOINT1 = chaospy.J(DIST1, DIST2)
JOINT2 = chaospy.J(DIST2, DIST1)
def test_1d_stochastic_dependencies():
"""Ensure ``stochastic_dependencies`` b... | mit | 7,330,205,589,527,342,000 | 37.072727 | 98 | 0.678606 | false | 2.96181 | true | false | false |
mizzao/ggplot | ggplot/tests/test_ggsave.py | 12 | 6111 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
from nose.tools import assert_equal, assert_true, assert_raises, with_setup
from matplotlib.testing.decorators import image_comparison, cleanup
import matplotlib.pyplot ... | bsd-2-clause | 4,875,643,261,472,345,000 | 38.173077 | 97 | 0.645394 | false | 2.955029 | true | false | false |
fusionbox/django-betterforms | tests/forms.py | 1 | 4522 | from collections import OrderedDict
from django import forms
from django.forms.models import inlineformset_factory
from django.contrib.admin import widgets as admin_widgets
from django.core.exceptions import ValidationError
from betterforms.multiform import MultiForm, MultiModelForm
from .models import User, Profile... | bsd-2-clause | -3,148,910,384,650,515,500 | 22.675393 | 79 | 0.601725 | false | 4.202602 | false | false | false |
mgejke/asyncsector | asyncsector/__main__.py | 1 | 2567 | ''' Start asyncsector '''
import sys
import asyncio
import argparse
import aiohttp
from asyncsector import AsyncSector
from asyncsector.util import get_time
async def async_main(loop):
'''
Async main function
Logs in to Sector Alarm and prints alarm history + temperatures repeatedly with delay.
'''... | bsd-3-clause | -4,952,250,106,156,272,000 | 30.691358 | 99 | 0.558239 | false | 4.456597 | false | false | false |
whit537/assertEquals | setup.py | 1 | 1313 | #!/usr/bin/env python
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
classifiers = [
'Development Status :: 4 - Beta'
, 'Environment :: Console'
, 'Environment :: Console :: Curses'
, 'Intended Audience :: Developers'
, 'License :: OSI Approved :: BSD License'
... | bsd-2-clause | 8,716,236,872,564,280,000 | 32.666667 | 76 | 0.578065 | false | 4.276873 | false | false | false |
mrj0n3s/jimplify | Jimplify/jimplify/visitors/foldingvisitor.py | 1 | 3056 | '''
Created on 29.04.2017
@author: Mr. Jones
'''
from jimplify.visitors.replacementvisitor import ReplacementVisitor
def check_node_type(node,varName):
return type(node).__name__ == varName
class FoldingVisitor():
def __init__(self):
self.optimization = 0
self.replaceme... | mit | -8,791,197,552,188,361,000 | 45.78125 | 161 | 0.582461 | false | 3.740514 | false | false | false |
alvarofe/cassle | handlers/ct.py | 1 | 2080 | from handlers import handlers
from handlers import handler
from handlers.base import BaseHandler
from conf import config, debug_logger
import logging
from pyasn1.codec.ber import decoder
from utils.sct_deser import DeserializeSCTList, DeserializeSCT
from datetime import datetime
import time
from notification.event_noti... | gpl-3.0 | -6,887,315,625,274,675,000 | 31 | 75 | 0.575962 | false | 3.636364 | false | false | false |
testmana2/test | Graphics/PixmapDiagram.py | 2 | 14278 | # -*- coding: utf-8 -*-
# Copyright (c) 2004 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog showing a pixmap.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import Qt, QSize, QEvent, qVersion
from PyQt5.QtGui import QPalette, QImage, QPixmap, QPainter, QFont, QC... | gpl-3.0 | 8,639,887,951,186,842,000 | 34.254321 | 79 | 0.57487 | false | 4.263362 | false | false | false |
manosai/tweepy | grade_hits_naive_template.py | 1 | 3347 | #!/bin/python
"""
This code grades the HITs based on the embedded control tweets.
It takes as input the csv file containing the submitted HITs.
It outputs hits_graded.csv, which contains the columns 'Approve' and 'Reject', one of which contains an 'X' for each HIT, according to the Turker's performance on controls.
""... | mit | -2,778,572,150,101,978,000 | 56.706897 | 580 | 0.737377 | false | 3.490094 | false | false | false |
tomxelliott/medicapp1.0 | quiz/views/quiz_views.py | 1 | 2247 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from django.template import loader
from django.http import HttpResponse, HttpResponseRedirect
from quiz.models import Topic, Question
def index(request):
topic_list = Topic.objects.order_by('topic_tex... | mit | 7,633,924,873,451,094,000 | 30.208333 | 74 | 0.682243 | false | 3.683607 | false | false | false |
sansbacon/nba | nbadb-update.py | 1 | 2779 | #!/usr/bin/env python3
# updates nbadb tables
# can run on daily or periodic basis
import logging
import sys
from nba.agents.nbacom import NBAComAgent
from nba.dates import today, yesterday, datetostr
from nba.season import season_start
import nbadb_player_update
from nba.utility import getdb
def run():
'''
... | mit | 6,304,203,522,170,712,000 | 30.224719 | 92 | 0.692695 | false | 3.571979 | false | false | false |
apache/incubator-allura | ForgeImporters/forgeimporters/github/utils.py | 3 | 6080 | # 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 (t... | apache-2.0 | -6,586,660,289,854,474,000 | 36.530864 | 88 | 0.499342 | false | 3.578576 | false | false | false |
ellisdg/3DUnetCNN | unet3d/scripts/segment.py | 1 | 2928 | import argparse
import os
import nibabel as nib
from unet3d.utils.utils import one_hot_image_to_label_map
def parse_args():
return format_parser(argparse.ArgumentParser(), sub_command=False).parse_args()
def format_parser(parser, sub_command=False):
if sub_command:
parser.add_argument("--segment", a... | mit | 8,653,854,663,082,976,000 | 45.47619 | 118 | 0.591189 | false | 4.376682 | false | false | false |
droberson/thefuzz | FuzzTCPClient.py | 1 | 6462 | #!/usr/bin/env python
"""
Start of TCP fuzzing client. Still very rough!!
TODO:
- Quiet mode. Sometimes I just dont care what the output is.
- Logging.
- send() wrapper.
- recv() wrapper.
- Combine common functionality with FuzzTCPServer somehow to get rid of the
code reuse.
- SIGINT handler.
- Ability to p... | mit | 950,273,996,955,376,800 | 28.506849 | 80 | 0.50031 | false | 4.471972 | false | false | false |
stczhc/neupy | neupy/network/utils.py | 1 | 2686 | import numpy as np
__all__ = ('iter_until_converge', 'shuffle', 'normalize_error', 'step',
'StopNetworkTraining')
class StopNetworkTraining(Exception):
""" Exception that needs to be triggered in case of
early training interruption.
"""
def iter_until_converge(network, epsilon, max_epochs):... | mit | 2,997,674,662,573,217,000 | 25.07767 | 74 | 0.585257 | false | 4.290735 | false | false | false |
etalab/udata | udata/core/post/tests/test_frontend.py | 1 | 2914 | import pytest
from flask import url_for
from udata.core.post.factories import PostFactory
from udata.tests.helpers import assert200
from udata.utils import faker
@pytest.mark.usefixtures('clean_db')
class PostBlueprintTest:
modules = ['core.post', 'admin', 'core.dataset', 'core.reuse',
'core.site... | agpl-3.0 | 1,739,220,303,708,025,600 | 40.628571 | 79 | 0.654427 | false | 3.764858 | true | false | false |
Woden501/taxicalc | dataload/migrations/0012_auto_20161205_2335.py | 1 | 5633 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-05 23:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dataload', '0011_auto_20161205_2305'),
]
operation... | agpl-3.0 | -3,604,738,034,899,233,300 | 30.121547 | 148 | 0.518906 | false | 4.04089 | false | false | false |
alexei-matveev/ase-local | ase/dft/wannier.py | 5 | 30345 | """ Maximally localized Wannier Functions
Find the set of maximally localized Wannier functions
using the spread functional of Marzari and Vanderbilt
(PRB 56, 1997 page 12847).
"""
from time import time
from math import sqrt, pi
from pickle import dump, load
import numpy as np
from ase.parallel import p... | gpl-2.0 | -6,547,666,531,041,114,000 | 36.978723 | 79 | 0.520712 | false | 3.223048 | false | false | false |
pombredanne/catawampus | tr/vendor/bup/lib/tornado/escape.py | 9 | 3877 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 | -2,619,419,155,834,334,700 | 30.520325 | 85 | 0.656435 | false | 3.778752 | false | false | false |
Kerbas-ad-astra/cfgnode | cfgnode.py | 2 | 5641 | # vim:ts=4:et
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 License, or (at your option) any later version.
#
# This prog... | gpl-2.0 | 2,260,116,918,244,147,700 | 32.981928 | 74 | 0.514448 | false | 3.96974 | true | false | false |
ocefpaf/cartopy | docs/source/conf.py | 1 | 13915 | # (C) British Crown Copyright 2011 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy 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)... | lgpl-3.0 | -2,147,187,273,770,101,000 | 32.611111 | 80 | 0.667697 | false | 3.7659 | true | false | false |
sukwon0709/equip | equip/utils/files.py | 2 | 1118 | # -*- coding: utf-8 -*-
"""
equip.utils.files
~~~~~~~~~~~~~~~~~
:copyright: (c) 2014 by Romain Gaucher (@rgaucher)
:license: Apache 2, see LICENSE for more details.
"""
import os
__normalize_path = lambda x: os.path.abspath(x)
def file_extension(filename):
if '.' not in filename:
return None
return ... | apache-2.0 | -2,107,476,683,591,352,300 | 22.787234 | 68 | 0.60644 | false | 3.36747 | false | false | false |
south-coast-science/scs_core | src/scs_core/aqcsv/conf/airnow_site_conf.py | 1 | 2587 | """
Created on 8 Mar 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
Site information required for a device that may join the AirNow-I project
example JSON:
{"site": "850MM123456789", "pocs": {"88102": 2}}
https://www.airnow.gov/
"""
from collections import OrderedDict
from scs_core.aqcsv.data.aqc... | mit | 5,752,880,743,845,243,000 | 25.947917 | 118 | 0.393506 | false | 5.013566 | false | false | false |
jaredhasenklein/the-blue-alliance | controllers/admin/admin_cron_controller.py | 1 | 21977 | from collections import defaultdict
from datetime import date, datetime, timedelta
import json
import logging
import os
import re
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
from consts.award_type import AwardType
from consts.client_... | mit | -1,306,634,088,553,061,000 | 39.925512 | 168 | 0.6262 | false | 3.882862 | false | false | false |
porduna/weblabdeusto | server/src/weblab/core/web/visir.py | 3 | 7833 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
... | bsd-2-clause | -6,064,263,341,798,380,000 | 30.708502 | 126 | 0.645301 | false | 3.579525 | false | false | false |
Duke-QCD/hic | hic/test/test_initial.py | 2 | 1538 | # -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from .. import initial
def test_ic():
"""initial conditions"""
ic = initial.IC((
(0, 0, 0, 0),
(0, 1, 1, 0),
(0, 1, 1, 0),
(0,... | mit | -8,581,211,706,627,421,000 | 25.517241 | 73 | 0.476593 | false | 3.015686 | false | false | false |
saulfield/SP-707 | sampler/pad.py | 1 | 3184 | import pygame
import os.path
import wave
from constants import *
class Pad:
def __init__(self, x, y, pad_id):
self.image = pygame.Surface((PAD_SIZE + 2 * PAD_BORDER, PAD_SIZE + 2 * PAD_BORDER))
self.rect = self.image.get_rect(x=x, y=y)
self.id = pad_id
self.on = False
self.... | mit | 8,705,927,137,116,118,000 | 36.904762 | 114 | 0.57946 | false | 3.387234 | false | false | false |
JewLion/DontBanDog | search.py | 1 | 6484 | import discord
import urllib
import re
import os
import random
import requests
import html
import json
from bs4 import BeautifulSoup
from discord.ext import commands
class Search(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def... | mit | 3,179,659,706,209,097,700 | 36.595238 | 168 | 0.520358 | false | 3.600222 | false | false | false |
shenhequnying/ceph-deploy | ceph_deploy/pkg.py | 5 | 1629 | import logging
from . import hosts
LOG = logging.getLogger(__name__)
def install(args):
packages = args.install.split(',')
for hostname in args.hosts:
distro = hosts.get(hostname, username=args.username)
LOG.info(
'Distro info: %s %s %s',
distro.name,
dist... | mit | -3,751,476,509,013,931,500 | 21.013514 | 60 | 0.563536 | false | 4.002457 | false | false | false |
tvarney/GameBreaker | gamebreaker/neopets/common.py | 1 | 2605 |
import gamebreaker.image as image
import os.path
import cv2
def GetGameArea(data_path : str = "./data", match_value: float = 0.70):
im = image.ImageGrabber()
img_ul = image.load_from_file(os.path.join(data_path, "neopets_top_left.png"), True, False)
img_br = image.load_from_file(os.path.join(d... | mit | 7,162,552,188,029,679,000 | 43.701754 | 111 | 0.597697 | false | 2.807112 | false | false | false |
geertj/draco2 | draco2/form/check.py | 1 | 2382 | # vi: ts=8 sts=4 sw=4 et
#
# check.py: form checking
#
# This file is part of Draco2. Draco2 is free software and is made available
# under the MIT license. Consult the file "LICENSE" that is distributed
# together with this file for the exact licensing terms.
#
# Draco2 is copyright (c) 1999-2007 by the Draco2 authors... | mit | 4,741,915,475,903,344,000 | 38.7 | 84 | 0.616709 | false | 4.092784 | false | false | false |
RealTimeWeb/blockpy | build.py | 1 | 1752 | import os
import re
with open('src/interface.html', 'r') as inp:
with open('src/interface.js', 'w') as output:
contents = inp.read()
cleaned_contents = contents.replace('"', '\\"').replace('\n', '')
js_contents = '''
/**
* An automatically generated file, based on interface.html.
... | apache-2.0 | 3,571,960,918,539,717,600 | 38.818182 | 93 | 0.631849 | false | 3.990888 | false | false | false |
chdhr-harshal/MCMonitor | src/python/MarkovChain/node_objectives.py | 1 | 9782 | #!/usr/local/bin/python
"""
Node objective functions
Algorithms implemented:
1. naive_greedy_parallel - In each iteration pick 1 node greedily.
2. naive_greedy_heuristic - Pick all k nodes at once greedily.
3. smart_greedy_parallel - In each iteration pick 1 node smart greedily.
"""
from __future__ import... | mit | -8,183,551,446,510,428,000 | 30.75974 | 101 | 0.569004 | false | 3.446794 | false | false | false |
destijl/grr | grr/gui/plugins/navigator_view_test.py | 2 | 9474 | #!/usr/bin/env python
"""Navigator view tests."""
from grr.gui import gui_test_lib
from grr.gui import runtests_test
from grr.lib import aff4
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.rdfvalues import client as rdf_client
class TestNavigatorView(gui_test_lib.Se... | apache-2.0 | -4,377,189,106,288,207,000 | 36.896 | 79 | 0.674161 | false | 3.430123 | true | false | false |
prtkm/jasp | jasp/jasp_dielectric.py | 3 | 3085 | # Contributed by Jason Marshall, 2014
import numpy as np
from jasp import *
def get_born_charges(self, return_tensor=False):
'''returns the born effective charges from the OUTCAR file.
OUTCAR gives effective charge as tensor
this function will give back a scalar value (tr(tensor)/3) or the tensor
yo... | gpl-2.0 | 8,387,582,400,108,350,000 | 27.045455 | 87 | 0.594814 | false | 3.474099 | false | false | false |
krzykwas/rhqagent | pyagent/data/sender/DataSenderFactory.py | 1 | 2195 | #-*- coding: utf-8 -*-
#
# Krzysztof „krzykwas” Kwaśniewski
# Gdańsk, 24-05-2012
#
# 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 late... | gpl-3.0 | 408,614,486,696,370,700 | 33.746032 | 86 | 0.755139 | false | 3.8471 | false | false | false |
sagnik17/Movie-Recommendation-System | mrs/recsys/RBM_user.py | 2 | 5211 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# library packages
from time import time
import pickle
# third party packages
import numpy as np
# local files
from ..datamodel import loaddata
class RBM_User:
"""
Restricted Boltzmann Machine
:param nvisible: Number of neurons on the visible layer
... | gpl-3.0 | -7,088,874,883,267,863,000 | 33.973154 | 110 | 0.553253 | false | 3.862861 | true | false | false |
altMITgcm/MITgcm66h | utils/python/MITgcmutils/MITgcmutils/cs/pcol.py | 1 | 7026 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
def pcol( x, y, data, projection=None, vmin=None, vmax=None, **kwargs):
"""function h=pcol(x,y,v)
function h=pcol(x,y,v, projection = mp )
plots 2D scalar fields v on the MITgcm cubed s... | mit | -712,590,560,700,973,400 | 35.978947 | 78 | 0.531739 | false | 3.056111 | false | false | false |
tstachl/Phoenix | Phoenix/Models/MemberModel.py | 1 | 3765 | """
Phoenix
LICENSE
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 | 8,751,646,413,733,087,000 | 35.911765 | 81 | 0.570784 | false | 5.101626 | false | false | false |
vlopezferrando/pymut | pymut/pmut.py | 1 | 1030 | # -*- coding: utf-8 -*-
import logging
from .data import get_protein_sequences
from .utils import variant_str
def get_sequences(variants):
protein_ids = set(variants.protein_id)
sequences = get_protein_sequences(protein_ids)
variants['sequence'] = [
sequences[row.protein_id] if row.protein_id in... | mit | -774,348,987,709,278,600 | 31.1875 | 77 | 0.609709 | false | 4.007782 | false | false | false |
rizal72/Cozmo-Voice-Commands | cvc/cozmo_voice_commands.py | 1 | 12089 | #!/usr/bin/env python3
'''
Cozmo Voice Commands (CvC)
Author: Riccardo Sallusti - http://riccardosallusti.it
Description: Issue complex voice commands to Cozmo, and watch him execute them.
More informations: https://github.com/rizal72/Cozmo-Voice-Commands
License: GNU
'''
import sys
import os
import asyncio
import oper... | gpl-3.0 | -8,884,909,650,001,569,000 | 33.638968 | 284 | 0.590702 | false | 3.698073 | false | false | false |
YeoLab/gscripts | gscripts/miso/__init__.py | 1 | 1969 | __author__ = 'olga'
import pandas as pd
def max_csv(x):
'''
Of integers separated by commas, take the max
e.g. 75112684,75112684 would return 75112684
or 75112684,75112689 would return 75112689
'''
return max(map(int, x.split(',')))
def min_csv(x):
'''
Of integers separated by comma... | mit | 1,188,497,922,550,647,000 | 36.884615 | 76 | 0.595734 | false | 3.326014 | false | false | false |
GNOME/testinggtk | tests/test_window.py | 1 | 9240 | '''
Tests for the ``gtk.Window`` class.
'''
import gtk
from gtk import gdk
import utils
def test_default_attributes():
win = gtk.Window()
assert win.get_opacity() == 1
assert isinstance(win.get_group(), gtk.WindowGroup)
def test_default_flags():
win = gtk.Window()
flags = win.flags()
assert gt... | lgpl-2.1 | -8,852,474,054,387,859,000 | 25.551724 | 71 | 0.628355 | false | 3.346614 | true | false | false |
jiadaizhao/LeetCode | 0701-0800/0711-Number of Distinct Islands II/0711-Number of Distinct Islands II.py | 1 | 1679 | import collections
class Solution:
def numDistinctIslands2(self, grid: List[List[int]]) -> int:
if not grid:
return 0
m, n = len(grid), len(grid[0])
table = set()
dr = [-1, 1, 0, 0]
dc = [0, 0, -1, 1]
def norm(path):
s = [[] for _ in range(8)]
... | mit | 850,967,021,137,891,200 | 33.979167 | 81 | 0.299583 | false | 3.807256 | false | false | false |
tranhuucuong91/simple-notebooks | config_default.py | 1 | 1094 | # -*- coding: utf-8 -*-
"""
Created on 2015-10-23 08:06:00
@author: Tran Huu Cuong <tranhuucuong91@gmail.com>
"""
import os
# Blog configuration values.
# You may consider using a one-way hash to generate the password, and then
# use the hash again in the login view to perform the comparison. This is just
# for sim... | mit | -9,216,209,138,791,773,000 | 23.863636 | 78 | 0.716636 | false | 3.073034 | false | false | false |
ric96/joypi | joypinoir.py | 1 | 4397 | import time
import signal
import pygame
import sys
import RPi.GPIO as GPIO
# The following is an example code written to controll the l298n motor contoller
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT) #input-1
GPIO.setup(12, GPIO.OUT) #input-2
GPIO.setup(15, GPIO.OUT) #input-3
GPIO.setup(16, GPIO.OUT) #input-4
GPI... | gpl-2.0 | 6,204,437,763,096,220,000 | 27.006369 | 103 | 0.610189 | false | 3.11623 | false | false | false |
tardyp/buildbot | master/buildbot/test/fakedb/base.py | 5 | 2075 | # 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
# ANY WARRANTY; without eve... | gpl-2.0 | -2,910,179,098,364,384,000 | 36.053571 | 100 | 0.628916 | false | 4.021318 | false | false | false |
amitgroup/parts-net | pnet/mixture_classification_layer.py | 1 | 5092 | from __future__ import division, print_function, absolute_import
from pnet.layer import SupervisedLayer
from pnet.layer import Layer
import numpy as np
from pnet.bernoulli_mm import BernoulliMM
from scipy.special import logit
import amitgroup as ag
@Layer.register('mixture-classification-layer')
class MixtureClassifi... | bsd-3-clause | -4,844,597,033,663,373,000 | 32.281046 | 76 | 0.473095 | false | 3.797166 | false | false | false |
207leftovers/cs207project | pype/optimize.py | 1 | 6532 | from .fgir import *
from .error import *
# Optimization pass interfaces
class Optimization(object):
def visit(self, obj): pass
class FlowgraphOptimization(Optimization):
'''Called on each flowgraph in a FGIR.
May modify the flowgraph by adding or removing nodes (return a new Flowgraph).
If you modify nodes, ... | mit | 498,436,717,710,551,500 | 40.08805 | 110 | 0.693815 | false | 3.93494 | false | false | false |
cdoremus/udacity-python_web_development-cs253 | test/unit6/blog/blog_appengine_storage_test.py | 1 | 2940 | '''
Created on May 6, 2012
@author: h87966
'''
from google.appengine.ext import testbed
import unittest
from unit6.blog.blog_entry import BlogData
from unit6.blog.blog_datastore_appengine import BlogAppengineDataStore
from unit6.blog.blog_datastore_appengine import FETCH_ALL_CACHE_KEY,LAST_QUERY_CACHE_KEY_SUFFIX
impor... | apache-2.0 | 5,196,649,053,538,201,000 | 36.705128 | 144 | 0.634014 | false | 3.462898 | true | false | false |
ShoYamanishi/wailea | jgaa/plot_performance.py | 1 | 1031 | import sys
import fileinput
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.colors as colors
def parseFile(filename):
lineno = 0
X = []
Y = []
with open(filename) as fp:
for line in fp:
line = line.strip()
fields = line.... | mit | -5,298,285,349,882,875,000 | 19.215686 | 49 | 0.518914 | false | 3.172308 | false | false | false |
Cinemair/cinemair-server | cinemair/users/admin.py | 1 | 1773 | from django.contrib import admin
from django.contrib.auth.models import Group as DjangoGroup
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from django.contrib.auth.forms import AdminPasswordChangeForm
from django.utils.translation import uge... | mit | 5,244,167,943,274,302,000 | 36.723404 | 83 | 0.680203 | false | 4.075862 | false | false | false |
neoareslinux/dragonflow | dragonflow/controller/l2_app.py | 1 | 16494 | # Copyright (c) 2015 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 | 2,516,230,360,733,764,000 | 36.917241 | 78 | 0.566145 | false | 3.960144 | false | false | false |
pyfa-org/eos | eos/stats/register/slot/__init__.py | 1 | 1209 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 | -8,152,946,714,981,125,000 | 43.777778 | 80 | 0.686518 | false | 4.12628 | false | false | false |
heyglen/ghstore | test/test_instance_index.py | 1 | 1555 | # -*- coding: utf-8 -*-
from ipaddress import IPv4Network
from nose.tools import assert_equals, assert_is_instance
from nose.tools import assert_false
from nose.tools import assert_in
from ghstore.instance_index import InstanceIndex
from .dummy import DummyClass
class TestInstanceIndex(object):
def test_encode(... | mit | -4,739,329,512,817,482,000 | 43.428571 | 75 | 0.724759 | false | 4.007732 | false | false | false |
Dryeck/17-18-Reinforcement | AlphaZero/policy_value_net_keras.py | 1 | 5975 | # -*- coding: utf-8 -*-
"""
An implementation of the policyValueNet with Keras
Tested under Keras 2.0.5 with tensorflow-gpu 1.2.1 as backend
@author: Mingxu Zhang
"""
from __future__ import print_function
#import sys
#otherPath = ['', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/pyth... | mit | 1,549,953,256,265,424,000 | 45.664063 | 345 | 0.645069 | false | 3.395679 | false | false | false |
ceridwen/combinators | spf.py | 1 | 21267 | from __future__ import absolute_import, division, print_function#, unicode_literals
import collections
# A bug in pprint on 2.7 prevents it from working correctly with
# frozensets: http://bugs.python.org/issue20192.
import pprint
import weakref
try:
from functools import singledispatch as _singledispatch
except ... | mit | 557,701,361,324,169,200 | 34.386023 | 177 | 0.559505 | false | 4.047003 | false | false | false |
sga001/cinch | exploits/CVE-2016-3137.py | 1 | 2454 | #!/usr/bin/env python3
from USB import *
from USBDevice import *
from USBConfiguration import *
from USBInterface import *
from USBEndpoint import *
class PwnUSBDevice(USBDevice):
name = "USB device"
def handle_buffer_available(self, lll):
return
def __init__(self, maxusb_app, verbose=0):
... | cc0-1.0 | 5,313,398,270,444,491,000 | 30.063291 | 81 | 0.432763 | false | 5.101871 | false | false | false |
ianmtaylor1/pacal | pacal/depvars/nddistr.py | 1 | 46597 | """Multidimensional distributions."""
import numbers
from functools import partial
from copy import copy
import numpy
from numpy import asfarray, asmatrix, dot, delete, array, zeros, empty_like, isscalar, repeat, zeros_like, nan_to_num
from numpy import pi, sqrt, exp, argmin, isfinite, concatenate, inf
from numpy imp... | gpl-3.0 | 2,255,207,801,161,682,700 | 38.091443 | 196 | 0.532459 | false | 2.950484 | false | false | false |
allink/allink-apps | work/tests/utils.py | 1 | 1770 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
def create_user(username, email, password, is_staff=False, is_superuser=False,
base_cms_permissions=False, permissions=None):
from django.contrib.auth.models import Permission
from django.contrib.a... | bsd-3-clause | 9,194,153,069,939,657,000 | 40.162791 | 82 | 0.679096 | false | 3.933333 | false | false | false |
spaam/svtplay-dl | lib/svtplay_dl/service/bigbrother.py | 1 | 2424 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
import copy
import json
import re
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.http import HTTP
from svtplay_dl.service import OpenGraphThumbMixin
from svtplay_dl.se... | mit | 1,815,062,214,866,196,700 | 36.292308 | 128 | 0.60396 | false | 3.706422 | false | false | false |
spesmilo/electrum | electrum/gui/text.py | 1 | 19968 | import tty
import sys
import curses
import datetime
import locale
from decimal import Decimal
import getpass
import logging
from typing import TYPE_CHECKING
import electrum
from electrum import util
from electrum.util import format_satoshis
from electrum.bitcoin import is_address, COIN
from electrum.transaction import... | mit | 3,510,345,709,318,191,000 | 35.638532 | 144 | 0.519882 | false | 3.641138 | true | false | false |
Debian/britney2 | britney2/installability/tester.py | 1 | 27838 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Niels Thykier <niels@thykier.net>
# 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 License, or
# (at your option) any later ... | gpl-2.0 | 2,917,106,498,178,868,700 | 40.798799 | 238 | 0.552554 | false | 4.460503 | false | false | false |
econti/quora-clone | quora/urls.py | 1 | 1347 | from django.contrib.auth.views import login, logout
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from quora.core.views import (
fblogin,
home,
password,
picture,
profile,
public_p... | mit | -72,841,550,121,280,980 | 34.447368 | 85 | 0.655531 | false | 3.563492 | false | true | false |
arteria/django-activeusers | activeusers/utils.py | 2 | 2805 | from django.conf import settings
import re
import unicodedata
# this is not intended to be an all-knowing IP address regex
IP_RE = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
def get_ip(request):
"""
Retrieves the remote IP address from the request data. If the user is
behind a proxy, they may have ... | mit | 6,645,807,176,430,549,000 | 31.252874 | 85 | 0.587879 | false | 3.984375 | false | false | false |
rinslow/fakeos | fakeos.py | 1 | 12136 | """Full mock of the builtin 'os' module for blazing-fast unit-testing."""
from pathlib import Path
import typing
from device import FakeDevice
from environment import FakeEnvironment
from filesystem import FakeFilesystem, FakeFilesystemWithPermissions, \
AbstractFilesystem
from operating_system import FakeOperatin... | mit | 7,687,314,863,759,327,000 | 41.222997 | 83 | 0.642103 | false | 4.443711 | false | false | false |
JoshuaSkelly/lunch-break-rl | ai/actions/movetoaction.py | 1 | 1442 | import helpers
import instances
from ai import action
class MoveToAction(action.Action):
def __init__(self, performer, destination, max_moves=None):
super().__init__(performer)
self.destination = destination
self.max_moves = max_moves
def prerequisite(self):
scene_root = inst... | mit | 1,235,693,690,461,321,000 | 28.428571 | 106 | 0.627601 | false | 4.039216 | false | false | false |
dannyboi104/SickRage | lib/sqlalchemy/dialects/mysql/pymysql.py | 78 | 1228 | # mysql/pymysql.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+pymysql
:name: PyMySQL
:dbapi: pymysql
:connectst... | gpl-3.0 | 8,094,878,966,790,725,000 | 26.288889 | 85 | 0.678339 | false | 3.766871 | false | false | false |
shayan72/Courseware | course/views.py | 1 | 5066 | from django.shortcuts import render
from django.http import Http404
from course.models import CourseInstance
from course.models import Syllabus
from course.models import Calendar
from course.models import Assignment
from course.models import Grade
from course.models import Resource
from course.models import Topic
from... | mit | -5,810,818,129,053,573,000 | 38.585938 | 113 | 0.714173 | false | 3.565095 | false | false | false |
bsmithers/CLIgraphs | utils.py | 1 | 2424 | import itertools
import os
import stat
import sys
class TransparentLineReader:
"""
Very simple class that facilitates reading from an already opened
file (e.g. stdin) or a filename or a named pipe
without the caller needing to know which it is
TODO: Handle IO errors more gracefully
"""
de... | agpl-3.0 | -6,878,258,875,312,352,000 | 26.556818 | 85 | 0.574257 | false | 3.97377 | false | false | false |
davidsims9t/itis-graphql | src/graphql/schemas/hierarchy.py | 1 | 1241 | import graphene
from graphene import relay
from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField
from .taxonomic_unit import TaxonomicUnit
from .synonym_link import SynonymLink
from models.hierarchy import Hierarchy as HierarchyModel
from models.taxonomic_unit import TaxonomicUnit as Taxonom... | gpl-3.0 | -1,559,514,607,145,846,000 | 40.366667 | 93 | 0.760677 | false | 3.842105 | false | false | false |
chaquotay/IndoorClimateStation | ClimateSensors.py | 1 | 3235 | #!/usr/bin/env python
"""Displays temperature and relative humidity on an LCD using Tinkerforge bricklets."""
HOST = "localhost"
PORT = 4223
UPDATE_PERIOD = 1000
from tinkerforge.ip_connection import IPConnection
from tinkerforge.bricklet_temperature import Temperature
from tinkerforge.bricklet_humidity import Humid... | apache-2.0 | -519,847,075,996,091,000 | 34.955556 | 130 | 0.654096 | false | 3.676136 | false | false | false |
jdepoix/goto_cloud | goto_cloud/source/migrations/0001_initial.py | 1 | 1517 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-12 14:00
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | mit | -83,132,459,107,511,980 | 40 | 166 | 0.609756 | false | 4.133515 | false | false | false |
cancerregulome/gidget | commands/feature_matrix_construction/main/compare2TSVs.py | 1 | 18554 | # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
import miscIO
import tsvIO
import math
import sys
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
NA_VALUE = -999999
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
... | mit | -1,159,756,704,754,953,500 | 33.359259 | 146 | 0.472674 | false | 3.394438 | false | false | false |
waweber/imapfs | imapfs/fs.py | 1 | 10227 | # IMAPFS - Cloud storage via IMAP
# Copyright (C) 2013 Wes Weber
#
# 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.
#
# T... | gpl-3.0 | 1,838,899,993,066,706,700 | 24.314356 | 84 | 0.636453 | false | 3.406729 | false | false | false |
IBMDecisionOptimization/docplex-examples | examples/cp/visu/house_building_optional.py | 1 | 4842 | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
This is a problem ... | apache-2.0 | -3,484,039,819,130,067,000 | 33.834532 | 152 | 0.555143 | false | 3.434043 | false | false | false |
JeffHeard/terrapyn | geocms/drivers/spatialite.py | 1 | 38538 | # from ga_ows.views import wms, wfs
from django.db.models.loading import get_model
from django.utils.text import slugify
from uuid import uuid4
from zipfile import ZipFile
import json
from django.contrib.gis.geos import Polygon, GEOSGeometry
from django.core.files import File
import numpy
import os
from osgeo import os... | apache-2.0 | -6,267,821,835,642,509,000 | 38.006073 | 202 | 0.550288 | false | 4.028222 | false | false | false |
Metronus/metronus | Metronus-Project/populate_database.py | 1 | 10110 | from metronus_app.model.role import Role
from metronus_app.model.company import Company
from metronus_app.model.employee import Employee
from metronus_app.model.project import Project
from metronus_app.model.department ... | mpl-2.0 | -4,704,086,310,763,037,000 | 30.69279 | 146 | 0.603264 | false | 3.553603 | false | false | false |
cloew/NytramPong | src/pong/ball_entity.py | 1 | 1508 | from .shaders import ShaderProgram
from .behaviors.ball import Ball
from .behaviors.ball_movement import BallMovement
from .collisions import Collidables, CollidableCategories
from nytram.entity import Entity
from nytram.renderers import EntityRenderer
from nytram.ext.box2d import Body, Fixture, BodyTypes, Box,... | mit | -75,973,778,904,902,580 | 46.709677 | 145 | 0.675066 | false | 3.57346 | false | false | false |
TresysTechnology/setools | setools/diff/netifcon.py | 1 | 3798 | # Copyright 2016, Tresys Technology, LLC
#
# This file is part of SETools.
#
# SETools 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 ... | lgpl-2.1 | 7,475,069,720,096,490,000 | 35.519231 | 97 | 0.618747 | false | 4.484061 | false | false | false |
jimstorch/tokp | tokp_lib/datetime_range.py | 1 | 1131 | #------------------------------------------------------------------------------
# File: datetime_range.py
# Purpose:
# Author: Jim Storch
# Revised:
# License: GPLv3 see LICENSE.TXT
#------------------------------------------------------------------------------
# Given a month/day string... | gpl-3.0 | -1,737,619,008,160,364,000 | 27.275 | 79 | 0.511052 | false | 3.556604 | false | false | false |
ParableSciences/YAK-server | setup.py | 1 | 4239 | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
from yak import __version__
def read(*parts):
filename = os.path.join(os.path.dirna... | mit | 2,704,237,799,815,741,400 | 30.4 | 114 | 0.57372 | false | 4.151812 | false | false | false |
alaasalman/taskit | DBHandler.py | 1 | 4238 | """
Copyright 2007 Alaa Salman <alaa@codedemigod.com>
This file is part of TaskIt.
TaskIt 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... | gpl-3.0 | 3,468,605,903,890,539,500 | 27.829932 | 84 | 0.597924 | false | 4.498938 | false | false | false |
madhuni/AstroBox | src/ext/makerbot_driver/Writer/AbstractWriter.py | 6 | 1032 | class AbstractWriter(object):
def __init__(self, file, condition):
self.external_stop = False
self._condition = condition
self.file = file
def open(self):
""" Opens the currently set port"""
raise NotImplementedError()
def is_open(self):
""" Fluch of file l... | agpl-3.0 | 8,543,612,678,673,194,000 | 27.666667 | 69 | 0.621124 | false | 4.914286 | false | false | false |
falgore88/grafana-metrics | grafana_metrics/thread_utils.py | 1 | 1566 | # coding: utf-8
from __future__ import unicode_literals
import logging
import traceback
from contextlib import closing
from multiprocessing import TimeoutError
from multiprocessing.dummy import Pool as ThreadPool
from threading import Thread
import six
class MetricThread(Thread):
def __init__(self, metric, call... | apache-2.0 | -758,447,934,535,358,700 | 39.153846 | 135 | 0.590038 | false | 4.552326 | false | false | false |
eliasdesousa/indico | indico/modules/events/abstracts/controllers/display.py | 2 | 3662 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 | -5,733,670,673,499,341,000 | 45.35443 | 116 | 0.708356 | false | 3.937634 | false | false | false |
WyseNynja/steam_friends | steam_friends/config.py | 1 | 1036 | from __future__ import absolute_import, print_function
# todo: make sure we exit if our config has this in it
SECRET = RuntimeError('__SECRET__PUT_THIS_IN_YOUR_ENV__')
class Config(object):
BROKER_URL = 'redis://redis:6379/1' # celery queue
CELERYD_HIJACK_ROOT_LOGGER = False
DEBUG = False
LOGGER_NAM... | mit | -4,923,239,628,078,367,000 | 24.268293 | 57 | 0.643822 | false | 3.320513 | true | false | false |
ArthurPBressan/FaceTweet | sisgep1/feed/models.py | 2 | 3216 | # coding: UTF-8
from __future__ import absolute_import
from flask.ext.security import Security, SQLAlchemyUserDatastore, \
UserMixin, RoleMixin
from flask.ext.social import Social
from flask.ext.social.datastore import SQLAlchemyConnectionDatastore
from sqlalchemy import Column, ForeignKey
from sqlalchemy.orm imp... | mit | -1,699,986,881,058,168,800 | 32.852632 | 83 | 0.637127 | false | 4.112532 | false | false | false |
spulec/moto | moto/ec2/responses/flow_logs.py | 2 | 5111 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.models import validate_resource_ids
from moto.ec2.utils import filters_from_querystring
class FlowLogs(BaseResponse):
def create_flow_logs(self):
resource_type = self._get_param("ResourceType")
resou... | apache-2.0 | -3,588,641,065,348,271,600 | 40.893443 | 103 | 0.632557 | false | 3.645506 | false | false | false |
gauntlt/gauntlt-demo | examples/webgoat/vuln-24/vuln-24-attack.py | 2 | 2156 | import requests
import json
import pprint
from bs4 import BeautifulSoup
s = requests.Session()
# Navigating to the WebGoat page
s.get("http://127.0.0.1:8080/WebGoat/login.mvc")
# Logging in
payload = {
'username': 'guest',
'password': 'guest'
}
s.post("http://127.0.0.1:8080/WebGoat/j_spring_security_check", payloa... | mit | -5,509,106,179,303,297,000 | 27.381579 | 111 | 0.692022 | false | 2.844327 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.