repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nimbis/django-central-message | central_message/south_migrations/0001_initial.py | 1 | 6941 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CentralMessage'
db.create_table(u'central_message_central... | bsd-3-clause | 7,461,150,924,728,953,000 | 69.121212 | 195 | 0.585362 | false | 3.703842 | false | false | false |
rootio/rootio_web | rootio/content/models.py | 1 | 9010 | import pytz, datetime
from coaster.sqlalchemy import BaseMixin
from sqlalchemy.sql import func
from sqlalchemy.ext.hybrid import hybrid_property
from ..extensions import db
from ..utils import STRING_LEN
import datetime
t_tracknetwork = db.Table(
u'content_tracknetwork',
db.Column(u'track_id', db.ForeignKey... | agpl-3.0 | -8,483,328,077,250,222,000 | 39.585586 | 107 | 0.696781 | false | 3.334567 | false | false | false |
pcamp/google-appengine-wx-launcher | launcher/addexisting_controller.py | 28 | 5297 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 | 2,448,839,151,527,251,000 | 30.909639 | 80 | 0.656976 | false | 4.02202 | false | false | false |
snicoper/snicoper.com | tests/unit/images.py | 1 | 1790 | import os
from django.core.files.uploadedfile import SimpleUploadedFile
from PIL import Image
from config.settings.test import MEDIA_ROOT
def simple_uploaded_file(image_path):
"""Crea una SimpleUploadedFile para campos de modelo
ImageField, FileField.
Args:
image_path (str): Path de la imagen ... | mit | -7,806,430,896,301,290,000 | 24.942029 | 79 | 0.621229 | false | 3.390152 | false | false | false |
charlesj/Apollo | database/versions/5da21d856a57_add_jobs.py | 1 | 1454 | """Add Jobs
Revision ID: 5da21d856a57
Revises: edd910853060
Create Date: 2017-07-30 16:43:35.839411
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5da21d856a57'
down_revision = 'edd910853060'
branch_labels = None
depends_on = None
def upgrade():
op.crea... | mit | 26,698,565,045,155,436 | 32.045455 | 81 | 0.656809 | false | 3.342529 | false | false | false |
synsun/robotframework | utest/running/test_userhandlers.py | 1 | 6437 | import unittest
from robot.errors import DataError
from robot.model import Keywords
from robot.running.userkeyword import (EmbeddedArgs, EmbeddedArgsTemplate,
UserKeywordHandler)
from robot.running.arguments import EmbeddedArguments, UserKeywordArgumentParser
from robot.utils.ass... | apache-2.0 | -8,467,912,947,278,760,000 | 36.424419 | 84 | 0.606494 | false | 3.69094 | true | false | false |
danche354/Sequence-Labeling | chunk/senna-hash-2-pos-d6-128-64.py | 1 | 6678 | from keras.models import Model
from keras.layers import Input, Masking, Dense, LSTM
from keras.layers import Dropout, TimeDistributed, Bidirectional, merge
from keras.layers.embeddings import Embedding
from keras.utils import np_utils
import numpy as np
import pandas as pd
import sys
import math
import os
from dateti... | mit | 4,881,834,216,791,345,000 | 33.963351 | 157 | 0.688829 | false | 3.08168 | false | false | false |
dtklein/vFense | tp/src/plugins/monit/utils.py | 1 | 8850 | import datetime
import time
import _db
from _db import Collection, Master
from vFense.db.client import r, db_create_close
AgentStatsKey = 'monit_stats'
AgentCollection = 'agents'
class MonitorKey():
Memory = u'memory'
FileSystem = u'file_system'
Cpu = u'cpu'
Timestamp = u'timestamp'
class Monit... | lgpl-3.0 | -7,869,110,874,207,492,000 | 20.585366 | 80 | 0.543277 | false | 4.260953 | false | false | false |
Zubieta/CPP | CodeSignal/Arcade/The_Core/Level_06_Labyrinth_Of_Nested_Loops/044_Is_Sum_Of_Consecutive_2.py | 3 | 1278 | # https://app.codesignal.com/arcade/code-arcade/labyrinth-of-nested-loops/EQSjA5PRfyHueeNkj
def isSumOfConsecutive2(n):
# Find the number of ways to express n as a sum of some (at least two)
# consecutive positive integers.
# e.g. isSumOfConsecutive2(9) == 2, 2+3+4==9, 4+5==9.
# count = 0
# for i i... | mit | -685,268,750,411,784,600 | 34.5 | 91 | 0.535211 | false | 3.363158 | false | false | false |
blacksph3re/alastair | cooking/helpers.py | 1 | 2487 | import csv, codecs
import math
from django.core.urlresolvers import resolve
from django.db.models import F, ExpressionWrapper, FloatField, IntegerField, CharField, Case, When, Sum, Func, Min, Q
from django.template.defaulttags import register
from .models import Project, Ingredient, Inventory_Item, MEASUREMENTS, Receip... | gpl-2.0 | -1,328,513,066,590,342,000 | 26.340659 | 117 | 0.702051 | false | 3.26378 | false | false | false |
emsrc/timbl-tools | test/test_client.py | 1 | 5050 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test TimblClient class
"""
import logging
import unittest
from tt.server import TimblServer
from tt.client import TimblClient, TimblClientError
from common import DATA_DIR
SERVER = None
def start_timbl_server():
global SERVER
options = "-f {0}/dimin.t... | gpl-3.0 | 3,136,496,633,895,326,000 | 29.065476 | 79 | 0.486931 | false | 4.418198 | true | false | false |
cp4/doubanInterface | src/doubanInterface.py | 2 | 5981 | # -*- coding: utf-8 -*-
import re
import urllib2
import time
import json
class bookIf:
def __init__(self, youth_booklist_url, author_booklist_url):
self.youth_booklist_url = youth_booklist_url
self.author_booklist_url = author_booklist_url
def get_group_booklist(self, group_id):
if gr... | mit | 942,565,085,847,429,100 | 41.721429 | 161 | 0.458452 | false | 4.077028 | false | false | false |
elationfoundation/git_hooks | pre-commit/utils/date_stamp.py | 1 | 1544 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import re
import subprocess
from datetime import datetime
def system(*args, **kwargs):
kwargs.setdefault('stdout', subprocess.PIPE)
proc = subprocess.Popen(args, **kwargs)
out, err = proc.communicate()
return out
def now():
"""... | gpl-2.0 | -1,175,021,152,180,080,600 | 31.851064 | 82 | 0.517487 | false | 3.446429 | false | false | false |
hightemp/cappMiniWebServer | temporary/encode.py | 1 | 1624 |
import base64
import os
from os.path import *
aDirectories = ['templates', 'assets']
sCurrentDir = os.path.dirname(os.path.abspath(__file__))
sTempDir = join(sCurrentDir, 'temporary')
def fnEcodeFilesInDir(in_sCurrentPath, in_sTempPath):
for sFileName in os.listdir(in_sCurrentPath):
sAbsolutePath = join(... | mit | 5,039,709,232,196,280,000 | 35.931818 | 78 | 0.669951 | false | 3.885167 | false | false | false |
SlashRoot/WHAT | what_apps/do/views.py | 1 | 23210 | from .forms import TaskForm, TaskPrototypeNameForm, TaskPrototypeForm, \
GenerateTaskForm, RestOfTheTaskPrototypeForm
from .models import Task, TaskProgeny, Verb, TaskPrototype, TaskPrototypeProgeny, \
TaskOwnership, TaskResolution, TaskAccessPrototype, TaskAccess, Protocol
from django import forms
from django.... | mit | 6,919,415,892,415,682,000 | 41.278689 | 212 | 0.630849 | false | 4.018352 | false | false | false |
mnahm5/django-estore | Lib/site-packages/awscli/topictags.py | 2 | 12651 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit | -4,637,528,009,400,645,000 | 41.884746 | 79 | 0.606592 | false | 4.320697 | false | false | false |
openelections/openelections-core | openelex/tasks/fetch.py | 2 | 1291 | import sys
import click
from openelex.base.fetch import BaseFetcher
from .utils import default_state_options, load_module
@click.command(help="Scrape data files and store in local file cache "
"under standardized name")
@default_state_options
@click.option('--unprocessed', is_flag=True,
help="Fetch unprocess... | mit | -5,731,460,157,850,020,000 | 32.973684 | 83 | 0.684741 | false | 3.984568 | false | false | false |
DaneelOliwan/dotfiles-vim | .vim/bundle/powerline/powerline/renderers/shell.py | 1 | 1842 | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
def int_to_rgb(num):
r = (num >> 16) & 0xff
g = (num >> 8) & 0xff
b = num & 0xff
return r, g, b
class ShellRenderer(Renderer):
'''Powerline shell segment renderer.'''
... | gpl-2.0 | -9,140,306,692,351,152,000 | 25.314286 | 72 | 0.614007 | false | 2.782477 | false | false | false |
kernsuite-debian/obit | python/scriptCopyVLTab.py | 2 | 18118 | # Python script to copy AIPS VL tables
import Table, Image, OErr, OSystem
# Init Obit
err=OErr.OErr()
ObitSys=OSystem.OSystem ("CopyVLTables", 1, 103, 1, ["None"],
2, ["../FITSdata/","/mnt/cdrom/MAPS/"], 1, 0, err)
OErr.printErrMsg(err, "Error with Obit startup")
outfile = "Catalog.fits"
ou... | gpl-2.0 | 8,407,360,759,406,397,000 | 29.297659 | 76 | 0.75654 | false | 2.393711 | false | false | false |
Fat-Zer/FreeCAD_sf_master | src/Mod/Draft/draftobjects/drawingview.py | 14 | 8057 | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... | lgpl-2.1 | -6,972,655,767,122,161,000 | 40.963542 | 79 | 0.462083 | false | 4.678862 | false | false | false |
dimitdim/GetARoom | Main/db_repository/versions/004_migration.py | 1 | 1360 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
post = Table('post', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('body', String(length=140)),
Column('timestamp', DateTime),
Column('user_id',... | gpl-2.0 | 6,732,537,120,585,568,000 | 28.565217 | 68 | 0.675 | false | 3.675676 | false | false | false |
hoidn/LCLS | dataccess/dataccess/autobatch.py | 1 | 1756 | import os
import time
import sys
import argparse
#sys.path.append('/reg/neh/home/ohoidn/anaconda/lib/python2.7/site-packages')
#sys.path.append('/reg/neh/home/ohoidn/anaconda/lib/python2.7/site-packages/pathos-0.2a1.dev0-py2.7.egg')
#sys.path.append('/reg/neh/home/ohoidn/anaconda/lib/python2.7/site-packages/dataccess-1... | gpl-3.0 | 493,112,196,730,480,000 | 32.132075 | 105 | 0.649203 | false | 3.135714 | false | false | false |
BugScanTeam/GitHack | lib/request.py | 1 | 1722 | #!/usr/bin/env python
# coding:utf-8
"""
Copyright (c) 2017 BugScan (http://www.bugscan.net)
See the file 'LICENCE' for copying permission
"""
import os
import urllib2
import random
from lib.common import writeFile
from lib.data import paths
from lib.data import target
from lib.data import agents
from lib.data import... | gpl-3.0 | -8,343,839,040,890,184,000 | 24.939394 | 86 | 0.607477 | false | 3.713666 | false | false | false |
csparkresearch/ExpEYES17-Qt | SPARK17/utilities/onlineBrowser.py | 1 | 2400 | # -*- coding: utf-8; mode: python; indent-tabs-mode: t; tab-width:4 -*-
import os,glob
from ..Qt import QtGui, QtCore,QtWidgets
import numpy as np
from .templates import ui_onlineBrowser as onlineBrowser
import pyqtgraph as pg
class dummyApp:
def processEvents(self):
pass
try:
import requests
except:
print ('r... | mit | 6,077,843,050,119,777,000 | 25.966292 | 71 | 0.690833 | false | 3.084833 | false | false | false |
Franciscowxp/PySpider | login.py | 1 | 2922 | # coding=utf-8
import requests
from urllib.parse import urlparse
class Login(object):
"""docstring for Login"""
def __init__(self, **signin):
self.url = signin['url']
if not signin['verify']:
self.logindata = signin['logindata']
self.loginurl = signin['loginurl']
... | gpl-2.0 | -2,216,983,034,984,773,400 | 33.761905 | 124 | 0.614041 | false | 3.001028 | false | false | false |
heineman/algorithms-nutshell-2ed | PythonCode/demo/app_kd_range.py | 1 | 5297 | """
Demonstration application for range search using kd tree.
Left mouse adds point.
Right mouse click begins drag of rectangle.
"""
import tkinter
from adk.kd import KDTree, X, Y, VERTICAL
from adk.region import Region, minValue, maxValue
RectangleSize = 4
class KDTreeApp:
... | mit | 6,429,294,040,961,874,000 | 34.531034 | 120 | 0.521805 | false | 3.958894 | false | false | false |
ns950/calibre | src/calibre/gui2/tweak_book/preview.py | 3 | 25045 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import time, textwrap, json
from bisect import bisect_right
from base64 impo... | gpl-3.0 | -1,991,309,667,338,330,600 | 37.471582 | 137 | 0.615053 | false | 3.913281 | false | false | false |
AlpineNow/python-alpine-api | examples/workfile.py | 1 | 10557 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Alpine Data, Inc.
# Copyright 2017 Alpine Data All Rights reserved.
"""Simple Command-Line Sample For Alpine API.
Command-line application to login and logout with Alpine API
Usage:
$ python workfile.py
To get detailed log output run:
$ python workfile.p... | mit | -3,272,726,833,132,391,400 | 47.431193 | 133 | 0.6176 | false | 3.844501 | false | false | false |
studio1247/gertrude | controls.py | 1 | 45793 | # -*- coding: utf-8 -*-
# This file is part of Gertrude.
#
# Gertrude 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.
#... | gpl-3.0 | -3,867,315,662,280,360,400 | 36.072874 | 187 | 0.582789 | false | 3.746727 | false | false | false |
lifemapper/core | LmCompute/tools/common/concatenate_matrices.py | 1 | 1246 | # !/bin/bash
"""This script concatenates two (or more) matrices along a specified axis
"""
import argparse
from LmBackend.common.lmobj import LMObject
from lmpy import Matrix
# .............................................................................
def main():
"""Main method of the script
"""
# Set... | gpl-3.0 | 8,207,966,249,622,702,000 | 26.688889 | 79 | 0.553772 | false | 4.019355 | false | false | false |
zstewar1/ALOLoader | chunckedparse.py | 1 | 4403 | #!/usr/bin/env python3
import aloobj
import argparse
import collections
import json
import pprint
import struct
import sys
def load_format(file):
return {int(k): v for k,v in json.load(file).items()}
def parse_chunked(format, buf):
chunk_data = collections.defaultdict(list)
while buf:
chunk_id, ... | mit | 3,351,580,639,956,508,000 | 30.905797 | 88 | 0.559846 | false | 3.886143 | false | false | false |
fredRos/pyFFTW | setup.py | 1 | 6522 | # Copyright 2012 Knowledge Economy Developments Ltd
#
# Henry Gomersall
# heng@kedevelopments.co.uk
#
# 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 y... | gpl-3.0 | 2,576,844,995,783,420,000 | 35.233333 | 139 | 0.650874 | false | 3.686829 | false | false | false |
mcandocia/RedditTreeGrab | genmod_params.py | 1 | 2399 | #this document contains the specific parameters for the generative model
#alter this prior to running code [genmod.py]
print "IMPORTING PARAMETERS"
useTerms = True
useSubs = True
name = 'apoptosis'
#this weights the terms more than the subreddits; this does nothing if subs is turned
#off
termMultiplier = 0.... | gpl-3.0 | 6,970,865,269,007,745,000 | 33.80597 | 112 | 0.756148 | false | 3.486919 | false | false | false |
bols-blue/ansible | lib/ansible/plugins/lookup/etcd.py | 56 | 2396 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# 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 later ver... | gpl-3.0 | -1,095,950,408,388,433,000 | 28.580247 | 75 | 0.6202 | false | 3.767296 | false | false | false |
sophiataskova/helping_hands | helping_hands_site/helping_hands_app/views.py | 1 | 2696 | from django.shortcuts import render_to_response, render, get_object_or_404
from django.template import RequestContext, loader
from django.http import HttpResponse, HttpResponseRedirect
from django.http import Http404
from django.core.urlresolvers import reverse
from helping_hands_app.forms import *
from django.contrib.... | mit | -7,993,477,616,929,553,000 | 31.878049 | 78 | 0.67322 | false | 3.895954 | false | false | false |
milegroup/gasatad | MainFrame.py | 1 | 81401 | """
This file is part of GASATaD.
GASATaD 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.
GASATaD is distributed in the hope that it will b... | gpl-3.0 | 7,454,908,388,289,037,000 | 42.022727 | 181 | 0.60029 | false | 3.885765 | true | false | false |
xpansa/odoomrp-wip | product_variants_no_automatic_creation/models/product_attribute_configurator.py | 3 | 2471 | # -*- coding: utf-8 -*-
# (c) 2015 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, fields, models
from openerp.addons import decimal_precision as dp
class ProductAttributeConfigurator(models.AbstractModel):
_name = 'product.attribute.configu... | agpl-3.0 | 9,041,073,232,427,097,000 | 38.854839 | 75 | 0.631323 | false | 3.766768 | false | false | false |
Connor-Y/csc148-assignment1 | Tour.py | 1 | 2464 | # Copyright 2013 Gary Baumgartner
# Distributed under the terms of the GNU General Public License.
#
# This file is part of Assignment 1, CSC148, Fall 2013.
#
# This 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 Foundat... | gpl-3.0 | 8,115,787,142,392,570,000 | 38.111111 | 101 | 0.676948 | false | 3.072319 | false | false | false |
keikenuro/kaiju-libnow | kaiju_libnow/libnow/src/business/exceptions/BaseException.py | 1 | 1668 | import os
import sys
class BaseException(Exception):
"""
BaseException class for all the others
exceptions defined for this app.
"""
def __init__(self, message, cause=None, *args, **kwargs):
"""
BaseException gets a message and a cause. These params
will be displaye... | gpl-3.0 | 5,302,735,792,033,693,000 | 26.8 | 85 | 0.535372 | false | 4.321244 | false | false | false |
mganeva/mantid | scripts/Muon/GUI/Common/grouping_table_widget/grouping_table_widget_view.py | 1 | 16836 | from __future__ import (absolute_import, division, print_function)
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import pyqtSignal as Signal
import sys
from Muon.GUI.Common.utilities import table_utils
from Muon.GUI.Common import message_box
group_table_columns = {0: 'group_name', 1: 'detector_ids', 2: 'number_of... | gpl-3.0 | -4,333,006,931,446,137,300 | 43.188976 | 120 | 0.59153 | false | 4.063722 | false | false | false |
joelmir/job_test_questions | candidates/models.py | 1 | 2370 | # -*- coding: utf-8 -*-
from django.db import models
from questions.models import Question
from django.core.mail import send_mail
from django.conf import settings
class Candidate(models.Model):
name = models.CharField(max_length=200)
email = models.EmailField()
def __unicode__(self):
return u'{0} - ... | mit | 8,692,020,386,437,051,000 | 42.814815 | 147 | 0.679628 | false | 3.459064 | false | false | false |
ISISComputingGroup/EPICS-inst_servers | CollisionAvoidanceMonitor/geometry.py | 1 | 2255 | import numpy as np
import ode
from CollisionAvoidanceMonitor.transform import Transformation
class GeometryBox(object):
def __init__(self, space, position=(0, 0, 0), size=(1, 1, 1), color=(1, 1, 1), oversize=1, name=None):
# Set parameters for drawing the body
self.color = color
self.siz... | bsd-3-clause | -474,506,855,969,731,600 | 33.692308 | 106 | 0.54235 | false | 3.690671 | false | false | false |
purplewall1206/musicbox | NEMbox/scrollstring.py | 13 | 1403 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from time import time
import locale
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
class scrollstring:
def __init__(self, content, START):
self.content = content # the true content of the string
self.display = content # the disp... | mit | -311,629,064,321,845,250 | 25.358491 | 76 | 0.573372 | false | 3.745308 | false | false | false |
SigPloiter/SigPloit | ss7/fraud.py | 1 | 5988 | #!/usr/bin/env python
"""
Created on 1 Feb 2018
@author: loay
"""
import os
import sys
import time
from subprocess import *
import sigploit
import ss7main
simsi_path = os.path.join(os.getcwd(), 'ss7/attacks/fraud/simsi')
mtsms_path = os.path.join(os.getcwd(), 'ss7/attacks/fraud/mtsms')
cl_path = os.path.join(os.ge... | mit | -2,386,668,206,320,904,700 | 37.146497 | 101 | 0.519038 | false | 3.31378 | false | false | false |
CtrlC-Root/cse3341 | Core/cse3341/pt/operand.py | 1 | 1699 | from ..token import Token
from .node import Node
from .constant import Constant
from .identifier import Identifier
from .expression import Expression
class Operand(Node):
"""
An operand.
"""
def __init__(self):
"""
Create the operand.
"""
self.value = None
@class... | mit | -5,072,925,527,626,581,000 | 24.742424 | 68 | 0.58505 | false | 4.654795 | false | false | false |
elric/virtaal-debian | virtaal/modes/quicktransmode.py | 6 | 1883 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | gpl-2.0 | -1,105,703,208,720,473,100 | 30.383333 | 81 | 0.688263 | false | 4.279545 | false | false | false |
Halframe/ihome_20161122 | handlers/Profile.py | 1 | 4839 | # coding=utf-8
import re
import logging
from .BaseHandler import BaseHandler
from utils.common import required_logined
from utils.response_code import RET
from utils.image_storage import storage
from config import image_url_prefix
class ProfileHandler(BaseHandler):
"""个人中心"""
@required_logined
def ... | gpl-3.0 | -3,416,722,500,883,955,700 | 34.3 | 192 | 0.56679 | false | 3.143151 | false | false | false |
ConnectBox/wifi-test-framework | ansible/plugins/mitogen-0.2.3/ansible_mitogen/plugins/connection/mitogen_local.py | 1 | 3082 | # Copyright 2017, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | mit | 6,438,423,665,345,968,000 | 34.837209 | 79 | 0.711551 | false | 4.082119 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties.py | 10 | 1507 | # 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 | -449,456,143,287,546,560 | 40.861111 | 84 | 0.631055 | false | 4.186111 | false | false | false |
citrix-openstack-build/neutron-lbaas | neutron_lbaas/services/loadbalancer/agent_scheduler.py | 2 | 5210 | # Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 | -4,766,120,125,139,007,000 | 39.387597 | 79 | 0.597889 | false | 4.260016 | false | false | false |
ryfx/modrana | modules/gui_modules/gui_qml/list_models.py | 1 | 3121 | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# A modRana QML GUI list models
#----------------------------------------------------------------------------
# Copyright 2013, Martin Kolman
#
# This program is free software: you can redistribute it and/or modify
# i... | gpl-3.0 | 1,145,764,220,678,838,900 | 29.300971 | 91 | 0.59404 | false | 4.32871 | false | false | false |
gregplaysguitar/django-dps | setup.py | 2 | 1171 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
# if there's a converted (rst) readme, use it, otherwise fall back to markdown
if os.path.exists('README.rst'):
readme_path = 'README.rst'
else:
readme_path = 'README.md'
# avoid importing the module
exec(open('dps/_version.py').rea... | bsd-2-clause | 8,254,026,549,920,261,000 | 24.456522 | 78 | 0.6345 | false | 3.877483 | false | false | false |
profkronholm/COSCnotes | COSCnotes/day016/assigngroups.py | 1 | 1717 | #!/usr/bin python
# simple script to select group of students at random.
# Written by Bill Kronholm
# Sep 1, 2014
# No rights reserved.
from random import shuffle
from time import strftime
import subprocess # used for printing
# list of students names as strings
students = [
"Karmen Rosebrock",
"Erna Halm",
... | gpl-2.0 | 6,200,605,508,681,465,000 | 20.197531 | 83 | 0.655795 | false | 2.960345 | false | false | false |
ocefpaf/OWSLib | owslib/owscontext/atom.py | 5 | 37822 | # -*- coding: utf-8 -*-
# =============================================================================
# Authors : Alexander Kmoch <allixender@gmail.com>
#
# =============================================================================
"""
API for OGC Web Services Context Document (OWS Context) format.
ATOM XML Enco... | bsd-3-clause | 4,384,036,189,799,634,400 | 35.935547 | 106 | 0.568188 | false | 3.644791 | true | false | false |
hep-cce/hpc-edge-service | balsam/job_sources/StatusMessage.py | 1 | 1185 | import logging
logger = logging.getLogger(__name__)
class StatusMessage:
NO_MESSAGE = 0x0
SUCCEEDED = 0x1 << 0
SUBMIT_DISABLED = 0x1 << 1
FAILED = 0x1 << 2
INVALID_EXE = 0x1 << 3
message_list = [
NO_MESSAGE,
SUCCEEDED,
... | bsd-3-clause | 7,310,423,936,941,458,000 | 25.931818 | 59 | 0.497046 | false | 4.557692 | false | false | false |
kwilliams-mo/iris | lib/iris/tests/test_ff.py | 1 | 13197 | # (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | gpl-3.0 | 346,667,395,340,066,240 | 40.369906 | 79 | 0.600364 | false | 3.379513 | true | false | false |
eavatar/ava-srv | src/eavatar.ava/ava/core/webfront.py | 1 | 3774 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import logging
import gevent
import bottle
from gevent import pywsgi
from ava.runtime import config
from ava.runtime import environ
logger = logging.getLogger(__name__)
_CONF_SECTION = 'webfront'
cl... | bsd-3-clause | 6,369,926,576,584,644,000 | 32.39823 | 104 | 0.590885 | false | 3.812121 | false | false | false |
flavour/tldrmp | modules/s3db/project.py | 2 | 259927 | # *- coding: utf-8 -*-
""" Sahana Eden Project Model
@copyright: 2011-2013 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software withou... | mit | -3,539,949,038,401,025,500 | 40.930473 | 219 | 0.426801 | false | 5.143912 | false | false | false |
saxtouri/triaina | setup.py | 1 | 2483 | # Copyright (c) 2014, Stavros Sachtouris
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | bsd-2-clause | 5,163,811,194,186,354,000 | 41.810345 | 80 | 0.712847 | false | 4.295848 | false | false | false |
GoogleCloudPlatform/serverless-expeditions | webhooks-with-cloud-run/Monolith/main.py | 1 | 5580 | # Copyright 2019 Google, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -7,725,025,906,462,267,000 | 27.911917 | 80 | 0.624014 | false | 3.755047 | false | false | false |
dmitrijus/hltd | python/hltd.py | 1 | 148906 | #!/bin/env python
import os,sys
sys.path.append('/opt/hltd/python')
sys.path.append('/opt/hltd/lib')
import time
import datetime
import dateutil.parser
import logging
import subprocess
from signal import SIGKILL
from signal import SIGINT
import simplejson as json
#import SOAPpy
import threading
import CGIHTTPServer
im... | lgpl-3.0 | -3,724,914,407,503,321,000 | 42.565243 | 194 | 0.517367 | false | 4.569912 | false | false | false |
firiceguo/Recommendation-NLP | src/network/network.py | 1 | 5711 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
from pyspark.sql.functions import *
from graphframes import *
"""
If you do it on the Jupyter Notebook, do the following config.
%%configure -f
{ "conf": {"spark.jars.packages": "graphframes:graphframes:0.3.0-spark2.0-s_2.11" }}
sc.addPyFile('wasb://5003@network5003.blob.co... | mit | -1,295,650,255,247,782,100 | 42.930769 | 135 | 0.639993 | false | 3.235694 | false | false | false |
quantrocket-llc/quantrocket-client | quantrocket/cli/utils/output.py | 1 | 1958 | # Copyright 2017 QuantRocket - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 | 7,578,797,005,245,311,000 | 38.959184 | 94 | 0.695608 | false | 3.963563 | false | false | false |
limodou/uliweb | uliweb/contrib/i18n/middle_i18n.py | 1 | 3448 | import re
from uliweb.i18n import set_language, format_locale
from uliweb import Middleware
from logging import getLogger
from uliweb.utils.common import request_url
accept_language_re = re.compile(r'''
([A-Za-z]{1,8}(?:-[A-Za-z]{1,8})*|\*) # "en", "en-au", "x-y-z", "*"
(?:;q=(0(?:\.\d{,3})... | bsd-2-clause | 3,296,269,799,420,879,400 | 33.9375 | 79 | 0.560325 | false | 3.784852 | false | false | false |
david-abel/simple_rl | examples/oomdp_example.py | 1 | 1115 | #!/usr/bin/env python
# Python imports.
import sys
# Other imports.
import srl_example_setup
from simple_rl.agents import QLearningAgent, RandomAgent
from simple_rl.tasks import TaxiOOMDP
from simple_rl.run_experiments import run_agents_on_mdp, run_single_agent_on_mdp
def main(open_plot=True):
# Taxi initial sta... | apache-2.0 | -7,784,361,188,939,700,000 | 32.787879 | 136 | 0.658296 | false | 2.829949 | false | false | false |
pscottdevos/pyfilesystem | fs/tests/test_ftpfs.py | 11 | 3291 | #!/usr/bin/env python
from fs.tests import FSTestCases, ThreadingTestCases
import unittest
import os
import sys
import shutil
import tempfile
import subprocess
import time
from os.path import abspath
import urllib
from six import PY3
try:
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.han... | bsd-3-clause | -4,249,187,715,346,728,000 | 28.383929 | 103 | 0.576724 | false | 3.844626 | true | false | false |
shenghaozou/PythonGrader | P5/outputCon.py | 1 | 2766 | from openpyxl import Workbook
from webview import WebView
import gradeSettings
class outputControl():
def __init__(self, sectionList, name, submissionFolder):
self.sectionList = sectionList
self.name = name
self.database = {}
self.submissionFolder = submissionFolder
self.sec... | apache-2.0 | 3,316,845,398,057,321,000 | 46.689655 | 176 | 0.530007 | false | 4.886926 | false | false | false |
emoitzi/django-excel-viewer | frontend/migrations/0001_initial.py | 1 | 1147 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('excel_import', '0007_document_current'),
... | gpl-3.0 | -3,576,765,931,572,799,500 | 38.551724 | 121 | 0.598954 | false | 4.201465 | false | false | false |
pyGrowler/growler-vhost | setup.py | 1 | 1789 | #
# setup.py
#
from setuptools import setup
import growler_vhost
NAME = "growler_vhost"
desc = """The Growler vhost server acts as forwarding agent for HTTP requests to
multiple domains hosted from a single server."""
description = """The Growler vhost server acts as forwarding agent for HTTP
requests to multiple ... | apache-2.0 | -6,473,186,051,370,596,000 | 27.854839 | 80 | 0.711571 | false | 3.914661 | false | false | false |
mfherbst/spack | var/spack/repos/builtin/packages/r-globaloptions/package.py | 5 | 1878 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | -6,516,717,663,214,309,000 | 45.95 | 81 | 0.676251 | false | 3.872165 | false | false | false |
perfectsearch/sandman | test/buildscripts/disable_unit_test_test.py | 1 | 2851 | #!/usr/bin/env python
#
# $Id: DisabledUnitTestTest.py 4193 2011-01-04 23:19:42Z dhh1969 $
#
# Proprietary and confidential.
# Copyright $Date:: 2011#$ Perfect Search Corporation.
# All rights reserved.
#
import sys, os, _testcase
from unittest2 import TestCase, skip
from codescan.disabled_unit_test import *
from test... | mit | 8,718,279,735,128,515,000 | 30.677778 | 111 | 0.672396 | false | 3.334503 | true | false | false |
AsherBond/MondocosmOS | grass_trunk/scripts/v.in.gns/v.in.gns.py | 2 | 4283 | #!/usr/bin/env python
############################################################################
#
# MODULE: v.in.gns
#
# AUTHOR(S): Markus Neteler, neteler itc it
# Converted to Python by Glynn Clements
#
# PURPOSE: Import GEOnet Names Server (GNS) country files into a GRASS vector map
#... | agpl-3.0 | -2,912,952,003,685,398,500 | 27.553333 | 102 | 0.571562 | false | 3.063662 | false | false | false |
gabrielelanaro/pyquante | PyQuante/Dynamics.py | 2 | 4332 | """\
Dynamics.py: Module for molecular dynamics
This program is part of the PyQuante quantum chemistry program suite.
Copyright (c) 2004, Richard P. Muller. All Rights Reserved.
PyQuante version 1.2 and later is covered by the modified BSD
license. Please see the file LICENSE that is part of this
distribution... | bsd-3-clause | 6,966,622,816,214,444,000 | 32.581395 | 78 | 0.602955 | false | 2.717691 | false | false | false |
TIGER-NET/WOIS_plugins | openlayers_plugin/weblayers/apple_maps.py | 5 | 1320 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
OpenLayers Plugin
A QGIS plugin
-------------------
begin : 2009-11-30
copyright : (C) 2009 by Pirmin Kalberer, Sourcepole
email : pka at source... | gpl-3.0 | 1,019,599,708,684,583,700 | 40.25 | 87 | 0.370455 | false | 5.617021 | false | false | false |
twatteyne/dustlink_academy | DataConnector/XivelySyncEngine.py | 2 | 9707 | #!/usr/bin/python
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('XivelySyncEngine')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import copy
import threading
from pydispatch import dispatcher
from EventBus ... | bsd-3-clause | -8,450,043,477,461,482,000 | 33.917266 | 96 | 0.394664 | false | 5.767677 | false | false | false |
JK-Warriors/Heimdallr | python/alarm.py | 1 | 81692 | #!/bin/env python
#-*-coding:utf-8-*-
import os
import sys
import string
import time
import datetime
import MySQLdb
import logging
import logging.config
logging.config.fileConfig("etc/logger.ini")
logger = logging.getLogger("wlblazers")
path='./include'
sys.path.insert(0,path)
import functions as func
import sendmail
i... | apache-2.0 | 6,049,866,737,927,612,000 | 68.822222 | 591 | 0.60236 | false | 3.368187 | false | false | false |
alexandremorlet/yambopy | tutorial/bn/ip_bn.py | 5 | 1731 | #
# Author: Henrique Pereira Coutada Miranda
# Run a IP calculation using yambo
#
from __future__ import print_function
import sys
from yambopy import *
from qepy import *
import argparse
#parse options
parser = argparse.ArgumentParser(description='Test the yambopy script.')
parser.add_argument('-dg','--doublegrid', a... | bsd-3-clause | 1,098,429,898,352,932,600 | 25.630769 | 92 | 0.645292 | false | 2.823817 | false | true | false |
OCA/l10n-italy | assets_management/models/asset_depreciation.py | 1 | 21256 | # Author(s): Silvio Gregorini (silviogregorini@openforce.it)
# Copyright 2019 Openforce Srls Unipersonale (www.openforce.it)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools import float_compare, float_i... | agpl-3.0 | 560,865,373,787,391,300 | 32.845541 | 79 | 0.563867 | false | 3.890719 | false | false | false |
Fakor/congov | web/engine_integration/models.py | 1 | 1444 | from django.db import models
class Blueprint(models.Model):
name = models.CharField(max_length=30)
class MineBlueprint(models.Model):
name = models.CharField(max_length=30, unique=True)
max_output_rate = models.FloatField()
output = models.IntegerField()
max_capacity = models.FloatField()
def... | mit | 5,290,383,118,267,450,000 | 27.88 | 72 | 0.695291 | false | 3.913279 | false | false | false |
stevenliuit/3vilTwinAttacker | Modules/AttackUp.py | 1 | 9722 | from PyQt4.QtGui import *
from PyQt4.QtCore import *
from os import getcwd,popen,chdir,walk,path,remove,stat,getuid
from Modules.DHCPstarvation import frm_dhcp_Attack,conf_etter
from platform import linux_distribution
from Core.Settings import frm_Settings
from re import search
import threading
from shutil import copyf... | mit | -4,197,046,734,792,370,000 | 41.273913 | 174 | 0.578688 | false | 3.674225 | true | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/filter_activity.py | 1 | 2393 | # 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 | -4,644,261,528,565,139,000 | 41.732143 | 148 | 0.623903 | false | 4.398897 | false | false | false |
OctavianLee/Pywechat | pywechat/services/wechat_card.py | 1 | 16043 | # -*- coding: utf-8 -*-
from pywechat.services.basic import Basic
class CardService(Basic):
"""This class is an implement of the Wechat service of card.
All request's urls come from the official documents.
Link: https://mp.weixin.qq.com/wiki/home/index.html
"""
def upload_image(self, image):
... | mit | 8,913,607,778,783,713,000 | 30.793456 | 95 | 0.447932 | false | 3.574845 | false | false | false |
pculture/mirocommunity | localtv/migrations/0010_remove_author.py | 1 | 14261 | from south.db import db
from django.db import models
from localtv.models import *
class Migration:
def forwards(self, orm):
# Dropping ManyToManyField 'Feed.auto_authors'
db.delete_table('localtv_feed_auto_authors')
# Dropping ManyToManyField 'Video.authors'
d... | agpl-3.0 | -6,726,288,681,998,937,000 | 71.390863 | 172 | 0.539934 | false | 3.65292 | false | false | false |
maxpumperla/elephas | examples/mnist_mlp_spark_asynchronous.py | 1 | 1835 | from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.utils import to_categorical
from elephas.spark_model import SparkModel
from elephas.utils.rdd_utils... | mit | 4,591,990,503,040,828,000 | 29.081967 | 91 | 0.751499 | false | 3.073702 | true | false | false |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/celery/canvas.py | 2 | 49586 | # -*- coding: utf-8 -*-
"""Composing task work-flows.
.. seealso:
You should import these from :mod:`celery` and not this module.
"""
from __future__ import absolute_import, unicode_literals
import itertools
import operator
import sys
from collections import MutableSequence, deque
from copy import deepcopy
from... | gpl-3.0 | -1,338,796,040,118,273,500 | 34.671942 | 79 | 0.558406 | false | 4.071605 | false | false | false |
rvianello/rdkit | rdkit/Chem/SaltRemover.py | 2 | 9561 | #
# Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrigh... | bsd-3-clause | 8,806,758,668,487,101,000 | 29.449045 | 88 | 0.65035 | false | 3.385623 | true | false | false |
africallshop/africallshop-iphone | submodules/externals/antlr3/runtime/Python/tests/t055templates.py | 16 | 11976 | import unittest
import textwrap
import antlr3
import antlr3.tree
import stringtemplate3
import testbase
import sys
import os
from StringIO import StringIO
class T(testbase.ANTLRTest):
def execParser(self, grammar, grammarEntry, input, group=None):
lexerCls, parserCls = self.compileInlineGrammar(grammar)
... | gpl-2.0 | -1,143,290,094,031,287,800 | 22.574803 | 84 | 0.373079 | false | 4.388421 | true | false | false |
ktbs/ktbs | doc/ext/sparqllexer.py | 1 | 2068 | # -*- coding: utf-8 -*-
"""
sparqllexer
~~~~~~~~~~~
Extension to add a sparql lexer to Sphinx.
``http://sphinx.pocoo.org/ext/appapi.html?highlight=pygments#sphinx.application.Sphinx.add%5Flexer``
It uses the Kier Davis code: ``https://github.com/kierdavis/SparqlLexer``.
.. code-block:: sparq... | lgpl-3.0 | 289,398,559,870,036,500 | 28.971014 | 104 | 0.567215 | false | 3.005814 | false | false | false |
ddanier/django_price | django_price/migrations/0001_initial.py | 1 | 1972 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tax',
f... | bsd-3-clause | 4,126,624,790,270,327,000 | 34.232143 | 145 | 0.525355 | false | 4.650943 | false | false | false |
MERegistro/meregistro | meregistro/apps/backend/views/crud.py | 1 | 6613 | # -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from django.core.paginator import Paginator
class CrudConfig:
def __init__(self, mode... | bsd-3-clause | 6,436,716,297,905,079,000 | 41.365385 | 175 | 0.761991 | false | 3.055479 | true | false | false |
nagyistoce/phoshare | phoshare/phoshare_ui.py | 6 | 41112 | """Reads iPhoto library info, and exports photos and movies. GUI version."""
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | apache-2.0 | -2,774,218,249,301,504,500 | 40.653495 | 100 | 0.581509 | false | 3.946247 | true | false | false |
chris-ch/omarket | python-lab/src/pnl.py | 1 | 2606 | import logging
import math
import numpy
class ZeroFeeModel(object):
def compute_fees(self, quantity, price):
return 0.
class InteractiveBrokersStockUSFeeModel(object):
def compute_fees(self, quantity, price):
max_fees = quantity * price * 0.5 / 100
return max(min(max_fees, 0.005 *... | apache-2.0 | 5,239,085,414,607,550,000 | 28.954023 | 106 | 0.60284 | false | 3.57476 | false | false | false |
jiemohuishou/virt-manager-0.9.3 | src/virtManager/createpool.py | 1 | 23776 | #
# Copyright (C) 2008 Red Hat, Inc.
# Copyright (C) 2008 Cole Robinson <crobinso@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opt... | gpl-2.0 | -9,079,758,717,288,793,000 | 36.920255 | 84 | 0.549714 | false | 3.929268 | true | false | false |
Arcana/emoticharms.trade | app/emoticharms/views.py | 1 | 4346 | from app import db
from ..emoticharms.models import UserPack, Pack
from flask import Blueprint, render_template, abort
from forms import UserPacksForm, PackQuantityField
from ..util import valid_ti5_ticket
from flask.ext.login import login_required, current_user
from ..users.models import User
emoticharms = Blueprint(... | gpl-2.0 | 9,041,931,948,394,719,000 | 32.183206 | 115 | 0.631845 | false | 3.422047 | false | false | false |
TNick/pyl2extra | pyl2extra/config/proxy.py | 1 | 2004 | """Module containing the Train class and support functionality."""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2015, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from collections import namedt... | bsd-3-clause | -2,535,705,651,637,892,600 | 33.551724 | 78 | 0.676647 | false | 4.523702 | false | false | false |
ebertland/audio-tools | fix-mb-tags.py | 1 | 1157 | #!/usr/bin/env python
# Copyright 2009 by Jeff Ebert
# License: GNU GPL v2
import sys
import mutagen.flac
import os.path as path
# Tip from:
# http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
def fix_mb... | mit | 5,164,661,301,358,378,000 | 26.547619 | 101 | 0.59032 | false | 3.305714 | false | false | false |
PLyczkowski/Sticky-Keymap | 2.74/scripts/presets/keyconfig/pie_keymap.py | 1 | 33628 | import bpy
import os
def kmi_props_setattr(kmi_props, attr, value):
try:
setattr(kmi_props, attr, value)
except AttributeError:
print("Warning: property '%s' not found in keymap item '%s'" %
(attr, kmi_props.__class__.__name__))
except Exception as e:
print("Warning: %... | gpl-2.0 | -9,156,502,979,376,254,000 | 63.175573 | 106 | 0.708517 | false | 2.716756 | false | false | false |
YOUR-WORST-TACO/AdvPythonProject | Program/airDB/db.py | 1 | 7946 | """
AIRLINE RESERVATION SYSTEM
DEVELOPERS
Stephen Tafoya
Ryan Hamilton
MAIN PROJECT FILE - RUNS ENTIRE PROGRAM
"""
import sqlite3 # ST Import database management
class AirDB(object): # ST
"""
class DB(db)
documentation:
class that handles main database management,
... | gpl-3.0 | -7,582,402,227,697,296,000 | 36.305164 | 157 | 0.507425 | false | 4.162389 | false | false | false |
gedaskir/qmeq | qmeq/builder/funcprop.py | 1 | 5038 | """Module containing FunctionProperties class."""
class FunctionProperties(object):
"""
Class containing miscellaneous variables for Approach and Approach2vN classes.
Attributes
----------
symq : bool
For symq=False keep all equations in the kernel, and the matrix is of size N by N+1.
... | bsd-2-clause | -3,665,908,777,324,899,000 | 43.982143 | 116 | 0.62505 | false | 3.960692 | false | false | false |
kthordarson/CouchPotatoServer | couchpotato/runner.py | 28 | 12513 | from logging import handlers
from uuid import uuid4
import locale
import logging
import os.path
import sys
import time
import traceback
import warnings
import re
import tarfile
import shutil
from CodernityDB.database_super_thread_safe import SuperThreadSafeDatabase
from argparse import ArgumentParser
from cache import... | gpl-3.0 | -5,350,388,513,148,154,000 | 33.282192 | 155 | 0.600575 | false | 3.743045 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.