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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kfcpaladin/sze-the-game | renpy/debug.py | 1 | 1941 | # Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | mit | 1,905,923,962,222,076,000 | 31.898305 | 92 | 0.729006 | false | 4.069182 | false | false | false |
pdebuyl/cg_md_polymerization | code/epoxy_setup.py | 1 | 3569 | import espressopp
import mpi4py.MPI as MPI
def get_velocity(system, n):
"""Obtain total velocity of a espressopp system."""
total_v = espressopp.Real3D(0.)
total_m = 0.
for i in range(n):
p = system.storage.getParticle(i)
total_v += p.v*p.mass
total_m += p.mass
return total_... | bsd-3-clause | -3,066,971,447,088,541,000 | 34.336634 | 155 | 0.674979 | false | 3.042626 | false | false | false |
hpparvi/PyTransit | pytransit/lpf/tessoclttvlpf.py | 1 | 3050 | # PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | gpl-2.0 | -3,970,768,457,033,635,300 | 40.780822 | 105 | 0.65541 | false | 3.125 | false | false | false |
RJRetro/mame | scripts/build/makedep.py | 2 | 8404 | #!/usr/bin/python
##
## license:BSD-3-Clause
## copyright-holders:Miodrag Milanovic
from __future__ import with_statement
import sys
## to ignore include of emu.h add it always to list
files_included = ['src/emu/emu.h']
include_dirs = ['src/emu/', 'src/devices/', 'src/mame/']
mappings = dict()
deps_files_included... | gpl-2.0 | 5,154,461,549,047,289,000 | 32.086614 | 92 | 0.510114 | false | 3.543002 | false | false | false |
pku9104038/edx-platform | common/lib/capa/capa/capa_problem.py | 1 | 28574 | #
# File: capa/capa_problem.py
#
# Nomenclature:
#
# A capa Problem is a collection of text and capa Response questions.
# Each Response may have one or more Input entry fields.
# The capa problem may include a solution.
#
"""
Main module which shows problems (of "capa" type).
This is used by capa_module.
"""
from ... | agpl-3.0 | -9,036,447,143,522,534,000 | 37.718157 | 115 | 0.585042 | false | 4.429391 | false | false | false |
JonathanSalwan/Triton | src/examples/python/proving_opaque_predicates.py | 1 | 3432 | #!/usr/bin/env python3
## -*- coding: utf-8 -*-
##
## Example to detect opaque predicates. This example is based
## on the Tomislav Zubcic's blog post [0,1] =).
##
## Output:
##
## $ python3 proving_opaque_predicates.py
## xor eax, eax
## jo 7
## opaque predicate: never taken
## ----------------------------------
... | apache-2.0 | -7,506,264,363,885,100,000 | 26.238095 | 115 | 0.540501 | false | 2.918367 | true | false | false |
mekkablue/Glyphs-Scripts | Kerning/kernanalysis.py | 1 | 7373 | # -*- coding: utf-8 -*--- --
from __future__ import print_function
from GlyphsApp import Glyphs
if Glyphs.versionNumber >= 3.0:
from GlyphsApp import LTR
from Foundation import NSNotFound
intervalList = (1,3,5,10,20)
categoryList = (
"Letter:Uppercase",
"Letter:Lowercase",
"Letter:Smallcaps",
"Punctuation",
"Sym... | apache-2.0 | -576,480,600,968,904,300 | 29.849372 | 152 | 0.714092 | false | 3.276889 | false | false | false |
Pablites/W2IO | setup.py | 1 | 1491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: W2IO (https://github.com/Pablites/W2IO)
# Authors: Paweł Wichary & Michał Waleszczuk
# Date: 21 July 2015
# Licence: available on github
"""
Setup of W2IO install all files of plugin
Instal directory is: ~/.starcluster/plugins
"""
import logging
import os
impor... | lgpl-3.0 | -7,020,134,948,091,910,000 | 30.020833 | 104 | 0.733378 | false | 3.229935 | true | true | false |
m3h0w/jigsaw_friend | trackbar.py | 1 | 1497 | """
usage: threshold_custom = tb.SimpleTrackbar(img, "ImgThresh")
"""
import cv2
import numpy as np
def empty_function(*arg):
pass
def SimpleTrackbar(img, win_name):
trackbar_name = win_name + "Trackbar"
cv2.namedWindow(win_name)
cv2.createTrackbar(trackbar_name, win_name, 0, 255, empty_function)
... | mit | -5,651,194,603,384,155,000 | 28.372549 | 76 | 0.639947 | false | 2.970238 | false | false | false |
eteq/ginga | ginga/Bindings.py | 1 | 66446 | #
# Bindings.py -- Bindings classes for Ginga FITS viewer.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import math
from ginga.misc import Bunch, Settings, Callback
... | bsd-3-clause | 6,027,979,708,236,508,000 | 34.646996 | 82 | 0.523658 | false | 3.671861 | false | false | false |
yotamfr/prot2vec | src/python/pssm3go_model.py | 1 | 11287 | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
USE_CUDA = False
KERN_SIZE = 3
def set_cuda(val):
global USE_CUDA
USE_CUDA = val
def sequence_mask(sequence_length, max_len=None):
if max_len is None:
max_len = sequence_... | mit | -5,608,129,983,196,193,000 | 35.409677 | 116 | 0.611234 | false | 3.52829 | false | false | false |
eneldoserrata/marcos_openerp | addons/point_of_sale/report/pos_receipt.py | 1 | 3036 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 873,737,431,624,882,400 | 38.428571 | 131 | 0.591897 | false | 3.790262 | false | false | false |
chrysante87/pyterpol | pyterpol_test/test_hjd/test.hjd.py | 1 | 1829 | import numpy as np
import pyterpol
def load_observations(f):
"""
:param f: file
:return:
"""
# load the observations
flist = np.loadtxt(f, usecols=[0], unpack=True, dtype=str)
hjd = np.loadtxt(f, usecols=[1], unpack=True).tolist()
hjd[0] = None
# create list of observations
ob... | gpl-2.0 | -9,011,860,902,559,890,000 | 24.402778 | 87 | 0.600328 | false | 2.95 | false | false | false |
upcFrost/SDR2_translate | GuiFuncs.py | 1 | 6614 | import os, ConfigParser, PIL
from PIL import Image, ImageTk, ImageDraw, ImageFont
from PakFile import *
from GimFile import *
from Common import *
from clt import *
def showSprite(self, GameDataLoc, pars):
fn = os.path.join(GameDataLoc,'all','cg', 'bustup_%02d_%02d.gim' % (pars[1][1], pars[2][1]))
GimImage = G... | gpl-3.0 | -2,265,219,950,478,194,700 | 34.180851 | 128 | 0.579226 | false | 3.164593 | false | false | false |
lokeshsaini94/DaysCalculator | src/days_calculator.py | 1 | 2817 | # Calculates number of days between two date.
# Enter your birth date and current date. This program will calculate the number of days
def date_error_check(month1, day1, month2, day2): # Checks if dates are correct.
if month1 > 12 or month2 > 12 or day1 > 31 or day2 > 31:
return False
return True
d... | apache-2.0 | 6,824,768,713,936,740,000 | 34.658228 | 117 | 0.629393 | false | 3.260417 | false | false | false |
moshthepitt/product.co.ke | links/migrations/0001_initial.py | 1 | 1633 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 10:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | mit | 4,329,832,834,615,764,500 | 41.973684 | 157 | 0.59951 | false | 4.219638 | false | false | false |
akretion/l10n-brazil | l10n_br_base/tests/test_other_ie.py | 1 | 3687 | # -*- coding: utf-8 -*-
# @ 2018 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
import logging
_logger = logging.getLogger(__name__)
class OtherIETest(TransactionCase)... | agpl-3.0 | -2,175,972,573,397,180,000 | 34.095238 | 76 | 0.504206 | false | 3.641304 | true | false | false |
DedMemez/ODS-August-2017 | toon/DistributedNPCLaffRestock.py | 1 | 2504 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.toon.DistributedNPCLaffRestock
from otp.nametag.NametagConstants import CFSpeech, CFTimeout
from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.toon import NPCToons
from DistributedNPCToonBase import DistributedNPCToonBase
imp... | apache-2.0 | 3,289,223,680,876,199,400 | 38.419355 | 98 | 0.680911 | false | 3.602878 | false | false | false |
cerrno/neurokernel | neurokernel/tools/gpu.py | 1 | 7561 | #!/usr/bin/env python
import numbers
import numpy as np
import pycuda.driver as drv
import pycuda.elementwise as elementwise
import pycuda.gpuarray as gpuarray
from pycuda.tools import dtype_to_ctype
# List of available numerical types provided by numpy:
# XXX This try/except is an ugly hack to prevent the doc buil... | bsd-3-clause | -1,037,744,287,174,244,400 | 33.683486 | 120 | 0.622404 | false | 3.384512 | false | false | false |
TravelModellingGroup/TMGToolbox | TMGToolbox/src/XTMF_internal/delete_scenario.py | 1 | 2229 | '''
Copyright 2016 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox 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 Fou... | gpl-3.0 | -351,590,633,516,950,140 | 30.408451 | 110 | 0.638852 | false | 4.237643 | false | false | false |
google/nerfactor | third_party/xiuminglib/xiuminglib/imprt.py | 1 | 2311 | from importlib import import_module
from .log import get_logger
logger = get_logger()
# For < Python 3.6
try:
ModuleNotFoundError
except NameError:
ModuleNotFoundError = ImportError
def preset_import(name, assert_success=False):
"""A unified importer for both regular and ``google3`` modules, according
... | apache-2.0 | -7,016,370,503,272,079,000 | 27.182927 | 77 | 0.590221 | false | 3.668254 | false | false | false |
CrankWheel/grit-i18n | grit/tool/xmb.py | 1 | 11671 | #!/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.
"""The 'grit xmb' tool.
"""
import getopt
import os
from xml.sax import saxutils
from grit import grd_reader
from grit import la... | bsd-2-clause | 5,850,516,025,989,369,000 | 32.927326 | 122 | 0.639877 | false | 3.564753 | false | false | false |
zjuchenyuan/BioWeb | Lib/Bio/Blast/NCBIStandalone.py | 1 | 74989 | # Copyright 1999-2000 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Patches by Mike Poidinger to support multiple databases.
# Updated by Peter Cock in 2007... | mit | -429,756,769,175,448,800 | 39.843682 | 107 | 0.56711 | false | 3.827727 | false | false | false |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/user_interfaces/mpl_with_glade_316_sgskip.py | 1 | 1165 | """
=========================
Matplotlib With Glade 316
=========================
"""
from gi.repository import Gtk
from matplotlib.figure import Figure
from matplotlib.axes import Subplot
from numpy import arange, sin, pi
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
class Win... | mit | 7,270,442,403,777,310,000 | 24.326087 | 83 | 0.641202 | false | 3.406433 | false | false | false |
OpenGeoscience/girder_db_items | server/dbs/sqlalchemydb.py | 1 | 19936 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware 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 t... | apache-2.0 | 3,844,353,940,656,065,000 | 40.620042 | 93 | 0.578953 | false | 4.588262 | false | false | false |
0111001101111010/hyde | hyde/tests/test_model.py | 1 | 5339 | # -*- coding: utf-8 -*-
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde.model import Config, Expando
from fswrap import File, Folder
def test_expando_one_level():
d = {"a": 123, "b": "abc"}
x = Expando(d)
assert x.a == d['a']
assert x.b == d['b']
def test_expando_two_levels():
d = {... | mit | -7,763,387,247,039,466,000 | 32.36875 | 85 | 0.561341 | false | 3.131378 | true | false | false |
MikeHoffert/caladbolg-engine | caladbolg/agents/character.py | 1 | 2442 | import json
from caladbolg.agents import formulas
from caladbolg.agents.stats import Stats, EquipmentStats
class Character:
"""
Represents a player character.
Characters have stats, equipment, and leveling information.
"""
def __init__(self, character_file):
self.level = 1
... | mit | 2,006,252,693,176,594,400 | 44.075472 | 118 | 0.613432 | false | 4.464351 | false | false | false |
Parclytaxel/Kinross | kinback/algebra.py | 1 | 1782 | # Numerical algebra and methods
# Parcly Taxel / Jeremy Tan, 2018
# https://parclytaxel.tumblr.com
import numpy as np
cc_abscissas = [(np.cos(np.arange(1, 2 ** k, 2) / 2 ** k * np.pi) + 1) / 2 for k in range(2, 11)]
def ccw_generate(n):
"""Clenshaw-Curtis weights for n+1 samples where n is a power of two.
DFT-... | mit | -3,334,467,633,558,380,000 | 44.615385 | 150 | 0.562114 | false | 2.530583 | false | false | false |
StarfruitStack/crabapple | crabapple/admin/controller/deployment.py | 1 | 2202 | # Copyright 2014 The crabapple Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import datetime
from flask import render_template, redirect, request
from crabapple.objects import Commit, Deployment, DeploymentStatus
class ControllerDe... | bsd-3-clause | 6,292,805,605,715,429,000 | 37.631579 | 101 | 0.601272 | false | 4.154717 | false | false | false |
nitely/Spirit | spirit/core/utils/ratelimit/ratelimit.py | 1 | 3853 | # -*- coding: utf-8 -*-
import hashlib
import time
from django.core.cache import caches
from ...conf import settings
from ..deprecations import warn
__all__ = ['RateLimit']
TIME_DICT = {
's': 1,
'm': 60}
def validate_cache_config():
try:
cache = settings.CACHES[settings.ST_RATELIMIT_CACHE]
... | mit | -127,130,421,655,364,450 | 25.944056 | 76 | 0.563717 | false | 3.811078 | false | false | false |
joytunes/JTLocalize | localization_flow/jtlocalize/core/handle_duplicates_in_localization.py | 1 | 2004 | #!/usr/bin/env python
from localization_utils import *
import argparse
def parse_args():
""" Parses the arguments given in the command line
Returns:
args: The configured arguments will be attributes of the returned object.
"""
parser = argparse.ArgumentParser(description='Omits duplications ... | mit | -1,579,286,691,620,859,600 | 29.363636 | 106 | 0.65519 | false | 3.78828 | false | false | false |
berkeley-stat159/project-alpha | code/utils/functions/tgrouping.py | 1 | 3121 | from __future__ import absolute_import, division, print_function
from mask_phase_2_dimension_change import neighbor_smoothing
from mask_phase_2_dimension_change import masking_reshape_start, masking_reshape_end
import numpy as np
def t_binary_grouping(t, cutoff, prop = False, abs_on = False):
"""
Evaluated ... | bsd-3-clause | 1,689,663,783,410,457,000 | 31.175258 | 92 | 0.65588 | false | 3.40349 | false | false | false |
ksmit799/Toontown-Source | toontown/golf/DistributedGolfHoleAI.py | 1 | 18607 | from direct.distributed import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import *
import DistributedPhysicsWorldAI
from direct.fsm.FSM import FSM
from toontown.ai.ToonBarrier import *
from toontown.golf import GolfGlobal... | mit | 5,974,727,302,163,878,000 | 36.363454 | 185 | 0.604342 | false | 3.652729 | false | false | false |
FabriceSalvaire/monitor-server | MonitorServer/Tools/Singleton.py | 1 | 4601 | ####################################################################################################
#
# MonitorServer - A Server Monitoring Application
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | gpl-3.0 | -2,197,945,327,112,230,400 | 30.513699 | 110 | 0.433601 | false | 5.312933 | false | false | false |
RyanChinSang/ECNG3020-ORSS4SCVI | BETA/TestCode/SpchRecg/APP-SpchRecg3.py | 1 | 1382 | import os
import pocketsphinx as ps
modeldir = "C:/Python36-64/Lib/site-packages/pocketsphinx/model/"
# datadir = "C:/Python36-64/Lib/site-packages/pocketsphinx/data/"
# Create a decoder with certain model
config = ps.Decoder.default_config()
config.set_string('-hmm', os.path.join(modeldir, 'en-us'))
config.set_strin... | gpl-3.0 | 2,085,290,420,487,328,000 | 32.707317 | 99 | 0.68958 | false | 3.112613 | true | false | false |
Kocal/django-tornado-websockets | tornado_websockets/modules/progressbar.py | 1 | 3746 | # coding=utf-8
from tornado_websockets.modules.module import Module
class ProgressBar(Module):
"""
Initialize a new ProgressBar module instance.
If ``min`` and ``max`` values are equal, this progress bar has its indeterminate state
set to ``True``.
:param min: Minimum value
... | gpl-3.0 | 7,786,795,235,155,894,000 | 28.234375 | 117 | 0.552378 | false | 4.316032 | false | false | false |
zhouzhaoze/dip | project3/Proj04-04/main.py | 1 | 2549 | #!/bin/python
# *-* encoding=utf-8 *-*
'''
Image Priting Program Based on Haftoning
'''
import sys
import numpy, scipy
from scipy import ndimage
from scipy import misc
import scipy.fftpack as fftpack
import matplotlib.pyplot as plt
sys.path.append('../Proj04-01')
from DFT import DFT_2D, IDFT_2D
def en_padding(img):... | apache-2.0 | -3,213,598,260,219,212,000 | 27.322222 | 114 | 0.567674 | false | 2.585193 | false | false | false |
solarpermit/solarpermit | website/migrations/0086_auto__del_actiontutorial__del_person__del_userreward__del_applicationh.py | 1 | 68516 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'ActionTutorial'
db.delete_table('website_actiontutorial')
# Deleting model 'Perso... | bsd-3-clause | 3,161,687,375,410,409,000 | 87.983117 | 200 | 0.573939 | false | 3.582536 | false | false | false |
Upande/MaMaSe | apps/event/migrations/0001_initial.py | 1 | 3706 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import wagtail.wagtailcore.fields
from django.conf import settings
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
migrations.sw... | apache-2.0 | 5,118,050,073,958,929,000 | 41.113636 | 146 | 0.552887 | false | 4.470446 | false | false | false |
marcoscastro/facebook_profile_photo | gui.py | 1 | 1243 | from tkinter import *
from face_photo import *
from PIL import Image, ImageTk
window = Tk() # cria uma janela
window.title('Facebook profile photo') # seta o título da janela
window.geometry('450x300') # seta o tamanho da janela
entry = Entry(window, width=25, justify='center') # cria uma entrada de texto
entry.inser... | mit | 2,414,084,095,627,359,000 | 26.422222 | 77 | 0.70884 | false | 2.815068 | false | false | false |
oVirt/ovirt-scheduler-proxy | src/ovirtscheduler/oschedproxyd.py | 1 | 3539 | #
# Copyright 2013 Red Hat, 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 writing... | apache-2.0 | 651,295,214,918,901,600 | 32.386792 | 78 | 0.627578 | false | 4.274155 | false | false | false |
imapp-pl/golem | golem/ethereum/client.py | 1 | 2118 | import logging
import rlp
from eth_rpc_client import Client as EthereumRpcClient
from .node import NodeProcess
log = logging.getLogger('golem.ethereum')
class Client(EthereumRpcClient):
""" RPC interface client for Ethereum node."""
STATIC_NODES = ["enode://f1fbbeff7e9777a3a930f1e55a5486476845f799f7d603f7... | gpl-3.0 | 3,904,709,206,332,040,700 | 32.09375 | 186 | 0.635033 | false | 3.53 | false | false | false |
rajul/tvb-framework | tvb/interfaces/command/demos/datatypes/search_and_export.py | 1 | 4973 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http://... | gpl-2.0 | 4,476,070,721,329,385,000 | 40.45 | 105 | 0.626986 | false | 4.010484 | false | false | false |
andreimaximov/algorithms | leetcode/algorithms/recover-binary-tree/solution.py | 1 | 2334 | #!/usr/bin/env python
class Solution(object):
def inorder(self, root):
"""
Returns the inorder traversal of nodes in the tree.
"""
current = root
stack = []
inorder = []
while current is not None or len(stack) > 0:
# Traverse to the left most (f... | mit | 140,343,525,249,919,440 | 29.311688 | 78 | 0.532562 | false | 4.052083 | false | false | false |
Rabuske/HeartRatePython | HeartRatePython/HeartRatePython/Token.py | 1 | 1293 | import datetime
class Token(object):
accessToken = None
refreshToken = None
generationDate = None
expiresIn = None # in seconds
type = None
userId = None
def __init__(self, userId, accessToken, refreshToken, type, expiresIn, generationDate=None):
self.userId = userId
s... | gpl-3.0 | 5,066,700,721,045,928,000 | 37.058824 | 164 | 0.649652 | false | 4.536842 | false | false | false |
mpkasp/django-bom | bom/migrations/0031_auto_20200104_1352.py | 1 | 2301 | # Generated by Django 2.2.8 on 2020-01-04 13:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bom', '0030_auto_20200101_2253'),
]
operations = [
migrations.AlterField(
model_name='partrevision',
name='height_un... | gpl-3.0 | -3,665,462,270,932,256,000 | 59.157895 | 442 | 0.453193 | false | 2.996068 | false | false | false |
fjruizruano/ngs-protocols | mitobim_run.py | 1 | 3707 | #!/usr/bin/python
import sys
import os
from subprocess import call
from Bio import SeqIO
print "Usage: mitobim_run.py NumberOfReads ListOfFiles Reference [miramito/quickmito/seedmito] missmatch"
try:
nreads = sys.argv[1]
except:
nreads = raw_input("Introduce number of reads: ")
try:
lista = sys.argv[2]
... | gpl-3.0 | 8,431,332,318,362,962,000 | 37.216495 | 423 | 0.647694 | false | 2.827613 | true | false | false |
eboreapps/Scikit-Learn-Playground | ScikitlearnPlayground/CrossValidationKNN.py | 1 | 1171 | #Copyright 2016 EBORE APPS (http://www.eboreapps.com)
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#http://www.apache.org/licenses/LICENSE-2.0
#Unless required by applicable law or agreed to... | apache-2.0 | -6,109,181,488,564,701,000 | 27.585366 | 73 | 0.760034 | false | 3.384393 | false | false | false |
skosukhin/spack | var/spack/repos/builtin/packages/everytrace/package.py | 1 | 2163 | ##############################################################################
# Copyright (c) 2013-2017, 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 | 4,433,843,952,145,421,000 | 41.411765 | 79 | 0.652797 | false | 3.8625 | false | false | false |
platsch/OctoPNP | octoprint_OctoPNP/ImageProcessing.py | 1 | 11846 | # -*- coding: utf-8 -*-
"""
This file is part of OctoPNP
OctoPNP 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.
Oc... | agpl-3.0 | -1,268,269,883,371,438,300 | 39.006757 | 139 | 0.574565 | false | 3.588485 | false | false | false |
pgmillon/ansible | lib/ansible/modules/database/postgresql/postgresql_ping.py | 1 | 3674 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {... | gpl-3.0 | 6,587,041,869,324,349,000 | 23.657718 | 92 | 0.633642 | false | 3.699899 | false | false | false |
chrisspen/homebot | src/test/google_speech/vad_example.py | 1 | 3455 | #!/usr/bin/env python
import collections
import contextlib
import sys
import wave
import webrtcvad
def read_wave(path):
with contextlib.closing(wave.open(path, 'rb')) as wf:
num_channels = wf.getnchannels()
assert num_channels == 1
sample_width = wf.getsampwidth()
assert sample_wi... | mit | 2,947,711,968,839,872,500 | 33.207921 | 86 | 0.582923 | false | 3.561856 | false | false | false |
dhanababum/dj-wkhtmltopdf | djwkhtmltopdf/url_helper.py | 1 | 2993 | import re
from django.core.exceptions import ViewDoesNotExist
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.conf import settings
def extract_views_from_urlpatterns(urlpatterns, base='', namespace=None):
"""
Return a list of views from a list of urlpatterns.
Each obje... | bsd-2-clause | -2,542,504,369,017,222,000 | 33.802326 | 79 | 0.546275 | false | 4.460507 | false | false | false |
abdelhalim/gits3 | src/gits3/amazon_s3_transport.py | 1 | 5828 | # Copyright (C) 2009 Abdelhalim Ragab <abdelhalim@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3
# of the License or (at your option) any later version of
# the License... | gpl-2.0 | 1,939,522,590,412,960,500 | 31.20442 | 78 | 0.498284 | false | 4.098453 | true | false | false |
CoderDojoPL/minecraft-python | rzeka.py | 1 | 1568 | # -*- coding: utf-8 -*-
# Autor: Wojtek Gembalczyk w.gembalczyk@coderdojo.org.pl
import mcpi.minecraft as minecraft
import mcpi.block as block
import time
import math
def woda3x3(x, z):
mc.setBlocks(x, 0, z-6, x, 2, z+6, block.AIR.id) #powietrze nad rzeką
mc.setBlocks(x, 0, z-5, x, 0, z+5, block.DIRT.id) ... | gpl-2.0 | -6,279,255,793,626,819,000 | 29.72549 | 84 | 0.596682 | false | 2.035065 | false | false | false |
EventTeam/beliefs | src/beliefs/referent.py | 1 | 4770 | """ This file defines two classes, TaxonomyCell and Referent, which work in
tandem to provide the 'kind' property to all referents, and the generalization
structure. The generalization structure (a taxonomy-- a directed acyclic graph
of IS-A relationships) is automatically constructed using the object-oriented
inher... | gpl-2.0 | 2,732,122,672,072,562,700 | 36.857143 | 117 | 0.607757 | false | 4.360146 | false | false | false |
leonth/private-configs | sublime-text-3/Packages/SublimePythonIDE/server/linter.py | 1 | 6132 | # -*- coding: utf-8 -*-
import sys
import os
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib"))
import _ast
import pep8
import pyflakes.checker as pyflakes
pyflakes.messages.Message.__str__ = (
lambda self: self.message % self.message_args
)
class PyflakesLoc:
""" Error lo... | mit | 9,175,192,041,530,635,000 | 29.81407 | 83 | 0.558056 | false | 4.015717 | false | false | false |
cedriclaunay/gaffer | python/GafferImageTest/MergeTest.py | 1 | 6664 | ##########################################################################
#
# Copyright (c) 2013, 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 | 524,376,069,707,290,940 | 36.438202 | 144 | 0.656212 | false | 3.633588 | true | false | false |
softcert/vsroom | vsroom/common/historian4.py | 1 | 10451 | import os
import time
import math
import errno
import marshal
import collections
import idiokit
from idiokit import timer, xmlcore
from idiokit.xmpp.jid import JID
from abusehelper.core import bot, events, taskfarm, services
from vsroom.common import eventdb
NS = "vsr#historian"
try:
import json
JSONDecodeEr... | mit | 4,675,445,567,437,754,000 | 31.557632 | 80 | 0.48847 | false | 4.121057 | false | false | false |
mesutcang/mongodb-word2vec-doc2vec | main.py | 1 | 1814 | # -*- encoding: utf-8 -*-
from glob import glob
from pymongo import MongoClient
from gensim import models
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
def fillMongo(db):
"""
gets the mongodb connection and fills the database.
"""
for index, file in enumerate(glob('./**/*.txt',recurs... | gpl-3.0 | 2,473,236,960,632,347,600 | 26.074627 | 135 | 0.675854 | false | 2.944805 | false | false | false |
HewlettPackard/python-hpOneView | tests/unit/resources/networking/test_connection_templates.py | 2 | 3312 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 limi... | mit | -7,821,508,190,935,121,000 | 39.390244 | 101 | 0.694143 | false | 3.82448 | true | false | false |
whyflyru/django-cacheops | cacheops/query.py | 1 | 20852 | # -*- coding: utf-8 -*-
import sys
import json
import six
from funcy import select_keys, cached_property, once, once_per, monkey, wraps
from funcy.py2 import mapcat, map
from .cross import pickle, md5
import django
from django.utils.encoding import smart_str
from django.core.exceptions import ImproperlyConfigured
from... | bsd-3-clause | -3,087,637,271,154,831,400 | 37.543438 | 100 | 0.590255 | false | 4.13484 | false | false | false |
timlau/dnf-daemon | daemon/dnfdaemon-session.py | 1 | 13512 | #!/usr/bin/python3
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it w... | gpl-2.0 | 1,706,098,923,312,927,200 | 32.864662 | 79 | 0.544627 | false | 4.411361 | false | false | false |
westpark/wallball | docs/steps/code/s2d.py | 1 | 1630 | WIDTH = 640
HEIGHT = 480
class Ball(ZRect): pass
#
# The ball is a red square halfway across the game screen
#
ball = Ball(0, 0, 30, 30)
ball.center = WIDTH / 2, HEIGHT / 2
ball.colour = "red"
#
# The ball moves one step right and one step down each tick
#
ball.direction = 1, 1
#
# The ball moves at a s... | mit | 6,844,163,819,388,710,000 | 20.054054 | 68 | 0.590798 | false | 3.012939 | false | false | false |
glottobank/pycldf | src/pycldf/cli_util.py | 1 | 2128 | from clldutils.clilib import PathType
from pycldf import Dataset, Database
#
# Copied from distutils.util - because we don't want to deal with deprecation warnings.
#
def strtobool(val): # pragma: no cover
"""Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't'... | apache-2.0 | 8,012,565,799,063,346,000 | 28.555556 | 97 | 0.610902 | false | 3.546667 | false | false | false |
azumimuo/family-xbmc-addon | plugin.video.salts/scrapers/yifystreaming_scraper.py | 1 | 4784 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | gpl-2.0 | 7,210,410,083,957,632,000 | 40.241379 | 175 | 0.567099 | false | 3.908497 | false | false | false |
ua-snap/downscale | snap_scripts/epscor_sc/compare_downscaling_versions_plots_cmip5_epscor_sc_pr_compare_withNOFIX.py | 1 | 9093 | # # # # # compare tasmin, tas, tasmax in a timeseries of GeoTiff files # # # #
def transform_from_latlon( lat, lon ):
''' simple way to make an affine transform from lats and lons coords '''
from affine import Affine
lat = np.asarray( lat )
lon = np.asarray(lon)
trans = Affine.translation(lon[0], lat[0])
scale ... | mit | -2,754,196,695,637,991,000 | 37.858974 | 135 | 0.634114 | false | 2.894017 | false | false | false |
Ape/sc2skills | main.py | 1 | 2472 | #!/usr/bin/env python3
import argparse
import collections
import enum
import trueskill
from ladder import Ladder
DRAW_PROBABILITY = 0.001
OPPONENT_SIGMA = 0.1
Result = enum.Enum("Result", "win loss")
Game = collections.namedtuple("Game", "result mmr label")
def load_games(games_file):
games = []
with open... | mit | -6,900,255,387,101,599,000 | 25.569892 | 79 | 0.604614 | false | 3.408276 | false | false | false |
srkukarni/heron | integration_test/src/python/integration_test/topology/one_bolt_multi_tasks.py | 1 | 1322 | # copyright 2016 twitter. 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 agree... | apache-2.0 | 2,974,093,918,747,431,000 | 41.645161 | 81 | 0.748109 | false | 3.831884 | true | false | false |
yaybu/touchdown | touchdown/tests/stubs/aws/rest_api.py | 1 | 1606 | # Copyright 2016 Isotoma Limited
#
# 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 | -3,704,852,946,402,137,000 | 31.12 | 88 | 0.62142 | false | 4.076142 | false | false | false |
gedaskir/qmeq | qmeq/approach/base/redfield.py | 1 | 6053 | """Module containing python functions, which generate first order Redfield kernel.
For docstrings see documentation of module neumann1."""
import numpy as np
import itertools
from ...wrappers.mytypes import doublenp
from ...wrappers.mytypes import complexnp
from ..aprclass import Approach
from .neumann1 import Ap... | bsd-2-clause | -8,804,896,393,798,070,000 | 43.507353 | 101 | 0.452999 | false | 3.325824 | false | false | false |
invenia/Arbiter | setup.py | 1 | 1178 | """
to install:
python setup.py install
"""
from setuptools import setup
setup(
name="arbiter",
description="A task-dependency solver",
long_description=open('README.rst').read(),
version="0.4.0",
author="Brendan Curran-Johnson",
author_email="brendan.curran.johnson@invenia.ca",
licen... | mit | 2,089,709,813,790,238,000 | 24.06383 | 70 | 0.573854 | false | 4.147887 | false | true | false |
ak15199/rop | art/panimage.py | 1 | 2671 | from ._baseclass import ArtBaseClass
import requests
try:
from thread import start_new_thread, allocate_lock
except:
from _thread import start_new_thread, allocate_lock
import logging
from opc.image import Image
def position(matrix, image):
x = 0
y = 0
while y < (image.height-matrix.height):
... | gpl-3.0 | -6,688,805,793,518,084,000 | 25.979798 | 84 | 0.561587 | false | 3.893586 | false | false | false |
nuagenetworks/vspk-python | vspk/v6/nuallredundancygroup.py | 1 | 24239 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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,053,294,178,348,660,000 | 31.890095 | 372 | 0.601551 | false | 4.371326 | false | false | false |
waisuan/minblog_af | minblog2/helpers/databaseManager.py | 1 | 6726 | from pymongo import MongoClient
import time
from bson import ObjectId
class DatabaseManager:
# DB set-up
def __init__(self):
client = MongoClient()
db = client.flaskr
self.entries_col = db.entries
# sort by [default] descending/latest order
def get_all_entries(self, sort_by=-1)... | mit | 3,785,670,568,057,706,500 | 56.487179 | 144 | 0.381505 | false | 4.852814 | false | false | false |
haku86/happyowlweb | happyowlweb/happyowlweb/urls.py | 1 | 1074 | from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^... | mit | 1,547,584,701,885,924,400 | 33.645161 | 78 | 0.675978 | false | 3.78169 | false | true | false |
bgroff/kala-app | django_kala/api/basecamp_classic/projects/serializers.py | 1 | 1207 | from rest_framework import serializers
from projects.models import Project, Category
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = [
'id', 'name', 'organization'
]
def create(self, validated_data):
return Project.objects... | mit | -3,842,473,095,268,577,300 | 29.948718 | 117 | 0.641259 | false | 4.642308 | false | false | false |
Wolfterro/SVD | src/old/1.0/GlobalVars.py | 1 | 1651 | # -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2017 Wolfgang Almeida <wolfgang.almeida@yahoo.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, i... | mit | -2,166,897,040,673,686,500 | 34.577778 | 80 | 0.707421 | false | 3.573913 | false | false | false |
UUDigitalHumanitieslab/timealign | annotations/views.py | 1 | 25800 | import os
from collections import defaultdict
from tempfile import NamedTemporaryFile
from lxml import etree
from django.contrib import messages
from django.contrib.admin.utils import construct_change_message
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.contrib.messag... | mit | 3,640,639,079,216,742,400 | 38.389313 | 116 | 0.647868 | false | 4.208809 | false | false | false |
shubhdev/edx-platform | lms/djangoapps/certificates/tests/test_views.py | 1 | 30514 | """Tests for certificates views. """
import json
import ddt
from uuid import uuid4
from nose.plugins.attrib import attr
from mock import patch
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client impo... | agpl-3.0 | 988,242,617,299,130,100 | 40.459239 | 118 | 0.606967 | false | 3.981472 | true | false | false |
openstack/heat | heat/tests/openstack/neutron/test_sfc/test_port_chain.py | 1 | 6568 | #
# 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 agreed to ... | apache-2.0 | 103,200,701,343,941,060 | 37.409357 | 79 | 0.600792 | false | 3.923536 | true | false | false |
matrumz/RPi_Custom_Files | Printing/hplip-3.15.2/ui4/plugindiagnose.py | 1 | 3164 | # -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2011 Hewlett-Packard Development Company, L.P.
#
# 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 | 7,540,046,640,401,814,000 | 28.570093 | 161 | 0.677623 | false | 3.853837 | false | false | false |
gradiuscypher/internet_illithid | mirror_shield/endpoints/filestore.py | 1 | 2550 | import traceback
import requests
import time
import imghdr
from os.path import exists, isfile, join, isdir
from os import makedirs, listdir, walk
from flask import Blueprint, request, send_from_directory, render_template
filestore = Blueprint('callback', __name__)
@filestore.route('/clone', methods=["POST"])
def clo... | mit | -8,529,620,719,959,950,000 | 27.977273 | 111 | 0.606667 | false | 3.923077 | false | false | false |
chetan51/nupic.research | sensorimotor/tests/unit/one_d_universe_test.py | 1 | 2335 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 | 1,721,112,332,134,884,000 | 39.258621 | 76 | 0.668094 | false | 3.898164 | true | false | false |
ucfopen/canvasapi | canvasapi/course.py | 1 | 94642 | import warnings
from canvasapi.assignment import Assignment, AssignmentGroup
from canvasapi.blueprint import BlueprintSubscription
from canvasapi.canvas_object import CanvasObject
from canvasapi.collaboration import Collaboration
from canvasapi.course_epub_export import CourseEpubExport
from canvasapi.custom_gradebook... | mit | 1,574,006,498,719,888,100 | 34.499625 | 132 | 0.601858 | false | 4.06032 | false | false | false |
remeeting/mrp-score | match_ref_hyp.py | 1 | 7218 | #!/usr/bin/env python
######################################################################
#
# File: match_ref_hyp.py
# Author: Adam Janin
# Feb 23, 2017
#
# Given a reference file and a hypothesis file, figure out which parts
# of the hypotheses match which part of the reference. Output the
# hypotheses file... | apache-2.0 | 9,198,778,341,884,706,000 | 39.550562 | 431 | 0.655583 | false | 3.792958 | false | false | false |
molgor/cyberklt | cyberklt/drivers/models.py | 1 | 1851 | # -*- coding: utf-8 -*-
import numpy as np
from django.db import models
import drivers.MPL3115A2 as mpl
class Temperature(models.Model):
temp = models.FloatField(default=-999.9) #Celcius
altitude = models.FloatField(default=np.nan) #meters
timestamp = models.DateTimeField(auto_now=True)
instrument = m... | gpl-3.0 | 6,452,715,802,677,283,000 | 27.476923 | 70 | 0.594273 | false | 3.808642 | false | false | false |
nicolashainaux/mathmaker | toolbox/build_db.py | 1 | 89443 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-3.0 | 5,954,798,789,077,043,000 | 47.293737 | 79 | 0.482178 | false | 3.287027 | false | false | false |
aberon10/training | training/ticketing_system/views.py | 1 | 10444 | # -*- coding: utf-8 -*-
import time
from django.db.models import Q
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponseNotFound
from django.contrib.auth.hashers import make_password
from django.contrib.auth.hashers import check_password
from django.views.... | mit | -1,894,123,065,612,673,500 | 32.474359 | 79 | 0.486021 | false | 4.949763 | false | false | false |
MadsJensen/RP_scripts | extract_ts_epochs_interupt.py | 1 | 1207 | import sys
import numpy as np
import mne
from mne.minimum_norm import read_inverse_operator, apply_inverse_epochs
from my_settings import (mne_folder, epochs_folder, source_folder)
subject = sys.argv[1]
method = "dSPM"
snr = 1.
lambda2 = 1. / snr**2
labels = mne.read_labels_from_annot(
subject=subject, parc="PA... | bsd-3-clause | 1,019,196,104,266,555,100 | 29.175 | 78 | 0.589064 | false | 3.002488 | false | false | false |
ContinuumIO/chaco | setup.py | 1 | 2424 | # Copyright (c) 2008-2012 by Enthought, Inc.
# All rights reserved.
from os.path import join
from numpy import get_include
from setuptools import setup, Extension, find_packages
info = {}
execfile(join('chaco', '__init__.py'), info)
numpy_include_dir = get_include()
# Register Python extensions
contour = Extension... | bsd-3-clause | -1,258,937,183,096,643,600 | 31.756757 | 79 | 0.622937 | false | 3.781591 | false | false | false |
cread/ecks | ecks/plugins/disk.py | 1 | 2091 | """
Ecks plugin to collect disk usage information
Copyright 2011 Chris Read (chris.read@gmail.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lice... | apache-2.0 | 7,506,630,265,331,763,000 | 30.681818 | 109 | 0.642276 | false | 3.808743 | false | false | false |
MaxTyutyunnikov/lino | obsolete/src/sandbox/cherrypy/4/hello4.py | 1 | 1278 | #!/usr/bin/python
import cherrypy
from HyperText.Documents import Document
from HyperText import HTML as html
from lino.apps.pinboard import demo
class Root:
def __init__(self,dbsess):
self.dbsess = dbsess
def default(self,*args,**kw):
title=str(self.dbsess)
doc=Document(titl... | gpl-3.0 | 2,859,601,189,977,585,700 | 22.236364 | 65 | 0.564945 | false | 3.380952 | false | false | false |
alpine9000/amiga_examples | tools/external/amitools/amitools/binfmt/hunk/HunkReader.py | 1 | 30698 | """A class for reading Amiga executables and object files in Hunk format"""
import os
import struct
import StringIO
from types import *
from Hunk import *
class HunkReader:
"""Load Amiga executable Hunk structures"""
def __init__(self):
self.hunks = []
self.error_string = None
self.type = None
se... | bsd-2-clause | -663,237,826,273,252,900 | 30.197154 | 115 | 0.555052 | false | 3.417724 | false | false | false |
hankcs/HanLP | hanlp/components/parsers/conll.py | 1 | 2534 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-26 15:37
from typing import Union
from hanlp.utils.io_util import get_resource, TimingFileIterator
from hanlp.utils.log_util import logger
def collapse_enhanced_empty_nodes(sent: list):
collapsed = []
for cells in sent:
if isinstance(cells[0], f... | apache-2.0 | 6,535,195,912,218,275,000 | 33.712329 | 119 | 0.500395 | false | 3.874618 | false | false | false |
gautamMalu/XenInBox | pyanaconda/rescue.py | 1 | 18256 | #
# rescue.py - anaconda rescue mode setup
#
# Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. All rights reserved.
#
# 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... | gpl-2.0 | 1,907,631,276,107,746,300 | 36.030426 | 117 | 0.526731 | false | 4.390572 | false | false | false |
WilJoey/tn_ckan | ckan/migration/versions/037_role_anon_editor.py | 1 | 1728 | from sqlalchemy import *
from sqlalchemy.sql import select, and_
from migrate import *
import logging
log = logging.getLogger(__name__)
def upgrade(migrate_engine):
'''#1066 Change Visitor role on System from "reader" to "anon_editor".'''
metadata = MetaData(migrate_engine)
# get visitor ID
user = Ta... | mit | -45,108,048,257,190,770 | 35 | 101 | 0.634259 | false | 3.74026 | false | false | false |
TIGER-NET/Temporal_profile_tool | ui/dlgabout.py | 1 | 2609 | # -*- coding: utf-8 -*-
"""
***************************************************************************
temporalprofileplugin.py
-------------------------------------
Copyright (C) 2014 TIGER-NET (www.tiger-net.org)
Based on Profile tool plugin:
Copyright (C) 2012 Patrice Verchere
*************... | gpl-3.0 | -6,917,851,896,494,671,000 | 41.770492 | 106 | 0.520889 | false | 4.422034 | false | false | false |
nikkomidoy/project_soa | tests/engine.py | 1 | 5462 | from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | mit | -8,286,656,587,252,442,000 | 34.23871 | 114 | 0.617906 | false | 3.99269 | false | false | false |
GeoMop/GeoMop | testing_integration/Analysis/store_restore.py | 1 | 3919 | import os
import shutil
import subprocess
from client_pipeline.mj_preparation import *
from pipeline.pipeline_processor import *
# setting testing directory
test_dir = "d:/test/store_restore"
# remove old files
workspace = os.path.join(test_dir, "workspace")
shutil.rmtree(workspace, ignore_errors=True)
# copy file... | gpl-3.0 | -8,578,005,189,924,669,000 | 21.267045 | 98 | 0.615718 | false | 3.183591 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.