repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
korzeniewskipl/python-mode | pymode/libs2/rope/refactor/method_object.py | 91 | 3868 | import warnings
from rope.base import pyobjects, exceptions, change, evaluate, codeanalyze
from rope.refactor import sourceutils, occurrences, rename
class MethodObject(object):
def __init__(self, project, resource, offset):
self.pycore = project.pycore
this_pymodule = self.pycore.resource_to_py... | lgpl-3.0 | 7,947,187,193,815,242,000 | 43.45977 | 83 | 0.577818 | false | 3.963115 | false | false | false |
QuLogic/meson | packaging/createpkg.py | 1 | 5166 | #!/usr/bin/env python3
# Copyright 2017-2021 The Meson development team
#
# 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... | apache-2.0 | -1,194,580,459,872,830,000 | 43.153846 | 98 | 0.567944 | false | 3.922551 | false | false | false |
jayrambhia/DeskWid | deskwid/deskwid.py | 1 | 11379 | """
Author : Jay Rambhia
email : jayrambhia777@gmail.com
Git : https://github.com/jayrambhia
gist : https://gist.github.com/jayrambhia
=============================================
Name : deskwid
Repo : DeskWid
Git : https://github.com/jayrambhia/DeskWid
version 0.1
"""
# Copyright (c) 2012 Jay Rambhia
# Pe... | apache-2.0 | 5,749,711,084,392,760,000 | 37.836177 | 104 | 0.59311 | false | 3.777888 | false | false | false |
gobelinus/plugin.video.radbox | default.py | 1 | 7080 | import sys
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
import urllib
import urllib2
from urlparse import urlparse
from BeautifulSoup import BeautifulStoneSoup
# plugin constants
plugin_handle = int(sys.argv[1])
plugin_id = 'plugin.video.radbox.me'
plugin_settings = xbmcaddon.Addon(id=plugin_id)
#con... | gpl-3.0 | -5,217,067,238,438,116,000 | 32.875598 | 116 | 0.557203 | false | 4.092486 | false | false | false |
ychab/punchline | punchline/core/tests/factories.py | 1 | 2067 | from datetime import timedelta
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from django.utils.translation import get_language, to_locale
import factory
from factory import f... | mit | -5,652,665,913,883,730,000 | 30.318182 | 74 | 0.640542 | false | 4.244353 | false | false | false |
glederrey/camogen | camogen/pattern.py | 1 | 2929 | #! /usr/bin/env python
# coding=utf-8
#
# Copyright © 2017 Gael Lederrey <gael.lederrey@epfl.ch>
#
# Distributed under terms of the MIT license.
#
# Based on the code of Ulf Astrom (http://www.happyponyland.net)
import numpy as np
from random import shuffle
class Pattern:
"""
The pattern is composed of sets ... | mit | 6,346,363,980,301,421,000 | 32.655172 | 102 | 0.565574 | false | 3.972863 | false | false | false |
Sakiut/FalltoSkyBot | FalltoSkyBot.py | 1 | 4354 | # -*- coding: utf-8 -*-
import asyncio
import discord
from discord.ext import commands
from libraries.perms import *
from libraries.library import *
from libraries import anilist
from libraries import mal
from libraries import lol
from libraries import youtube
from libra... | agpl-3.0 | 5,215,326,779,590,970,000 | 31.646617 | 134 | 0.652695 | false | 3.245142 | false | false | false |
Locu/chronology | jia/commands/runscheduler.py | 1 | 1737 | """Starting point for the Jia Scheduler
Never replace this runscheduler.py script with a WSGI server that serves
from multiple threads/processes. Because each Flask app would receive its own
instance of Scheduler (with its own task queue), this application is not
parallelizable. Running multiple Flask instances will r... | mit | -1,032,099,308,154,276,100 | 31.773585 | 77 | 0.653425 | false | 4.039535 | false | false | false |
priba/aproximated_ged | main.py | 1 | 1118 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
main.py
Distance computation and comparison between different aproximated graph edit distance techniques with the same costs.
"""
from VanillaAED import VanillaAED
from VanillaHED import VanillaHED
import os
import glob
import itertools
import networkx as nx
_... | mit | -5,977,965,559,311,782,000 | 24.409091 | 194 | 0.608229 | false | 2.852041 | false | false | false |
roscoeZA/GeoGigSync | src/geogigpy/examples.py | 1 | 3558 | import geogig
from geogigpy.commit import Commit
import os
import time
from geogigpy.repo import Repository
def squash_latest(repo, n, message = None):
'''
Squashes the latest n commits into a single one.
If a message is passed, it uses it for the resulting commit.
Otherwise, it uses the messages from ... | cc0-1.0 | 1,279,075,348,563,506,200 | 28.907563 | 95 | 0.571388 | false | 3.77707 | false | false | false |
johntellsall/shotglass | shotglass/app/management/commands/spider.py | 1 | 5601 | """
label.py --
"""
# pylint: disable=W0640
# list files in Git branch
# git ls-tree --name-status --full-tree -r v4.0.0
from __future__ import print_function
import itertools
import os
import re
import subprocess
from django.core.management.base import BaseCommand
from palettable import colorbrewer
from PIL import... | mit | -1,025,960,441,505,374,200 | 26.865672 | 88 | 0.573112 | false | 3.527078 | false | false | false |
rev112/playterminal | games/utils/stepic_client.py | 1 | 1714 | import requests
STEPIC_URL = 'https://stepic.org/'
STEPIC_API_URL = STEPIC_URL + 'api/'
STEPIC_OAUTH_TOKEN_URL = STEPIC_URL + 'oauth2/token/'
STEPIC_API_ATTEMPTS_URL = STEPIC_API_URL + 'attempts'
STEPIC_API_ATTEMPT_URL = STEPIC_API_ATTEMPTS_URL + '/{id}'
class LoginError(Exception):
"""An exception raised when ... | apache-2.0 | 3,823,306,025,411,629,000 | 34.708333 | 75 | 0.61902 | false | 3.616034 | false | false | false |
Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/spline/get_spline_samples.py | 1 | 1806 | import bpy
from ... base_types.node import AnimationNode
from . spline_evaluation_base import SplineEvaluationBase
class GetSplineSamplesNode(bpy.types.Node, AnimationNode, SplineEvaluationBase):
bl_idname = "an_GetSplineSamplesNode"
bl_label = "Get Spline Samples"
def create(self):
self.newInput(... | gpl-3.0 | 5,299,046,533,360,349,000 | 45.307692 | 129 | 0.645072 | false | 3.685714 | false | false | false |
CactusDev/CactusBot | cactusbot/commands/magic/alias.py | 2 | 1908 | """Alias command."""
from . import Command
from ...packets import MessagePacket
class Alias(Command):
"""Alias command."""
COMMAND = "alias"
@Command.command(role="moderator")
async def add(self, alias: "?command", command: "?command", *_: False,
raw: "packet"):
"""Add a n... | mit | 2,289,707,931,717,732,900 | 31.896552 | 78 | 0.539308 | false | 4.468384 | false | false | false |
acesonl/remotecare | remotecare/core/views.py | 1 | 4190 | # -*- coding: utf-8 -*-
"""
Module containing a baseclass for all formviews and a
function for serving files via the X-Sendfile directive.
:subtitle:`Class and function definitions:`
"""
import os
import posixpath
from django.conf import settings
from django.views.static import serve, directory_index
from django.htt... | gpl-3.0 | 7,615,098,070,892,999,000 | 35.754386 | 78 | 0.639141 | false | 4.232323 | false | false | false |
pcmagic/stokes_flow | head_Force/helix_strain_rate.py | 1 | 14541 | import sys
import petsc4py
petsc4py.init(sys.argv)
import numpy as np
import pickle
# from time import time
# from scipy.io import loadmat
# from src.stokes_flow import problem_dic, obj_dic
from src.geo import *
from petsc4py import PETSc
from src import stokes_flow as sf
from src import slender_body as slb
# from s... | mit | -8,241,114,434,260,275,000 | 41.147826 | 98 | 0.580015 | false | 3.08072 | false | false | false |
keen99/SickRage | sickbeard/scene_exceptions.py | 3 | 12381 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 | 4,838,817,458,302,959,000 | 36.978528 | 127 | 0.636217 | false | 3.974639 | false | false | false |
stevertaylor/NX01 | NX01_bayesutils.py | 1 | 38843 |
"""
Created by stevertaylor
Copyright (c) 2014 Stephen R. Taylor
Code contributions by Rutger van Haasteren (piccard) and Justin Ellis (PAL/PAL2).
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.ndimage.filters as filter
try:
... | mit | -443,844,931,980,766,500 | 33.588602 | 146 | 0.57771 | false | 3.10322 | false | false | false |
ongspxm/webpy-user_auth | login.py | 1 | 2977 | import web
import time
import json
import hashlib
import random as rand
urls = [
'/si', 'SignIn',
'/su', 'SignUp',
'/so', 'SignOut'
]
app = web.application(urls, globals())
db = web.database(dbn='sqlite', db='database.db')
db.query('''
CREATE TABLE IF NOT EXISTS users(
uid INTE... | mit | -7,934,062,007,674,383,000 | 24.114035 | 113 | 0.507222 | false | 3.544048 | false | false | false |
Craxic/plyj | plyj/parsers/type_parser.py | 1 | 11563 | #!/usr/bin/env python2
from plyj.model.classes import WildcardBound, Wildcard
from plyj.model.modifier import BasicModifier
from plyj.model.source_element import collect_tokens
from plyj.model.type import Type, TypeParameter
class TypeParser(object):
@staticmethod
def p_modifiers_opt(p):
"""modifiers_... | bsd-3-clause | 8,764,992,733,921,963,000 | 27.553086 | 78 | 0.461904 | false | 3.653397 | false | false | false |
Pexego/sale_commission | __unported__/production_costs/mrp_production.py | 3 | 15241 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 | -8,389,467,133,961,617,000 | 56.942966 | 211 | 0.602795 | false | 4.216657 | false | false | false |
JNU-Include/CNN | lib/cnn.py | 1 | 3148 | from abc import abstractmethod
import tensorflow as tf
# import matplotlib.pyplot as plt
class CNN:
X = None
X_2d = None
Y = None
hypothesis = None
cost_function = None
optimizer = None
sess = None
costs = []
weights = []
biases = []
logs = []
@abstractmethod
... | mit | 2,364,735,504,427,076,000 | 34.923077 | 129 | 0.616702 | false | 2.218527 | false | false | false |
interlegis/sigi | sigi/apps/casas/migrations/0017_auto_20210416_0841.py | 1 | 1652 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('casas', '0016_auto_20210407_1559'),
]
operations = [
migrations.AlterField(
mod... | gpl-2.0 | -2,913,698,605,413,775,400 | 35.711111 | 159 | 0.605327 | false | 3.754545 | false | false | false |
google/prediction_framework | util/backfill.py | 1 | 2972 | """The module executes manual backfilling, if not possible to do it via BQ UI."""
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licen... | apache-2.0 | -2,515,570,229,196,856,300 | 27.576923 | 81 | 0.684388 | false | 3.655597 | false | false | false |
JackDanger/sentry | src/sentry/api/endpoints/project_key_details.py | 1 | 5359 | from __future__ import absolute_import
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry import features
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.... | bsd-3-clause | 1,844,525,207,111,555,300 | 33.133758 | 78 | 0.590222 | false | 4.526182 | false | false | false |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/pandas/tseries/period.py | 9 | 37251 | # pylint: disable=E1101,E1103,W0232
from datetime import datetime, timedelta
import numpy as np
import pandas.tseries.frequencies as frequencies
from pandas.tseries.frequencies import get_freq_code as _gfc
from pandas.tseries.index import DatetimeIndex, Int64Index, Index
from pandas.tseries.base import DatelikeOps, Dat... | apache-2.0 | 176,077,118,830,696,740 | 33.619888 | 138 | 0.558857 | false | 4.056517 | false | false | false |
sillvan/hyperspy | hyperspy/tests/signal/test_signal_subclass_conversion.py | 2 | 2914 | from nose.tools import assert_true, assert_equal, raises
import numpy as np
from hyperspy.signal import Signal
from hyperspy import signals
from hyperspy.exceptions import DataDimensionError
class Test1d():
def setUp(self):
self.s = Signal(np.arange(2))
@raises(DataDimensionError)
def test_as_i... | gpl-3.0 | 1,742,805,369,718,233,000 | 27.851485 | 72 | 0.586136 | false | 2.97955 | true | false | false |
snowplow/snowplow-python-tracker | snowplow_tracker/subject.py | 1 | 5113 | """
subject.py
Copyright (c) 2013-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Version 2.0. You may obtain a copy of the Apache License Version 2.0 ... | apache-2.0 | -6,939,349,307,530,068,000 | 29.987879 | 98 | 0.506748 | false | 4.293031 | false | false | false |
rocktavious/pyversion | version_tests/test_version.py | 1 | 5918 | import os
import unittest as unittest
import sys
from contextlib import contextmanager
from io import StringIO
from version.version import Version, VersionUtils, parse_version
from version.cli import main
class TestSemanticVersion(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.version = Ve... | mit | -9,050,871,076,357,910,000 | 36.220126 | 130 | 0.601386 | false | 3.197191 | true | false | false |
sony/nnabla | python/src/nnabla/utils/audio_utils/common.py | 1 | 4670 | # Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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 ... | apache-2.0 | -8,377,945,302,023,448,000 | 33.338235 | 111 | 0.659529 | false | 3.721116 | false | false | false |
vicalloy/lbforum-site | lbforum_site/settings/base.py | 1 | 5246 | """
Django settings for lbforum_site project.
Generated by 'django-admin startproject' using Django 1.10.
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... | bsd-3-clause | 7,336,714,896,714,217,000 | 25.494949 | 91 | 0.68414 | false | 3.320253 | false | false | false |
mtreinish/stestr | stestr/commands/slowest.py | 2 | 3472 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 | -3,476,049,485,416,303,600 | 33.039216 | 78 | 0.65265 | false | 3.892377 | true | false | false |
davislidaqing/Mcoderadius | toughradius/console/admin/node.py | 5 | 3863 | #!/usr/bin/env python
#coding=utf-8
import sys, os
from bottle import Bottle
from bottle import request
from bottle import response
from bottle import redirect
from bottle import MakoTemplate
from bottle import static_file
from bottle import abort
from beaker.cache import cache_managers
from toughradius.console.libs.p... | agpl-3.0 | -7,872,724,241,092,292,000 | 29.710744 | 89 | 0.658681 | false | 2.844564 | false | false | false |
quinten991/PenO3OnTrack | Raspi/GPScalculations.py | 1 | 2134 | import time
import pytz
from datetime import datetime
timeZone = pytz.timezone('Europe/Brussels')
def GPStime(line):
"""Returns the time difference between the internal clock
from the Raspberry Pi and the time given by the GPS reciever
"""
GPSdataList = line.split(':')
for i in range(1, 6):
... | mit | -1,915,177,450,629,096,200 | 30.382353 | 127 | 0.6209 | false | 3.129032 | false | false | false |
mibanescu/pulp | server/pulp/server/managers/repo/group/publish.py | 11 | 6349 | from gettext import gettext as _
import logging
import sys
from celery import task
from pulp.common import dateutils
from pulp.plugins.conduits.repo_publish import RepoGroupPublishConduit
from pulp.plugins.config import PluginCallConfiguration
from pulp.plugins.loader import api as plugin_api
from pulp.plugins.model ... | gpl-2.0 | -2,524,351,315,354,337,300 | 39.43949 | 98 | 0.650339 | false | 4.258216 | true | false | false |
eadains09/scripts | pycamera/__init__.py | 1 | 1665 | # Copyright 2014 by Akkana Peck: share and enjoy under the GPL v2 or later.
'''picamera: find and use cameras of various types.
A pyphoto object will have the following methods:
__init__(verbose) # Set verbose to True for chatter on stdout
take_still(outfile=None)
# If outfile is no... | gpl-2.0 | -7,666,903,436,547,779,000 | 29.272727 | 75 | 0.637237 | false | 3.667401 | false | false | false |
aron-bordin/Python-File-Crawler | db.py | 1 | 3385 | import pymysql
class db():
'''
Class to manage all connections with the database.
Get and add files/keywords
'''
def __init__(self, host=None, user=None, password=None, database=None):
'''
Initialize the database object with this settings
:param host: MySQL/MariaDB h... | gpl-3.0 | 1,110,684,551,281,763,500 | 28.189655 | 126 | 0.552437 | false | 4.225968 | false | false | false |
eexcalibur/partition_downhill_simplex | problems/bbob/createfolders.py | 1 | 1777 | #!/usr/bin/env python
"""
This module generates the folder structure for doing a BBOB experiment.
To use this module either do from the shell command line:
$ python createfolders.py DATAPATH
or from the python command line:
>>> import createfolders
>>> createfolders.main('DATAPATH')
"... | gpl-2.0 | 3,042,903,582,523,611,000 | 25.924242 | 75 | 0.582442 | false | 4.057078 | false | false | false |
mvduin/py-uio | src/uio/ti/pwmss.py | 1 | 2141 | from uio.device import Uio
from uio.utils import fix_ctypes_struct
from pathlib import Path
import ctypes
from ctypes import c_uint32 as u32
from .ecap import ECap
from .eqep import EQep
from .epwm import EPwm
@fix_ctypes_struct
class Cfg( ctypes.Structure ):
_fields_ = [
("ident", u32),
... | mit | 2,865,257,816,749,103,000 | 29.585714 | 78 | 0.510509 | false | 3.568333 | false | false | false |
oshtaier/robottelo | tests/foreman/cli/test_report.py | 1 | 2222 | # -*- encoding: utf-8 -*-
# vim: ts=4 sw=4 expandtab ai
"""Test class for Reports CLI."""
import random
from robottelo.cli.report import Report
from robottelo.common import ssh
from robottelo.common.decorators import run_only_on
from robottelo.test import CLITestCase
@run_only_on('sat')
class TestReport(CLITestCase... | gpl-3.0 | 1,944,407,990,434,366,000 | 26.097561 | 72 | 0.620612 | false | 4.003604 | true | false | false |
ttfkam/pg_gnufind | gnufind/__init__.py | 1 | 10923 | from multicorn import ForeignDataWrapper
import re
from subprocess import Popen, PIPE
# wrapper 'geekspeak.FindWrapper',
# options(
# mimetype='/usr/bin/file -b -i {}' # mime type
# season='s(?P<season>\\d{2})e(?P<episode>\\d{2})(?: - (?P<name>.*?))\.(?P<extension>[^.]{3,4})'
# )
class FindWrapper(ForeignDataWr... | gpl-2.0 | -207,143,510,356,773,250 | 34.343042 | 100 | 0.575314 | false | 3.435357 | false | false | false |
zippynk/quotebot | sendquote.py | 1 | 1113 | #!/usr/bin/env python
# A python module for submitting Quotes to the Backtick Quote DB. Distributed as part of quotebot by Nathan Krantz-Fire (a.k.a zippynk). https://github.com/zippynk/quotebot
# Based on Hardmath123's jokebot. https://github.com/hardmath123/jokebot
# Many thanks to Hardmath123 and Nickolas360 for ... | mpl-2.0 | -7,677,775,591,704,952,000 | 32.727273 | 173 | 0.695418 | false | 3.198276 | false | false | false |
ulich/docker-httpavail | httpavail.py | 1 | 1072 | import sys, requests, argparse
from retrying import retry
argparser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
argparser.add_argument('url', help='the URL to check')
argparser.add_argument('-t', '--timeout', type=int, default=120, help='total timeout in seconds to wait for the ur... | mit | -4,041,030,128,070,851,600 | 38.703704 | 133 | 0.709888 | false | 3.514754 | false | false | false |
qdulab/OEMS | experiment/migrations/0002_auto__chg_field_lesson_name__del_field_experiment_status__del_field_ex.py | 1 | 8379 | # -*- 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):
# Changing field 'Lesson.name'
db.alter_column(u'experiment_lesson', 'name', self.gf('django.db.models.fiel... | mit | -7,694,462,357,899,617,000 | 66.580645 | 187 | 0.567251 | false | 3.707522 | false | false | false |
mrclro/kbxrec | project/locations/admin.py | 1 | 1511 | from django.contrib import admin
from .models import *
class CountryAdmin(admin.ModelAdmin):
prepopulated_fields = {"iso": ("name",)}
list_display = ('name', 'nationality', 'iso',)
ordering = ('name',)
admin.site.register(Country, CountryAdmin)
class RegionAdmin(admin.ModelAdmin):
prepopulated_field... | mit | -8,884,092,660,275,789,000 | 29.836735 | 53 | 0.648577 | false | 3.530374 | false | false | false |
pawelmhm/recenseo.es | src/forms.py | 1 | 1765 | from wtforms import *
class ReviewThis(Form):
review_text = TextAreaField('review text', [validators.Length(min=6, max=300)])
rating = IntegerField('rating', [validators.Required(), \
validators.NumberRange(min=1, max=5)])
anonymous = BooleanField('Anonymous')
class Register(Form):
username = ... | mit | 2,074,300,919,342,506,000 | 48.055556 | 94 | 0.666856 | false | 4.182464 | false | false | false |
sahilshah/sparse-app | server/OpenSfM/opensfm/reconstruction.py | 1 | 28473 | # -*- coding: utf-8 -*-
from collections import defaultdict
from itertools import combinations
import os
from subprocess import call, Popen, PIPE
import tempfile
import datetime
from itertools import combinations
import numpy as np
import cv2
import json
import time
import math
import networkx as nx
from networkx.alg... | bsd-2-clause | 7,921,792,755,362,348,000 | 34.996207 | 127 | 0.58501 | false | 3.534823 | true | false | false |
scotwk/cloud-custodian | tools/c7n_sphere11/c7n_sphere11/wsgigw.py | 10 | 4025 | # Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | 5,032,557,467,919,798,000 | 33.110169 | 74 | 0.624099 | false | 3.826046 | false | false | false |
siwl/test_website | config.py | 1 | 1074 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get('MAIL_USE... | mit | 5,071,288,839,026,248,000 | 24.571429 | 71 | 0.685289 | false | 3.215569 | true | false | false |
hforge/itools | test/test_handlers.py | 1 | 5066 | # -*- coding: UTF-8 -*-
# Copyright (C) 2006-2010 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2007 Nicolas Deram <nderam@gmail.com>
# Copyright (C) 2008 Gautier Hayoun <gautier.hayoun@supinfo.com>
# Copyright (C) 2008, 2010 David Versmisse <versmisse@lil.univ-littoral.fr>
# Copyright (C) 2010 Hervé Cauwelier... | gpl-3.0 | -3,087,671,834,970,600,000 | 26.516304 | 75 | 0.589571 | false | 3.739291 | true | false | false |
auto-mat/prahounakole | apps/cyklomapa/feeds.py | 1 | 1206 | # -*- coding: utf-8 -*-
from django.contrib.syndication.views import Feed
from .models import Poi
class UzavirkyFeed(Feed):
title = "Městem na kole - aktuální uzavírky"
link = "/"
description = u"Aktuální uzavírky cyklostezek a cyklotras"
def get_object(self, request):
return request.mesto
... | gpl-3.0 | -323,450,097,134,005,500 | 25 | 130 | 0.656355 | false | 3.22372 | false | false | false |
Mutnick/nicotine-plus | plugins/discogs-url2search/__init__.py | 2 | 2289 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# For debugging
NPLUS = True
class FakePlugin(object):
def log(self, text):
print text
from urllib import urlopen
try:
from pynicotine.pluginsystem import BasePlugin
except ImportError:
NPLUS = False
print "It seems this plugin is not loaded from ... | gpl-3.0 | -2,157,501,380,250,271,000 | 30.356164 | 127 | 0.577982 | false | 3.554348 | false | false | false |
jubalfh/cog | cog/util/misc.py | 1 | 2465 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Activision Publishing, Inc.
# Copyright (c) 2014, 2015 Miroslaw Baran <miroslaw+p+cog@makabra.org>
# the cog project is free software under 3-clause BSD licence
# see the LICENCE file in the project root for copying terms
# miscellaneous utility functions, some of them b... | bsd-3-clause | 1,912,482,964,506,129,700 | 23.166667 | 81 | 0.606897 | false | 3.588064 | false | false | false |
BeckmaR/EBEK | EBEK/EBEK_appl/models.py | 1 | 1301 | from django.db import models
class Compartment(models.Model):
name = models.CharField(max_length=20, unique=True)
folder = models.CharField(max_length=20)
def __str__(self):
return "Compartment " + str(self.name) + " in folder " + str(self.folder)
class Tag(models.Model):
text = models.Char... | gpl-3.0 | 5,257,635,778,689,197,000 | 23.092593 | 84 | 0.669485 | false | 3.525745 | false | false | false |
alisw/alibuild | alibuild_helpers/log.py | 1 | 3904 | import logging
import sys
import re
from os import getenv
import socket, time
import datetime
from alibuild_helpers.utilities import format, to_unicode
debug, error, warning, info, success = (None, None, None, None, None)
def dieOnError(err, msg):
if err:
error("%s", msg)
sys.exit(1)
class LogFormatter(log... | gpl-3.0 | 9,001,031,913,166,068,000 | 35.485981 | 97 | 0.587346 | false | 3.218467 | false | false | false |
IG2AD/pypi | an_example_pypi_project/roman.py | 1 | 2360 | import re
class OutOfRangeError(ValueError):
pass
class NotIntegerError(ValueError):
pass
class InvalidRomanNumeralError(ValueError):
pass
roman_numeral_map = (('M', 1000),
('CM', 900),
('D', 500),
('CD', 400),
('C... | gpl-2.0 | -9,041,611,013,733,321,000 | 26.44186 | 78 | 0.472881 | false | 3.564955 | false | false | false |
rsepassi/tensor2tensor | tensor2tensor/models/research/transformer_sketch.py | 1 | 5499 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | -759,488,439,848,641,900 | 32.327273 | 76 | 0.696672 | false | 3.312651 | false | false | false |
tbrunetti/GWAS_Analysis_Pipeline | summary_stats.py | 1 | 9600 | import pandas as pd
import statistics as stats
import matplotlib as mpl
mpl.use('Agg') # bypass X11 if using server where X11 is not supported
import matplotlib.pyplot as plt
import numpy as np
from fpdf import FPDF
def parameters_and_thresholds(params):
pdf = FPDF()
pdf.add_page()
pdf.set_margins(20, 10, 20)
p... | mit | -197,858,565,334,188,320 | 41.105263 | 181 | 0.650208 | false | 2.468501 | false | false | false |
tiexinliu/odoo_addons | smile_checklist/models/ir_actions.py | 5 | 2056 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 | 8,154,791,202,431,233,000 | 35.070175 | 78 | 0.581712 | false | 4.221766 | false | false | false |
hlamer/enki | enki/plugins/session.py | 3 | 4134 | """
session --- Reopen files when starting
======================================
"""
from PyQt5.QtCore import QTimer
import os.path
from enki.core.core import core
from enki.core.defines import CONFIG_DIR
import enki.core.json_wrapper
_AUTO_SAVE_INTERVAL_MS = 60 * 1000
def getSessionFilePath():
if core.comma... | gpl-2.0 | -5,263,369,657,246,779,000 | 32.072 | 107 | 0.592404 | false | 4.393199 | false | false | false |
Smirl/teaflask | app/api_1_0/brewers.py | 1 | 1215 | from . import api, api_paginate, api_get
from ..models import Brewer, Pot, Role
@api.route('/brewers/')
def get_brewers():
"""All brewers."""
return api_paginate(
'api.get_brewers',
Brewer.query,
tag_name='brewers'
)
@api.route('/brewers/<int:id_>/')
def get_brewer(id_):
"""G... | gpl-2.0 | -122,816,460,982,154,640 | 22.365385 | 70 | 0.590947 | false | 2.838785 | false | false | false |
realestate-com-au/iam_syncr | iam_syncr/roles.py | 1 | 4045 | from iam_syncr.errors import BadRole, CantFindTemplate, NoTemplates
from iam_syncr.amazon.roles import AmazonRoles
from iam_syncr.statements import Statements
from iam_syncr.helpers import listified
from option_merge import MergedOptions
import logging
import six
log = logging.getLogger("iam_syncr.roles")
class Role... | mit | -6,501,061,031,152,026,000 | 41.578947 | 129 | 0.665019 | false | 4.08999 | false | false | false |
nop33/indico | indico/modules/rb/models/util.py | 2 | 1968 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | gpl-3.0 | -8,131,858,855,135,184,000 | 37.588235 | 107 | 0.675813 | false | 3.967742 | false | false | false |
DailyActie/Surrogate-Model | 01-codes/tensorflow-master/tensorflow/python/framework/test_util_test.py | 1 | 6543 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit | -1,844,383,254,325,671,700 | 35.966102 | 86 | 0.608589 | false | 3.864737 | true | false | false |
BackupTheBerlios/freespeak | freespeak/ui/intro.py | 1 | 6227 | # FreeSpeak - a GUI frontend to online translator engines
# freespeak/ui/intro.py
#
## Copyright (C) 2008, 2009 Luca Bruno <lethalman88@gmail.com>
##
## This file is part of FreeSpeak.
##
## FreeSpeak is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as ... | gpl-2.0 | 6,007,230,680,022,231,000 | 31.602094 | 95 | 0.595632 | false | 3.958678 | false | false | false |
Kiganshee/Flip-Sign | TransitionFunctions.py | 1 | 14898 | from PIL import Image
from PIL import ImageDraw
from PIL import ImageChops
import random
def message_transition(func):
func.is_message_transition = True
func.is_display_transition = False
def display_transition(func):
func.is_message_transition = False
func.is_display_transition = True
def FlashStars... | cc0-1.0 | -4,221,173,926,858,153,500 | 42.564327 | 119 | 0.687542 | false | 4.056085 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/ripper/plugins/getfromlist.py | 1 | 1046 |
from plugin import plugin
def description():
return 'gets files listed in a file'
class getfromlist(plugin, ):
def __init__(self, os, maxsize):
plugin.__init__(self, os, maxsize, __name__)
print ('loaded %s' % __name__)
def preGet(self):
lFiles = self.listFiles()
size = ... | unlicense | 6,442,459,602,165,250,000 | 28.083333 | 144 | 0.559273 | false | 3.803636 | false | false | false |
LethusTI/supportcenter | vendor/lethusbox/lethusbox/municipios/utils.py | 1 | 1339 | # -*- coding: utf-8 -*-
__all__ = ('Loader',)
import os
from bz2 import decompress
from django.utils import simplejson as json
from models import *
class Loader(object):
"""
Responsável por pré carregar os municipios e estados brasileiros
"""
def __init__(self):
compressed = open(
... | gpl-3.0 | 1,218,452,904,028,062,500 | 28.043478 | 68 | 0.537425 | false | 3.399491 | false | false | false |
mmcardle/MServe | django-mserve/mservefuse.py | 1 | 20837 | #!/usr/bin/python
########################################################################
#
# University of Southampton IT Innovation Centre, 2011
#
# Copyright in this library belongs to the University of Southampton
# University Road, Highfield, Southampton, UK, SO17 1BJ
#
# This software may not be used, sold, lice... | lgpl-2.1 | 2,203,922,001,253,221,000 | 38.843212 | 94 | 0.522052 | false | 4.135146 | false | false | false |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/stat/cluster/clusternode_stats.py | 3 | 7687 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 | 1,298,700,422,590,174,700 | 29.383399 | 269 | 0.7099 | false | 3.40434 | false | false | false |
GoogleCloudPlatform/appengine-taskqueue-counter | main.py | 1 | 1222 | import os
import jinja2
import webapp2
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
JINJA_ENV = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
class Counter(ndb.Model):
count = ndb.IntegerProperty(indexed=False)
class CounterHandler(webap... | apache-2.0 | -8,398,371,206,901,393,000 | 25.565217 | 73 | 0.646481 | false | 3.85489 | false | false | false |
jledbetter/openhatch | mysite/customs/management/commands/customs_twist.py | 1 | 9348 | # This file is part of OpenHatch.
# Copyright (C) 2011 Jack Grigg
# Copyright (C) 2010, 2011 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | agpl-3.0 | -8,602,715,330,285,050,000 | 40.919283 | 99 | 0.622379 | false | 4.057292 | false | false | false |
alexandru/TheBuzzEngine | buzzengine/frontend/views.py | 2 | 2072 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Alexandru Nedelcu"
__email__ = "noreply@alexn.org"
import hashlib
import re
from urllib import quote
from datetime import datetime, timedelta
from django.utils import simplejson as json
from google.appengine.api import users
from django.shortcuts i... | mit | 114,990,475,185,297,310 | 29.485294 | 132 | 0.675193 | false | 3.851301 | false | false | false |
ppwwyyxx/dash-docset-tensorflow | transform.py | 1 | 4728 | #!/usr/bin/env python
# File: transform.py
import sys
import os
import pathlib
import magic
import multiprocessing as mp
import time
from urllib.parse import urlparse
import bs4
import tqdm
import pygments
import pygments.lexers
import pygments.formatters
from selectolax.parser import HTMLParser
LEXER = pygments.le... | apache-2.0 | -1,010,773,604,168,603,000 | 30.52 | 109 | 0.580372 | false | 3.504818 | false | false | false |
alex-ip/geophys2netcdf | geophys2netcdf/metadata/_csw_metadata.py | 1 | 13415 | #!/usr/bin/env python
"""XML Metadata module
Author: Alex Ip (alex.ip@ga.gov.au)
"""
import xml.dom.minidom
import logging
import os
import re
import unicodedata
from _xml_metadata import XMLMetadata
logger = logging.getLogger('root.' + __name__)
class CSWMetadata(XMLMetadata):
"""Subclass of XMLMetadata to m... | apache-2.0 | -6,911,574,159,285,492,000 | 41.452532 | 165 | 0.620127 | false | 3.544254 | false | false | false |
Ubuntu-Solutions-Engineering/glance-simplestreams-sync-charm | hooks/charmhelpers/contrib/network/ip.py | 1 | 1852 | import sys
from charmhelpers.fetch import apt_install
from charmhelpers.core.hookenv import (
ERROR, log,
)
try:
import netifaces
except ImportError:
apt_install('python-netifaces')
import netifaces
try:
import netaddr
except ImportError:
apt_install('python-netaddr')
import netaddr
def... | agpl-3.0 | -8,030,243,180,346,129,000 | 25.84058 | 76 | 0.603132 | false | 4.0883 | false | false | false |
samuelpulfer/ldaptools | lib/dirtools.py | 1 | 1714 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" ldap basic utilities
- connect
- disconnect
- search: search directory
- len: length of search result
- listdn: list DN's of a result (for debugging)
"""
import sys, os
import socket
import ldap
# module variables
_conn = None
def disconnect():
global _conn
_conn... | mit | -7,395,518,207,272,815,000 | 21.552632 | 90 | 0.68203 | false | 2.950086 | false | false | false |
MatthewScholefield/mycroft-simple | mycroft/util/misc.py | 1 | 5233 | # Copyright (c) 2017 Mycroft AI, Inc.
#
# This file is part of Mycroft Light
# (see https://github.com/MatthewScholefield/mycroft-light).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
... | apache-2.0 | -6,781,883,764,488,552,000 | 31.91195 | 97 | 0.61265 | false | 3.778339 | false | false | false |
MartinPyka/Parametric-Anatomical-Modeling | pam/pam_anim/gui.py | 1 | 5596 | """PAM-anim GUI module"""
import bpy
from .. import model
from . import anim_functions
class PamAnimDataPane(bpy.types.Panel):
"""A panel for loading model data"""
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
bl_context = "objectmode"
bl_label = "Model data"
bl_category = "PAM Animate... | gpl-2.0 | 6,540,760,405,333,051,000 | 26.840796 | 99 | 0.614189 | false | 3.484433 | false | false | false |
kaaveland/spurv | spurv/enc.py | 1 | 1522 | # coding=utf-8
# Copyright (c) 2013 Robin Kåveland Hansen
#
# This file is a part of spurv. It is distributed under the terms
# of the modified BSD license. The full license is available in
# LICENSE, distributed as part of this software.
"""
This module exists for encoding convenience and string-compatibility
with bot... | bsd-3-clause | 3,094,334,529,286,396,400 | 27.166667 | 71 | 0.654175 | false | 3.8025 | false | false | false |
chryswoods/SireTests | unittests/SireMove/simulation.py | 1 | 3475 |
from Sire.Mol import *
from Sire.IO import *
from Sire.Vol import *
from Sire.FF import *
from Sire.MM import *
from Sire.CAS import *
from Sire.Maths import *
from Sire.Qt import *
from Sire.Units import *
from Sire.System import *
from Sire.Move import *
from Sire.Cluster import *
import sys
t = QTime()
cljff = I... | gpl-2.0 | 8,143,206,868,404,663,000 | 21.861842 | 85 | 0.611223 | false | 2.993109 | false | false | false |
taxido/django-storages | setup.py | 5 | 1272 | from setuptools import setup
import storages
def read(filename):
with open(filename) as f:
return f.read()
setup(
name='django-storages-redux',
version=storages.__version__,
packages=['storages', 'storages.backends'],
author='Josh Schneier',
author_email='josh.schneier@gmail.com',
... | bsd-3-clause | -1,177,335,634,741,110,800 | 29.285714 | 75 | 0.593553 | false | 3.889908 | false | false | false |
kevbradwick/rockyroad | rockyroad/elements.py | 1 | 2134 | from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
class WebElement:
"""
WebElement
A WebElement represents a single object on the web page. It could be
anything node from the DOM.
"""
_locator = None
def __init__(self, element_id=None... | bsd-3-clause | 4,684,066,832,095,494,000 | 30.382353 | 79 | 0.579663 | false | 4.119691 | false | false | false |
adamcharnock/django-pipeline-forgiving | setup.py | 1 | 1051 | #!/usr/bin/env python
from os.path import exists
from setuptools import setup, find_packages
from django_pipeline_forgiving import __version__
setup(
name='django-pipeline-forgiving',
version=__version__,
# Your name & email here
author='Adam Charnock',
author_email='adam@adamcharnock.com',
#... | mit | 6,570,844,872,426,273,000 | 35.241379 | 99 | 0.694577 | false | 3.780576 | false | false | false |
danbradham/mvp | mvp/renderglobals.py | 1 | 1327 | # -*- coding: utf-8 -*-
import maya.cmds as cmds
RENDER_GLOBALS = [
'multiSampleEnable', 'multiSampleCount', 'colorBakeResolution',
'bumpBakeResolution', 'motionBlurEnable', 'motionBlurSampleCount',
'ssaoEnable', 'ssaoAmount', 'ssaoRadius', 'ssaoFilterRadius',
'ssaoSamples'
]
class RenderGlobals(obj... | mit | -60,658,502,519,145,816 | 25.54 | 70 | 0.645064 | false | 4.045732 | false | false | false |
Ox0000/mergehosts | mergehosts.py | 1 | 7800 | #!/usr/bin/python
# merges a couple of files into a single hosts file
# Licensed under the GNU General Public License version 2
import argparse
import os
import random
import shutil
import socket
import sys
import tempfile
import time
VERBOSITY_ERR = 0
VERBOSITY_WARN = 1
VERBOSITY_INFO = 2
VERBOSITY_VERBOSE = 3
SINK... | gpl-2.0 | -6,510,210,628,805,188,000 | 32.766234 | 238 | 0.642308 | false | 3.753609 | false | false | false |
AlanJAS/turtleart | collaboration/xocolor.py | 2 | 7814 | # Copyright (C) 2006-2007 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is dis... | mit | -2,796,400,216,265,054,700 | 26.807829 | 72 | 0.491554 | false | 2.490121 | false | false | false |
bristy/HackYourself | hackerearth/hacker_earth/web_engage/interest.py | 1 | 1563 | # http://www.hackerearth.com/webengage-hiring-challenge-1/
# algorithm/numbers-of-interest-2-1/
from sys import stdin
def getInt():
return map(int, stdin.readline().split())
# @param integer n
# list of primes below n
def sieve(n):
primes = list()
s = [True] * n
s[0] = s[1] = False
for i in ... | mit | 1,900,720,930,956,455,000 | 20.410959 | 58 | 0.37364 | false | 3.263048 | false | false | false |
jacquesqiao/Paddle | python/paddle/fluid/tests/unittests/test_dist_word2vec.py | 1 | 6940 | # Copyright (c) 2018 PaddlePaddle Authors. 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 app... | apache-2.0 | 2,837,698,968,285,008,400 | 33.187192 | 90 | 0.598271 | false | 3.71123 | true | false | false |
rustychris/stompy | stompy/xr_transect.py | 1 | 44596 | """
Methods for representing and manipulating transects
in xarray datasets.
Transects being a dataset with the form
x(s), y(s), z(s,k) or z(k)
u(s,k), v(s,k), etc.
where x(s),y(s) describes a polyline.
names are somewhat standardized, but can generally be provided
U: vector valued velocity in geographic coordinate ... | mit | 1,655,688,946,458,658,000 | 34.00471 | 105 | 0.593035 | false | 3.366244 | false | false | false |
chillbear/django-staticfiles-webpack-dev | webpack/storage.py | 1 | 5275 | # coding=utf-8
"""
"""
from django.contrib.staticfiles.storage import StaticFilesStorage
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from storages.backends.s3boto import S3BotoStorage
import os
import json
class WebpackDevServerStorage(StaticFilesStorage):
"""
Simpl... | mit | -747,429,896,498,978,000 | 38.365672 | 126 | 0.637156 | false | 4.147013 | true | false | false |
scottmc94/pingpong | e.py | 1 | 1748 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#read the file
#save the gameid
#save the matchid
#save array of players
#Ask:
#Winner?
#Check against array, if found go else verify
#Loser?
#Wins?
#if wins 3 put in 3 games.
#If wins 2, ask which game lost.
#
import time
file = open("games.txt","r")
players = []
m = [... | gpl-2.0 | 2,487,090,715,263,169,500 | 21.126582 | 81 | 0.600686 | false | 2.362162 | false | false | false |
ahwillia/tensortools | tensortools/cpwarp/datasets.py | 1 | 3512 | import numpy as np
from scipy.ndimage import gaussian_filter1d
from tensortools.cpwarp.shifted_cp import ShiftedCP
from tensortools.cpwarp.multishift import MultiShiftModel
def simulate_shifted_cp(
shape, rank, max_shift=.5, smoothness=2.0, noise_scale=.1, seed=None):
"""
Generates a synthetic datase... | mit | 4,637,174,803,562,872,000 | 30.079646 | 78 | 0.643508 | false | 3.784483 | false | false | false |
dhermes/project-euler | python/complete/no097.py | 1 | 1294 | #!/usr/bin/env python
# P = 28433 x 2^7830457 + 1 is a big prime number
# Find the last ten digits of this prime number.
# P mod 10**10 is relevant to us
# From CRT, we can find this in 2**10 and 5**10
# P == 1 mod 2**10 since 2**7830457 == 0
# Since 2 is a unit in integers mod 5**10, we know it has
# order dividin... | apache-2.0 | 8,797,771,689,344,988,000 | 29.093023 | 77 | 0.588872 | false | 2.729958 | false | false | false |
liyao001/BioQueue | worker/cluster_models/HTCondor.py | 1 | 5845 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/5/3 2:05
# @Project : BioQueue
# @Author : Li Yao
# @File : HTCondor.py
from __future__ import print_function
def cancel_job(job_id):
"""
Cancel job
:param job_id: int, job id
:return: if success, return 1, else return 0
"""
... | apache-2.0 | -1,828,707,365,313,281,300 | 30.594595 | 136 | 0.547648 | false | 3.514732 | false | false | false |
mscuthbert/abjad | abjad/tools/selectortools/PatternedSelectorCallback.py | 2 | 2418 | # -*- encoding: utf-8 -*-
from abjad.tools import rhythmmakertools
from abjad.tools import selectiontools
from abjad.tools.abctools import AbjadValueObject
class PatternedSelectorCallback(AbjadValueObject):
r'''A patterned selector callback.
'''
### CLASS VARIABLES ###
__slots__ = (
'_apply_... | gpl-3.0 | 8,528,677,674,797,157,000 | 26.804598 | 74 | 0.516956 | false | 4.70428 | false | false | false |
ashmastaflash/cloudpassage_slim | test/integration/test_integration_halo_session.py | 1 | 2253 | import imp
import os
import sys
module_name = 'cloudpassage_slim'
here_dir = os.path.dirname(os.path.abspath(__file__))
module_path = os.path.join(here_dir, '../../')
sys.path.append(module_path)
fp, pathname, description = imp.find_module(module_name)
cloudpassage_slim = imp.load_module(module_name, fp, pathname, de... | bsd-2-clause | -3,721,976,291,040,768,000 | 40.722222 | 77 | 0.617843 | false | 3.581876 | true | false | false |
unioslo/cerebrum | contrib/copy_with_size_check.py | 1 | 5653 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 | -210,513,088,896,430,560 | 32.252941 | 80 | 0.651689 | false | 4.046528 | false | false | false |
Schevo/schevogtk | schevogtk2/grid.py | 1 | 16917 | """Grid widget."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
import gc
import datetime
import sys
from schevo.lib import optimize
from schevo.error import EntityDoesNotExist
import gtk
from gtk import gdk
from schevogtk2.utils import gproperty, gsignal, type_register
WATCH = gdk.Curso... | mit | 6,734,482,078,654,481,000 | 33.737166 | 80 | 0.576166 | false | 3.911445 | false | false | false |
rbaravalle/imfractal | test_generates_data_correlations_BioAsset.py | 1 | 2395 | from os import listdir
from os.path import isfile, join
import numpy as np
import sys, getopt
import csv
from imfractal import *
test_usage_str = sys.argv[0] + " -p <path_mats>"
meta_pos_filename = 2
meta_pos_start_data = 2
meta_pos_end_data = 20
argv = sys.argv[1:]
path_mats = ''
TRANSFORMED_INPUT_STR = ''
if MF... | bsd-3-clause | 1,555,069,778,232,781,000 | 22.722772 | 93 | 0.609603 | false | 2.857995 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.