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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
davebridges/mousedb | mousedb/veterinary/views.py | 1 | 7047 | '''This module generates the views for the veterinary app.
There is one generic home view for the entire app as well as detail, create update and delete views for these models:
* :class:`~mousedb.veterinary.models.MedicalIssue`
* :class:`~mousedb.veterinary.models.MedicalCondition`
* :class:`~mousedb.veterinary.model... | bsd-3-clause | 775,855,840,487,166,100 | 44.75974 | 133 | 0.724847 | false | 3.782609 | false | false | false |
ANR-DIADEMS/timeside-diadems | timeside/plugins/diadems/irit_singings.py | 1 | 7234 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Maxime Le Coz <lecoz@irit.fr>
# This file is part of TimeSide.
# TimeSide 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
# ... | gpl-2.0 | -1,683,434,666,844,066,000 | 35.14 | 119 | 0.639734 | false | 3.301964 | false | false | false |
SnapSearch/SnapSearch-Client-Python | src/SnapSearch/detector.py | 1 | 11166 | # -*- coding: utf-8 -*-
"""
SnapSearch.detector
~~~~~~~~~~~~~~~~~~~
:copyright: 2014 by `SnapSearch <https://snapsearch.io/>`_
:license: MIT, see LICENSE for more details.
:author: `LIU Yu <liuyu@opencps.net>`_
:date: 2014/03/08
"""
# future import should come first
from __future__ import wi... | mit | 7,516,432,823,431,704,000 | 38.178947 | 79 | 0.543346 | false | 4.695542 | false | false | false |
phoebe-project/phoebe2-docs | 2.2/tutorials/irrad_method_horvat.py | 1 | 3005 | #!/usr/bin/env python
# coding: utf-8
# Lambert Scattering (irrad_method='horvat')
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip for your installation or don't wa... | gpl-3.0 | -420,098,855,563,994,800 | 22.476563 | 203 | 0.66589 | false | 2.940313 | false | false | false |
afodor/pythonExamples | src/viterbi/viterbiExample.py | 1 | 2894 | import random
class MarkovState:
def __init__(self,charsToEmit, emissionProbs,transitionProbs):
self.charsToEmit = charsToEmit
self.emissionProbs = emissionProbs
self.transitionProbs = transitionProbs
def getEmissionIndex(self):
aRand = random.random()
cumulative = 0
index =0
for val ... | gpl-2.0 | 38,707,374,708,130,250 | 25.561905 | 81 | 0.630615 | false | 2.817916 | false | false | false |
salazardetroya/libmesh | doc/statistics/libmesh_citations.py | 1 | 2340 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Number of "papers using libmesh" by year.
#
# Note 1: this does not count citations "only," the authors must have actually
# used libmesh in part of their work. Therefore, these counts do not include
# things like Wolfgang citing us in his pap... | lgpl-2.1 | 302,535,557,434,097,100 | 26.529412 | 78 | 0.674359 | false | 2.962025 | false | false | false |
Strangemother/python-state-machine | scratch/machine_4/integration.py | 1 | 4183 | from tools import color_print as cl
class ConditionIntegrate(object):
def read_node(self, node):
'''
Read the conditions of a node.
'''
if hasattr(node, 'conditions') is False:
return
cnds = node.conditions()
# cl('yellow', 'get conditions for node', no... | mit | -4,974,785,414,804,036,000 | 31.176923 | 65 | 0.537413 | false | 4.061165 | false | false | false |
caio1982/capomastro | jenkins/utils.py | 1 | 4525 | from urlparse import urljoin
import xml.etree.ElementTree as ET
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.utils import timezone
from django.utils.text import slugify
PARAMETERS = ".//properties/hudson.model.ParametersDefini... | mit | 3,326,860,643,878,144,500 | 29.993151 | 92 | 0.671381 | false | 4.170507 | false | false | false |
koomik/CouchPotatoServer | couchpotato/core/plugins/log/main.py | 1 | 4216 | import os
import traceback
from couchpotato.api import addApiView
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
log = CPLog... | gpl-3.0 | -6,851,123,021,384,806,000 | 26.376623 | 110 | 0.463947 | false | 4.026743 | false | false | false |
WilsonWangTHU/neural_graph_evolution | graph_util/structure_mapper.py | 1 | 7819 | #!/usr/bin/env python2
# -----------------------------------------------------------------------------
# @author:
# Tingwu Wang, Jun 23rd, 2017
# -----------------------------------------------------------------------------
import init_path
from util import logger
from . import mujoco_parser
import numpy as n... | mit | 7,428,175,684,621,202,000 | 40.152632 | 79 | 0.553012 | false | 3.399565 | false | false | false |
vitordeatorreao/amproj | amproj/datasets/dataset.py | 1 | 3520 | """Base class for a memory representation of any dataset"""
class Dataset:
"""Represents a dataset read to memory"""
def __init__(self, feature_names=[]):
"""Initializes a new instance of Dataset
Parameters
----------
feature_names : list<str>, optional
List of na... | gpl-2.0 | 126,932,584,548,431,800 | 34.555556 | 79 | 0.511932 | false | 4.637681 | false | false | false |
lmorchard/badger | apps/socialconnect/views.py | 1 | 12314 | import urllib, urllib2
import cgi
import os
from django.conf import settings
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
... | bsd-3-clause | 6,301,588,463,236,984,000 | 36.889231 | 87 | 0.598993 | false | 4.369766 | false | false | false |
napalm-automation/napalm | test/ios/TestIOSDriver.py | 1 | 6582 | # Copyright 2015 Spotify AB. All rights reserved.
#
# The contents of this file are 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 requi... | apache-2.0 | -1,167,232,957,800,592,000 | 32.753846 | 91 | 0.614707 | false | 3.94841 | true | false | false |
emulbreh/vacuous | vacuous/backends/dulwich/tasks.py | 1 | 1530 | from StringIO import StringIO
from celery.task import Task
from celery.task.sets import TaskSet, subtask
from dulwich.protocol import ReceivableProtocol
from dulwich.server import ReceivePackHandler
from vacuous.backends import load_backend
from vacuous.backends.dulwich.utils import WebBackend
from vacuous.tasks imp... | mit | -4,407,668,046,472,185,000 | 33.772727 | 113 | 0.640523 | false | 3.963731 | false | false | false |
hashimmm/iiifoo | testutils/manifest_validator.py | 1 | 3963 | from testutils.presentation_api.implementations.manifest_factory.loader import \
ManifestReader
from iiifoo_utils import image_id_from_canvas_id
def validate(manifestjson, logger=None):
"""Validate a given manifest json object."""
mr = ManifestReader(manifestjson)
try:
r = mr.read()
js... | mit | 5,603,357,598,368,924,000 | 40.715789 | 80 | 0.607368 | false | 3.966967 | false | false | false |
radicalbit/ambari | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py | 1 | 23158 | #!/usr/bin/env python
"""
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");... | apache-2.0 | -4,470,074,220,140,164,000 | 42.205224 | 147 | 0.630883 | false | 3.822083 | true | false | false |
seanchen/taiga-back | taiga/users/serializers.py | 1 | 5786 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.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 F... | agpl-3.0 | 3,606,832,449,048,560,600 | 37.56 | 103 | 0.639523 | false | 4.182213 | false | false | false |
FireBladeNooT/Medusa_1_6 | medusa/notifiers/plex.py | 1 | 10632 | # coding=utf-8
# Author: Dustyn Gibson <miigotu@gmail.com>
#
# This file is part of Medusa.
#
# Medusa 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) a... | gpl-3.0 | 4,151,996,194,805,680,000 | 42.219512 | 178 | 0.586155 | false | 4.125728 | false | false | false |
QualiSystems/shellfoundry | shellfoundry/commands/extend_command.py | 1 | 6915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import shutil
import click
from shellfoundry.exceptions import VersionRequestException
from shellfoundry.utilities.config_reader import CloudShellConfigReader, Configuration
from shellfoundry.utilities.constants import (
METADATA_AUTHOR_FIELD,
TEM... | apache-2.0 | 2,709,334,728,992,063,500 | 36.994505 | 88 | 0.635141 | false | 4.231946 | true | false | false |
rougier/dana | examples/oja.py | 1 | 3086 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright INRIA
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
#
# DANA is a computing framework for the simulation of distributed,
# asynchronous, numerical and adaptive models... | bsd-3-clause | -3,846,490,947,212,068,000 | 44.382353 | 79 | 0.685677 | false | 3.510808 | false | false | false |
ideascube/pibox-installer | kiwix-hotspot/backend/util.py | 1 | 15466 | # -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
import os
import re
import sys
import time
import shlex
import signal
import ctypes
import tempfile
import threading
import subprocess
import data
from util import CLILogger
# windows-only flags to prevent sleep on executing thread
WINDOWS_SLEEP_FLAGS = {
... | gpl-3.0 | 3,680,295,156,000,532,500 | 32.764192 | 88 | 0.563696 | false | 4.003106 | false | false | false |
Brett777/Predict-Churn | model_management/datascience_framework.py | 1 | 8515 | import os
import io
import sys
import dill
import copy
from datetime import datetime
from .evaluator import Evaluator
from .utils import (
post_to_platform,
get_current_notebook,
strip_output,
get_current_notebook,
mkdir_p,
)
class DataScienceFramework(object):
def __init__(
self,
... | mit | -343,225,543,429,373,700 | 34.92827 | 91 | 0.376864 | false | 6.416729 | true | false | false |
SebWouters/CheMPS2 | PyCheMPS2/tests/test12.py | 1 | 3497 | #
# CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
# Copyright (C) 2013-2018 Sebastian Wouters
#
# 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 ... | gpl-2.0 | -2,050,985,702,913,222,700 | 35.427083 | 103 | 0.635402 | false | 3.070237 | false | false | false |
jinjiaho/project57 | forms.py | 1 | 3372 | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, SelectField, BooleanField,DecimalField
from wtforms.validators import DataRequired, Email, Length
from flaskext.mysql import ... | mit | 4,052,969,891,147,546,600 | 49.328358 | 211 | 0.733393 | false | 3.844926 | false | false | false |
kristohr/pybayenv2 | pybayenv/compute_average_bf.py | 1 | 4066 | #!/usr/bin/python
import sys, string, re, os, commands, time, math
#from scipy import stats
#import scipy as sp
import numpy as np
#import matplotlib as mpl
#from matplotlib import pyplot as plt
class SNP:
def __init__(self, name, num_env, t):
self.name = name
self.num_env = [F... | bsd-3-clause | 8,263,703,149,634,889,000 | 23.792683 | 70 | 0.512789 | false | 3.118098 | false | false | false |
thenakliman/nirikshak | nirikshak/post_task/console.py | 1 | 2103 | # Copyright 2017 <thenakliman@gmail.com>
#
# 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... | apache-2.0 | 6,413,825,219,913,676,000 | 39.442308 | 78 | 0.622444 | false | 3.809783 | false | false | false |
matematik7/STM | tests/test_parser.py | 1 | 6119 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------
# tests/test_parser.py
#
# Test input arguments parser
# ----------------------------------------------------------------
# copyright (c) 2015 - Domen Ipavec
# Distributed under The MIT License, see LICENS... | mit | -2,415,367,671,543,004,000 | 37.484277 | 99 | 0.594868 | false | 3.919923 | true | false | false |
ciudadanointeligente/write-it | nuntium/user_section/views.py | 1 | 24845 | import requests
from django.contrib.auth.decorators import login_required
from subdomains.utils import reverse
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView, CreateView, Det... | gpl-3.0 | 4,677,099,118,318,445,000 | 36.417169 | 137 | 0.692413 | false | 4.002739 | false | false | false |
cinepost/Copperfield_FX | copper/shout/drivers/refined.py | 1 | 2799 | #!/usr/bin/env python
#
# This program shows how to write data to mplay by writing data to the
# imdisplay program using a pipe.
#
# This program uses the -k option on imdisplay to perform progressive
# refinement when rendering an image. The image is quite simple.
#
# Notes:
# This uses the simple format (... | unlicense | -7,526,381,331,422,434,000 | 30.1 | 80 | 0.554484 | false | 3.089404 | false | false | false |
corpnewt/CorpBot.py | Cogs/BotAdmin.py | 1 | 12950 | import asyncio, discord, re, random
from operator import itemgetter
from discord.ext import commands
from Cogs import Utils, DisplayName, Message, PickList
def setup(bot):
# Add the bot and deps
settings = bot.get_cog("Settings")
bot.add_cog(BotAdmin(bot, settings))
class BotAdmin(commands.Cog):
... | mit | 2,491,016,822,418,353,700 | 43.759717 | 200 | 0.669035 | false | 3.229426 | false | false | false |
proyectosdeley/proyectos_de_ley | migrate_db.py | 1 | 2327 | import dataset
import datetime
import os
import unicodedata
def convert_name_to_slug(name):
"""Takes a congresista name and returns its slug."""
name = name.replace(",", "").lower()
name = name.split(" ")
if len(name) > 2:
i = 0
slug = ""
while i < 3:
slug += name[... | mit | -3,755,114,459,877,640,000 | 25.443182 | 78 | 0.568973 | false | 3.236439 | false | false | false |
ubports-weblate/gallery-app | tests/autopilot/gallery_app/emulators/photo_viewer.py | 1 | 9588 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012-2015 Canonical
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
import logging
from auto... | gpl-3.0 | -9,074,009,003,350,327,000 | 37.66129 | 79 | 0.61577 | false | 4.074798 | false | false | false |
emonty/ansible-container | ansible_container/shipit/modules/k8s_deployment.py | 1 | 9208 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible 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 la... | lgpl-3.0 | 7,921,536,518,088,795,000 | 33.74717 | 131 | 0.535947 | false | 4.474247 | false | false | false |
smurfix/DaBroker | dabroker/client/codec.py | 1 | 10644 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of DaBroker, a distributed data access manager.
##
## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>,
## it is licensed under the GPLv3. See the file `README.rst` fo... | gpl-3.0 | -5,950,866,018,713,775,000 | 25.984772 | 140 | 0.659142 | false | 2.935395 | false | false | false |
tongfa/vent | wserve/wserve/views.py | 1 | 1406 | from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
from wserve.settings import VENT_WD, VENT_WWW_CLIENT_EP
import cPickle as pickle
import json, time, os
def address2key(address):
r = 0
for s in address[0].split('.'):
r = r << 8
... | mit | 2,273,925,697,469,779,000 | 28.914894 | 83 | 0.604552 | false | 3.437653 | false | false | false |
herqles-io/hq-manager | src/hqmanager/api/user.py | 1 | 5040 | import cherrypy
class UserAPIController(object):
exposed = True
def __init__(self, identity, assignment):
self.identity = identity
self.assignment = assignment
def index(self):
return "User api Index"
@cherrypy.tools.json_out()
@cherrypy.tools.json_in()
@cherrypy.to... | mit | 5,361,003,477,038,764,000 | 34.244755 | 106 | 0.644444 | false | 4.315068 | false | false | false |
davidgardenier/frbpoppy | tests/dm_snr/future.py | 1 | 6523 | """Check the log N log F slope for future surveys."""
import numpy as np
import matplotlib.pyplot as plt
from copy import copy
from frbpoppy import CosmicPopulation, Survey, LargePopulation, SurveyPopulation, hist
from frbpoppy import unpickle, pprint
import frbpoppy.direction_dists as did
import frbpoppy.galacticops ... | mit | 1,674,763,514,524,134,700 | 28.251121 | 86 | 0.555879 | false | 3.08708 | false | false | false |
i02sopop/Kirinki | gstreamer/examples/video_receiver.py | 1 | 2317 | #!/usr/bin/env python
# -=- encoding: utf-8 -=-
################ VIDEO RECEIVER
import gobject, pygst
pygst.require("0.10")
import gst
# TODO: detect from the RTPSource element inside the GstRtpBin
REMOTE_HOST = '192.168.34.150'
READ_VIDEO_CAPS = 'video.caps'
pipeline = gst.Pipeline('server')
caps = open(READ_VIDE... | agpl-3.0 | -9,069,301,017,670,709,000 | 33.073529 | 67 | 0.70738 | false | 2.565891 | false | false | false |
cloudysunny14/CloudySwitch | cloudyswitch/app/psyco_eventlet.py | 1 | 2308 | """A wait callback to allow psycopg2 cooperation with eventlet.
Use `make_psycopg_green()` to enable eventlet support in Psycopg.
"""
# Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a co... | apache-2.0 | -6,447,168,683,168,695,000 | 42.54717 | 79 | 0.717938 | false | 4.204007 | false | false | false |
tu-rbo/differentiable-particle-filters | methods/dpf_kitti.py | 1 | 43029 | import os
import numpy as np
import sonnet as snt
import tensorflow as tf
import matplotlib.pyplot as plt
from utils.data_utils_kitti import wrap_angle, compute_statistics, split_data, make_batch_iterator, make_repeating_batch_iterator, rotation_matrix, load_data_for_stats
from utils.method_utils import atan2, compute... | mit | 6,549,029,999,007,857,000 | 50.16409 | 255 | 0.560738 | false | 3.742303 | false | false | false |
westurner/pyglobalgoals | notebooks/globalgoals-pyglobalgoals.py.py | 1 | 16352 |
# coding: utf-8
# # @TheGlobalGoals for Sustainable Development
# ## Background
#
# * Homepage: **http://www.globalgoals.org/**
# - Twitter: https://twitter.com/TheGlobalGoals
# - Instagram: https://instagram.com/TheGlobalGoals/
# - Facebook: https://www.facebook.com/globalgoals.org
# - YouTube: https://www.youtube... | bsd-3-clause | -4,042,131,204,744,934,400 | 24.630094 | 120 | 0.635763 | false | 2.940478 | false | false | false |
GoogleCloudPlatform/healthcare-deid | setup.py | 1 | 1364 | """Setup module for the healthcare_deid DLP pipeline.
All of the code necessary to run the pipeline is packaged into a source
distribution that is uploaded to the --staging_location specified on the command
line. The source distribution is then installed on the workers before they
start running.
When remotely execut... | apache-2.0 | 6,858,331,243,784,327,000 | 32.268293 | 80 | 0.737537 | false | 3.598945 | false | false | false |
SethGreylyn/gwells | gwells/migrations/0009_auto_20170711_1600_squashed_0010_auto_20170713_0917.py | 1 | 20389 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-13 17:57
from __future__ import unicode_literals
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('gwells', '0009... | apache-2.0 | -280,287,383,028,197,200 | 34.45913 | 186 | 0.548286 | false | 4.581798 | false | false | false |
dsparrow27/zoocore | zoo/libs/command/commandui.py | 1 | 2760 | from functools import partial
from qt import QtWidgets, QtGui, QtCore
from zoo.libs import iconlib
from zoo.libs.utils import zlogging
logger = zlogging.getLogger(__name__)
class CommandActionBase(QtCore.QObject):
"""CommandUi class deals with encapsulating a command as a widget
"""
triggered = QtCore.S... | gpl-3.0 | -7,807,650,875,466,042,000 | 33.5 | 107 | 0.598913 | false | 4.119403 | false | false | false |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons/io_blend_utils/bl_utils/subprocess_helper.py | 1 | 5646 | # ##### 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 program is distrib... | gpl-3.0 | -5,265,626,018,868,350,000 | 28.873016 | 97 | 0.553135 | false | 4.491647 | false | false | false |
tetra5/radiance | ui/widgets/verticallabel.py | 1 | 1370 | # -*- coding: utf-8 -*-
"""
Created on 28.01.2011
@author: vda
"""
from PyQt4 import QtCore, QtGui
class VerticalLabel(QtGui.QWidget):
def __init__(self, text, parent=None):
QtGui.QLabel.__init__(self, parent)
self.text = text
fm = QtGui.QApplication.fontMetrics()
se... | mit | 5,865,820,515,146,894,000 | 26.42 | 72 | 0.586861 | false | 3.586387 | false | false | false |
supermaik/selbot | Quote_Command.py | 1 | 1175 | from Quotes import Quote
from Command import Command
class Quote_Command(Command):
def __init__(self, config):
self.connection = config['connection']
self.event = config['event']
self.channel = config['channel']
pass
def resolve(self):
args = self.event.arguments[0].sp... | unlicense | 5,750,818,820,420,012,000 | 34.606061 | 97 | 0.556596 | false | 4.450758 | false | false | false |
ojengwa/Bookie | bookie/tests/factory.py | 1 | 2651 | """Provide tools for generating objects for testing purposes."""
from datetime import datetime
from random import randint
import random
import string
from bookie.models import DBSession
from bookie.models import Bmark
from bookie.models import Tag
from bookie.models.applog import AppLog
from bookie.models.auth import ... | agpl-3.0 | 812,322,954,075,319,000 | 23.775701 | 77 | 0.632214 | false | 3.875731 | false | false | false |
Jasonmk47/OpenWPM | automation/Proxy/mitm_commands.py | 1 | 4714 | # This module parses MITM Proxy requests/responses into (command, data pairs)
# This should mean that the MITMProxy code should simply pass the messages + its own data to this module
from urlparse import urlparse
import datetime
import mmh3
import json
import zlib
import os
def encode_to_unicode(msg):
"""
Tri... | gpl-3.0 | 2,147,477,469,874,632,200 | 39.637931 | 163 | 0.627068 | false | 3.823195 | false | false | false |
Sharecare/cyclops | app/httpreq.py | 1 | 4917 | import urllib
import urllib2
import urlparse
import socket
import time
import json
import sys
import logging
logger = logging.getLogger(__name__)
import pprint
pp = pprint.PrettyPrinter(indent=4)
# we need to make sure we don't follow redirects so build a new opener
class NoRedirection(urllib2.HTTPErrorProcessor):
... | apache-2.0 | -4,183,367,405,335,792,600 | 28.620482 | 142 | 0.580232 | false | 3.847418 | false | false | false |
jiaphuan/models | research/astronet/astronet/astro_model/astro_model.py | 1 | 10261 | # Copyright 2018 The TensorFlow 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 ... | apache-2.0 | 8,468,219,150,089,580,000 | 32.753289 | 80 | 0.645941 | false | 4.169443 | false | false | false |
pawelmhm/splash | splash/network_manager.py | 1 | 17016 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import base64
import itertools
import functools
from datetime import datetime
import traceback
from PyQt5.QtCore import QByteArray, QTimer
from PyQt5.QtNetwork import (
QNetworkAccessManager,
QNetworkProxyQuery,
QNetworkRequest,
QNetworkRe... | bsd-3-clause | 1,547,243,669,720,539,400 | 37.497738 | 104 | 0.622297 | false | 4.146199 | false | false | false |
mefly2012/platform | src/clean_validate/zyktgg.py | 1 | 1453 | # -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from common import public
class zyktgg():
"""开庭公告"""
need_check_ziduan = ['main',
'city',
'bbd_dotime',
'title'
]
def check_... | apache-2.0 | 8,685,627,748,616,619,000 | 23.636364 | 59 | 0.451661 | false | 3.188235 | false | false | false |
libvirt/libvirt-test-API | libvirttestapi/repos/domain/save.py | 1 | 2922 | # Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
# Save domain as a statefile
import os
import libvirt
from libvirt import libvirtError
from libvirttestapi.src import sharedmod
from libvirttestapi.utils import utils
required_params = ('guestname', 'filepath',)
optional_p... | gpl-2.0 | -1,875,613,081,637,927,700 | 26.055556 | 67 | 0.629363 | false | 3.824607 | false | false | false |
noelevans/sandpit | fivethiryeight/riddler_casino.py | 1 | 1180 | """
Suppose a casino invents a new game that you must pay $250 to play. The game
works like this: The casino draws random numbers between 0 and 1, from a
uniform distribution. It adds them together until their sum is greater than 1,
at which time it stops drawing new numbers. You get a payout of $100 each time
a new nu... | mit | -3,011,533,244,456,876,500 | 27.780488 | 78 | 0.677119 | false | 3.323944 | false | false | false |
sunlightlabs/sarahs_inbox | mail/views.py | 1 | 8502 | from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.core.paginator import Paginator
from django.http import HttpResponse, HttpResponseRedirect
from urllib import unquote
from haystack.query import SearchQuerySet
from mail.models import *
from django.... | bsd-3-clause | 8,381,273,969,921,054,000 | 32.738095 | 159 | 0.631498 | false | 3.683709 | false | false | false |
nbeck90/city-swap | cityswap/requests/migrations/0001_initial.py | 1 | 1445 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-11 16:52
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial... | mit | 4,474,503,118,401,711,600 | 44.15625 | 163 | 0.624913 | false | 3.96978 | false | false | false |
ingmarlehmann/franca-tools | franca_parser/franca_parser/franca_ast.py | 1 | 15547 | #------------------------------------------------------------------------------
# franca_parser: franca_ast.py
#
# AST node classes: AST node classes for Franca IDL (*.fidl).
# Builds an AST to be used in other tools.
#
# This code is *heavlily* inspired by 'pycparser' by Eli Bendersky
# (https://gi... | mpl-2.0 | 2,878,004,356,479,588,400 | 29.247082 | 118 | 0.589631 | false | 4.06139 | false | false | false |
nuobit/odoo-addons | connector_oxigesti/components_custom/binder.py | 1 | 8847 | # -*- coding: utf-8 -*-
# Copyright 2013-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
"""
Binders
=======
Binders are components that know how to find the external ID for an
Odoo ID, how to find the Odoo ID for an external ID and how to
create the binding between them.
"""
i... | agpl-3.0 | 2,360,778,247,693,015,600 | 38.851351 | 106 | 0.58144 | false | 4.523006 | false | false | false |
helfertool/helfertool | src/registration/models/shift.py | 1 | 7529 | from django.core.validators import MinValueValidator
from django.db import models
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from django.template.defaultfilters import date as date_f
from django.utils.timezone import localtime
from django.utils.translation import ugettext_lazy ... | agpl-3.0 | -1,135,561,369,318,406,400 | 31.175214 | 113 | 0.594501 | false | 4.045674 | false | false | false |
mpapierski/hb_balancer | protocol.py | 1 | 6557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# hb_balancer
# High performance load balancer between Helbreath World Servers.
#
# Copyright (C) 2012 Michał Papierski <michal@papierski.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 | -1,380,034,530,598,753,500 | 28.399103 | 98 | 0.675412 | false | 3.133843 | false | false | false |
sameersingh/bibere | scripts/first_pages.py | 1 | 1750 | #!/usr/bin/python3
import argparse
from read_json import *
import tempfile
import shutil
import pypdftk
import os
def get_pdf(source, dest):
shutil.copy(source, dest)
def run(idir, bdir, ofile):
authors, venues, papers = read_all_info(idir)
fpdf_names = []
tmpdirname = tempfile.mkdtemp... | bsd-2-clause | -2,552,111,543,381,166,600 | 36.888889 | 118 | 0.564 | false | 3.535354 | false | false | false |
openstack/yaql | yaql/language/contexts.py | 1 | 9928 | # Copyright (c) 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 | 7,695,287,142,699,506,000 | 32.427609 | 79 | 0.599919 | false | 4.192568 | false | false | false |
ActiveState/code | recipes/Python/59867_crossplatform_import_hook_endofline/recipe-59867.py | 1 | 1504 | # Import hook for end-of-line conversion,
# by David Goodger (dgoodger@bigfoot.com).
# Put in your sitecustomize.py, anywhere on sys.path, and you'll be able to
# import Python modules with any of Unix, Mac, or Windows line endings.
import ihooks, imp, py_compile
class MyHooks(ihooks.Hooks):
def load_source(sel... | mit | 6,434,838,695,669,646,000 | 35.682927 | 75 | 0.588431 | false | 3.978836 | false | false | false |
RTHMaK/RPGOne | deep_qa-master/deep_qa/layers/recurrence_modes.py | 1 | 1184 | from typing import Any, Dict
from collections import OrderedDict
from keras import backend as K
class FixedRecurrence:
'''
This recurrence class simply performs a fixed number of memory network steps and
returns the memory representation and representation of the background knowledge
generated by the... | apache-2.0 | 6,218,812,813,095,521,000 | 39.827586 | 101 | 0.723818 | false | 4.274368 | false | false | false |
disler/Kontact | App/Server.py | 1 | 3547 | from flask import Flask, render_template, current_app, Response, request
from server.DBInterface import DBInterface
from server.Validator import Validator
from server.WebUtil import WebUtil
import json
import ast
app = Flask(__name__)
#load database interface
db = DBInterface()
#load validator
validator = Validator.... | mit | -8,879,114,534,368,940,000 | 24.702899 | 79 | 0.643079 | false | 3.809882 | false | false | false |
arenadata/ambari | ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py | 1 | 7000 | #!/usr/bin/env python
'''
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")... | apache-2.0 | 1,205,591,747,481,414,000 | 53.6875 | 291 | 0.59 | false | 3.721425 | true | false | false |
frew/simpleproto | scons-local-1.1.0/SCons/Scanner/C.py | 1 | 4739 | """SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... | bsd-2-clause | -3,936,452,968,050,813,000 | 36.611111 | 94 | 0.638109 | false | 4.053892 | false | false | false |
uclouvain/osis_louvain | base/models/learning_unit_year.py | 1 | 24536 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 | -1,512,369,831,425,935,600 | 43.853748 | 120 | 0.663746 | false | 3.836591 | false | false | false |
openworm/Blender2NeuroML | src/Entity/Entity.py | 1 | 21651 | '''
Created on 03.06.2011
@author: Sergey Khayrulin
'''
from __future__ import absolute_import
from Entity.Vertex import Vertex
from Entity.Face import Face
from Entity.Slice import Slice, AlternateSlice
from Entity.Helper import *
import pprint
import math
class Entity(object):
'''
Main Clas... | mit | -6,809,170,652,540,044,000 | 47.095238 | 160 | 0.549813 | false | 4.067443 | false | false | false |
cansik/pyunicon | pyunicon/Cocoa/CocoaMouse.py | 1 | 2057 | from Quartz.CoreGraphics import CGEventCreateMouseEvent
from Quartz.CoreGraphics import CGEventPost
from Quartz.CoreGraphics import kCGEventMouseMoved
from Quartz.CoreGraphics import kCGEventLeftMouseDown
from Quartz.CoreGraphics import kCGEventLeftMouseUp
from Quartz.CoreGraphics import kCGEventRightMouseDown
from Qua... | mit | 2,062,059,134,703,579,100 | 37.092593 | 85 | 0.712202 | false | 3.528302 | false | false | false |
AhmedHani/Neural-Networks-for-ML | Implementations/simple_word2vec/cbow.py | 1 | 2983 | import tensorflow as tf
class CBOW(object):
def __init__(self, args):
self.__args = args
self.__ngram_size = args.ngram_size
self.__input_size = self.__ngram_size - 1
self.__vocab_size = args.vocab_size + 1
self.__embedding_dim = args.embedding_dim
self.__learning_r... | gpl-3.0 | -121,940,656,376,534,380 | 49.576271 | 166 | 0.612471 | false | 3.719451 | false | false | false |
alexsiri7/RoboScrum | stories/views.py | 1 | 2140 | from django.shortcuts import render_to_response, get_object_or_404
from django.template import Context, loader
from stories.models import Story, Sprint
from django.http import HttpResponse
from django.views.generic import DetailView, ListView
class SprintView(DetailView):
days = ["", "","Mon", "", "", "", "Tue", "... | gpl-3.0 | 218,280,061,264,985,020 | 43.583333 | 171 | 0.659346 | false | 3.065903 | false | false | false |
Knio/dominate | dominate/dom_tag.py | 1 | 12996 | __license__ = '''
This file is part of Dominate.
Dominate 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) any later version.
Dominate is distributed in... | lgpl-3.0 | -2,593,975,155,927,345,700 | 25.740741 | 85 | 0.6255 | false | 3.903875 | false | false | false |
openmicroscopy/omero-marshal | omero_marshal/encode/encoders/mask.py | 1 | 1127 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Glencoe Software, Inc. All rights reserved.
#
# This software is distributed under the terms described by the LICENCE file
# you can find at the root of the distribution bundle.
# If the file is missing please request a copy by contacting
# jason@glen... | gpl-2.0 | 9,218,345,415,002,380,000 | 27.897436 | 76 | 0.692103 | false | 3.096154 | false | false | false |
jseabold/statsmodels | statsmodels/tsa/vector_ar/output.py | 5 | 6945 | from statsmodels.compat.python import lzip
from io import StringIO
import numpy as np
from statsmodels.iolib import SimpleTable
mat = np.array
_default_table_fmt = dict(
empty_cell = '',
colsep=' ',
row_pre = '',
row_post = '',
table_dec_above='=',
table_dec_below='=',
header_dec_below... | bsd-3-clause | -7,572,108,318,767,246,000 | 27.004032 | 79 | 0.500216 | false | 3.495219 | false | false | false |
stefanklug/django-lazysignup | lazysignup/migrations/0001_initial.py | 1 | 4128 | # flake8: noqa
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'LazyUser'
db.create_table('lazysignup_lazyuser', (
('id', self.... | bsd-3-clause | 1,776,426,415,339,057,000 | 57.971429 | 182 | 0.556928 | false | 3.749319 | false | false | false |
dmccloskey/ddt_python | ddt_python/ddt_container_biPlotAndValidation.py | 1 | 20231 | from .ddt_container import ddt_container
from .ddt_tile import ddt_tile
from .ddt_tile_html import ddt_tile_html
class ddt_container_biPlotAndValidation(ddt_container):
def make_biPlotAndValidation(self,
data1,data2,
data1_keys,data1_nestkeys,data1_keymap,
data2_keys,data2_nestkeys,data2_ke... | mit | -6,382,075,242,696,304,000 | 32.329489 | 82 | 0.497059 | false | 4.068168 | false | false | false |
nuncjo/Delver | examples.py | 1 | 6037 | # -*- coding:utf-8 -*-
import os
import psycopg2
from pprint import pprint
from delver import Crawler
def scraping_movies_table():
c = Crawler()
c.logging = True
c.useragent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
c.open("http://www.boxofficemojo.com/daily/")
... | mit | 3,424,693,276,046,666,000 | 31.283422 | 92 | 0.558556 | false | 3.712792 | false | false | false |
beeftornado/sentry | src/sentry/stacktraces/processing.py | 1 | 20204 | from __future__ import absolute_import
import six
import logging
from datetime import datetime
from django.utils import timezone
from collections import namedtuple, OrderedDict
import sentry_sdk
from sentry.models import Project, Release
from sentry.utils.cache import cache
from sentry.utils.hashlib import hash_val... | bsd-3-clause | 501,741,680,478,238,800 | 34.076389 | 100 | 0.620719 | false | 4.307889 | false | false | false |
MTLeeLab/RESA | resa_util.py | 1 | 10051 | ###
# Copyright 2016 Miler T. Lee, University of Pittburgh
# This file is part of the RESA Suite
#
# RESA Suite 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 op... | gpl-3.0 | 4,324,001,643,226,316,000 | 26.3125 | 749 | 0.553477 | false | 3.373951 | false | false | false |
openstack/sahara-dashboard | sahara_dashboard/content/data_processing/clusters/cluster_templates/views.py | 1 | 7433 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 | 4,539,590,981,925,018,600 | 40.066298 | 77 | 0.675636 | false | 4.324026 | true | false | false |
caterinaurban/Lyra | src/lyra/tests/code_jam/pancake_flipper/pancakes_fyodr.py | 1 | 1842 | def pow(a: int, b: int) -> int:
power: int = 1
for i in range(b):
power = power * a
return power
def check(memos: Dict[(Tuple[(int, int, int, int)], int)], i: int, s: int, c: int, k: int) -> int:
if (s == 0):
return 0
elif ((i, s, c, k) not in memos):
memos[(i, s, c, k)]: in... | mpl-2.0 | -7,948,510,953,474,577,000 | 28.709677 | 98 | 0.410966 | false | 3.080268 | false | false | false |
RedHatInsights/insights-core | insights/parsers/corosync_cmapctl.py | 1 | 2063 | """
CorosyncCmapctl - Command ``corosync-cmapctl [params]``
=======================================================
This module parses the output of the ``corosync-cmapctl [params]`` command.
"""
from insights import parser, CommandParser
from insights.parsers import SkipException, ParseException
from insights.specs ... | apache-2.0 | 1,929,703,601,921,233,200 | 36.509091 | 108 | 0.644207 | false | 3.848881 | true | false | false |
ksteinfe/decodes | src/decodes/core/dc_interval.py | 1 | 10356 | from decodes.core import *
import math, random
class Interval(object):
"""
an interval class
"""
def __init__(self, a=0,b=1):
""" Interval Constructor.
:param a: First number of the interval.
:type a: float
:param b: Second number of the interval.
... | gpl-3.0 | 6,334,377,875,742,004,000 | 31.772152 | 197 | 0.539784 | false | 4.367777 | false | false | false |
bnbowman/BifoAlgo | src/Chapter2/Sec24_LeaderCycleSeq.py | 1 | 3081 | #! /usr/bin/env python3
from collections import Counter
from operator import itemgetter
def cyclo_seq( spectrum_file, spectrum_table_file ):
N, spectrum = parse_spectrum_file( spectrum_file )
spectrum_table = parse_spectrum_table( spectrum_table_file )
aa_weights = set(spectrum_table.values())
peptides = list(fin... | gpl-2.0 | -5,203,654,426,318,608,000 | 29.81 | 72 | 0.674132 | false | 2.702632 | false | false | false |
taigaio/taiga-back | taiga/projects/attachments/permissions.py | 1 | 5169 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... | agpl-3.0 | -7,189,436,673,565,517,000 | 52.28866 | 119 | 0.734185 | false | 4.05094 | false | false | false |
cysuncn/python | spark/crm/PROC_O_LNA_XDXT_CUSTOMER_RELATIVE.py | 1 | 5008 | #coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_O_LNA_XDXT_CUSTOMER_RELATIVE').setMaster(sys.argv[2])
sc = SparkContext(conf ... | gpl-3.0 | 2,939,206,429,795,156,000 | 41.551724 | 179 | 0.545989 | false | 2.891623 | false | true | false |
saffsd/updatedir | src/updatedir/__init__.py | 1 | 4396 | import logging
import os
import urlparse
logger = logging.getLogger(__name__)
def updatetree(source, dest, overwrite=False):
parsed_url = urlparse.urlparse(dest)
logger.debug(parsed_url)
if parsed_url.scheme == '':
import shutil
if overwrite and os.path.exists(parsed_url.path):
logger.debug("Delet... | gpl-3.0 | -6,502,143,634,632,490,000 | 33.077519 | 88 | 0.605778 | false | 3.725424 | false | false | false |
jelly/calibre | src/calibre/gui2/actions/show_quickview.py | 2 | 7899 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QAction
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.dialogs.quickview import... | gpl-3.0 | -8,621,730,550,062,112,000 | 37.531707 | 96 | 0.620965 | false | 3.979345 | false | false | false |
kantai/passe-framework-prototype | django/http/__init__.py | 1 | 31597 | import datetime
import os
import re
import time
from pprint import pformat
from urllib import urlencode, quote
from urlparse import urljoin
#try:
# from StringIO import StringIO
#except ImportError:
from StringIO import StringIO
from copy import deepcopy
try:
# The mod_python version is more efficient, so try i... | bsd-3-clause | 649,093,225,685,276,500 | 36.705251 | 134 | 0.576352 | false | 4.209566 | false | false | false |
rchav/vinerack | saleor/userprofile/models.py | 2 | 5462 | from __future__ import unicode_literals
from django.contrib.auth.models import (
AbstractBaseUser, BaseUserManager, PermissionsMixin)
from django.db import models
from django.forms.models import model_to_dict
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from djang... | bsd-3-clause | -8,794,741,306,931,394,000 | 35.657718 | 77 | 0.631637 | false | 3.952243 | false | false | false |
lmazuel/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/file_info.py | 1 | 1684 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -8,983,340,538,904,316,000 | 39.095238 | 104 | 0.612827 | false | 4.17866 | false | false | false |
ScreamingUdder/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSBeamSpreaderTransmission.py | 1 | 13137 | #pylint: disable=no-init,invalid-name
from __future__ import (absolute_import, division, print_function)
import mantid.simpleapi as api
from mantid.api import *
from mantid.kernel import *
import os
from reduction_workflow.find_data import find_data
class SANSBeamSpreaderTransmission(PythonAlgorithm):
def categ... | gpl-3.0 | -2,155,445,629,212,738,800 | 49.722008 | 126 | 0.599528 | false | 4.792776 | false | false | false |
sebleier/python-redis | pyredis/hash.py | 1 | 2365 | from collections import defaultdict
class Hash(object):
def __init__(self):
self._data = defaultdict(int)
def hset(self, key, value):
"""
Set ``key`` to ``value`` within hash ``name``
Returns 1 if HSET created a new field, otherwise 0
"""
if key in self._data:... | bsd-3-clause | 7,353,101,178,696,724,000 | 26.183908 | 77 | 0.542072 | false | 4.063574 | false | false | false |
stepanovsh/project_template | {{cookiecutter.repo_name}}/config/settings/local.py | 1 | 2101 | # -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default... | bsd-3-clause | 1,962,637,750,829,820,200 | 30.358209 | 101 | 0.502142 | false | 4.235887 | false | false | false |
jmeppley/py-metagenomics | sample_records.py | 1 | 3684 | #!/usr/bin/env python
"""
This script takes any file that can be divided into records and
returns N randomly selected records
Records can be fasta, fastq, genbank, or something described by a
simple RegExp
"""
from os import path
from edl.util import *
from edl.batch import *
import re
import sys
import argparse
... | mit | -5,833,227,940,174,607,000 | 34.76699 | 79 | 0.602334 | false | 4.525799 | false | false | false |
Nichol4s/PyHead | tests/unreader.py | 1 | 1888 |
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# Classes that can undo reading data from
# a given type of data source.
class Unreader(object):
def __init__(self):
self.buf = StringIO()
def chunk(self):
raise NotImplementedError()... | mit | -3,738,559,382,780,167,700 | 24.863014 | 69 | 0.544492 | false | 4.068966 | false | false | false |
jzitelli/poolvr.py | poolvr/billboards.py | 1 | 4370 | import pkgutil
import os.path
from ctypes import c_void_p
import numpy as np
import OpenGL.GL as gl
import OpenGL.error
from .gl_rendering import Node, Technique, Material, Program, DTYPE_COMPONENT_TYPE, Texture
from .gl_primitives import PlanePrimitive
NULL_PTR = c_void_p(0)
# TODO: pkgutils way
TEXTURES_DIR = o... | mit | -6,383,165,777,984,583,000 | 50.411765 | 116 | 0.613501 | false | 3.933393 | false | false | false |
JioCloud/glance | glance/api/middleware/cache.py | 1 | 12967 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | -4,818,873,228,218,001,000 | 39.021605 | 78 | 0.61001 | false | 4.273896 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.