repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Kraymer/keroaek | keroaek/__init__.py | 1 | 1888 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2015, Fabrice Laporte
#
# 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 righ... | mit | 8,338,894,956,068,001,000 | 32.122807 | 78 | 0.622881 | false | 3.892784 | false | false | false |
aaronkaplan/intelmq-old | intelmq/bots/parsers/hpfeeds/parser.py | 5 | 1028 | from intelmq.lib.bot import Bot, sys
from intelmq.lib.message import Event
from intelmq.bots import utils
import redis
import json
class HPFeedsBot(Bot):
def process(self):
report = self.receive_message()
self.logger.info(report)
if report:
#m ... | agpl-3.0 | -4,485,831,432,475,425,000 | 29.151515 | 82 | 0.500973 | false | 4.161943 | false | false | false |
QuantumGhost/env_conf | env_conf/provider.py | 1 | 2387 | import os
from .errors import Missing
from .types import FieldType
class Field:
def __init__(
self, type_, desc=None, name=None,
optional=False, default=None):
self.name = name
self.desc = desc
self.optional = optional
self.default = default
self._c... | bsd-3-clause | -3,506,847,169,531,147,300 | 28.109756 | 79 | 0.532468 | false | 4.217314 | false | false | false |
jsmesami/naovoce | src/fruit/signals.py | 1 | 2817 | from django.core.mail import mail_managers
from django.dispatch import receiver
from django.utils.translation import ugettext_noop, ugettext_lazy as _
from comments.signals import comment_created
from gallery.signals import image_created
@receiver(comment_created)
def somebody_commented_your_fruit(comment, comment_t... | bsd-3-clause | -4,929,217,873,916,473,000 | 39.242857 | 86 | 0.57082 | false | 3.756 | false | false | false |
JacoRuit/tgbot | tgbot/reply_markup.py | 1 | 2761 | import json
class ReplyMarkup(object):
def dict(self):
raise NotImplementedError()
def json(self):
return json.dumps(self.dict())
def __str__(self):
return str(self.dict())
class ReplyKeyboardMarkup(ReplyMarkup):
def __init__(self, buttons = [], resize_keyboard = False, one_t... | mit | -5,428,615,211,913,268,000 | 31.104651 | 108 | 0.59761 | false | 4.030657 | false | false | false |
pymedusa/SickRage | ext/cloudscraper/captcha/deathbycaptcha.py | 2 | 7187 | from __future__ import absolute_import
import json
import requests
try:
import polling
except ImportError:
raise ImportError(
"Please install the python module 'polling' via pip or download it from "
"https://github.com/justiniso/polling/"
)
from ..exceptions import (
reCaptchaExcepti... | gpl-3.0 | 2,024,386,768,089,290,800 | 29.845494 | 121 | 0.484347 | false | 5.029391 | false | false | false |
brianrodri/oppia | python_utils.py | 2 | 21060 | # coding: utf-8
#
# Copyright 2019 The Oppia 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 requi... | apache-2.0 | 8,958,891,144,418,246,000 | 32.165354 | 157 | 0.676211 | false | 4.141593 | false | false | false |
mydongistiny/external_chromium_org | tools/telemetry/telemetry/timeline/trace_event_importer.py | 33 | 18358 | # Copyright 2014 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.
''' TraceEventImporter imports TraceEvent-formatted data
into the provided model.
This is a port of the trace event importer from
https://code.google.com/p/tr... | bsd-3-clause | -855,325,235,855,090,400 | 36.618852 | 80 | 0.59342 | false | 3.764971 | false | false | false |
tdaylan/pcat | pcat/comp_rtag.py | 1 | 2871 | from __init__ import *
def comp(nameplot):
if nameplot == 'DS_Store':
return
nameplot = nameplot[:-4]
print 'comp() working on ' + nameplot + '...'
cmnd = 'mkdir -p ' + pathimag + 'comprtag/' + nameplot + '/'
#print cmnd
os.system(cmnd)
#print
strgplot = nam... | mit | 4,369,272,736,650,746,400 | 29.542553 | 91 | 0.568443 | false | 3.281143 | false | false | false |
Cerberus98/lightshowpi | tools/sync_file_generator.py | 4 | 7604 | # sync file generator for lightshowpi
# run usage
#
# python sync_file_generator.py
#
# Enter y to confirm that you wish to run this
# Enter the path to the folder containing your audio files
# along with the sync files it will also generate a playlist file
# enter the path to this playlist file in your overrides.cfg a... | bsd-2-clause | 2,666,866,845,903,510,000 | 34.203704 | 95 | 0.604945 | false | 3.974909 | true | false | false |
tlangerak/Multi-Agent-Systems | build/lib.win32-2.7/spade/Envelope.py | 3 | 10208 | # -*- coding: utf-8 -*-
import types
import AID
try:
import json
except ImportError:
import simplejson as json
class Envelope:
"""
FIPA envelope
"""
def __init__(self, to=None, _from=None, comments=None, aclRepresentation=None, payloadLength=None, payloadEncoding=None, date=None, encrypted=No... | lgpl-2.1 | 9,053,603,676,128,585,000 | 33.958904 | 260 | 0.480701 | false | 3.564246 | false | false | false |
flapjax/FlapJack-Cogs | wordclouds/wordclouds.py | 1 | 11985 | import aiohttp
import asyncio
import discord
import functools
import re
from io import BytesIO
import numpy as np
import os
from PIL import Image
from redbot.core import Config, checks, commands
from redbot.core.utils.chat_formatting import box, pagify
from redbot.core.data_manager import cog_data_path
from wordcloud ... | mit | -1,817,683,374,265,702,000 | 34.45858 | 129 | 0.570296 | false | 4.054465 | false | false | false |
arthurbarnard/Dirac_simulation | plot_dirac.py | 1 | 3286 | import matplotlib.pyplot as plt
import numpy as np
import time
import pickle
from matplotlib.path import Path
from dirac_sheet import dirac_sheet
def main():
fig = plt.figure()
filename='E:/pyDirac/collimator_output_full_absorb
# make these smaller to increase the resolution
dx = .25
dt = 0.1
Ngrid = int(1802... | gpl-3.0 | 6,279,819,993,380,902,000 | 25.296 | 163 | 0.62538 | false | 2.102367 | false | false | false |
feliposz/learning-stuff | python/ps2a.py | 1 | 1119 | # Problem Set 2 - Problem 3
# Author: Felipo Soranz
# Time: ~ 30 Minutes
# For the Diophantine equation (i.e. a, b, c, n are all positive integers):
# a * 6 + b * 9 + c * 20 = n
# Try to find the larges possible value for n where the equation is false
count_possibles = 0
max_impossible = 0
for i in range(1,150):
... | mit | -5,938,834,110,778,184,000 | 28.447368 | 77 | 0.520107 | false | 3.586538 | false | false | false |
Toto-Azero/Wikipedia | pywikibot/ipday.py | 1 | 1805 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Toto Azéro, 2011-2015
#
# Distribué sous licence GNU GPLv3
# Distributed under the terms of the GNU GPLv3 license
# http://www.gnu.org/licenses/gpl.html
#
import pywikibot, ip
from pywikibot import pagegenerators
import os, datetime, shutil, locale, codecs
locale.se... | gpl-3.0 | 4,224,437,962,589,099,000 | 24.309859 | 140 | 0.706733 | false | 2.280457 | false | false | false |
skunkwerks/netinf | python/nilib/niforward.py | 1 | 13774 | #!/usr/bin/env python
"""
@package nilib
@file niforward.py
@brief CL-independent NetInf routing module
@version Copyright (C) 2013 SICS Swedish ICT AB
This is an adjunct to the NI URI library developed as
part of the SAIL project. (http://sail-project.eu)
Specification(s) - note, versions may change... | apache-2.0 | -1,378,632,209,066,269,400 | 33.17866 | 94 | 0.588936 | false | 4.147546 | false | false | false |
caioariede/django-location-field | tests/test.py | 1 | 1682 | from django.test import TestCase
from django.conf import settings
from location_field.apps import DefaultConfig
from tests.models import Place
from tests.forms import LocationForm
from pyquery import PyQuery as pq
import json
import location_field
class LocationFieldTest(TestCase):
def test_plain(self):
... | mit | 3,618,242,750,608,257,500 | 27.508475 | 73 | 0.617717 | false | 3.875576 | true | false | false |
lantianlz/zx | common/capty.py | 1 | 2800 | # -*- coding: utf-8 -*-
"""This tries to do more or less the same thing as CutyCapt, but as a
python module.
This is a derived work from CutyCapt: http://cutycapt.sourceforge.net/
////////////////////////////////////////////////////////////////////
//
// CutyCapt - A Qt WebKit Web Page Rendering Capture Utility
//
/... | gpl-2.0 | -537,168,439,815,580,860 | 32.333333 | 78 | 0.635 | false | 3.835616 | false | false | false |
malvikasharan/APRICOT | apricotlib/rna_related_cdd_domain.py | 1 | 5632 | #!/usr/bin/env python
# Description = RNA related CDD domain
import re
class RnaRelatedCDDSelection(object):
'''classification of data'''
def __init__(self, keywords_file,
cdd_whole_data_file,
interpro_mapped_cdd,
domain_data_path):
self._keywords_fi... | isc | -6,527,694,381,438,963,000 | 46.728814 | 85 | 0.47745 | false | 3.897578 | false | false | false |
foursquare/pants | contrib/node/src/python/pants/contrib/node/subsystems/node_distribution.py | 1 | 8456 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import filecmp
import logging
import os
import shutil
from pants.base.deprecated import ... | apache-2.0 | 5,834,333,962,453,197,000 | 41.492462 | 99 | 0.680345 | false | 3.955098 | true | false | false |
moloney/pathmap | tests/test_pathmap.py | 1 | 8162 | import nose
from nose.tools import *
from tempfile import mkdtemp
import shutil, os, sys
from os.path import join, split
#Make sure we test the local source code rather than the installed copy
test_dir = os.path.dirname(__file__)
src_dir = os.path.normpath(os.path.join(test_dir, '..'))
sys.path.insert(0, src_dir)
imp... | mit | 4,489,761,024,084,811,300 | 37.140187 | 77 | 0.451237 | false | 3.890372 | true | false | false |
ojengwa/grr | lib/worker.py | 1 | 15836 | #!/usr/bin/env python
"""Module with GRRWorker implementation."""
import pdb
import time
import traceback
import logging
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import flow
from grr.lib import master
from grr.lib import queue_manager as queue_manager_lib
from ... | apache-2.0 | -2,781,089,918,829,109,000 | 38.393035 | 80 | 0.64606 | false | 4.311462 | true | false | false |
frhumanes/consulting | web/src/private_messages/templatetags/messages.py | 1 | 2744 | # -*- encoding: utf-8 -*-
from django.core.urlresolvers import reverse
from django import template
from private_messages.models import Message
from django.utils.translation import ugettext_lazy as _
register = template.Library()
@register.filter('unread_messages')
def get_unread_messages(user):
if user is None... | apache-2.0 | 669,657,954,398,505,200 | 29.153846 | 79 | 0.638848 | false | 3.73842 | false | false | false |
AmesianX/amoco | amoco/arch/x64/formats.py | 5 | 1941 | # -*- coding: utf-8 -*-
from amoco.arch.core import Formatter
def pfx(i):
if i.misc['pfx'] is None: return ''
pfxgrp0 = i.misc['pfx'][0]
if pfxgrp0 is None: return ''
return '%s '%pfxgrp0
def mnemo(i):
mnemo = i.mnemonic.replace('cc','')
if hasattr(i,'cond'): mnemo += i.cond[0].split('/')[0]
... | gpl-2.0 | -5,184,224,687,456,694,000 | 26.338028 | 90 | 0.551777 | false | 2.733803 | false | false | false |
ChrisLR/Python-Roguelike-Template | combat/attacks/unarmed/base.py | 1 | 2256 | import abilities
from combat import targets
from combat.attacks.base import Attack
from combat.enums import DamageType
from echo import functions
from stats.enums import StatsEnum
from util import check_roller, dice
class Punch(Attack):
name = "Punch"
target_type = targets.Single
description = "Basic unar... | mit | 7,263,794,132,409,718,000 | 33.181818 | 85 | 0.657358 | false | 3.772575 | false | false | false |
brianjmiller/TinCanPython | test/activitydefinition_test.py | 2 | 9485 | # Copyright 2014 Rustici Software
#
# 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... | apache-2.0 | 6,283,205,923,333,592,000 | 36.788845 | 89 | 0.610648 | false | 4.495261 | true | false | false |
vascotenner/holoviews | holoviews/plotting/mpl/hooks.py | 1 | 9173 | import copy
import numpy as np
from matplotlib import pyplot as plt
try:
from mpld3 import plugins
except:
plugins = None
import param
from ...core import NdOverlay, Overlay
from ...element import HeatMap, Raster, Scatter, Curve, Points, Bars, Histogram
from . import CurvePlot, PointPlot, OverlayPlot, Raster... | bsd-3-clause | -1,523,589,428,948,259,600 | 35.114173 | 91 | 0.587594 | false | 3.857443 | false | false | false |
tiborsimko/analysis-preservation.cern.ch | cap/modules/fixtures/utils.py | 1 | 4290 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2018 CERN.
#
# CERN Analysis Preservation Framework is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either... | gpl-2.0 | 5,375,609,865,573,419,000 | 32 | 78 | 0.663403 | false | 3.939394 | false | false | false |
Silmathoron/NNGT | nngt/simulation/nest_activity.py | 1 | 23441 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#
# This file is part of the NNGT project to generate and analyze
# neuronal networks and their activity.
# Copyright (C) 2015-2019 Tanguy Fardet
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 | -1,356,721,159,638,273,800 | 34.091317 | 79 | 0.570709 | false | 3.884176 | false | false | false |
Tinkerforge/brickv | src/brickv/plugin_system/plugins/red/config_parser.py | 1 | 2024 | # -*- coding: utf-8 -*-
"""
RED Plugin
Copyright (C) 2014 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2014 Ishraq Ibne Ashraf <ishraq@tinkerforge.com>
config_parser.py: Parses key=value configs from RED Brick
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General... | gpl-2.0 | -2,293,106,811,281,669,000 | 26.337838 | 98 | 0.687098 | false | 3.802632 | true | false | false |
JeanJoskin/Traffique | src/tracker.py | 1 | 2591 | # Traffique: live visitor statistics on App Engine
# Copyright (C) 2011 Jean Joskin <jeanjoskin.com>
#
# Traffique 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... | gpl-3.0 | 5,526,692,384,639,389,000 | 36.014286 | 86 | 0.60633 | false | 3.810294 | false | false | false |
iamarf/terminal-quest | linux_story/story/challenges/challenge_22.py | 1 | 4393 | #!/usr/bin/env python
# coding: utf-8
# Copyright (C) 2014, 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# A chapter of the story
from linux_story.step_helper_functions import unblock_cd_commands
from linux_story.story.terminals.terminal_mkdir import TerminalMkdir
from linu... | gpl-2.0 | 5,963,692,810,422,163,000 | 25.119048 | 89 | 0.568596 | false | 2.879265 | false | false | false |
dannysellers/django_orders | tracker/templatetags/num_filters.py | 1 | 1433 | from django import template
register = template.Library()
@register.filter
def length (value, length=2):
"""
Truncates `value` to `length`
:type value: float
:type length: int
:rtype: str
"""
if value:
_length = int(length)
_string = str(value).split('.')
if len(_s... | gpl-2.0 | -1,343,144,368,386,720,800 | 24.589286 | 89 | 0.573622 | false | 3.609572 | false | false | false |
Samuel-Phillips/python-graph-theory | graphs.py | 1 | 1379 | #!/usr/bin/python3
import collections
import sys
Conn = collections.namedtuple('Conn', ['node', 'weight'])
def info(*tt):
print(*tt, file=sys.stderr)
class Node:
finf = float('inf')
def __init__(self):
self.connected = []
self.origin = None
self.dist = self.finf
info("Cre... | mit | 15,872,365,635,721,076 | 26.039216 | 66 | 0.565627 | false | 3.716981 | false | false | false |
Jailander/COSMOS | kriging_exploration/src/kriging_exploration/topological_map.py | 1 | 1803 | import utm
import yaml
import numpy as np
from map_coords import MapCoords
def coord_in_poly(point, limits):
x=point.easting
y=point.northing
n = len(limits)
inside = False
#
p1x = limits[0].easting
p1y = limits[0].northing
for i in range(n+1):
p2x = limits[i % n].easti... | mit | -3,500,028,241,945,313,300 | 25.514706 | 76 | 0.4731 | false | 3.338889 | false | false | false |
joelsmith/openshift-tools | scripts/cloud/aws/ops-ec2-trim-ebs-snapshots.py | 5 | 4809 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
This is a script that snapshots all volumes in a given account.
The volumes must be tagged like so:
snapshot: daily
snapshot: weekly
This assumes that your AWS credentials are loaded in the ENV variables:
AWS_ACCESS_KEY_ID=xxxx
AWS_SECRET_ACC... | apache-2.0 | -4,464,730,399,330,036,700 | 37.782258 | 112 | 0.62487 | false | 4.082343 | false | false | false |
plecto/django-smart-lists | testproject/migrations/0002_auto_20190728_1359.py | 1 | 1712 | # Generated by Django 2.2.3 on 2019-07-28 13:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [('testproject', '0001_initial')]
operations = [
migrations.CreateModel(
name='ForeignModelWithoutUrl',
... | mit | -6,303,085,913,088,266,000 | 33.24 | 120 | 0.538551 | false | 4.493438 | false | false | false |
pgaines937/news_articles | sentiment.py | 1 | 4501 | from nltk.corpus import stopwords
from itertools import chain
from nltk.corpus import wordnet
from collections import defaultdict
import pip
import csv
# combined_dataset_verbose has all the news article.
f = open('combined_dataset_verbose.csv')
csv_f = csv.reader(f)
next(csv_f)
# Set of positive, negative and neutra... | mit | -3,985,413,873,002,839,600 | 44.01 | 605 | 0.725839 | false | 2.80611 | false | false | false |
dvspirito/pymeasure | pymeasure/instruments/hp/hp33120A.py | 1 | 4833 | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2017 PyMeasure Developers
#
# 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 limit... | mit | 8,442,955,602,036,176,000 | 39.957627 | 88 | 0.651769 | false | 4.047739 | false | false | false |
uwosh/Campus_Directory_web_service | getNextSemestersWithDescription.py | 1 | 3594 | # $Id$
# returns the current (if available) and next PeopleSoft semester codes with matching descriptions, as of today
import re
import xmlrpclib
Randy_Loch = '192.168.0.1'
Kim_Nguyen_G5 = '192.168.0.1'
Kim_Nguyen_Air = '192.168.0.1'
Kim_Nguyen_iMac = '192.168.0.1'
John_Hren_MBP = '192.168.0.1'
CMF2 = '192.168.0.1'
P... | gpl-2.0 | 1,523,897,577,284,683,300 | 45.076923 | 302 | 0.605175 | false | 3.108997 | false | false | false |
rgreinho/docker-django-cookiecutter | {{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/settings/base.py | 1 | 4751 | import os
import sys
from urllib.parse import urlparse
import dj_database_url
# PATH vars
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def root(x):
return os.path.join(BASE_DIR, x)
# Insert the apps dir at the top of your path.
sys.path.insert(0, root('apps'))
# SECURITY WARNING: ke... | mit | 7,790,231,306,529,477,000 | 29.455128 | 98 | 0.687434 | false | 3.532342 | false | false | false |
LedgerHQ/blue-loader-python | ledgerblue/loadMCU.py | 1 | 2294 | """
*******************************************************************************
* Ledger Blue
* (c) 2016 Ledger
*
* 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-2.0 | -4,812,842,145,532,295,000 | 37.25 | 129 | 0.653008 | false | 3.941581 | false | false | false |
sbmlteam/deviser | generator/code_files/CppCodeFile.py | 1 | 37362 | #!/usr/bin/env python
#
# @file CppCodeFile.py
# @brief class for generating code file for the given class
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2018 by the California Institute of Technology
# (Cal... | lgpl-2.1 | -6,839,600,027,321,510,000 | 43.163121 | 99 | 0.549435 | false | 4.543045 | false | false | false |
howknows/Ropper | ropperapp/disasm/chain/ropchain.py | 1 | 1655 | # coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-2.0 | 5,436,525,872,334,288,000 | 30.226415 | 118 | 0.653776 | false | 4.1375 | false | false | false |
apaleyes/mxnet | tools/ipynb2md.py | 3 | 1485 | #!/usr/bin/env python
"""
Convert jupyter notebook into the markdown format. The notebook outputs will be
removed.
It is heavily adapted from https://gist.github.com/decabyte/0ed87372774cf5d34d7e
"""
import sys
import io
import os
import argparse
import nbformat
def remove_outputs(nb):
"""Removes the outputs c... | apache-2.0 | 7,133,700,526,051,015,000 | 24.603448 | 86 | 0.639731 | false | 3.09375 | false | false | false |
bikash/h2o-dev | py2/testdir_single_jvm/test_w2v_basic.py | 1 | 8524 | import unittest, time, sys, random, re
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_jobs
from h2o_test import verboseprint, dump_json, OutputObj
import h2o_test
DO_SUMMARY=False
targetList = ['red', 'mail', 'black flag', 5, 1981, 'central park',
'good', 'liqu... | apache-2.0 | -6,097,692,025,574,265,000 | 34.966245 | 135 | 0.547396 | false | 3.45241 | true | false | false |
semkiv/heppy_fcc | fastsim/detectors/perfect.py | 1 | 2316 | from detector import Detector, DetectorElement
import material
from geometry import VolumeCylinder
import math
class ECAL(DetectorElement):
def __init__(self):
volume = VolumeCylinder('ecal', 1.55, 2.25, 1.30, 2. )
mat = material.Material('ECAL', 8.9e-3, 0.) # lambda_I = 0
self.eta_crack =... | gpl-3.0 | 3,510,170,150,373,318,000 | 24.733333 | 70 | 0.585492 | false | 3.664557 | false | false | false |
mjalas/pyprojectgen | src/license_generator.py | 2 | 1133 | """License file generator module."""
from pathlib import Path
from src.license_templates import MIT_LICENSE_TEMPLATE
from src.license_templates import GPL3_LICENSE_TEMPLATE
from src.license_templates import APACHE_LICENSE_TEMPLATE
class LicenseGenerator(object):
"""License file generator class."""
@staticmeth... | gpl-3.0 | -709,988,112,307,069,600 | 38.068966 | 79 | 0.623124 | false | 4.550201 | false | false | false |
lucky/autumn | autumn/tests/run.py | 2 | 4507 | #!/usr/bin/env python
import unittest
import datetime
from autumn.model import Model
from autumn.tests.models import Book, Author
from autumn.db.query import Query
from autumn.db import escape
from autumn import validators
class TestModels(unittest.TestCase):
def testmodel(self):
# Create tables
... | mit | -1,967,974,872,636,074,800 | 29.869863 | 80 | 0.531174 | false | 3.829227 | true | false | false |
kpod13/python-mailgunlog | mailgunlog/mailgunlog.py | 1 | 9029 | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import json
import argparse
import time
from datetime import datetime, date as _date
from dateutil.relativedelta import relativedelta
try:
from email.Utils import formatdate
except ImportError: # py3
from email.utils import for... | apache-2.0 | -323,765,785,715,018,600 | 33.200758 | 142 | 0.512128 | false | 4.193683 | false | false | false |
sanjioh/django-header-filter | tests/test_matcher_or.py | 1 | 1830 | from header_filter.matchers import Header
def test_or_matcher_supports_bitwise_not(rf):
h_name_1, h_value_1 = 'HTTP_X_A', 'val_x'
h_name_2, h_value_2 = 'HTTP_X_B', 'val_y'
matcher = ~(Header(h_name_1, h_value_1) | Header(h_name_2, h_value_2))
request = rf.get('/', **{h_name_1: h_value_1, h_name_2: h_v... | mit | -366,165,832,665,979,300 | 41.55814 | 103 | 0.585246 | false | 2.264851 | false | false | false |
mja054/swift_plugin | swift/common/ring/ring.py | 5 | 6075 | # Copyright (c) 2010-2011 OpenStack, 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 ... | apache-2.0 | 4,469,315,506,916,429,300 | 36.96875 | 79 | 0.588971 | false | 4.212899 | false | false | false |
log2timeline/plaso | plaso/parsers/winreg_plugins/bam.py | 2 | 3427 | # -*- coding: utf-8 -*-
"""Windows Registry plugin to parse the Background Activity Moderator keys."""
import os
from dfdatetime import filetime as dfdatetime_filetime
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.lib import dtfabric_helper
... | apache-2.0 | -76,917,701,552,588,500 | 30.440367 | 78 | 0.693026 | false | 4.128916 | false | false | false |
eliksir/mailmojo-python-sdk | mailmojo_sdk/api/page_api.py | 1 | 15435 | # coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibilit... | apache-2.0 | 683,332,016,425,368,700 | 35.232394 | 114 | 0.56346 | false | 4.046932 | false | false | false |
gsnbng/erpnext | erpnext/regional/report/datev/datev.py | 1 | 12719 | # coding: utf-8
"""
Provide a report and downloadable CSV according to the German DATEV format.
- Query report showing only the columns that contain data, formatted nicely for
dispay to the user.
- CSV download functionality `download_datev_csv` that provides a CSV file with
all required columns. Used to import th... | agpl-3.0 | 2,071,427,166,371,283,500 | 29.406699 | 110 | 0.699213 | false | 2.940088 | false | false | false |
benjamincongdon/adept | mapGenerator.py | 1 | 5638 | import sys
import random
from noise import snoise3
from PIL import Image
from biome import Biome
"""
Class that generates tile data for the world map with a given seed.
The generation algorithm uses Perlin noise to generate maps for both altitude and moisture.
(This requires the 'noise' library)
Based on the generated... | mit | -4,249,066,386,086,056,000 | 39.271429 | 114 | 0.545406 | false | 3.646831 | false | false | false |
tcuthbert/tcuthbert | tombomation/blog/migrations/0003_auto_20150212_0746.py | 1 | 1304 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_category'),
]
operations = [
migrations.AlterModelOptions... | mit | -4,135,064,516,705,127,400 | 33.315789 | 185 | 0.590491 | false | 4.30363 | false | false | false |
leandrotoledo/python-telegram-bot | setup.py | 2 | 4496 | #!/usr/bin/env python
"""The setup and build script for the python-telegram-bot library."""
import os
import subprocess
import sys
from setuptools import setup, find_packages
UPSTREAM_URLLIB3_FLAG = '--with-upstream-urllib3'
def get_requirements(raw=False):
"""Build the requirements list for this project"""
... | lgpl-3.0 | 58,550,580,717,179,704 | 35.552846 | 99 | 0.571397 | false | 4.010705 | false | false | false |
realms-team/solmanager | libs/smartmeshsdk-REL-1.3.0.1/app/SyncTemp/logAnalysis.py | 2 | 9586 | import re
import time
import traceback
EVENT_TEMPERATURE = 'temperature'
EVENT_STARTAPP = 'start_app'
EVENT_STOPAPP = 'stop_app'
EVENT_CONNECTED = 'connected'
EVENT_DISCONNECTED = 'disconnected'
EVENT_ALL = [
EVENT_TEMPERATURE,
EVENT_STARTAPP,
EVENT_STOPAPP,
EVENT_CONNECTED,... | bsd-3-clause | 6,065,518,607,416,828,000 | 33.235714 | 116 | 0.471938 | false | 4.112398 | false | false | false |
RyanWilsonDev/DomoPy | setup.py | 1 | 1771 | import os
from setuptools import setup
# Manage version in __init__.py
def get_version(version_tuple):
"""version from tuple accounting for possible a,b,rc tags."""
# in case an a, b, or rc tag is added
if not isinstance(version_tuple[-1], int):
return '.'.join(
map(str, version_tup... | mit | 5,546,842,748,305,411,000 | 26.671875 | 97 | 0.621683 | false | 3.833333 | false | false | false |
senarvi/theanolm | theanolm/training/nesterovoptimizer.py | 1 | 2905 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A module that implements the Nesterov momentum optimizer.
"""
import numpy
from theanolm.backend import Parameters
from theanolm.training.basicoptimizer import BasicOptimizer
class NesterovOptimizer(BasicOptimizer):
"""Nesterov Momentum Optimization Method
N... | apache-2.0 | 8,641,707,506,987,998,000 | 38.256757 | 79 | 0.64716 | false | 4.483025 | false | false | false |
mushkevych/scheduler | synergy/db/model/unit_of_work.py | 1 | 4120 | __author__ = 'Bohdan Mushkevych'
from odm.document import BaseDocument
from odm.fields import StringField, ObjectIdField, IntegerField, DictField, DateTimeField
TYPE_MANAGED = 'type_managed' # identifies UOW created by Abstract State Machine child for Managed Process
TYPE_FREERUN = 'type_freerun' ... | bsd-3-clause | -3,814,641,550,784,682,000 | 37.148148 | 120 | 0.706553 | false | 3.769442 | false | false | false |
smart-solution/icy | icy_installation_request/icy_installation_request.py | 2 | 10755 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
#
##############################################################################
from openerp.osv import osv, fields
import datetime
from datetime import timedelta
from datetime import date
c... | lgpl-3.0 | -4,379,551,844,585,959,000 | 42.02 | 378 | 0.553045 | false | 3.595787 | false | false | false |
tomjelinek/pcs | pcs_test/tier1/cib_resource/test_stonith_create.py | 3 | 15836 | import re
from pcs_test.tier1.cib_resource.common import ResourceTest
from pcs_test.tier1.cib_resource.stonith_common import need_load_xvm_fence_agent
from pcs_test.tools.misc import is_minimum_pacemaker_version
PCMK_2_0_3_PLUS = is_minimum_pacemaker_version(2, 0, 3)
PCMK_2_0_5_PLUS = is_minimum_pacemaker_version(2, ... | gpl-2.0 | -8,530,056,943,300,553,000 | 40.025907 | 83 | 0.46849 | false | 4.39157 | true | false | false |
skirpichev/omg | diofant/tests/printing/test_mpmath.py | 2 | 1202 | from diofant import QQ, GoldenRatio, Rational, RootOf, Sum, oo, pi, sqrt
from diofant.abc import n, x
from diofant.printing.lambdarepr import MpmathPrinter
__all__ = ()
def test_basic():
p = MpmathPrinter()
assert p.doprint(GoldenRatio) == 'phi'
assert p.doprint(Rational(2)) == '2'
assert p.doprint... | bsd-3-clause | 7,876,439,909,670,022,000 | 24.574468 | 75 | 0.549085 | false | 2.458078 | false | false | false |
CovingtonResearchGroup/olm | olm/loggers/TruBluToolkit.py | 1 | 1515 | #Tools for reading and analysis of data from TruBlu data loggers
from pandas import read_csv
from pandas import concat
from pandas import DataFrame
import os
"""
Functions to read TruBlu logger files.
"""
#read in the CSV file from a TruBlu logger and return a pandas DataFrame
def readTruBlu(csvfile):
"""
R... | mit | -6,940,888,148,651,302,000 | 31.234043 | 171 | 0.646205 | false | 3.564706 | false | false | false |
hlx98007/deployment-scripts | chef_scripts/merge.py | 1 | 5112 | #!/usr/bin/python
# Author: Luxing Huang
# Purpose: Merging a specific Chef environment into another, or into a
# template.
# Note: This can also be applied to Role files and Data Bag files, as long
# as they are valid JSON files.
#
# This script always creates a 3rd json file becau... | mit | -351,743,658,188,424,260 | 33.540541 | 156 | 0.62813 | false | 3.32596 | false | false | false |
mkeilman/sirepo | sirepo/job_supervisor.py | 2 | 35598 | # -*- coding: utf-8 -*-
"""TODO(e-carlin): Doc
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcollections
from pykern import pkconfig
from pykern impo... | apache-2.0 | 7,034,954,215,981,804,000 | 34.491525 | 135 | 0.531041 | false | 4.001124 | false | false | false |
alrusdi/video-store | ticketing/models.py | 1 | 1935 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from videostore.models import Video
TICKET_STATUS_CHOICES = (
('pending', _('Pending view')),
('seen', _('Seen')),
('overdue', _('Overdue')),
('blocked', _('Blocked')),
)
class Server(models.... | mit | 5,529,225,616,823,311,000 | 20.988636 | 69 | 0.555039 | false | 3.824111 | false | false | false |
hzlf/openbroadcast | website/apps/alibrary/forms/mediaforms.py | 1 | 13193 | from django import forms
from django.conf import settings
from django.forms import ModelForm, Form
from django.forms.models import BaseInlineFormSet, inlineformset_factory
from django.contrib.contenttypes.generic import BaseGenericInlineFormSet, generic_inlineformset_factory
from django.utils.translation import uge... | gpl-3.0 | 3,522,110,206,090,351,600 | 32.402532 | 254 | 0.555446 | false | 4.466148 | false | false | false |
newenclave/moscatell | agent/addsubsys.py | 1 | 2847 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv
import os
def header_file( ):
"""
#ifndef SUBSYS_%ss-name%_H
#define SUBSYS_%ss-name%_H
#include "application.h"
namespace msctl { namespace agent {
class %ss-name%: public common::subsys_iface {
struct impl;
frien... | gpl-3.0 | 4,424,536,121,336,183,300 | 19.933824 | 69 | 0.517387 | false | 3.108079 | false | false | false |
jinyu121/HowOldAreYou | HowOldWebsite/trainers/util_trainer.py | 1 | 4606 | # -*- coding: UTF-8 -*-
import os
import threading
import django.conf
from HowOldWebsite.models import RecordFace
from HowOldWebsite.utils.image import do_imread
from HowOldWebsite.utils.image import do_rgb2gray
from HowOldWebsite.utils.language import reflect_get_class
__author__ = 'Hao Yu'
class UtilTrainer:
... | gpl-3.0 | 5,053,455,212,866,597,000 | 31.20979 | 97 | 0.490664 | false | 4.312734 | false | false | false |
philipn/sycamore | Sycamore/buildDB.py | 2 | 50124 | # -*- coding: utf-8 -*-
"""
Build a wiki database from scratch. You should run this the FIRST TIME you install your wiki.
"""
# Imports
import sys
import os
import shutil
import time
from copy import copy
import __init__ # woo hackmagic
__directory__ = os.path.dirname(__file__)
share_directory = os.path.abspath(os.p... | gpl-2.0 | 1,005,118,203,528,990,100 | 39.32502 | 94 | 0.586007 | false | 3.998724 | true | false | false |
guaix-ucm/pyemir | emirdrp/preprocess.py | 3 | 4954 | #
# Copyright 2008-2014 Universidad Complutense de Madrid
#
# This file is part of PyEmir
#
# PyEmir 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 l... | gpl-3.0 | 7,333,595,398,069,707,000 | 28.664671 | 78 | 0.601736 | false | 3.50106 | false | false | false |
Alan-Robertson/python-qinfer | src/qinfer/tomography/models.py | 3 | 9912 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# models.py: Likelihood models for quantum state and process tomography.
##
# © 2017, Chris Ferrie (csferrie@gmail.com) and
# Christopher Granade (cgranade@cgranade.com).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permi... | agpl-3.0 | 7,411,290,033,158,219,000 | 35.282051 | 110 | 0.600808 | false | 4.052782 | false | false | false |
FBergeron/FeedNotifier | controls.py | 1 | 6026 | import wx
import wx.lib.wordwrap as wordwrap
import util
class Event(wx.PyEvent):
def __init__(self, event_object, type):
super(Event, self).__init__()
self.SetEventType(type.typeId)
self.SetEventObject(event_object)
EVT_HYPERLINK = wx.PyEventBinder(wx.NewEventType())
class Line(w... | bsd-3-clause | 7,334,771,045,423,110,000 | 33.244318 | 71 | 0.577498 | false | 3.481225 | false | false | false |
curtisforrester/dyna_settings | tests/test_dyna_settings.py | 1 | 5775 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_dyna_settings
----------------------------------
Tests for `dyna_settings` module. I normally use py.test.
"""
import unittest
from dyna_settings.core import DynaSettings, _dyna_controller, register_dyna_settings, dyna_value, \
NoMatchingSettingsClass, DynaS... | bsd-3-clause | -1,955,690,828,082,807,300 | 29.555556 | 103 | 0.627186 | false | 3.857715 | true | false | false |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/userdata/addon_data/plugin.video.p2p-streams/acestream/ace/ACEStream/Core/Statistics/Logger.py | 1 | 5405 | #Embedded file name: ACEStream\Core\Statistics\Logger.pyo
import sys
import os
import time
import socket
import threading
from traceback import print_exc
DEBUG = False
log_separator = ' '
logger = None
def create_logger(file_name):
global logger
logger = Logger(3, file_name)
def get_logger():
if logger i... | apache-2.0 | -4,605,293,595,324,325,400 | 31.957317 | 253 | 0.537095 | false | 3.605737 | false | false | false |
wenjie2wang/touchpy | icd9.py | 1 | 1901 | #!/usr/bin/python3
import os
import re
import time
import touch_icd9 as touch
# read input data
inputFile = input("Please enter the input CSV file name: ")
# inputFile = "sample_icd9.csv"
try:
fhand0 = open(inputFile)
except:
print("Error: failed to open/find", inputFile)
exit()
# define output file ... | gpl-3.0 | -8,298,090,924,444,540,000 | 26.955882 | 74 | 0.59495 | false | 3.400716 | false | false | false |
neilvallon/pyMap | MapGenerator.py | 1 | 4649 | import random, math
class MapGenerator:
def __init__(self, x, y, seed):
self.x = x
self.y = y
self.rand = random.Random(seed)
self.mapMatrix = self.emptyMap(x, y)
def emptyMap(self, x, y):
return [[0]*x for i in range(y)]
def randomCord(self):
x = int(self.rand.uniform(0, self.x-1)) % self.x#int(... | mit | -2,824,779,610,451,991,000 | 23.994624 | 106 | 0.619273 | false | 2.465005 | false | false | false |
mbertrand/OWSLib | owslib/wms.py | 3 | 27171 | # -*- coding: iso-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : Sean Gillies <sgillies@frii.com>
# Julien Anguenot <ja@nuxeo.com>
#
# Contact email: sgillie... | bsd-3-clause | 1,327,718,469,035,729,000 | 37.001399 | 156 | 0.567186 | false | 4.322463 | true | false | false |
cfrantz/bubbles | bubbles/xmlimpl.py | 2 | 1784 | #####################################################
#
# copyright.txt
#
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Hewlett-Packard and the Hewlett-Packard logo are trademarks of
# Hewlett-Packard Development Company, L.P. in the U.S. and/or other countries.
#
# This library is free software; you c... | lgpl-2.1 | 452,225,795,640,824,770 | 30.857143 | 80 | 0.662556 | false | 3.895197 | false | false | false |
koss822/misc | Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/parso/test/normalizer_issue_files/E26.py | 3 | 1509 | #: E261:4
pass # an inline comment
#: E261:4
pass# an inline comment
# Okay
pass # an inline comment
pass # an inline comment
#: E262:11
x = x + 1 #Increment x
#: E262:11
x = x + 1 # Increment x
#: E262:11
x = y + 1 #: Increment x
#: E265
#Block comment
a = 1
#: E265+1
m = 42
#! This is important
mx = 42 - 42
... | gpl-3.0 | -5,574,635,903,315,972,000 | 18.346154 | 79 | 0.413519 | false | 3.899225 | false | false | false |
5nizza/party-elli | parsing/acacia_parser_desc.py | 1 | 3091 | import os
from helpers.python_ext import lmap
from parsing.acacia_lexer_desc import *
class Assumption:
def __init__(self, data):
self.data = data
class Guarantee:
def __init__(self, data):
self.data = data
precedence = (
('left','OR'),
('left','IMPLIES','EQUIV'),
('left','AND'... | mit | -961,444,308,778,483,700 | 20.921986 | 95 | 0.526043 | false | 3.060396 | false | false | false |
alfa-addon/addon | plugin.video.alfa/channels/doramedplay.py | 1 | 11294 | # -*- coding: utf-8 -*-
# -*- Channel DoramedPlay -*-
# -*- BASED ON: Channel DramasJC -*-
# -*- Created for Alfa-addon -*-
import requests
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
import re
from channelselector import get_thumb
from core import httptool... | gpl-3.0 | -3,013,731,974,807,321,600 | 37.52901 | 140 | 0.564975 | false | 3.752992 | false | false | false |
networks-lab/metaknowledge | metaknowledge/tests/test_citation.py | 2 | 2640 | #Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
import unittest
import metaknowledge
class TestCitation(unittest.TestCase):
def setUp(self):
self.Cite = metaknowledge.Citation("John D., 2015, TOPICS IN COGNITIVE SCIENCE, V1, P1, DOI 0.1063/1.1695064")
def test_citation... | gpl-2.0 | -6,042,287,925,163,941,000 | 39.615385 | 118 | 0.65947 | false | 3.091335 | true | false | false |
PrashntS/numptyphysics | tools/update_license_header.py | 2 | 2137 | import subprocess
import sys
import re
import collections
LICENSE_BLOCK_RE = r'/[*].*?This program is free software.*?\*/'
HEADER_TEMPLATE = """/*
* This file is part of NumptyPhysics <http://thp.io/2015/numptyphysics/>
* <<COPYRIGHT>>
*
* This program is free software; you can redistribute it and/or
* modify it... | gpl-3.0 | -2,561,553,201,379,447,300 | 32.920635 | 109 | 0.61722 | false | 3.736014 | false | false | false |
kobox/achilles.pl | src/packaging/views.py | 1 | 2590 | from django.views.generic import DetailView, ListView, TemplateView
from django.views.generic.detail import SingleObjectMixin
from .models import Category, Product, ProductImage
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from fm.views import AjaxCreateView
from ... | mit | -1,861,989,263,490,719,200 | 34.986111 | 90 | 0.673745 | false | 4.034268 | false | false | false |
wendlers/pyscmpd | setup.py | 1 | 1673 | #!/usr/bin/env python
##
# This file is part of the carambot-usherpa project.
#
# Copyright (C) 2012 Stefan Wendler <sw@kaltpost.de>
#
# 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 ver... | gpl-3.0 | -6,542,002,191,140,657,000 | 29.418182 | 96 | 0.73162 | false | 3.115456 | false | false | false |
DavidAndreev/indico | indico/MaKaC/services/implementation/abstracts.py | 2 | 3384 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 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 | 3,373,898,325,747,520,000 | 40.268293 | 107 | 0.710106 | false | 3.880734 | false | false | false |
lu-ci/apex-sigma-plugins | utilities/nihongo/wanikani/wanikani.py | 3 | 5298 | import json
import aiohttp
import arrow
import discord
async def wanikani(cmd, message, args):
if message.mentions:
target = message.mentions[0]
else:
target = message.author
api_document = cmd.db[cmd.db.db_cfg.database]['WaniKani'].find_one({'UserID': target.id})
if api_document:
... | gpl-3.0 | 8,162,439,197,226,712,000 | 51.92 | 114 | 0.573318 | false | 3.975958 | false | false | false |
dmayer/time_trial | time_trial_gui/gui/trial_detail_widget.py | 1 | 4254 | __author__ = 'daniel'
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import pyqtSignal
class TrialDetailsWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(TrialDetailsWidget, self).__init__(parent)
self.layout = QtGui.QVBoxLayout()
self.setLayout(self.layout)
self... | mit | 7,482,381,196,374,320,000 | 30.279412 | 82 | 0.652562 | false | 3.507007 | false | false | false |
Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/challenge_auth_policy.py | 4 | 5654 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Policy implementing Key Vault's challenge authentication protocol.
Normally the protocol is only used for the client's first service request, upon which:
1. The chal... | mit | -2,599,558,481,152,889,000 | 39.385714 | 119 | 0.6919 | false | 4.526821 | false | false | false |
3drepo/3drepo.io | scripts/dbMaintenance/repairFileShare.py | 1 | 4718 | import sys, os
from pymongo import MongoClient
import gridfs
import re
isPython3 = bool(sys.version_info >= (3, 0))
if isPython3:
from io import BytesIO
else:
from StringIO import StringIO
if len(sys.argv) <= 5:
print("Not enough arguments.")
print("removeOrphanFiles.py <mongoURL> <mongoPort> <userNa... | agpl-3.0 | 4,102,785,895,408,671,000 | 40.752212 | 114 | 0.474989 | false | 4.442561 | false | false | false |
Jofemago/Computacion-Grafica | SPACE INVADERS/Player.py | 1 | 1903 | '''
Se crea una clase jugador la cual tendra un movimiento con los teclas
y dispara
'''
import pygame
from configuraciones import *
TIEMPODESTRUCION = 8
class Vida(pygame.sprite.Sprite):
def __init__(self, img):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(img).convert()
... | mit | 927,243,830,971,040,500 | 21.388235 | 74 | 0.565423 | false | 3.16113 | false | false | false |
gitcoinco/web | app/quadraticlands/admin.py | 1 | 1491 | from django.contrib import admin
from quadraticlands.models import (
GTCSteward, InitialTokenDistribution, MissionStatus, QLVote, QuadLandsFAQ, SchwagCoupon,
)
class InitialTokenDistributionAdmin(admin.ModelAdmin):
raw_id_fields = ['profile']
search_fields = ['profile__handle']
list_display = ['id', ... | agpl-3.0 | 2,581,283,953,521,136,600 | 31.413043 | 94 | 0.724346 | false | 3.269737 | false | false | false |
ethertricity/bluesky | plugins/ilsgate.py | 2 | 3467 | """ BlueSky plugin template. The text you put here will be visible
in BlueSky as the description of your plugin. """
import numpy as np
# Import the global bluesky objects. Uncomment the ones you need
from bluesky import stack #, settings, navdb, traf, sim, scr, tools
from bluesky import navdb
from bluesky.tools.a... | gpl-3.0 | 5,524,521,760,201,754,000 | 37.522222 | 103 | 0.659937 | false | 3.899888 | false | false | false |
nirik/python-fedora | fedora/tg/visit/jsonfasvisit1.py | 4 | 4242 | # -*- coding: utf-8 -*-
#
# Copyright © 2007-2008 Red Hat, Inc. All rights reserved.
#
# This file is part of python-fedora
#
# python-fedora 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
# ve... | gpl-2.0 | 6,948,084,201,747,106,000 | 37.207207 | 79 | 0.660457 | false | 3.789991 | false | false | false |
Vagab0nd/SiCKRAGE | lib3/twilio/rest/preview/understand/assistant/task/sample.py | 2 | 18621 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | gpl-3.0 | -6,238,906,540,563,084,000 | 36.694332 | 192 | 0.626873 | false | 4.450526 | false | false | false |
mshubian/BAK_open-hackathon | open-hackathon-adminUI/test/app/admin/test_admin_mgr.py | 1 | 3886 | import sys
sys.path.append("../src/")
import unittest
from app.admin.admin_mgr import AdminManager
from app.database.models import AdminUser, AdminEmail, AdminUserHackathonRel
from hackathon import app
from mock import Mock, ANY
from flask import g
class AdminManagerTest(unittest.TestCase):
def setUp(self):
... | apache-2.0 | -5,152,764,983,523,254,000 | 39.479167 | 88 | 0.65826 | false | 3.279325 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.