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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tomasbasham/ratelimit | ratelimit/decorators.py | 1 | 4409 | '''
Rate limit public interface.
This module includes the decorator used to rate limit function invocations.
Additionally this module includes a naive retry strategy to be used in
conjunction with the rate limit decorator.
'''
from functools import wraps
from math import floor
import time
import sys
import threading
... | mit | -1,125,524,861,554,458,100 | 35.438017 | 98 | 0.629621 | false | 4.877212 | false | false | false |
mice-software/maus | bin/analyze_data_online.py | 1 | 14624 | #!/usr/bin/env python
# This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
#
# MAUS 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 | 3,474,413,742,253,010,000 | 35.019704 | 80 | 0.594434 | false | 3.851462 | false | false | false |
palankai/dddcrud | app/handlers.py | 1 | 1175 | from .events import ContactCreated, ContactUpdated, ContactDeleted
from .policy import policy, PhoneNumberLongEnough
@policy(PhoneNumberLongEnough())
class CreateContactHandler:
def __init__(self, repo, bus):
self.repo = repo
self.bus = bus
def __call__(self, cmd):
self.repo.create(cm... | mit | -8,243,245,142,680,655,000 | 22.039216 | 72 | 0.629787 | false | 3.626543 | false | false | false |
servetus/pycofi | pycofi/queries.py | 1 | 1056 | from numpy import matrix, asarray, apply_along_axis
from numpy.linalg import norm
import simplejson
def get_top_items(user_index, items, Theta, X, item_mean=None, R_filter=None):
if R_filter == None:
R_filter = set([])
scores = X[user_index,:] * Theta
if(item_mean != None):
scores = mat... | mit | 5,900,448,722,124,836,000 | 24.756098 | 78 | 0.632576 | false | 3.3 | false | false | false |
robiame/AndroidGeodata | pil/ImageColor.py | 1 | 7665 | #
# The Python Imaging Library
# $Id$
#
# map CSS3-style colour description strings to RGB
#
# History:
# 2002-10-24 fl Added support for CSS-style color strings
# 2002-12-15 fl Added RGBA support
# 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2
# 2004-07-19 fl Fixed gray/grey spelling ... | mit | -670,456,465,135,821,300 | 27.144487 | 73 | 0.515982 | false | 2.791333 | false | false | false |
INSEBRE/lanparty.iesebre.com | test/fcgi/fcgi.py | 1 | 15432 | #!/usr/bin/python
#------------------------------------------------------------------------
# Copyright (c) 1998 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: fcgi.py
#
# Descripti... | gpl-2.0 | 788,579,133,595,370,900 | 33.072727 | 91 | 0.463971 | false | 3.816968 | true | false | false |
W4ngatang/DocumentSummarizer | postprocess/gen_preds.py | 1 | 3663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create the data for the LSTM.
"""
import os
import sys
import argparse
import numpy as np
import h5py
import itertools
import pdb
import re
from collections import defaultdict
def gen_preds(args, gold=0):
if not gold:
try:
k = args.k
... | mit | -3,497,275,557,048,698,400 | 41.103448 | 123 | 0.568387 | false | 3.788004 | false | false | false |
letouriste001/SmartForest_2.0 | python3.4Smartforest/lib/python3.4/site-packages/django/utils/encoding.py | 1 | 10090 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse import un... | mit | 3,089,730,319,248,334,000 | 34.900356 | 81 | 0.619151 | false | 3.539649 | false | false | false |
eirannejad/pyRevit | pyrevitlib/pyrevit/output/__init__.py | 1 | 23733 | """Provide access to output window and its functionality.
This module provides access to the output window for the currently running
pyRevit command. The proper way to access this wrapper object is through
the :func:`get_output` of :mod:`pyrevit.script` module. This method, in return
uses the `pyrevit.output` module t... | gpl-3.0 | 1,745,673,272,930,747,100 | 32.008345 | 102 | 0.577845 | false | 4.213956 | false | false | false |
KirarinSnow/Google-Code-Jam | World Finals 2010/D.py | 1 | 1649 | #!/usr/bin/env python
#
# Problem: Travel Plan
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
for case in range(int(raw_input())):
n = int(raw_input())
x = map(int, raw_input().split())
f = int(raw_input())
x.sort()
if 2*(x[n-1]-x[0]) > f:
... | gpl-3.0 | -9,187,201,303,024,424,000 | 25.596774 | 65 | 0.299576 | false | 3.311245 | false | false | false |
pulsar-chem/Pulsar-Core | test/system/TestAtom.py | 1 | 1937 | import pulsar as psr
def run_test():
tester=psr.PyTester("Testing the Atom class")
H, H2=psr.create_atom([0.0,0.0,0.0],1), psr.create_atom([0.0,0.0,0.0],1,1)
tester.test_return("create_atom works",True,True,H.__eq__,H2)
tester.test_equal("correct Z",1,H.Z)
tester.test_equal("correct isotope",1,H.i... | bsd-3-clause | 1,443,255,930,028,945,400 | 46.243902 | 80 | 0.68921 | false | 2.610512 | true | false | false |
Harvard-ATG/media_management_lti | media_manager/urls.py | 1 | 1193 | """media_manager URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, na... | bsd-3-clause | -1,802,701,804,387,765,000 | 40.137931 | 77 | 0.69321 | false | 3.428161 | false | false | false |
gymnasium/edx-platform | common/djangoapps/student/views/management.py | 1 | 59233 | """
Student Views
"""
import datetime
import json
import logging
import uuid
import warnings
from collections import namedtuple
import analytics
import dogstats_wrapper as dog_stats_api
from bulk_email.models import Optout
from courseware.courses import get_courses, sort_by_announcement, sort_by_start_date
from djang... | agpl-3.0 | 8,491,777,773,612,389,000 | 39.850345 | 126 | 0.656864 | false | 4.197945 | true | false | false |
rajashreer7/autotest-client-tests | linux-tools/nss_pam_ldapd/nss_pam_ldapd.py | 3 | 1154 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class nss_pam_ldapd(test.test):
"""
Autotest module for testing basic functionality
of nss_pam_ldapd
@author
"""
version = 1
nfail = 0
path = ''
def init... | gpl-2.0 | -7,909,553,592,994,969,000 | 23.553191 | 96 | 0.551127 | false | 3.898649 | true | false | false |
tectronics/brahms-md | analysisScripts/general/getAverageProfile.py | 1 | 1548 | #!/usr/bin/python2
# Julien Michel june 2007
# usage is getAverageProfile.py file1.dat file2.dat file3.dat
# where fileX can be an electron density profile, or a lateral pressure profile.
# can probably be used for other outputs like electron pressure profile etc...
import os,sys
averages = []
resized = False
for f... | gpl-3.0 | -5,348,391,275,696,439,000 | 24.377049 | 80 | 0.540698 | false | 3.372549 | false | false | false |
crypotex/taas | taas/user/forms.py | 1 | 4141 | from django import forms
from django.contrib.auth import forms as auth_forms, get_user_model
from django.utils.translation import ugettext_lazy as _
class UserCreationForm(auth_forms.UserCreationForm):
required_css_class = 'required'
password1 = forms.CharField(label=_("Password"), min_length=8, max_length=6... | gpl-2.0 | 6,816,467,417,513,750,000 | 39.203883 | 118 | 0.602753 | false | 4.467098 | false | false | false |
zhaochao/fuel-web | nailgun/nailgun/objects/role.py | 1 | 3212 | # -*- coding: utf-8 -*-
# Copyright 2015 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 requi... | apache-2.0 | 5,119,622,813,998,003,000 | 29.884615 | 78 | 0.665006 | false | 3.874548 | false | false | false |
marmyshev/transitions | openlp/plugins/songs/forms/songmaintenancedialog.py | 1 | 9854 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | gpl-2.0 | 908,024,984,709,142,800 | 62.153846 | 106 | 0.68717 | false | 4.034398 | false | false | false |
jia-kai/hearv | disp_freq.py | 1 | 1942 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# $File: disp_freq.py
# $Date: Sun Nov 23 12:45:25 2014 +0800
# $Author: jiakai <jia.kai66@gmail.com>
import matplotlib.pyplot as plt
import numpy as np
import argparse
import json
def main():
parser = argparse.ArgumentParser()
parser.add_argument('fpath', help=... | unlicense | 6,850,090,640,253,229,000 | 29.34375 | 77 | 0.57827 | false | 3.220564 | false | false | false |
pu6ki/elsyser | elsyser/settings.py | 1 | 4974 | """
Django settings for elsyser project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | mit | -2,167,837,604,075,419,100 | 23.502463 | 91 | 0.681946 | false | 3.320427 | false | false | false |
moertle/pyaas | pyaas/web/auth/facebook.py | 1 | 2166 |
import datetime
import pyaas
import tornado.auth
#
# Facebook Authentication
#
FBURL = '%s://%s/login/facebook?next=%s'
class Facebook(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin):
@tornado.web.asynchronous
def get(self):
redir = tornado.escape.url_escape(self.get_argument('next',... | mit | -3,376,014,447,902,641,000 | 29.942857 | 78 | 0.519391 | false | 3.874776 | false | false | false |
ansp-2015/arquea | protocolo/forms.py | 1 | 13060 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django import forms
from django.forms.utils import ErrorList
from django.utils.translation ... | mpl-2.0 | 6,822,829,020,151,119,000 | 44.582456 | 120 | 0.589331 | false | 3.314031 | false | false | false |
Agrajag-Petunia/existential-romantic-novel | run.py | 1 | 1939 | from datetime import datetime
from src.textgenerator import TextGenerator
from src.utils import extract_project_gutenberg_novel, remove_titles
# The source files to use
# NOTE: Ulysses makes the generated text just a little too weird.
files = [
'./data/life_and_amours.txt',
'./data/memoirs_of_fanny_hill.txt',... | mit | -3,681,694,281,724,751,400 | 31.316667 | 74 | 0.636411 | false | 3.425795 | false | false | false |
vshandubey/movie-database | ui/home/MovieTable.py | 1 | 2833 |
from PyQt4 import QtGui, QtCore
from core.repository import MovieRepository
import core.Constants as Constants
class MovieTable(QtGui.QTableWidget):
def __init__(self, mainWindow):
self.mainWindow = mainWindow
super(MovieTable, self).__init__()
#Init database
se... | apache-2.0 | 7,562,268,095,940,497,000 | 35.320513 | 92 | 0.606777 | false | 4.312024 | false | false | false |
gbugaisky/bimm_185_conotoxin | wip-scripts_data/kNNProc.py | 1 | 1321 | #!usr/bin/env/python
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn import neighbors
def kNNGen(trainfile, testfile):
features = np.genfromtxt(trainfile, delimiter=' ', usecols=(0, 1, 2))
labels = np.genfromtxt(trainfile, delimiter=' ', usecols=(-1))
tests = np.genf... | gpl-2.0 | 6,156,723,284,375,252,000 | 33.789474 | 118 | 0.695685 | false | 3.079254 | true | false | false |
aggelgian/algorithmic-library | python/data_structures/binary_indexed_tree.py | 1 | 1365 | # -*- coding: utf-8 -*-
"""
Binary Indexed Tree
-------------------
Based on the proposed C/C++ implementation by
Yannis Chatzimichos @ https://git.softlab.ntua.gr/public/pdp-camp/blob/master/2013/advanced_data_structures.pdf
Supports the operations
- ADD S X
Add X to the sum at posit... | mpl-2.0 | -6,951,622,506,403,230,000 | 25.764706 | 115 | 0.52381 | false | 3.033333 | false | false | false |
qedsoftware/commcare-hq | corehq/apps/repeaters/models.py | 1 | 20914 | import base64
from collections import namedtuple
from datetime import datetime, timedelta
import logging
import urllib
import urlparse
from django.utils.translation import ugettext_lazy as _
from requests.exceptions import Timeout, ConnectionError
from corehq.apps.cachehq.mixins import QuickCachedDocumentMixin
from co... | bsd-3-clause | -7,446,610,611,473,382,000 | 33.973244 | 114 | 0.639572 | false | 4.097571 | false | false | false |
iffy/ppo | ppo/parse_plugins/sqlite_plugin.py | 1 | 2316 | # Copyright (c) The ppo team
# See LICENSE for details.
import tempfile
import os
from ppo import plugins
from structlog import get_logger
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
import sqlite3 as sqlite
class SQLite3Parser(plugins.ParserPlugin):
"""
I parse SQLite database... | apache-2.0 | -7,123,455,095,867,599,000 | 29.473684 | 89 | 0.536269 | false | 4.218579 | false | false | false |
chippey/gaffer | python/GafferUI/UIEditor.py | 1 | 57874 | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause | 1,587,227,539,915,710,200 | 31.422409 | 180 | 0.67431 | false | 3.574897 | false | false | false |
clessor88/trigrams | trigrams.py | 1 | 2164 | """Trigram analysis text generator."""
import sys
from random import randint
import io
def create_word_bank(word_list):
"""Create a dictionary with keys of 2 word pairs."""
word_bank = {}
for i, word in enumerate(word_list):
key = word + ' ' + word_list[i + 1]
if i < len(word_list) - 2:
... | mit | 2,701,385,325,316,454,000 | 28.643836 | 68 | 0.554067 | false | 3.52443 | false | false | false |
peeyush-tm/check_mk | modules/notify.py | 1 | 82627 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 | 4,618,191,767,830,784,000 | 40.583795 | 134 | 0.534765 | false | 4.018432 | false | false | false |
SeismicPi/SeismicPi | GUI/configParse.py | 1 | 1112 | import re
def fileToDic(configFile):
def isAlphaNumUnder(s):
return s.isalpha() or s == '_' or s.isdigit()
keyValueDict = {}
for line in configFile:
if(line[0] == '#'):
pass
else:
foundKey = False
foundSeparator = False
foundValue = False
lineKey = ""
lineValue = ""
for currentChar i... | mit | -5,345,107,037,231,477,000 | 19.218182 | 63 | 0.619604 | false | 3.349398 | false | false | false |
intip/da-apps | applications/da_horoscopo/site.py | 1 | 3784 | # -*- encoding: LATIN1 -*-
#
# Copyright 2009 Prima Tech.
#
# Licensed under the Environ License, Version 1.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.intip.com.br/licenses/ENVIRON-LICENSE-1.0
#
# Unless required by ... | gpl-2.0 | -6,958,432,567,843,381,000 | 30.272727 | 78 | 0.496564 | false | 3.688109 | false | false | false |
BackupTheBerlios/espressopp | testsuite/pickle_potential/testwarmup.py | 1 | 1313 | import espresso
from espresso import Real3D
d = 0.85
Nchains = 10
Mmonomers = 10
N = Nchains * Mmonomers
L = pow(N/d, 1.0/3)
system, integrator = espresso.standard_system.PolymerMelt(Nchains, Mmonomers,(10,10,10), dt = 0.005, temperature=1.0)
print "starting warmup"
org_dt = integrator.dt
pot = system.getInteracti... | gpl-3.0 | 5,970,155,635,582,008,000 | 22.446429 | 117 | 0.740289 | false | 2.854348 | false | false | false |
avain/claripy | claripy/__init__.py | 1 | 2002 | #!/usr/bin/env python
# pylint: disable=F0401,W0401,W0603,
import os
import sys
import socket
import logging
l = logging.getLogger("claripy")
l.addHandler(logging.NullHandler())
_all_backends = [ ]
_eager_backends = [ ]
_model_backends = [ ]
from .errors import *
from . import operations
from . import ops as _all_o... | bsd-2-clause | 3,187,415,920,999,431,700 | 18.821782 | 103 | 0.713786 | false | 3.108696 | false | false | false |
sveetch/DjangoSveetchies | settings.py | 1 | 11061 | # -*- coding: utf-8 -*-
"""
Django settings for DjangoSveetchies development
This is the version for development environnment only. For production usage you should
create a new settings file like "prod_settings.py" where you import these settings and
overwrite the required ones like PROJECT_DIR, ADMINS, DATABASES, S... | mit | 6,801,798,735,232,977,000 | 32.515152 | 217 | 0.689421 | false | 3.429457 | false | false | false |
InUrSys/PescArt2.0 | src/srcPlus/GenericCalculoEstim.py | 1 | 8058 | '''
Created on 24/11/2017
@author: chernomirdinmacuvele
'''
from PyQt5.Qt import QDialog, QStandardItemModel, QStandardItem, QComboBox,\
QModelIndex
import mixedModel
import QT_tblViewUtility
import CustomWidgets
import FuncSQL
import searchSimple
import pprint
class GenericCalculoEstim(QDialog):
def CBTe... | gpl-3.0 | 2,110,455,335,392,600,800 | 39.094527 | 167 | 0.542194 | false | 3.600536 | false | false | false |
wmaciel/crowd-sketch-filter | src/splitter.py | 1 | 1854 | import sys
import os
import shutil
from PIL import Image
def generate_1d_box_limits(dim, num_divs):
'''
Generates the limits of a crop box in a single dimension
Example, if dim is 512 pixels and num_divs is 5, it should return:
[(0, 103), (103, 206), (206, 308), (308, 410), (410, 512)]
'''
ass... | mit | -5,730,984,335,753,049,000 | 26.671642 | 103 | 0.552319 | false | 3.19105 | false | false | false |
jrbainter/netana | netana/equations.py | 1 | 1464 | from griddialog import *
from wequ import wequ
import pickle
from tkinter.messagebox import showerror
class Equations():
def cleanup(self,dig):
if dig.status == "Save":
self.Mat = dig.get()
self.SaveEquations()
if dig.top: dig.top.destroy()
def SaveEquations(self):
# Save Mat Equations to file
if len... | gpl-3.0 | 7,628,883,418,903,884,000 | 21.181818 | 69 | 0.68306 | false | 2.633094 | false | false | false |
rwl/PyCIM | CIM14/IEC61968/Metering/Reading.py | 1 | 5442 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | -2,014,066,142,019,675,400 | 37.323944 | 134 | 0.668688 | false | 4.205564 | false | false | false |
radiac/sermin | sermin/utils.py | 1 | 1923 | """
Util functions
"""
import os
import shlex
from subprocess import Popen, PIPE
from six import string_types
from .exceptions import ShellError
from . import report
class ShellOutput(str):
def __new__(cls, stdout, stderr):
# Store raw
stdout = stdout.strip() if stdout else ''
stderr = s... | bsd-3-clause | -398,740,528,859,610,240 | 23.0375 | 75 | 0.577223 | false | 4.00625 | false | false | false |
Primary-Traxex/odooalipay | models/func.py | 1 | 3484 | # coding: utf-8
"""
* 支付宝接口公用函数 python版本
* 详细:该类是请求、通知返回两个文件所调用的公用函数核心处理文件
* 版本:1.0
* 日期:2012-07-19(官方)本接口写于2017年新春
* 说明:
"""
import json
import sys
import types
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
from base64 import b64encode,b64decode
from urllib... | mit | 2,567,390,790,461,478,000 | 22.816667 | 74 | 0.607418 | false | 2.27186 | false | false | false |
makhan/spaghetti-basic | translator.py | 1 | 1798 | """
A module that simply bolts on simple loops
by translating them into interpretable code in Spaghetti.
This module will probably disappear in the future.
This is just a quick hack some hours before the GCJ 2010 Quals
to add FOR loops for solving problems during the contest
Warning: Extremely Buggy and hardly works... | mit | -601,688,768,264,575,000 | 22.657895 | 72 | 0.669633 | false | 2.904685 | false | false | false |
hyatzh/redis-py | redis/client.py | 1 | 72902 | from __future__ import with_statement
from itertools import chain, starmap
import datetime
import sys
import warnings
import time as mod_time
from redis._compat import (b, izip, imap, iteritems, dictkeys, dictvalues,
basestring, long, nativestr, urlparse, bytes)
from redis.connection import C... | mit | 8,373,793,123,824,788,000 | 35.96856 | 79 | 0.59115 | false | 4.319095 | false | false | false |
jptomo/rpython-lang-scheme | rpython/rtyper/rnone.py | 1 | 2579 | from rpython.flowspace.model import Constant
from rpython.annotator.model import SomeNone
from rpython.rtyper.rmodel import Repr, TyperError, inputconst
from rpython.rtyper.lltypesystem.lltype import Void, Bool, Ptr, Char
from rpython.rtyper.lltypesystem.llmemory import Address
from rpython.rtyper.rpbc import SmallFunc... | mit | -3,959,287,251,146,390,500 | 30.45122 | 71 | 0.647926 | false | 3.156671 | false | false | false |
peterjanes/dosage | dosagelib/plugins/r.py | 1 | 5376 | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from __future__ import absolute_import, division, print_function
from re import compile
from six.move... | mit | -1,011,755,485,602,224,600 | 33.909091 | 104 | 0.620722 | false | 3.182948 | false | false | false |
SanaMobile/sana.mds | src/mds/api/contrib/openmrslib/openmrs19.py | 1 | 17366 | """ Classes and utilities for talking to an OpenMRS server version 1.9
:Authors: Sana Dev Team
:Version: 2.0
"""
import urllib
import cookielib
import logging
import urllib2
import cjson
import time
import base64
from django.conf import settings
from . import openers
from mds.api.responses import succeed, fail
__al... | bsd-3-clause | 1,089,484,495,699,072,800 | 37.939462 | 99 | 0.563803 | false | 4.329594 | false | false | false |
bingweichen/GOKU | backend/server/database/model.py | 1 | 11139 | """
@author: Bingwei Chen
@time: 8/4/17
@desc: models
每个field 生效是要重新删表,建表
"""
import json
from datetime import datetime
from peewee import *
from server.database.db import database
from server.utility.constant.basic_constant import \
DELIVERY, APPOINTMENT_STATUS
from server.utility.constant.const_db import C... | apache-2.0 | -5,023,248,486,933,650,000 | 24.85422 | 78 | 0.645464 | false | 2.890764 | false | false | false |
tmolteno/python-necpp | PyNEC/example/context_clean.py | 1 | 8139 | # Note: explicit zeroes are blanks. All other values should be specified symbolically.
# Currently these contain only the subset of cards that I needed
class Range(object):
def __init__(self, start, stop, count=None, delta=None):
self.start = start
self.stop = stop
if count is not None:
... | gpl-2.0 | 5,148,461,539,862,816,000 | 43.233696 | 199 | 0.646885 | false | 3.454584 | false | false | false |
dorotapalicova/GoldDigger | gold_digger/data_providers/yahoo.py | 1 | 2754 | # -*- coding: utf-8 -*-
from datetime import date
from ._provider import Provider
class Yahoo(Provider):
"""
Real-time service with no known limits offers only latest exchange rates.
Implicit base currency is USD.
"""
BASE_URL = "http://query.yahooapis.com/v1/public/yql"
PREPARED_YQL = "SELECT... | apache-2.0 | -5,179,105,512,653,488,000 | 35.72 | 125 | 0.564996 | false | 3.657371 | false | false | false |
brandonlee503/Algorithms-Assignments | Practice Assignment 2/HW2Q3.py | 1 | 1088 | def algorithm3(arr):
maxLength = 0
if len(arr) <= 0:
return 0
if len(arr) == 1:
return 1
for i in arr:
print "i is: " + str(i)
temp = [arr[i-1]]
for j in range(len(arr) - i):
spliceArrayJ = arr[j+1:]
print "reversed array: "
reversedArray = spliceArrayJ[::-1]
print reversedArray
print "Th... | mit | -7,528,026,928,750,685,000 | 26.225 | 86 | 0.624081 | false | 2.542056 | false | false | false |
JioCloud/oslo-incubator | pypi/setup.py | 1 | 1560 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
# Copyright (c) 2012 OpenStack Foundation.
#
# 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
#
# Un... | apache-2.0 | 9,090,687,576,045,347,000 | 35.27907 | 69 | 0.663462 | false | 4.369748 | false | false | false |
olitheolix/qtmacs | doc/source/code_snippets/tut_3_7.py | 1 | 1962 | """
Tutorial 3: Applet- and macro signatures.
"""
# Import the module with the global variables and the macro base class.
import qtmacs.qte_global as qte_global
from qtmacs.base_macro import QtmacsMacro
from qtmacs.base_applet import QtmacsApplet
from PyQt4 import QtGui
# Get a reference to the main instance of Qtmac... | gpl-3.0 | 5,176,266,747,123,214,000 | 29.184615 | 74 | 0.67788 | false | 3.400347 | false | false | false |
aronparsons/spacewalk | backend/satellite_tools/satsync.py | 1 | 101969 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 | -891,730,889,753,331,100 | 40.603019 | 120 | 0.564289 | false | 4.23688 | false | false | false |
fifoforlifo/pynja | test2/remake.py | 1 | 8988 | #!/usr/bin/python3.3
import sys
import os
rootDir = sys.path[0]
sys.path.append(os.path.normpath(os.path.join(rootDir, "..", "packages")))
sys.path.append(os.path.join(rootDir, "build"))
import pynja
import repo
build_cpp = True
build_java = True
def generate_ninja_build(projectMan):
# define cpp_variants and... | apache-2.0 | -8,794,421,707,129,115,000 | 47.847826 | 182 | 0.630952 | false | 3.377678 | false | false | false |
Smetterleen/Neopets-Python-API | examples/Player.py | 1 | 2994 | import secrets
import logging
import traceback
import sys
from datetime import datetime
def main():
logging.basicConfig(filename='neopapi.log', level=logging.DEBUG, format='%(asctime)s|%(levelname)s|%(name)s|%(msg)s', datefmt="%x-%X")
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
... | gpl-3.0 | -7,169,292,783,107,106,000 | 37.883117 | 192 | 0.569806 | false | 4.008032 | false | false | false |
o108minmin/pint | pint/floattools.py | 1 | 2814 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import fractions
'''
floattools
tools for floating point number
'''
def stringtofraction(arg):
'''
arg : str
-> fractions.Fraction
(jp)
引数argから近似分数を生成します。
返り値はfractions.Fractionとして返されます。
詳細はfractionsを見てください。
引数の形式は以下の通りです。
... | mit | 4,094,020,670,867,079,000 | 22.086207 | 85 | 0.506721 | false | 2.713273 | false | false | false |
triple-j/base16-palette | build/build_schemes.py | 1 | 1510 | #!/usr/bin/env python
import os
from git import Repo
from shutil import rmtree
from glob import glob
import xml.etree.ElementTree as etree
import re
git_url = "https://github.com/chriskempson/base16.git"
repo_dir = "./base16"
scss_dir = "../scss/color-schemes"
labels = [
"base00",
"base01",
"base02",
... | mit | 2,400,405,034,719,158,000 | 20.884058 | 79 | 0.561589 | false | 3.081633 | false | false | false |
Duncan93/dbm-project2 | Ttest.py | 1 | 5148 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 22:52:24 2015
@author: lorraine
"""
import json
from pprint import pprint
import numpy as np
from scipy.stats import mstats
from scipy import stats
import csv
import pandas as pd
#json_data=open("data/{0}_B.json".format("pizza")).read()
#data = json.loads(json_data)
... | mit | -4,440,707,402,355,450,000 | 37.691729 | 144 | 0.705402 | false | 3.077751 | true | false | false |
Micronaet/micronaet-migration | report_purchase_custom/report/company/parser.py | 1 | 10924 | ##############################################################################
#
# Copyright (c) 2008-2010 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
# General contacts <info@kndati.lv>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the who... | agpl-3.0 | 6,611,097,650,410,658,000 | 38.294964 | 99 | 0.502014 | false | 4.12382 | false | false | false |
mitodl/bootcamp-ecommerce | hubspot/management/commands/sync_hubspot.py | 1 | 4122 | """
Management command to sync all Users, Orders, Products, and Lines with Hubspot
and Line Items
"""
from django.contrib.auth.models import User
from django.core.management import BaseCommand
from applications.models import BootcampApplication
from hubspot.api import (
make_contact_sync_message,
make_product_... | bsd-3-clause | 7,408,869,084,964,508,000 | 29.761194 | 111 | 0.565745 | false | 4.320755 | false | false | false |
jlongstaf/f5-openstack-lbaasv2-driver | f5lbaasdriver/v2/bigip/disconnected_service.py | 1 | 3379 | # Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 | 364,617,107,890,503,300 | 38.752941 | 79 | 0.612311 | false | 4.578591 | false | false | false |
Azure/WALinuxAgent | azurelinuxagent/common/osutil/suse.py | 1 | 6891 | #
# Copyright 2018 Microsoft Corporation
#
# 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 | 7,067,188,137,874,378,000 | 40.763636 | 107 | 0.612103 | false | 3.92426 | true | false | false |
brynpickering/calliope | calliope/test/test_cli.py | 1 | 4812 | import os
import tempfile
import pytest # pylint: disable=unused-import
from click.testing import CliRunner
import calliope
from calliope import cli, AttrDict
_THIS_DIR = os.path.dirname(__file__)
_MODEL_NATIONAL = os.path.join(
_THIS_DIR,
'..', 'example_models', 'national_scale', 'model.yaml'
)
class Tes... | apache-2.0 | -8,558,425,467,268,571,000 | 38.442623 | 118 | 0.576891 | false | 3.695853 | true | false | false |
gusDuarte/software-center-5.2 | softwarecenter/ui/gtk3/views/webkit.py | 1 | 6532 | # Copyright (C) 2010 Canonical
#
# Authors:
# Michael Vogt
# Gary Lasker
#
# 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; version 3.
#
# This program is distributed in the hope that it will b... | lgpl-3.0 | -6,916,611,946,628,458,000 | 35.49162 | 79 | 0.640539 | false | 3.797674 | false | false | false |
geodynamics/pylith | pylith/bc/AuxSubfieldsTimeDependent.py | 1 | 2804 | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... | mit | 8,185,914,683,688,222,000 | 33.617284 | 127 | 0.628031 | false | 3.627426 | false | false | false |
bitmazk/django-download-stats | download_stats/tests/test_settings.py | 1 | 1778 | """Settings that need to be set in order to run the tests."""
import os
DEBUG = True
SITE_ID = 1
APP_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
ROOT_URLCONF = 'downloa... | mit | -3,483,909,533,195,000,000 | 23.356164 | 61 | 0.664792 | false | 3.21519 | false | true | false |
shipperizer/reimagined-garbanzo | server.py | 1 | 3198 | #!/usr/bin/env python
import logging
import sys
from os import environ
from time import sleep
import json
from uuid import uuid4
from celery import Celery
import pika
def init_logging():
logger = logging.getLogger('server')
logger.setLevel(logging.INFO)
sh = logging.StreamHandler()
formatter = loggi... | mit | 5,642,650,292,563,329,000 | 29.169811 | 127 | 0.626329 | false | 3.771226 | false | false | false |
amaork/libi2c | example/pylibi2c_tools.py | 1 | 2343 | # -*- coding: utf-8 -*-
import argparse
import pylibi2c
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# Required args
parser.add_argument('-b', '--bus', help='i2c bus, such as /dev/i2c-1', type=str, required=True)
parser.add_argument('-d', '--device', help='i2c device address, such as... | mit | -5,291,170,457,087,977,000 | 40.105263 | 115 | 0.608621 | false | 3.309322 | false | false | false |
crisisking/skybot | plugins/misc.py | 1 | 1609 | import socket
import subprocess
import time
from util import hook, http
socket.setdefaulttimeout(10) # global setting
def get_version():
try:
stdout = subprocess.check_output(['git', 'log', '--format=%h'])
except:
revnumber = 0
shorthash = '????'
else:
revs = stdout.spli... | unlicense | -14,688,733,195,193,010 | 22.661765 | 71 | 0.63207 | false | 3.224449 | false | false | false |
tecan/xchat-rt | plugins/scripts/encryption/supybot-bitcoin-marketmonitor-master/GPG/plugin.py | 1 | 48123 | ###
# GPG - supybot plugin to authenticate users via GPG keys
# Copyright (C) 2011, Daniel Folkinshteyn <nanotube@users.sourceforge.net>
#
# 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, ... | gpl-2.0 | 1,254,094,022,718,385,700 | 45.227666 | 248 | 0.573655 | false | 4.191534 | false | false | false |
guildai/guild | guild/commands/s3_sync_impl.py | 1 | 2872 | # Copyright 2017-2021 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 | -9,071,415,864,090,001,000 | 23.758621 | 74 | 0.602019 | false | 3.410926 | false | false | false |
theandygross/Figures | src/Figures/Boxplots.py | 1 | 11851 | """
Created on Apr 24, 2013
@author: agross
"""
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import Stats.Scipy as Stats
from Figures.FigureHelpers import latex_float, init_ax
from Figures.FigureHelpers import prettify_ax
from Helpers.Pandas import match_series, true_index
colors = plt.rcPa... | mit | -5,644,501,510,842,958,000 | 35.24159 | 83 | 0.562062 | false | 3.091028 | false | false | false |
jackuess/pirateplay.se | lib/pirateplay/lib/rerequest.py | 1 | 2797 | import itertools, re, urllib2
DEBUG = False
def set_debug(debug):
global DEBUG
DEBUG = debug
def debug_print(s):
if DEBUG:
print(' DEBUG ' + s)
def del_empty_values(d):
for key in d.keys():
if d[key] == '' or d[key] == None:
del d[key]
return d
def req_key(req):
key = req.get_full_url()
key += str(re... | gpl-3.0 | 6,237,002,380,573,614,000 | 23.982143 | 81 | 0.65463 | false | 2.901452 | false | false | false |
bakhtout/odoo-educ | addons/openeducat_erp/op_book_movement/op_book_movement.py | 1 | 6674 | # -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 | 8,279,460,501,516,231,000 | 45.027586 | 214 | 0.534612 | false | 3.764241 | false | false | false |
PitchBlackPL/Solar | solar_vis.py | 1 | 4499 | # coding: utf-8
# license: GPLv3
"""Модуль визуализации.
Нигде, кроме этого модуля, не используются экранные координаты объектов.
Функции, создающие гaрафические объекты и перемещающие их на экране, принимают физические координаты
"""
header_font = "Arial-16"
"""Шрифт в заголовке"""
window_width = 800
"""Ширина окна... | gpl-3.0 | -5,636,459,889,650,575,000 | 26.588235 | 117 | 0.651538 | false | 1.745348 | false | false | false |
anchore/anchore-engine | anchore_engine/services/apiext/api/controllers/images.py | 1 | 55254 | import datetime
import io
import json
import re
import tarfile
from connexion import request
import anchore_engine.apis
import anchore_engine.common
import anchore_engine.common.images
import anchore_engine.configuration.localconfig
import anchore_engine.subsys.metrics
from anchore_engine import utils
from anchore_en... | apache-2.0 | 974,177,585,576,685,700 | 33.255425 | 169 | 0.59326 | false | 4.332628 | true | false | false |
bradyt/taskdsetup | taskdsetup/client.py | 1 | 1148 |
import os
import shutil
import subprocess
from .core import (ensure_dir, canonicalize)
def main(data, server, port, data_orgs_dict):
task_dir = os.path.expanduser('~/.task')
ensure_dir(task_dir)
d = data_orgs_dict
for org in d:
for uuid in d[org]:
full_name = d[org][uuid]
... | gpl-3.0 | -2,863,920,050,727,676,000 | 46.833333 | 99 | 0.436411 | false | 3.763934 | false | false | false |
openstack/python-heatclient | heatclient/common/utils.py | 1 | 14093 | # Copyright 2012 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 | 5,589,027,641,212,562,000 | 30.387528 | 79 | 0.598027 | false | 3.879163 | false | false | false |
DSP-sleep/CUBIC-Atlas | cell_mapping.py | 1 | 19899 | # cell_mapping.py gives annotation to the detected cells through registering
# the sample brain to the CUBIC-Atlas.
# Please see the help.txt file for details.
#
# Copyright (C) 2017, Tatsuya C. Murakami
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 | -1,083,745,853,646,201,300 | 39.281377 | 275 | 0.582843 | false | 3.379586 | false | false | false |
JointBox/jbaccess-server | jbaccess/jba_core/migrations/0001_initial.py | 1 | 4911 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-03 12:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | gpl-3.0 | 390,449,312,591,841,100 | 37.069767 | 204 | 0.534922 | false | 4.38091 | false | false | false |
erudit/eruditorg | eruditorg/erudit/migrations/0057_auto_20161123_1703.py | 1 | 1817 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-11-23 22:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("erudit", "0056_auto_20161111_1125"),
]
operations =... | gpl-3.0 | 4,950,922,311,403,660,000 | 32.018182 | 100 | 0.449339 | false | 4.766404 | false | false | false |
strahlex/pymachinetalk | pymachinetalk/machinetalk_core/common/subscribe.py | 1 | 9269 | # coding=utf-8
import zmq
import threading
import uuid
from google.protobuf.message import DecodeError
from fysom import Fysom
import machinetalk.protobuf.types_pb2 as pb
from machinetalk.protobuf.message_pb2 import Container
class Subscribe(object):
def __init__(self, debuglevel=0, debugname='Subscribe'):
... | mit | 6,050,195,010,412,286,000 | 31.985765 | 83 | 0.561657 | false | 3.904381 | false | false | false |
naronald/SUMOoD | peopleCollection.py | 1 | 3732 | # -*- coding: utf-8 -*-
"""
@file peopleCollection.py
@author Nicole Ronald
@date 2014-03-17
@version
Defines a collection of people who request trips from the
demand-responsive transportation system.
SUMOoD (SUMO on Demand); see http://imod-au.info/sumood
Copyright (C) 2014 iMoD
SUMO, Simulation of Urban MOb... | gpl-2.0 | -7,704,165,522,916,638,000 | 32.026549 | 78 | 0.576367 | false | 4.065359 | false | false | false |
rgtjf/Semantic-Texual-Similarity-Toolkits | stst/libs/word_aligner/aligner.py | 1 | 88789 | # coding: utf8
from .config import *
from .parseUtil import *
from .util import *
from .wordSim import *
##############################################################################################################################
def alignNouns(source, target, sourceParseResult, targetParseResult, existingAlignmen... | mit | -1,147,417,126,804,859,300 | 60.83078 | 438 | 0.624526 | false | 3.702164 | false | false | false |
Machyne/econ_comps | full_2011.py | 1 | 6827 | import os
import numpy as np
import pandas as pd
from pandas.tools.plotting import scatter_matrix
import pylab
import statsmodels.formula.api as smf
import statsmodels.stats.api as sms
from industry_to_days import get_census_mapper
"""
USAGE:
python full_2011.py
CREATES:
results/2011/clean.csv
results/2011/corr.txt... | bsd-3-clause | -5,579,685,436,232,137,000 | 32.465686 | 78 | 0.573458 | false | 3.104593 | false | false | false |
jaggerkyne/PyKids | Part_02/Chapter_16/stick_figure_game.py | 1 | 4105 | # Another code written by Jagger Kyne
# Copyright 2006 - 2013 Jagger Kyne <jagger.kyne@gmail.com>
__author__ = 'Jagger Kyne'
from tkinter import *
import random
import time
class Game:
def __init__(self):
self.tk = Tk()
self.tk.title("Mr. Stick Man Race for the Exit")
self.tk.resizable(0,... | gpl-2.0 | -187,072,159,571,861,660 | 31.078125 | 108 | 0.613886 | false | 2.790619 | false | false | false |
ZeitOnline/briefkasten | application/briefkasten/views.py | 1 | 4612 | # -*- coding: utf-8 -*-
import pkg_resources
import colander
from pyramid.httpexceptions import HTTPFound
from pyramid.renderers import get_renderer
from briefkasten import _, is_equal
title = "ZEIT ONLINE Briefkasten"
version = pkg_resources.get_distribution("briefkasten").version
class _FieldStorage(colander.Schem... | bsd-3-clause | 6,311,432,539,316,876,000 | 31.013889 | 99 | 0.662473 | false | 3.822554 | false | false | false |
CoffeRobot/amazon_challenge_motion | src/amazon_challenge_motion/bt_motion.py | 1 | 18421 | #!/usr/bin/env python
# motion_utils
#
# Created on: April 13, 2015
# Authors: Francisco Vina
# fevb <at> kth.se
#
# Copyright (c) 2015, Francisco Vina, CVAP, KTH
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | bsd-3-clause | 7,456,780,908,091,122,000 | 33.239777 | 156 | 0.575267 | false | 3.760155 | false | false | false |
SaschaMester/delicium | gpu/command_buffer/build_gles2_cmd_buffer.py | 1 | 350071 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""code generator for GLES2 command buffers."""
import itertools
import os
import os.path
import sys
import re
import platform
fro... | bsd-3-clause | -6,201,626,395,720,655,000 | 30.532246 | 91 | 0.593157 | false | 3.301934 | true | false | false |
thushear/MLInAction | ml/word2vec.py | 1 | 1733 | # import logging
# logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
#
# from gensim import corpora
#
# documents = ["Human machine interface for lab abc computer applications",
# "A survey of user opinion of computer system response time",
# "The EPS ... | apache-2.0 | 635,369,198,885,061,200 | 36.673913 | 96 | 0.680323 | false | 3.656118 | false | false | false |
pczhaoyun/wolf | wolf/spiders/wolves/kuyi.py | 1 | 1132 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import urlparse
from scrapy import log
from scrapy.http import Request
from base.base_wolf import Base_Wolf
class Wolf(Base_Wolf):
def __init__(self, *args, **kwargs):
super(Wolf, self).__init__(*args, **kwargs)
self.name = 'kuyi'
s... | apache-2.0 | 3,645,572,560,154,432,000 | 34.375 | 108 | 0.595406 | false | 3.369048 | false | false | false |
jhunkeler/cbc | cbc/cli/remote_purge.py | 1 | 1921 | #!/usr/bin/env python
'''
DANGER. THIS WILL WIPE AN ENTIRE ANACONDA.ORG REPOSITORY CHANNEL.
YOU HAVE BEEN WARNED.
'''
import argparse
from subprocess import check_output, STDOUT
def choose(answer):
answer = answer.upper()
if answer == 'Y' or answer == 'YES':
return True
return False
def prompt... | bsd-3-clause | -7,318,447,129,900,656,000 | 25.315068 | 87 | 0.588235 | false | 3.834331 | false | false | false |
uclouvain/OSIS-Louvain | base/tests/factories/organization.py | 1 | 1749 | ##############################################################################
#
# 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 bus... | agpl-3.0 | 8,396,260,698,860,064,000 | 42.7 | 87 | 0.671053 | false | 4.084112 | false | false | false |
Jumpscale/jumpscale_core8 | lib/JumpScale/tools/openwrt/base.py | 1 | 1470 | import functools
class BaseService:
def __init__(self, wrt):
self._wrt = wrt
self._package = None
@property
def package(self):
if self._package is None:
self._package = self._wrt.get(self.PACKAGE)
return self._package
class BaseServiceSection:
def __ne... | apache-2.0 | -5,721,080,247,273,872,000 | 24.344828 | 75 | 0.564626 | false | 4.027397 | false | false | false |
slightlynybbled/tk_tools | tests/test_ButtonGrid.py | 1 | 1266 | import tkinter as tk
import pytest
from tk_tools import ButtonGrid
from tests.test_basic import root
@pytest.fixture
def btn_grid_3col(root):
eg = ButtonGrid(root, 3, headers=['a', 'b', 'c'])
yield eg
eg._redraw()
def test_creation_with_header(root):
ButtonGrid(root, 3, headers=['a', 'b', 'c'])
... | mit | -2,284,509,175,240,753,200 | 20.1 | 54 | 0.580569 | false | 2.864253 | true | false | false |
daknuett/python3-nf | py/nf/integral/base/rect/line.py | 1 | 1526 | from ..do.line import integrate_numbers_rect
from ....util.do.iterators import WidthIterator, StepIterator
def integrate_steps(f, rnge, steps):
"""
Approximate the integral of ``f``
in the range ``rnge`` using a decomposition
with ``steps`` subintervalls.
``f`` must return ``float`` or ``int``.
``rnge`` must... | agpl-3.0 | -7,385,630,607,984,555,000 | 25.310345 | 92 | 0.671691 | false | 2.992157 | false | false | false |
seebass/drf-tools | drf_tools/views.py | 1 | 8766 | from datetime import datetime
import logging
from rest_framework import status
from rest_framework.mixins import RetrieveModelMixin, ListModelMixin, DestroyModelMixin
from rest_framework.parsers import MultiPartParser
from rest_framework.relations import PrimaryKeyRelatedField
from rest_framework.renderers import JSON... | mit | 4,416,811,976,637,126,700 | 33.924303 | 126 | 0.689824 | false | 4.022946 | false | false | false |
Triv90/Heat | heat/openstack/common/version.py | 1 | 3271 |
# Copyright 2012 OpenStack LLC
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
#
# 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 | 3,530,254,261,941,602,000 | 37.034884 | 79 | 0.631611 | false | 4.713256 | false | false | false |
heromod/migrid | mig/webserver/webserver.py | 1 | 1966 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# webserver - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of... | gpl-2.0 | -8,052,238,269,252,702,000 | 23.886076 | 81 | 0.722787 | false | 3.627306 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.