repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aguijarro/DataSciencePython | DataWrangling/CaseStudy/project/audit.py | 1 | 2399 | import xml.etree.cElementTree as ET
from collections import defaultdict
import re
street_type_re = re.compile(r'\S+\.?$', re.IGNORECASE)
city_type_re = re.compile(r'\S+\.?$', re.IGNORECASE)
expected = ["Street", "Avenue", "Boulevard", "Drive",
"Court", "Place", "Square", "Lane", "Road",
"Tra... | mit | -636,464,583,109,244,500 | 31 | 70 | 0.557316 | false | 3.29533 | false | false | false |
ppppn/bib-generator | gen_bib.py | 1 | 1967 | #! /bin/sh
""":"
exec python3 "$0" ${1+"$@"}
"""
import argparse
import csv
import re
from datetime import datetime
from html_format import HTML_FORMAT
def readStyles(format_csv_fname):
formats = {}
f = open(format_csv_fname, encoding='sjis')
reader = csv.reader(f)
category_header = next(reader)[0]
... | mit | -3,812,726,738,535,261,000 | 31.245902 | 73 | 0.613625 | false | 3.506239 | false | false | false |
daizhengy/RDS | trove/guestagent/datastore/mysql/service.py | 1 | 43726 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | apache-2.0 | 5,361,696,649,788,965,000 | 39.263352 | 79 | 0.55196 | false | 4.247717 | true | false | false |
sigma-random/pwndbg | pwndbg/commands/nearpc.py | 1 | 2744 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from capstone import *
import pwndbg.arguments
import pwndbg.color
import pwndbg.disasm
import pwndbg.disasm.color
import pwndbg.functions
import pwndbg.ida
import pwndbg.regs
import pwndbg.strings
import pwndbg.symbol
import pwndbg.ui
import pwndbg.vmmap
@pwndbg.command... | mit | 3,652,252,772,521,421,000 | 25.901961 | 92 | 0.603863 | false | 3.522465 | false | false | false |
eLRuLL/scrapy | tests/mockserver.py | 1 | 7989 | import json
import os
import random
import sys
from subprocess import Popen, PIPE
from urllib.parse import urlencode
from OpenSSL import SSL
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.web.static import File
from twisted.web.test.test_webclient import Payloa... | bsd-3-clause | 8,276,427,149,703,918,000 | 30.207031 | 105 | 0.619477 | false | 3.740169 | true | false | false |
dstufft/fastly-py | tests/test_core.py | 1 | 1153 | # Copyright 2014 Donald Stufft
#
# 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, so... | apache-2.0 | -7,275,991,855,456,668,000 | 33.939394 | 74 | 0.740676 | false | 3.830565 | false | false | false |
zuun77/givemegoogletshirts | codejam/2019/1B/q1.py | 1 | 1278 | import collections
def solve(case, P, Q, people):
ver, hor = {}, {}
s, n, e, w = 0, 0, 0, 0
for p in people:
x, y, d = p
if d == 'S':
if y in ver: ver[y] = (ver[y][0]+1, ver[y][1])
else: ver[y] = (1, 0)
s += 1
elif d == 'N':
if y in v... | apache-2.0 | -4,067,940,558,325,939,000 | 25.625 | 58 | 0.400626 | false | 2.690526 | false | false | false |
jimbotonic/df_nlp | step1/prepare_data2.py | 1 | 2591 | #
# This file is part of DF.
#
# DF is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation;
# either version 3 of the License, or (at your option) any
# later version.
#
# Latassan is distributed in the hope that it ... | gpl-2.0 | 8,706,524,835,819,565,000 | 33.092105 | 118 | 0.650714 | false | 3.159756 | false | false | false |
renesugar/arrow | python/pyarrow/pandas_compat.py | 1 | 37193 | # 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | -6,731,303,660,057,483,000 | 33.247698 | 79 | 0.591912 | false | 4.007435 | false | false | false |
nymoral/euler | p18.py | 1 | 2156 | """
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3 ->
7 4 ->
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75... | mit | 1,246,611,544,375,990,300 | 31.179104 | 157 | 0.650742 | false | 3.189349 | false | false | false |
BV-DR/foamBazar | pythonScripts/gmshScript/geo.py | 1 | 14381 | import numpy as np
import copy
from .misc import *
from .point import Point
from .line import Line
from .surface import Surface
from .volume import Volume
"""
class to handle gmsh geo-file(s)
"""
class extdb(dict):
'''
Extrude database, this is for conveniently accessing dict-keys by calling as attribute
... | gpl-3.0 | -6,198,291,772,516,877,000 | 39.509859 | 137 | 0.527849 | false | 3.428129 | false | false | false |
AutorestCI/azure-sdk-for-python | azure-cognitiveservices-vision-contentmoderator/azure/cognitiveservices/vision/contentmoderator/models/classification.py | 1 | 1545 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -4,682,587,792,800,070,000 | 37.625 | 105 | 0.606472 | false | 3.941327 | false | false | false |
Asparagirl/ArchiveBot | pipeline/archivebot/seesaw/wpullargs_test.py | 1 | 2884 | from os import environ as env
import unittest
from .wpull import WpullArgs
from seesaw.item import Item
# taken form pipeline/pipeline.py
if 'WARC_MAX_SIZE' in env:
WARC_MAX_SIZE = env['WARC_MAX_SIZE']
else:
WARC_MAX_SIZE = '5368709120'
def joined(args):
return str.join(' ', args)
class TestWpullArgs(un... | mit | -364,133,565,755,845,800 | 30.692308 | 81 | 0.606449 | false | 3.569307 | true | false | false |
pfig/CmdrKeen | setup.py | 1 | 1221 | from setuptools import setup, find_packages
def long_description_from_readme():
with open('README.rst') as readme:
return readme.read()
setup(
name="CommanderKeen",
version="0.1",
packages=find_packages(),
scripts=['scripts/keen.py'],
author="Pedro Figueiredo",
author_email="pfig@... | mit | 3,875,417,983,791,774,000 | 30.307692 | 70 | 0.610975 | false | 3.791925 | false | false | false |
Haikson/virtenviro | virtenviro/content/templatetags/page_tags.py | 1 | 4472 | # ~*~ coding: utf-8 ~*~
__author__ = 'Kamo Petrosyan'
from django import template
from django.db.models import Q
from virtenviro.content.models import Snippet, Page, AdditionalField, Menu
from django.template import loader, Context
from virtenviro.utils import *
register = template.Library()
@register.assignment_tag... | apache-2.0 | -318,434,964,313,289,300 | 28.813333 | 87 | 0.632156 | false | 3.68369 | false | false | false |
MehdiSfr/tensor-flow | tensorflow/python/ops/candidate_sampling_ops.py | 1 | 18205 | # 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... | apache-2.0 | -4,878,222,035,196,797,000 | 46.408854 | 80 | 0.715737 | false | 4.05276 | false | false | false |
xzhang2016/tfagent | setup.py | 1 | 1318 | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
def main():
setup(name='tfta',
version='0.0.1',
description='TF Agent',
long_description='TF Agent',
author='Xue Zhang',
author_email='xue.zhang@tufts.edu',
url='https://git... | bsd-2-clause | 5,773,306,868,928,383,000 | 38.939394 | 78 | 0.525797 | false | 4.157729 | false | false | false |
mendhak/Kindle-Time-and-Weather | server/weather-script.py | 1 | 6448 | #!/usr/bin/python
# Kindle Weather Display
# Matthew Petroff (http://www.mpetroff.net/)
# September 2012
#
# Owen Bullock - UK Weather - MetOffice - Aug 2013
# Apr 2014 - amended for Wind option
#
# Mendhak - redone for WeatherUnderground API
import json
import urllib2
from xml.dom import minidom
import datetime
impo... | mit | 3,446,430,669,195,974,700 | 34.234973 | 93 | 0.596309 | false | 2.916327 | false | false | false |
xswxm/MyIoT | devices/system.py | 1 | 1715 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import threading, os
class CPUTemp:
_lock = threading.RLock()
def __init__(self, id, title, feasible = True):
self.id = id
self.title = title
self.feasible = feasible
self.category = 'Value'
def description(self):
message ... | gpl-3.0 | -1,412,676,988,932,031,500 | 31.339623 | 76 | 0.533839 | false | 3.808889 | false | false | false |
bfirsh/django-mptt | setup.py | 1 | 2361 | """
Based entirely on Django's own ``setup.py``.
"""
import os
from distutils.command.install import INSTALL_SCHEMES
from distutils.core import setup
def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is Non... | mit | -2,161,140,952,425,725,200 | 35.323077 | 146 | 0.639136 | false | 3.759554 | false | false | false |
Tanmay28/coala | bears/tests/natural_language/AlexBearTest.py | 1 | 1313 | import os
import subprocess
import sys
from queue import Queue
sys.path.insert(0, ".")
import unittest
from bears.tests.LocalBearTestHelper import LocalBearTestHelper
from bears.natural_language.AlexBear import AlexBear
from coalib.settings.Section import Section
class AlexBearTest(LocalBearTestHelper):
def setU... | agpl-3.0 | 2,532,052,658,769,836,500 | 29.534884 | 65 | 0.568926 | false | 4.115987 | true | false | false |
hpcloud/CloudAgents | agents/file_exists.py | 1 | 3605 | #!/usr/bin/env python
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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.or... | apache-2.0 | 6,946,789,395,821,561,000 | 30.347826 | 196 | 0.671567 | false | 3.319521 | false | false | false |
pwittchen/learn-python-the-hard-way | exercises/exercise35.py | 1 | 1993 | # Exercise 35: Branches and Functions
from sys import exit
def gold_room():
print "This room is full of gold. How much do you take?"
choice = raw_input("> ")
if "0" in choice or "1" in choice:
how_much = int(choice)
else:
dead("Man, learn to type a number.")
if how_much < 50:
... | mit | 956,250,791,782,358,400 | 24.551282 | 80 | 0.578525 | false | 3.484266 | false | false | false |
willjp/pyqconcurrency | qconcurrency/models.py | 1 | 37871 | #!/usr/bin/env python
"""
Name : qconcurrency/models.py
Created : Apr 14, 2017
Author : Will Pittman
Contact : willjpittman@gmail.com
________________________________________________________________________________
Description : Generic models, and interfaces for models to be used
... | bsd-3-clause | -3,545,572,550,942,199,300 | 34.660075 | 119 | 0.464577 | false | 4.625748 | false | false | false |
LittleBun/Personal | ics632/tutorial_sim_grid/topic2/generate_xml_bintree_and_hostfile.py | 1 | 5081 | #!/usr/bin/env python2.7
import sys
import os
import math
# Link parameters
link_latency = "10us"
link_bandwidth = 10
link_bandwidth_unit = "Gbps"
# Convenient math wrappers
def floor(x):
return int(math.floor(x))
def ceil(x):
return int(math.ceil(x))
def pow2(x):
return int(math.pow(2,x))
# XML generation funct... | unlicense | -6,806,824,665,409,877,000 | 34.78169 | 156 | 0.604212 | false | 2.936994 | true | false | false |
shubhamchaudhary/biggboss | biggboss-checker.py | 1 | 6274 | #!/usr/bin/env python3
#
# Copyright (c) 2014 Shubham Chaudhary <me@shubhamchaudhary.in>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | gpl-3.0 | 3,544,284,820,136,747,500 | 35.057471 | 138 | 0.626076 | false | 3.493318 | true | false | false |
jankim/deepnl | bin/dl-sentiwords.py | 1 | 7318 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Learn sentiment-specific word embeddings from tweets.
Author: Giuseppe Attardi
"""
import logging
import numpy as np
import argparse
from ConfigParser import ConfigParser
from itertools import chain
# allow executing from anywhere without installing the package
impo... | gpl-3.0 | -4,546,892,508,208,062,000 | 37.114583 | 98 | 0.599344 | false | 4.222735 | true | false | false |
lhilt/scipy | runtests.py | 1 | 17145 | #!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python... | bsd-3-clause | -2,131,450,785,985,568,300 | 34.205339 | 87 | 0.533508 | false | 3.883352 | true | false | false |
YourCyborg/Sun-RPI | docs/sphinx/src2rest/src2rest.py | 1 | 2118 | #! /usr/bin/python
#
# Auto-generate reST documentation for Sphinx from Evennia source
# code.
#
# Uses etinenned's sphinx autopackage script. Install it to folder
# "autogen" in this same directory:
#
# hg clone https://bitbucket.org/etienned/sphinx-autopackage-script autogen
#
# Create a directory tree "code/" co... | bsd-3-clause | 6,890,642,337,181,281,000 | 32.09375 | 107 | 0.635505 | false | 3.228659 | false | false | false |
BartGo/bottle-stack | nonpip-dl.py | 1 | 1774 | """ Download external components (non-Python)
"""
import requests
import zipfile
""" Download additional (non-Python) files needed by the project
"""
import os
import shutil
import sys
sys.path.append("./lib")
# http://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py
def do... | mit | 1,648,368,742,869,832,000 | 31.851852 | 109 | 0.669109 | false | 3.184919 | false | false | false |
wondie/batch_gps_importer | batch_gps_importer.py | 1 | 3604 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Batch GPS Importer
A QGIS plugin
Initializer of the plugin.
-------------------
begin : 2017-03-18
copyright ... | gpl-3.0 | 602,411,071,137,016,400 | 36.936842 | 83 | 0.508879 | false | 4.650323 | false | false | false |
ggood/adsbTheremin | aircraft_map.py | 1 | 6296 | # aircraft_map: maintains a list of aircraft "seen" by an ADSB
# receiver.
import math
import time
DEFAULT_PURGE_TIME = 120 # Forget planes not heard from in this many seconds
DEFAULT_PURGE_INTERVAL = 1 # How often to purge stale aircraft
EARTH_RADIUS = 6371000 # Earth's radius in meters
class Aircraft(object):
... | unlicense | 2,571,144,089,346,902,500 | 33.032432 | 77 | 0.546537 | false | 3.797346 | false | false | false |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/theano/sandbox/gpuarray/opt.py | 1 | 35148 | import copy
import numpy
import logging
from six.moves import xrange
import theano
from theano import tensor, scalar, gof
from theano.compile import optdb
from theano.compile.ops import shape_i
from theano.gof import (local_optimizer, EquilibriumDB,
SequenceDB, Optimizer, toolbox)
from theano.g... | bsd-3-clause | -188,701,961,609,684,220 | 34.253761 | 80 | 0.584898 | false | 3.531043 | false | false | false |
astroswego/data-plots | src/data_plots/stats.py | 1 | 3782 | import numpy
import matplotlib
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
from matplotlib import rcParams
from scipy.optimize import curve_fit
from data_plots.utils import labeler, titler
rcParams['text.usetex'] = True
def scatter_hist(x, y, *args,
... | mit | 7,716,508,680,442,090,000 | 31.886957 | 77 | 0.59651 | false | 3.107642 | false | false | false |
HLP-R/hlpr_kinesthetic_teaching | hlpr_kinesthetic_interaction/src/hlpr_kinesthetic_interaction/jaco_7dof_arm.py | 1 | 2145 | #!/usr/bin/env python
import rospy
from hlpr_manipulation_utils.manipulator import Gripper
from kinova_msgs.srv import Start, Stop
from hlpr_kinesthetic_interaction.kinesthetic_interaction import KinestheticInteraction
"""
jaco_7dof_arm.py
Simple wrapper that abstracts out the arm class so that other arms
can use ki... | bsd-3-clause | 3,589,335,116,544,430,000 | 38.722222 | 96 | 0.682051 | false | 3.259878 | false | false | false |
ggf84/tupan | tupan/particles/body.py | 1 | 18588 | # -*- coding: utf-8 -*-
#
"""
TODO.
"""
from __future__ import print_function
import sys
import copy
import numpy as np
from ..lib import extensions
from ..lib.utils.timing import decallmethods, timings
__all__ = ["Bodies"]
class NbodyMethods(object):
"""This class holds common methods for particles in n-bod... | mit | 647,833,605,706,238,800 | 26.497041 | 79 | 0.528298 | false | 3.43586 | false | false | false |
ValorNaram/isl | inputchangers/001.py | 1 | 15830 | from __future__ import print_function
import os
globe = {}
generateIndex = False
lang = "en"
brackets = ["[&]", "{&}", "(&)", "<&>"]
class compiler():
def __init__(self):
self = self
def languageSupport(self, f):
if "langBuffer" in globe:
langBuffer = globe["langBuffer"]
else:
langBuffer = {}
if not f i... | mit | -5,764,654,230,822,029,000 | 39.480818 | 227 | 0.601655 | false | 2.993758 | false | false | false |
graingert/maluroam | maluroam/eduroam_snort/models.py | 1 | 3623 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# models.py
#
# Copyright 2012 Thomas Grainger <tagrain@gmail.com>
#
# 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; version 3.
# ... | agpl-3.0 | -4,906,065,184,165,069,000 | 33.504762 | 115 | 0.642009 | false | 3.663296 | false | false | false |
harlequin/sickbeard | sickbeard/metadata/tivo.py | 1 | 13263 | # Author: Nic Wolfe <nic@wolfeden.ca>
# Author: Gordon Turner <gordonturner@gordonturner.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | gpl-3.0 | 8,133,758,677,926,244,000 | 40.839117 | 176 | 0.562618 | false | 4.213151 | false | false | false |
ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/lib/agw/toasterbox.py | 1 | 46688 | # --------------------------------------------------------------------------- #
# TOASTERBOX wxPython IMPLEMENTATION
# Ported And Enhanced From wxWidgets Contribution (Aj Bommarito) By:
#
# Andrea Gavana, @ 16 September 2005
# Latest Revision: 14 Mar 2012, 21.00 GMT
#
#
# TODO/Caveats List
#
# 1. Any Idea?
#... | mit | -4,192,503,519,830,455,000 | 33.077385 | 279 | 0.525103 | false | 4.279377 | false | false | false |
funkyfuture/deck-chores | deck_chores/indexes.py | 1 | 2095 | from functools import lru_cache
from types import MappingProxyType
from typing import Dict, Tuple
from deck_chores.config import cfg, CONTAINER_CACHE_SIZE
from deck_chores.utils import log
####
@lru_cache(maxsize=CONTAINER_CACHE_SIZE)
def container_name(container_id: str) -> str:
return cfg.client.containers.g... | isc | 137,992,603,129,664,260 | 33.344262 | 86 | 0.71074 | false | 3.193598 | false | false | false |
Tim-Erwin/sanic | sanic/router.py | 1 | 13870 | import re
from collections import defaultdict, namedtuple
from collections.abc import Iterable
from functools import lru_cache
from sanic.exceptions import NotFound, InvalidUsage
from sanic.views import CompositionView
Route = namedtuple(
'Route',
['handler', 'methods', 'pattern', 'parameters', 'name', 'uri']... | mit | 1,279,275,129,031,850,000 | 35.214099 | 79 | 0.559697 | false | 4.446938 | false | false | false |
StuartAxelOwen/join | join/_join_funcs.py | 1 | 2328 | from functools import partial
__author__ = 'stuart'
def get_object_attrs(obj):
if hasattr(obj, '__dict__'):
return obj.__dict__
elif hasattr(obj, '__slots__'):
return {key: getattr(obj, key) for key in obj.__slots__}
else:
return {}
class Union(object):
def __init__(self, at... | mit | -4,050,428,239,922,643,500 | 29.233766 | 92 | 0.572165 | false | 3.742765 | false | false | false |
soylentdeen/Graffity | src/ErrorBudgetAnalysis.py | 1 | 7600 | import Graffity
import numpy
import scipy
import matplotlib.pyplot as pyplot
wave = 632.8
ciao = Graffity.WFS(wavelength=1800.0)
var = numpy.array([False, False, True, True, True])
offsets = []
x = 0
for v in var:
if v:
offsets.append(x)
x+= 1
else:
offsets.append(0)
zern = [0.0, 0.0... | mit | -3,690,607,500,366,776,000 | 31.478632 | 84 | 0.589474 | false | 2.509079 | false | false | false |
jbvsmo/discoder | discoder/lib/parse.py | 1 | 2685 | # coding: utf-8
""" Copyright (c) 2013 João Bernardo Vianna Oliveira
This file is part of Discoder.
Discoder 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
... | gpl-3.0 | 4,299,707,843,823,941,600 | 30.952381 | 102 | 0.548808 | false | 4.085236 | false | false | false |
kubow/HAC | System/UI74KW.py | 1 | 2115 | #!/usr/bin/python3
import os.path
from kivy.resources import resource_add_path
KV_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)))
resource_add_path(KV_PATH)
print(KV_PATH)
#import kivy
#kivy.require('1.7.1')
from kivy.lang import Builder
Builder.load_file('H808E.kv')
from kivy.app import App
from kiv... | unlicense | -7,743,993,530,130,653,000 | 29.652174 | 86 | 0.689362 | false | 3.519135 | false | false | false |
PatentBlocker/Motorola_Patent_Citations | src/get_citations.py | 1 | 1772 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 20 16:08:56 2016
@author: Thibault
"""
import pandas as pd
import numpy as np
# Loading the data
data_dir = '../data'
# training and validation sets
train_file = data_dir + '/blocking1114.csv'
# Opening the blocking data
TrainFile = pd.read_csv(train_file, header=None... | bsd-2-clause | -3,259,559,936,448,086,000 | 22.315789 | 135 | 0.731941 | false | 2.862682 | false | false | false |
public/python-super3 | test.py | 1 | 2905 | import time
import inspect
import random
from super3 import more_super3 as super3, callable_super3
def super_proxy(self, type):
py_super = super(type, self)
my_super = super3(caller=inspect.currentframe().f_back)
assert py_super.__str__() == my_super.__str__() \
or (py_super.__self_class__ ... | lgpl-3.0 | 1,098,780,801,679,328,900 | 19.034483 | 75 | 0.512909 | false | 3.150759 | false | false | false |
GarethPW/Scratch-Comment-Viewer | old/v2.0.0/scratchcomments.py | 1 | 4830 | '''
Scratch Project Comments Parser v1.0.0
Created for use with SCV Server v2.0.0
Created by Scratch user, Gaza101.
Licensed under GNU General Public License v3.
www.garethpw.net
'''
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint
from urllib2 import urlopen
class Comm... | gpl-3.0 | -5,200,480,149,626,272,000 | 56.5 | 199 | 0.547826 | false | 3.642534 | false | false | false |
kyubifire/softlayer-python | SoftLayer/managers/dns.py | 1 | 8207 | """
SoftLayer.dns
~~~~~~~~~~~~~
DNS Manager/helpers
:license: MIT, see LICENSE for more details.
"""
import time
from SoftLayer import utils
class DNSManager(utils.IdentifierMixin, object):
"""Manage SoftLayer DNS.
See product information here: http://www.softlayer.com/DOMAIN-SERVICES
... | mit | 1,036,015,339,823,414,800 | 33.628692 | 102 | 0.60156 | false | 4.263377 | false | false | false |
adityahase/frappe | frappe/desk/page/user_profile/user_profile.py | 1 | 2323 | import frappe
from datetime import datetime
@frappe.whitelist()
def get_energy_points_heatmap_data(user, date):
return dict(frappe.db.sql("""select unix_timestamp(date(creation)), sum(points)
from `tabEnergy Point Log`
where
date(creation) > subdate('{date}', interval 1 year) and
date(creation) < subdate('{... | mit | -6,314,365,701,903,240,000 | 28.782051 | 85 | 0.637538 | false | 2.882134 | false | false | false |
ToonTownInfiniteRepo/ToontownInfinite | toontown/estate/DistributedFurnitureItem.py | 1 | 4767 | from toontown.toonbase.ToontownGlobals import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.catalog import CatalogItem
from toontown.toonbase import ToontownGlobals
from direct.distributed import DistributedObject
from toontown.toonbase import TTLocalizer
impor... | mit | 3,282,787,121,327,398,400 | 33.294964 | 119 | 0.643382 | false | 3.724219 | false | false | false |
willi-kappler/Snowball_Python | modules/gimmick.py | 1 | 13945 | import random
import pygame
import gfxobject
class Gimmick:
"Class for the funny gimmicks. Note that it doesn't use any of the gfxobject classes"
def __init__(self, screen, level):
self.screen = screen
self.level = level
self.tux = gfxobject.GFXObject(screen, level, level.playerGfx, 0, ... | gpl-2.0 | -7,936,916,952,836,410,000 | 38.616477 | 109 | 0.502617 | false | 3.223532 | false | false | false |
googleapis/googleapis-gen | google/cloud/websecurityscanner/v1/websecurityscanner-v1-py/google/cloud/websecurityscanner_v1/types/finding_type_stats.py | 1 | 1388 | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -8,043,455,129,311,050,000 | 26.76 | 74 | 0.668588 | false | 4.106509 | false | false | false |
robotika/husky | ros/tcpros.py | 1 | 3927 | """
Parsing TCPROS communication protocol
usage:
./tcpros <log file to replay>
"""
import socket
import struct
import sys
import datetime
def prefix4BytesLen( s ):
"adding ROS length"
return struct.pack("I", len(s)) + s
def splitLenStr( data ):
ret = []
while len(data) >= 4:
size = s... | mit | 264,870,536,879,751,900 | 27.664234 | 93 | 0.520499 | false | 3.768714 | false | false | false |
pseudobeard/teambalancer | legacy/getter.py | 1 | 1244 | import json
import requests
with open('properties.json') as data_file:
data = json.load(data_file)
jwtToken = data["jwtToken"]
id = data["id"]
ITEM_NAME = data["item_name"]
headers = {"authorization" : "Bearer " + jwtToken}
baseurl = "https://api.streamelements.com/kappa/v1/store/"
end = "/redemptions?limit=100... | gpl-3.0 | -2,647,808,785,494,130,000 | 26.666667 | 99 | 0.605305 | false | 3.54416 | false | false | false |
rmulton/lawen | webservice_caller/GoogleAPICaller.py | 1 | 2949 | import json
import re
from bs4 import BeautifulSoup
from model.Transport.Walk import Walk
from model.Transport.PublicTransport import PublicTransport
from model.Transport.Drive import Drive
from model.Transport.Bicycle import Bicycle
from model.Possibilities import Possibilities
from webservice_caller.TransportAPICalle... | mit | 4,741,626,998,261,590,000 | 39.958333 | 213 | 0.60902 | false | 4.039726 | false | false | false |
kevintee/Predicting-Gene-Networks | results/goatools-master/scripts/map_to_slim.py | 1 | 4362 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import os
import os.path as op
import sys
sys.path.insert(0, op.join(op.dirname(__file__), ".."))
from goatools.obo_parser import GODag
from goatools.mapslim import mapslim
# copied from find_enrichment.py
# TODO: put this method int... | mit | 2,198,930,277,739,661,600 | 36.282051 | 78 | 0.560064 | false | 3.631973 | false | false | false |
polypmer/obligarcy | obligarcy/urls.py | 1 | 1546 | from django.conf.urls import url
from . import views
from django.conf.urls.static import static, settings
urlpatterns = [
# ex: /oblicarcy/
url(r'^$', views.index, name='index'),
url(r'^firehose/$', views.firehose, name='firehose'),
url(r'^profile/$', views.profile, name='profile'),
# ex: /obliga... | gpl-3.0 | -9,180,719,467,244,064,000 | 40.783784 | 130 | 0.609314 | false | 2.939163 | false | true | false |
xinl/lifepadbox | lp/time.py | 1 | 1825 | import datetime
class TZOffset(datetime.tzinfo):
def __init__(self, offset_string):
# validity of offset_string is already taken care of by Setting.put() so we just trust it here.
self.offset_string = offset_string
self._h = int(self.offset_string[1:3])
self._m = int(self.offset_st... | bsd-2-clause | 3,487,160,411,433,715,700 | 41.465116 | 168 | 0.61863 | false | 3.135739 | false | false | false |
tuwmft/MatterBot | mattermost_bot/plugins/mlpl/Game.py | 1 | 9936 | from threading import Timer
import random
import string
class Game():
IDDLE = 0
START_GAME = 1
START_ROUND = 2
DURING_ROUND = 3
END_ROUND = 4
POINTS_PER_SCORE = [
1,
2,
3,
5,
7,
10,
14,
20,
]
MLPL_BONUS = 10
MESSAGE... | mit | 1,998,505,489,977,923,300 | 28.88253 | 92 | 0.519605 | false | 3.679896 | false | false | false |
aveao/AveBot | cogs/stockstream.py | 1 | 1897 | import discord
from discord.ext import commands
import secrets
class Stockstream:
def __init__(self, bot):
self.bot = bot
@commands.command()
async def copypasta(self, ctx, ticker: str):
"""Generates a copypasta for StockStream using the given ticker."""
copypasta_list = ["Kreygas... | mit | 6,933,392,645,307,308,000 | 53.2 | 128 | 0.627306 | false | 3.345679 | false | false | false |
ttrifonov/horizon | horizon/horizon/dashboards/nova/access_and_security/security_groups/tests.py | 1 | 10057 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | -533,934,509,314,937,400 | 35.046595 | 79 | 0.586159 | false | 3.95167 | true | false | false |
zaina/nova | nova/virt/libvirt/volume.py | 1 | 68849 | # Copyright 2011 OpenStack Foundation
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | apache-2.0 | 2,811,650,872,835,121,700 | 42.219711 | 79 | 0.554402 | false | 4.223088 | true | false | false |
FOSSRIT/Nova | controllers/extras.py | 1 | 79892 | # Copyright (C) 2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# Distributed under the terms of the GNU Lesser General Public License
# http://www.gnu.org/copyleft/lesser.html
from networkx.classes.multigraph import MultiGraph
from netwo... | gpl-3.0 | -6,707,146,173,462,512,000 | 33.615251 | 101 | 0.528664 | false | 3.580193 | false | false | false |
isotoma/precog | setup.py | 1 | 1182 | # Copyright 2016 Isotoma Limited
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | apache-2.0 | 5,478,780,143,963,121,000 | 30.105263 | 74 | 0.692047 | false | 3.764331 | false | false | false |
IronLanguages/ironpython3 | Src/StdLib/Lib/socket.py | 1 | 20953 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | apache-2.0 | 2,936,274,193,800,808,000 | 34.393581 | 95 | 0.606214 | false | 4.173904 | false | false | false |
mastorak/udolc | udolc/UdolcWindow.py | 1 | 4139 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2013 <Konstantinos Mastorakis> <mastorak at gmail dot com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
... | gpl-3.0 | -7,600,585,048,314,815,000 | 35.955357 | 79 | 0.62648 | false | 3.857409 | false | false | false |
martin-green/skojjt | imports.py | 1 | 3816 | # -*- coding: utf-8 -*-
import time
from data import Semester, TaskProgress, UserPrefs
from dataimport import RunScoutnetImport
from google.appengine.ext import deferred, ndb
from flask import Blueprint, render_template, request, make_response, redirect
import_page = Blueprint('import_page', __name__, template_folder... | apache-2.0 | 3,902,891,039,809,497,600 | 38.340206 | 136 | 0.659329 | false | 3.566355 | false | false | false |
bsgbryan/Ardus | node_modules/microtime/build/c4che/default.cache.py | 1 | 1405 | AR = '/usr/bin/ar'
ARFLAGS = 'rcs'
CCFLAGS = ['-g']
CCFLAGS_MACBUNDLE = ['-fPIC']
CCFLAGS_NODE = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
CC_VERSION = ('4', '2', '1')
COMPILER_CXX = 'g++'
CPP = '/usr/bin/cpp'
CPPFLAGS_NODE = ['-D_GNU_SOURCE', '-DEV_MULTIPLICITY=0']
CPPPATH_NODE = '/usr/local/include/node'
CPPP... | mit | -3,397,733,078,171,443,700 | 28.270833 | 82 | 0.625623 | false | 2.482332 | false | true | false |
Elastica/kombu | kombu/clocks.py | 1 | 4635 | """
kombu.clocks
============
Logical Clocks and Synchronization.
"""
from __future__ import absolute_import, unicode_literals
from threading import Lock
from itertools import islice
from operator import itemgetter
from .five import python_2_unicode_compatible, zip
__all__ = ['LamportClock', 'timetuple']
R_CLOCK ... | bsd-3-clause | 5,739,204,968,868,085,000 | 28.711538 | 77 | 0.604962 | false | 4.090909 | false | false | false |
miquelcampos/GEAR_mc | gear/xsi/rig/component/chain_01/guide.py | 1 | 3991 | '''
This file is part of GEAR.
GEAR is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distrib... | lgpl-3.0 | 630,757,503,374,750,000 | 31.185484 | 106 | 0.527938 | false | 3.998998 | false | false | false |
google/skia | infra/bots/assets/cmake_mac/create.py | 1 | 1130 | #!/usr/bin/env python
#
# Copyright 2019 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import os
import subprocess
import sys
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
INFRA_BOTS_DIR = os.path.... | bsd-3-clause | -5,843,847,538,980,746,000 | 24.111111 | 79 | 0.635398 | false | 3.237822 | false | false | false |
shengqh/ngsperl | lib/QC/bamSoftClipPosition.py | 1 | 3130 | import pysam
import argparse
import sys
import logging
import os
from asyncore import read
parser = argparse.ArgumentParser(description="Build soft clip position distribution in BAM file.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
DEBUG=False
NOT_DEBUG = not ... | apache-2.0 | 2,228,004,793,218,113,500 | 36.195122 | 146 | 0.675399 | false | 3.243523 | false | false | false |
msg/g2ools | nord/convert/lfo.py | 1 | 10685 | #
# lfo.py - Lfo tab conversion objects
#
# Copyright (c) 2006,2007 Matt Gerassimoff
#
# This file is part of g2ools.
#
# g2ools is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License,... | gpl-2.0 | -1,390,390,369,953,476,000 | 29.971014 | 76 | 0.656341 | false | 2.7216 | false | false | false |
HybridF5/jacket | jacket/api/compute/openstack/compute/limits.py | 1 | 2400 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | 5,010,607,489,460,766,000 | 34.820896 | 78 | 0.68625 | false | 4.088586 | false | false | false |
Fokko/incubator-airflow | airflow/contrib/example_dags/example_emr_job_flow_automatic_steps.py | 1 | 2363 | # -*- coding: utf-8 -*-
#
# 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 | -6,546,665,006,355,624,000 | 29.294872 | 100 | 0.658485 | false | 3.511144 | false | false | false |
elvandy/nltools | nltools/datasets.py | 1 | 4739 | '''
NeuroLearn datasets
===================
functions to help download datasets
'''
## Notes:
# Need to figure out how to speed up loading and resampling of data
__all__ = ['download_nifti',
'get_collection_image_metadata',
'download_collection',
'fetch_emotion_ratings',
'fetch_pain']
__author__ = ["Luk... | mit | 7,979,483,591,160,874,000 | 28.993671 | 86 | 0.703313 | false | 3.219429 | false | false | false |
zuowang/Paddle | python/paddle/trainer/PyDataProvider2.py | 1 | 13558 | # Copyright (c) 2016 Baidu, 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 o... | apache-2.0 | -1,903,039,986,429,761,800 | 35.544474 | 83 | 0.567119 | false | 4.495358 | false | false | false |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/Bio/SCOP/__init__.py | 1 | 31882 | # Copyright 2001 by Gavin E. Crooks. All rights reserved.
# Modifications Copyright 2004/2005 James Casbon. All rights Reserved.
# Modifications Copyright 2010 Jeffrey Finkelstein. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that ... | apache-2.0 | 2,075,764,463,224,599,300 | 34.662192 | 99 | 0.552977 | false | 3.671772 | false | false | false |
mcs07/ChemDataExtractor | chemdataextractor/cli/pos.py | 1 | 11619 | # -*- coding: utf-8 -*-
"""
chemdataextractor.cli.pos
~~~~~~~~~~~~~~~~~~~~~~~~~
Part of speech tagging commands.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import click
from ..doc import Document, Text
from ..nlp.corpus import gen... | mit | -1,216,581,177,639,905,800 | 42.845283 | 132 | 0.58697 | false | 3.275726 | false | false | false |
CollinRooney12/htsprophet | htsprophet/fitForecast.py | 1 | 13224 | # -*- coding: utf-8 -*-
"""
Name: fitForecast.py
Author: Collin Rooney
Last Updated: 7/18/2017
This script will contain functions for all types of hierarchical modeling approaches.
It will use the prophet package as a forecasting tool.
The general idea of it is very similar to the hts package in R, but it is a little
m... | mit | 7,184,139,017,834,954,000 | 45.080139 | 179 | 0.548851 | false | 3.780446 | false | false | false |
tommasoberlose/p2p_bittorrent | SocketFunc.py | 1 | 1263 | import socket
####### SOCKET
def create_socket_server(myHost, port):
s = None
for res in socket.getaddrinfo(None, int(port), socket.AF_UNSPEC,socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
s = socket.socket(af, socktype, proto)
except socket.error as ms... | mit | -3,098,031,255,870,166,000 | 24.26 | 107 | 0.585115 | false | 2.944056 | false | false | false |
nlgndnmz/ctpsingle | BeyerHedetmieni.py | 1 | 3481 |
import sys
# G is the gamma matrix
# par is the parent array
# n is the number of nodes
def writeGammaMatrix(gammaFile, G, par, n):
for i in range(n):
for j in range(n):
G[i][j] = 0
for i in range(n):
G[i][i] = 1
j = par[i]-1
while j > -1:
G[j][i] = 1
j = par[j]-1
for i in range(n):
for j in r... | gpl-3.0 | 5,346,986,811,560,547,000 | 17.918478 | 109 | 0.561046 | false | 2.334675 | false | false | false |
fzimmermann89/pyload | module/plugins/crypter/DevhostStFolder.py | 1 | 2306 | # -*- coding: utf-8 -*-
#
# Test links:
# http://d-h.st/users/shine/?fld_id=37263#files
import re
import urlparse
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class DevhostStFolder(SimpleCrypter):
__name__ = "DevhostStFolder"
__type__ = "crypter"
__version__ = "0... | gpl-3.0 | 6,376,989,188,903,538,000 | 33.41791 | 95 | 0.506071 | false | 3.280228 | false | false | false |
dbousque/lymp | srcs/lymp.py | 1 | 6462 |
from time import time
from struct import pack, unpack
import bson, sys, os, codecs
from random import randint
from traceback import print_exc
def int_to_int64_bytes(i):
return pack('>q', i)
def py_to_bson(val):
if type(val) is int:
return bson.int64.Int64(val)
if sys.version_info.major == 2 and type(val) is st... | mit | -693,447,540,580,453,000 | 29.625592 | 103 | 0.656608 | false | 2.864362 | false | false | false |
johnjohnlin/nicotb | sim/standalone/test_semaphore.py | 1 | 1602 | #!/usr/bin/env python
# Copyright (C) 2017,2019, Yu Sheng Lin, johnjohnlys@media.ee.ntu.edu.tw
# This file is part of Nicotb.
# Nicotb 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 ... | gpl-3.0 | 9,214,477,608,298,877,000 | 24.83871 | 72 | 0.721598 | false | 3.098646 | false | false | false |
mkauppila/rachel | bot/parse.py | 1 | 1792 | import irc
def parse_nick(nick):
""" Separates nick from the mode characters.
Examples:
parse_nick('@_markus') => (_markus, 'o')
parse_nick('+_markus') => ('_markus', 'v')
"""
converter = {'@' : 'o', '+' : 'v'}
modes = converter.keys()
first_character = nick[0]
if first_character in modes:
return (nick... | mit | -63,711,807,403,173,780 | 23.547945 | 63 | 0.682478 | false | 3.246377 | false | false | false |
ImmaculateObsession/nest | pebbles/forms.py | 1 | 3224 | from django import forms
from django.utils.text import slugify
from suit_redactor.widgets import RedactorWidget
from pebbles.models import (
Pebble,
PebblePage,
)
class PebblePageForm(forms.Form):
title = forms.CharField(
max_length=140,
required=True,
widget=forms.TextInput(attr... | mit | 3,485,214,062,149,560,000 | 29.130841 | 109 | 0.611042 | false | 3.856459 | false | false | false |
philroche/Django-tinymce-filebrowser | mce_filebrowser/models.py | 1 | 1228 | import datetime
from django.db import models
from django.utils.translation import ugettext as _
from mce_filebrowser.conf import LOCAL_MCE_FILEBROWSER_UPLOADDIR,LOCAL_MCE_FILEBROWSER_PERUSER
def content_file_name(instance, filename):
if LOCAL_MCE_FILEBROWSER_PERUSER == True:
return "%s/%s/%s/%s" %(LOCA... | mit | -6,621,422,880,594,318,000 | 33.111111 | 153 | 0.645765 | false | 3.430168 | false | false | false |
wrightjb/bolt-planar | setup.py | 1 | 2408 | # setup.py for planar
#
# $Id$
import os
import sys
import shutil
from distutils.core import setup, Extension
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
if sys.version_info >= (3, 0):
raise ImportError("build_py_2to3 not found in distutils - it is require... | bsd-3-clause | -2,776,766,464,232,461,000 | 28.365854 | 97 | 0.634551 | false | 3.415603 | false | false | false |
teddy-michel/Mimir | games/forms.py | 1 | 2992 | from django.forms import ModelForm, Textarea, HiddenInput, IntegerField, CharField, Select
from django.utils.translation import ugettext as _
from base.models import Tag
from .models import Game, Saga, SagaGame, GameAttribute, GameLink, GameTag, GameUser
class GameForm(ModelForm):
class Meta:
model = Gam... | gpl-3.0 | -415,004,628,209,892,350 | 28.048544 | 107 | 0.580548 | false | 3.792142 | false | false | false |
acutesoftware/AIKIF | aikif/lib/cls_goal_time.py | 1 | 1843 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# cls_goal_time.py
from aikif.lib.cls_goal import Goal
class GoalTime(Goal):
"""
goals around time - eg maximise use of object / minimize time of task
"""
def __init__(self, maximise=True, current_val=0, target_val=0):
"""
set maximise = True... | gpl-3.0 | -5,118,131,896,329,419,000 | 33.773585 | 124 | 0.546934 | false | 3.627953 | false | false | false |
domob1812/huntercore | test/functional/auxpow_mining.py | 1 | 6838 | #!/usr/bin/env python3
# Copyright (c) 2014-2018 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test the merge-mining RPC interface:
# getauxblock, createauxblock, submitauxblock
from test_framework.test_framework... | mit | 2,870,474,276,787,400,000 | 35.962162 | 77 | 0.659842 | false | 3.629512 | true | false | false |
algorhythms/LeetCode | 276 Paint Fence.py | 1 | 3181 | """
Premium Question
"""
__author__ = 'Daniel'
class Solution(object):
def numWays_oneliner(self, n, k):
return 0 if n < 1 else sum(reduce(lambda F, i: [(k-1)*(F[0]+F[1]), F[0]], xrange(1, n), [k, 0]))
def numWays(self, n, k):
"""
You need to abstract number of colors to binary value ... | mit | 631,004,810,354,814,800 | 26.188034 | 111 | 0.408362 | false | 3.162028 | false | false | false |
Jc2k/libcloudcore | libcloudcore/driver.py | 1 | 2268 | # 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 regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | 6,896,000,010,012,746,000 | 34.4375 | 74 | 0.659171 | false | 4.369942 | false | false | false |
lailongwei/llbc | wrap/pyllbc/script/comm/Timer.py | 1 | 3690 | # -*- coding: utf-8 -*-
import time as _time
from datetime import datetime as _dt
from datetime import tzinfo as _tzinfo
from datetime import timedelta as _timedelta
import llbc
class _pyllbcGMT(_tzinfo):
"""llbc library GMT tzinfo class encapsulation"""
_delta = _timedelta(0)
def utcoffset(self, dt):
... | mit | -2,180,250,508,961,024,300 | 29.213115 | 120 | 0.620867 | false | 3.614104 | false | false | false |
juanchopanza/NeuroM | neurom/morphmath.py | 1 | 12380 | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | bsd-3-clause | -7,683,719,952,775,599,000 | 29.79602 | 98 | 0.656704 | false | 3.622001 | false | false | false |
karolyi/forum-django | backend/migrate_to_django/markdownparser.py | 1 | 1130 | import html
from bs4.element import Tag
from forum.base.models import Comment
from html2text import html2text
def markdown_smilies(img_tag: Tag):
img_src = img_tag.get('src', '')
if img_src.startswith('/static/images/smiliereplace/'):
img_alt = img_tag.get('alt', '')
img_tag.replace_with(img... | mit | -5,486,757,108,375,557,000 | 28.736842 | 77 | 0.643363 | false | 3.247126 | false | false | false |
roac-monitoring/roac-agent | roac/logs.py | 1 | 1388 | # vim: set fileencoding=utf-8 :
from __future__ import absolute_import
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
def log_to_stderr(logger=None, level = logging.DEBUG):
"""Configures the python log system to log to stderr
logger: Logger to configure. Pass no... | bsd-3-clause | -5,082,369,550,257,231,000 | 27.916667 | 76 | 0.669308 | false | 4.3375 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.