repo_name stringlengths 5 100 | path stringlengths 4 299 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1.03M | license stringclasses 15
values | hash int64 -9,223,351,895,964,839,000 9,223,297,778B | line_mean float64 3.17 100 | line_max int64 7 1k | alpha_frac float64 0.25 0.98 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|
nicolashainaux/mathmaker | tests/00_libs/test_anglessets.py | 1 | 5684 | # -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | gpl-3.0 | -4,337,252,058,295,016,400 | 38.2 | 78 | 0.589726 | false |
davechallis/gensim | gensim/models/ldamulticore.py | 9 | 12566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jan Zikes, Radim Rehurek
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Latent Dirichlet Allocation (LDA) in Python, using all CPU cores to parallelize and
speed up model t... | lgpl-2.1 | -4,509,515,091,963,753,000 | 44.201439 | 174 | 0.623906 | false |
vgupta6/Project-2 | modules/tests/inv/helper.py | 2 | 16414 | __all__ = ["send",
"track_send_item",
"send_shipment",
"receive",
"track_recv_item",
"recv_shipment",
"recv_sent_shipment",
"send_rec",
"send_get_id",
"send_get_ref",
"recv_rec",
"recv_get_id",
... | mit | 1,742,293,231,489,619,000 | 39.132029 | 217 | 0.519678 | false |
Pike/elmo | apps/shipping/forms.py | 2 | 1261 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from __future__ import unicode_literals
from django import forms
from shipping.mo... | mpl-2.0 | -7,068,895,552,219,340,000 | 32.184211 | 74 | 0.655829 | false |
Creworker/FreeCAD | src/Mod/OpenSCAD/colorcodeshapes.py | 29 | 4659 | #***************************************************************************
#* *
#* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> *
#* *
#* This pr... | lgpl-2.1 | 7,837,713,276,584,346,000 | 40.598214 | 123 | 0.520713 | false |
cboling/SDNdbg | docs/old-stuff/pydzcvr/doc/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py | 4 | 20045 | # Copyright 2014 Arista Networks, 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 requ... | apache-2.0 | 3,187,505,232,501,817,000 | 39.413306 | 79 | 0.545922 | false |
jamiecaesar/SecureCRT | templates/single_device_template.py | 3 | 2754 | # $language = "python"
# $interface = "1.0"
import os
import sys
import logging
# Add script directory to the PYTHONPATH so we can import our modules (only if run from SecureCRT)
if 'crt' in globals():
script_dir, script_name = os.path.split(crt.ScriptFullName)
if script_dir not in sys.path:
sys.path.... | apache-2.0 | 3,464,533,098,248,832,000 | 34.766234 | 119 | 0.657226 | false |
collects/VTK | Examples/Infovis/Python/hierarchical_graph.py | 17 | 2136 | from vtk import *
source = vtkRandomGraphSource()
source.SetNumberOfVertices(200)
source.SetEdgeProbability(0.01)
source.SetUseEdgeProbability(True)
source.SetStartWithTree(True)
source.IncludeEdgeWeightsOn()
source.AllowParallelEdgesOn()
# Connect to the vtkVertexDegree filter.
degree_filter = vtkVertexDegree()
degr... | bsd-3-clause | 7,096,711,207,002,817,000 | 29.514286 | 70 | 0.831929 | false |
cstavr/synnefo | snf-pithos-backend/pithos/backends/lib/sqlite/groups.py | 1 | 3735 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 | 6,196,770,812,204,499,000 | 34.571429 | 78 | 0.591968 | false |
ProgVal/Limnoria-test | test/test_plugins.py | 9 | 1717 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyr... | bsd-3-clause | 8,212,996,658,022,921,000 | 49.5 | 79 | 0.774024 | false |
Distrotech/libxml2 | python/tests/reader3.py | 35 | 4153 | #!/usr/bin/python -u
#
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import libxml2
try:
import StringIO
str_io = StringIO.StringIO
except:
import io
str_io = io.StringIO
docstr="""<?xml version='1.0'?>
<!DOCTYPE doc [
<!ENTITY tst "<p>test</p>">
]>
<doc>&tst;</d... | gpl-3.0 | -7,122,903,785,842,022,000 | 24.95625 | 74 | 0.651096 | false |
onitake/ansible | lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py | 4 | 24848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 | -6,552,969,544,336,799,000 | 30.373737 | 93 | 0.602704 | false |
datsfosure/ansible | examples/scripts/yaml_to_ini.py | 175 | 7609 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 lat... | gpl-3.0 | 1,051,190,400,753,278,800 | 35.936893 | 119 | 0.540938 | false |
Tanmay28/coala | coalib/tests/output/JSONEncoderTest.py | 1 | 2819 | import sys
import json
import unittest
from datetime import datetime
sys.path.insert(0, ".")
from coalib.output.JSONEncoder import JSONEncoder
class TestClass1(object):
def __init__(self):
self.a = 0
class TestClass2(object):
def __init__(self):
self.a = 0
self.b = TestClass1()
cl... | agpl-3.0 | -8,412,124,947,123,936,000 | 26.105769 | 77 | 0.548421 | false |
parkbyte/electrumparkbyte | plugins/trezor/clientbase.py | 7 | 8778 | import time
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.wallet import BIP44_Wallet
class GuiMixin(object):
# Requires: self.proto, self.device
messages = {
3: _("Confirm the transaction output on your %s device"),
4: _("Confirm internal entro... | mit | -1,289,873,340,784,256,500 | 37.331878 | 79 | 0.599339 | false |
Backflipz/plugin.video.excubed | resources/lib/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 | 4,613,011,822,758,106,000 | 54.825328 | 70 | 0.553113 | false |
fabioz/pep8 | testsuite/E26.py | 14 | 1225 | #: E261:1:5
pass # an inline comment
#: E262:1:12
x = x + 1 #Increment x
#: E262:1:12
x = x + 1 # Increment x
#: E262:1:12
x = y + 1 #: Increment x
#: E265:1:1
#Block comment
a = 1
#: E265:2:1
m = 42
#! This is important
mx = 42 - 42
#: E266:3:5 E266:6:5
def how_it_feel(r):
### This is a variable ###
a = ... | mit | 7,955,188,299,268,242,000 | 19.762712 | 79 | 0.342041 | false |
fhaoquan/kbengine | kbe/src/lib/python/Lib/lib2to3/fixes/fix_callable.py | 161 | 1151 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | lgpl-3.0 | -4,702,990,959,018,992,000 | 30.108108 | 80 | 0.61338 | false |
pipsiscool/audacity | lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/compiler_fc.py | 287 | 1846 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,imp,types
from waflib import Utils,Configure,Options,Logs,Errors
from waflib.Tools import fc
fc_compiler={'win32':['gfortran','ifort'],'darwin':['gfortran','g95'... | mit | -3,481,206,233,998,690,000 | 41.930233 | 239 | 0.729144 | false |
nexgenta/apt | test/pre-upload-check.py | 2 | 5809 | #!/usr/bin/python
import sys
import os
import glob
import os.path
from subprocess import call, PIPE
import unittest
stdout = os.open("/dev/null",0) #sys.stdout
stderr = os.open("/dev/null",0) # sys.stderr
apt_args = [] # ["-o","Debug::pkgAcquire::Auth=true"]
class testAuthentication(unittest.TestCase):
"""
... | gpl-2.0 | -3,632,881,847,565,245,000 | 36.720779 | 111 | 0.531761 | false |
openstack-infra/reviewstats | reviewstats/cmd/openapproved.py | 1 | 3204 | # Copyright (C) 2011 - Soren Hansen
# Copyright (C) 2013 - Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 | -5,270,525,455,848,682,000 | 35 | 79 | 0.615481 | false |
dparlevliet/zelenka-report-storage | server-db/twisted/web/_auth/basic.py | 66 | 1635 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP BASIC authentication.
@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
"""
import binascii
from... | lgpl-3.0 | -5,136,695,321,204,966,000 | 26.711864 | 84 | 0.666667 | false |
marscher/PyEMMA | pyemma/plots/__init__.py | 1 | 1704 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 vers... | lgpl-3.0 | 42,813,406,846,926,700 | 23.014085 | 97 | 0.696009 | false |
LogicalKnight/pywinauto | pywinauto/__init__.py | 14 | 1225 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... | lgpl-2.1 | 6,364,185,076,031,224,000 | 33 | 68 | 0.750204 | false |
craigem/MyAdventures | csvBuild.py | 1 | 1286 | # csvBuild from Adventure 6.
# import required modules
import mcpi.minecraft as minecraft
import mcpi.block as block
# connect to minecraft
mc = minecraft.Minecraft.create()
# define some constants
GAP = block.AIR.id
WALL = block.GOLD_BLOCK.id
FLOOR = block.GRASS.id
# Open the file containing maze data
FILENAME = "... | gpl-3.0 | -4,673,038,382,056,888,000 | 23.730769 | 65 | 0.634526 | false |
Elbagoury/odoo | addons/sale_margin/__init__.py | 441 | 1042 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 | 1,416,282,871,942,009,600 | 42.416667 | 78 | 0.619002 | false |
Elbagoury/odoo | addons/website_report/report.py | 257 | 2124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 | -8,844,894,048,427,906,000 | 44.191489 | 119 | 0.582863 | false |
presidentielcoin/presidentielcoin | qa/rpc-tests/test_framework/blockstore.py | 1 | 5425 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Presidentielcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# BlockStore: a helper class that keeps a map of blocks and implements
# helper funct... | mit | 9,068,670,471,248,562,000 | 32.079268 | 77 | 0.579539 | false |
jakesyl/pychess | lib/pychess/Players/PyChessFICS.py | 20 | 17313 | from __future__ import print_function
import email.Utils
from gi.repository import Gtk
import math
import pychess
import random
import signal
import subprocess
from threading import Thread
from pychess.compat import urlopen, urlencode
from pychess.Players.PyChess import PyChess
from pychess.System.prefix import addDa... | gpl-3.0 | -6,922,454,449,462,359,000 | 40.123515 | 121 | 0.540923 | false |
jasonwzhy/django | django/contrib/admindocs/tests/test_fields.py | 638 | 1172 | from __future__ import unicode_literals
import unittest
from django.contrib.admindocs import views
from django.db import models
from django.db.models import fields
from django.utils.translation import ugettext as _
class CustomField(models.Field):
description = "A custom field type"
class DescriptionLackingFi... | bsd-3-clause | -5,016,524,069,817,250,000 | 25.044444 | 74 | 0.62884 | false |
mrry/tensorflow | tensorflow/python/kernel_tests/slice_op_test.py | 18 | 10265 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -7,970,495,887,450,566,000 | 37.590226 | 80 | 0.600195 | false |
andmos/ansible | lib/ansible/modules/clustering/consul.py | 23 | 19949 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'... | gpl-3.0 | -1,379,211,342,108,684,300 | 34.245583 | 136 | 0.609153 | false |
davidfraser/sqlalchemy | test/ext/test_mutable.py | 21 | 18754 | from sqlalchemy import Integer, ForeignKey, String
from sqlalchemy.types import PickleType, TypeDecorator, VARCHAR
from sqlalchemy.orm import mapper, Session, composite
from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.orm.instrumentation import ClassManager
from sqlalchemy.testing.schema import Table, Column
fr... | mit | 80,530,328,737,471,220 | 24.620219 | 78 | 0.535992 | false |
ChristineLaMuse/mozillians | vendor-local/lib/python/celery/tests/test_worker/__init__.py | 12 | 33416 | from __future__ import absolute_import
from __future__ import with_statement
import socket
import sys
from collections import deque
from datetime import datetime, timedelta
from Queue import Empty
from kombu.transport.base import Message
from kombu.connection import BrokerConnection
from mock import Mock, patch
from... | bsd-3-clause | -1,895,767,343,035,479,600 | 33.953975 | 78 | 0.587503 | false |
bloopletech/Comix | src/thumbnail.py | 2 | 6430 | """thumbnail.py - Thumbnail module for Comix implementing (most of) the
freedesktop.org "standard" at http://jens.triq.net/thumbnail-spec/
Only normal size (i.e. 128x128 px) thumbnails are supported.
"""
import os
from urllib import pathname2url, url2pathname
try: # The md5 module is deprecated as of Python 2.5, repl... | gpl-2.0 | 1,211,705,157,724,083,500 | 32.664921 | 78 | 0.651944 | false |
alexsh/Telegram | TMessagesProj/jni/boringssl/third_party/googletest/test/googletest-uninitialized-test.py | 95 | 2474 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 | -3,258,380,564,801,925,600 | 35.925373 | 82 | 0.756265 | false |
v1teka/yo | vendor/psy/psysh/test/tools/gen_unvis_fixtures.py | 536 | 3120 | #! /usr/bin/env python3
import sys
from os.path import abspath, expanduser, dirname, join
from itertools import chain
import json
import argparse
from vis import vis, unvis, VIS_WHITE
__dir__ = dirname(abspath(__file__))
OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json')
# Add custom fixtures her... | gpl-3.0 | -4,311,066,869,243,529,700 | 32.191489 | 80 | 0.586538 | false |
tyler-abbot/psid_py | setup.py | 1 | 2486 | """A setup module for psidPy
Based on the pypa sample project.
A tool to download data and build psid panels based on psidR by Florian Oswald.
See:
https://github.com/floswald/psidR
https://github.com/tyler-abbot/psidPy
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
her... | mit | -7,097,989,396,776,916,000 | 32.146667 | 79 | 0.645213 | false |
victorbriz/omim | 3party/freetype/src/tools/docmaker/utils.py | 153 | 3513 | #
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use, modify,... | apache-2.0 | -3,209,469,644,274,226,700 | 26.661417 | 75 | 0.615713 | false |
nick-thompson/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py | 141 | 8457 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"date-year-0000": "0000-12-09",
"date-month-00": "2002-00-15",
"date-month-13": "2002-13-15",
"date-0005-02-29": "0005-02-29",
"date... | mpl-2.0 | -3,316,956,019,688,272,000 | 47.005682 | 89 | 0.63404 | false |
Sheikh-Aman/Stupid-Simple | Owl/owl.py | 1 | 3536 | import urllib2
import json
# Copyright 2016, Aman Alam
#
# 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 la... | apache-2.0 | 1,199,927,583,401,330,200 | 41.60241 | 120 | 0.670814 | false |
squarefactor/sorl | sorl/thumbnail/tests/templatetags.py | 2 | 10486 | import os
from django.conf import settings
from django.template import Template, Context, TemplateSyntaxError
from sorl.thumbnail.tests.classes import BaseTest, RELATIVE_PIC_NAME
class ThumbnailTagTest(BaseTest):
def render_template(self, source):
context = Context({
'source': RELATIVE_PIC_NAM... | bsd-3-clause | 4,388,880,401,686,010,400 | 32.608974 | 78 | 0.622544 | false |
minghuascode/pyj | library/pyjamas/ui/DropHandler.py | 9 | 3204 | # Copyright (C) 2010 Jim Washington
#
# 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 wr... | apache-2.0 | -1,597,006,847,413,705,200 | 31.04 | 78 | 0.659176 | false |
edeposit/edeposit.amqp.harvester | src/edeposit/amqp/harvester/tests/unittests/test_autoparser.py | 1 | 4415 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import pytest
import dhtmlparser
import harvester.edeposit_autoparser as autoparser
# Variables ========================================================... | mit | 8,019,252,120,661,142,000 | 23.527778 | 80 | 0.540204 | false |
zerotk/reraiseit | setup.py | 1 | 1574 | #!/bin/env python
from setuptools import setup
setup(
name='zerotk.reraiseit',
use_scm_version=True,
author='Alexandre Andrade',
author_email='kaniabi@gmail.com',
url='https://github.com/zerotk/reraiseit',
description='Reraise exceptions.',
long_description='''A function to re-raise exc... | lgpl-3.0 | 9,158,408,608,334,773,000 | 31.122449 | 123 | 0.634053 | false |
rhyolight/nupic | examples/tm/hello_tm.py | 10 | 6174 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | -6,695,195,385,743,187,000 | 39.352941 | 99 | 0.68918 | false |
florian-dacosta/OCB | openerp/addons/test_convert/tests/test_convert.py | 382 | 2303 | import collections
import unittest2
from lxml import etree as ET
from lxml.builder import E
from openerp.tests import common
from openerp.tools.convert import _eval_xml
Field = E.field
Value = E.value
class TestEvalXML(common.TransactionCase):
def eval_xml(self, node, obj=None, idref=None):
return _eval_... | agpl-3.0 | -8,721,784,582,223,784,000 | 26.746988 | 72 | 0.538862 | false |
battlehorse/rhizosphere | appengine/src/py/handlers/showcase/googlecode.py | 1 | 9970 | #!/usr/bin/env python
#
# Copyright 2010 The Rhizosphere 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
#
# U... | apache-2.0 | -8,143,730,671,700,434,000 | 33.738676 | 83 | 0.649348 | false |
algorhythms/LintCode | Interleaving Positive and Negative Numbers.py | 1 | 1350 | """
Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.
Have you met this question in a real interview? Yes
Example
Given [-1, -2, -3, 4, 5, 6], after re-range, it will be [-1, 5, -2, 4, -3, 6] or any other reasonable answer.
Note
You are not necessary ... | apache-2.0 | -8,921,503,985,788,272,000 | 27.145833 | 116 | 0.531111 | false |
barbuza/django | django/contrib/gis/db/backends/mysql/introspection.py | 700 | 1771 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... | bsd-3-clause | -3,778,621,017,512,529,400 | 42.195122 | 90 | 0.615471 | false |
UK992/servo | etc/wpt-summarize.py | 4 | 1754 | #!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/l... | mpl-2.0 | 1,967,211,925,997,286,400 | 37.130435 | 71 | 0.615165 | false |
fichter/grpc | src/python/grpcio/grpc/framework/base/null.py | 39 | 2106 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause | 7,337,527,146,759,436,000 | 36.607143 | 72 | 0.763058 | false |
Gjacquenot/PyRayTracer | raytracer/raytrace-receiver2.py | 1 | 38736 | # -*- coding: utf-8 -*-
"""
@author: Jaap Verheggen, Guillaume Jacquenot
"""
from __future__ import division
import vtk
import numpy as np
import vtk.util.numpy_support as ns
import raytracer as ray
cosd = lambda angle: np.cos(angle / 180 * np.pi)
sind = lambda angle: np.sin(angle / 180 * np.pi)
tand = lambda angle:... | mit | 6,415,017,978,709,350,000 | 40.786408 | 168 | 0.579177 | false |
charlescearl/VirtualMesos | third_party/boto-2.0b2/boto/gs/connection.py | 5 | 2004 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | apache-2.0 | 2,570,334,947,547,340,000 | 49.1 | 77 | 0.716567 | false |
feigames/Odoo | addons/marketing_campaign/report/campaign_analysis.py | 379 | 5310 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 4,086,454,288,565,740,500 | 51.019608 | 102 | 0.530155 | false |
aragos/tichu-tournament | python/reportlab/pdfbase/_fontdata_widths_courierbold.py | 224 | 3664 | widths = {'A': 600,
'AE': 600,
'Aacute': 600,
'Acircumflex': 600,
'Adieresis': 600,
'Agrave': 600,
'Aring': 600,
'Atilde': 600,
'B': 600,
'C': 600,
'Ccedilla': 600,
'D': 600,
'E': 600,
'Eacute': 600,
'Ecircumflex': 600,
'Edieresis': 600,
'Egrave': 600,
'Eth': 600,
'Euro': 600,
'F': 600,
'G': 600,
'... | mit | -5,437,147,673,017,319,000 | 15 | 23 | 0.561681 | false |
alexissmirnov/donomo | donomo_archive/deps/paypal/standard/pdt/tests/test_pdt.py | 9 | 5522 | """
run this with ./manage.py test website
see http://www.djangoproject.com/documentation/testing/ for details
"""
import os
from django.conf import settings
from django.shortcuts import render_to_response
from django.test import TestCase
from paypal.standard.pdt.forms import PayPalPDTForm
from paypal.standard.pdt.mode... | bsd-3-clause | 4,248,454,874,700,304,400 | 45.411765 | 101 | 0.624411 | false |
jayofdoom/cloud-init-debian-pkg | cloudinit/config/cc_byobu.py | 7 | 2886 | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 | 6,275,317,914,335,046,000 | 35.075 | 76 | 0.606722 | false |
gregcaporaso/qiime | scripts/conditional_uncovered_probability.py | 15 | 4838 | #!/usr/bin/env python
# File created on 1 April 2012
from __future__ import division
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Jens Reeder", "Jose Antonio Navas Molina", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jens Reeder"
... | gpl-2.0 | 8,896,769,902,928,978,000 | 36.215385 | 89 | 0.63642 | false |
chirilo/mozillians | vendor-local/lib/python/unidecode/x0c5.py | 253 | 4581 | data = (
'sseum', # 0x00
'sseub', # 0x01
'sseubs', # 0x02
'sseus', # 0x03
'sseuss', # 0x04
'sseung', # 0x05
'sseuj', # 0x06
'sseuc', # 0x07
'sseuk', # 0x08
'sseut', # 0x09
'sseup', # 0x0a
'sseuh', # 0x0b
'ssyi', # 0x0c
'ssyig', # 0x0d
'ssyigg', # 0x0e
'ssyigs', # 0x0f
'ss... | bsd-3-clause | 6,588,337,022,329,290,000 | 16.755814 | 19 | 0.439642 | false |
topazproject/topaz | tests/test_celldict.py | 3 | 1141 | from topaz.celldict import CellDict, Cell, GlobalsDict
from .base import BaseTopazTest
class TestCellDict(BaseTopazTest):
def test_single_set(self, space):
c = CellDict()
v = c.version
c.set(space, "a", 2)
assert c.version is not v
assert c._get_cell("a", c.version) == 2
... | bsd-3-clause | 408,474,187,701,671,600 | 29.837838 | 85 | 0.544259 | false |
MonicaHsu/truvaluation | venv/lib/python2.7/site-packages/simplejson/tests/test_item_sort_key.py | 140 | 1127 | from unittest import TestCase
import simplejson as json
from operator import itemgetter
class TestItemSortKey(TestCase):
def test_simple_first(self):
a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'}
self.assertEqual(
... | mit | -8,906,873,084,904,617,000 | 55.35 | 137 | 0.490683 | false |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/web/test/test_util.py | 16 | 12590 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.util}.
"""
from __future__ import absolute_import, division
import gc
from twisted.python.failure import Failure
from twisted.trial.unittest import SynchronousTestCase, TestCase
from twisted.internet import defer
fro... | mit | -8,920,966,017,674,404,000 | 33.398907 | 81 | 0.606672 | false |
USGSDenverPychron/pychron | pychron/pipeline/tasks/tree_node.py | 1 | 3345 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 | -2,415,939,757,539,616,000 | 25.76 | 81 | 0.578774 | false |
vigilv/scikit-learn | sklearn/gaussian_process/correlation_models.py | 230 | 7630 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
"""
The built-in correlation models submodule for the gaussian_process module.
"""
import numpy as np
def absolute_exponential(theta, d):
"""
Abs... | bsd-3-clause | 5,880,914,574,739,771,000 | 25.866197 | 78 | 0.547706 | false |
alexrao/YouCompleteMe | third_party/ycmd/third_party/jedi/test/test_evaluate/test_buildout_detection.py | 13 | 2751 | import os
from textwrap import dedent
from jedi._compatibility import u
from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
_get_buildout_scripts,
sys_path_with_modifications,
_check_module)
from jedi... | gpl-3.0 | -4,834,138,966,233,370,000 | 29.910112 | 85 | 0.61614 | false |
tensorflow/lucid | lucid/scratch/web/observable.py | 1 | 2465 | import json
from lucid.misc.io.showing import _display_html
def renderObservable(url, cells=None, data=None):
"""Display observable notebook cells in iPython.
Args:
url: url fragment to observable notebook. ex: '@observablehq/downloading-and-embedding-notebooks'
cells: an array of strings for the names of... | apache-2.0 | -788,707,965,468,401,200 | 27.662791 | 106 | 0.622312 | false |
quixoten/ansible | lib/ansible/cli/doc.py | 17 | 11990 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible 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.
#
# Ansible is distributed i... | gpl-3.0 | 2,400,568,851,459,023,000 | 37.184713 | 153 | 0.54362 | false |
dataxu/ansible | lib/ansible/module_utils/facts/other/facter.py | 232 | 2985 | # This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed in the hope that ... | gpl-3.0 | -9,162,952,936,423,398,000 | 34.117647 | 87 | 0.646566 | false |
ict-felix/stack | expedient/src/python/expedient/clearinghouse/commands/management/commands/setup_media.py | 2 | 1035 | '''Command to link static content to settings.STATIC_DOC_ROOT
Created on Aug 24, 2010
@author: jnaous
'''
from django.core.management.base import NoArgsCommand
from django.conf import settings
import pkg_resources
import os
class Command(NoArgsCommand):
help = "Link static content from package to %s" % settings.... | apache-2.0 | -736,013,820,706,910,700 | 32.387097 | 78 | 0.624155 | false |
robovm/robovm-studio | plugins/hg4idea/testData/bin/mercurial/pvec.py | 94 | 5989 | # pvec.py - probabilistic vector clocks for Mercurial
#
# Copyright 2012 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''
A "pvec" is a changeset property based on the theory of vector clocks
that... | apache-2.0 | 7,892,422,276,843,619,000 | 27.519048 | 79 | 0.592252 | false |
imply/chuu | ppapi/generators/idl_parser.py | 25 | 37745 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Parser for PPAPI IDL """
#
# IDL Parser
#
# The parser is uses the PLY yacc library to build a set of parsing rules based
# on... | bsd-3-clause | 4,310,717,186,275,542,500 | 29.711961 | 81 | 0.621115 | false |
RichardLitt/wyrd-django-dev | tests/modeltests/custom_methods/tests.py | 150 | 1196 | from __future__ import absolute_import
from datetime import date
from django.test import TestCase
from .models import Article
class MethodsTests(TestCase):
def test_custom_methods(self):
a = Article.objects.create(
headline="Area man programs in Python", pub_date=date(2005, 7, 27)
)... | bsd-3-clause | -2,435,113,597,600,341,500 | 26.181818 | 78 | 0.526756 | false |
kevintaw/django | django/contrib/gis/db/models/query.py | 16 | 36639 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... | bsd-3-clause | 360,247,608,459,187,140 | 43.572993 | 114 | 0.584896 | false |
paolodedios/tensorflow | tensorflow/python/kernel_tests/embedding_ops_test.py | 6 | 48038 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 1,064,695,674,563,006,100 | 39.641286 | 80 | 0.624839 | false |
sergio-incaser/bank-payment | __unported__/account_banking/parsers/__init__.py | 14 | 1053 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 | -7,006,655,941,373,913,000 | 42.875 | 78 | 0.611586 | false |
trachelr/mne-python | mne/stats/parametric.py | 5 | 12542 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import numpy as np
from functools import reduce
from string import ascii_uppercase
from ..externals.six import strin... | bsd-3-clause | 5,728,243,986,000,986,000 | 34.131653 | 78 | 0.594323 | false |
stainsteelcrown/nonsense-story-generator | venv/lib/python2.7/site-packages/werkzeug/urls.py | 146 | 33150 | # -*- coding: utf-8 -*-
"""
werkzeug.urls
~~~~~~~~~~~~~
This module implements various URL related functions.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
from werkzeug._compat import text_type, PY2, to_unicode,... | mit | 5,352,139,911,993,716,000 | 35.182314 | 83 | 0.594967 | false |
techvoltage/capstone | bindings/python/test.py | 33 | 5021 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
import binascii
import sys
from xprint import to_hex, to_x, to_x_32
_python3 = sys.version_info.major == 3
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x... | bsd-3-clause | 6,139,981,171,410,466,000 | 50.234694 | 272 | 0.625772 | false |
transferwise/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit | -8,763,417,256,080,298,000 | 30.163043 | 110 | 0.636554 | false |
gabrielsaldana/sqmc | sabesqmc/quote/tests/test_forms.py | 1 | 2384 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from ..forms import QuoteForm
class TestQuoteForm(TestCase):
def setUp(self):
pass
def test_validate_emtpy_quote(self):
form = QuoteForm({'message': ''})
self.assertFals... | agpl-3.0 | 373,462,940,213,938,370 | 40.824561 | 267 | 0.636745 | false |
hbrunn/OCB | addons/payment_authorize/controllers/main.py | 247 | 1261 | # -*- coding: utf-8 -*-
import pprint
import logging
import urlparse
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class AuthorizeController(http.Controller):
_return_url = '/payment/authorize/return/'
_cancel_url = '/payment/authorize/cancel/'
@http.ro... | agpl-3.0 | 8,330,796,822,597,135,000 | 38.40625 | 97 | 0.654243 | false |
cjparsons74/kupfer | kupfer/obj/objects.py | 1 | 11035 | # -*- coding: UTF-8 -*-
"""
Copyright 2007--2009 Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
This file is a part of the program kupfer, which is
released under GNU General Public License v3 (or any later version),
see the main program file, and COPYING for details.
"""
import os
from os import path
import gobject
fr... | gpl-3.0 | -217,940,039,745,900,320 | 26.179803 | 74 | 0.695696 | false |
klabble/pollution-music | weather.py | 1 | 4565 | #!/usr/bin/env python3
# Copyright 2013 David Walker
#
# This file is part of Pollution Music.
#
# Pollution Music 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 | -2,753,267,676,844,873,000 | 38.353448 | 80 | 0.604381 | false |
was4444/chromium.src | third_party/WebKit/Source/devtools/scripts/modular_build.py | 32 | 6644 | #!/usr/bin/env python
#
# 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.
"""
Utilities for the modular DevTools build.
"""
from os import path
import os
try:
import simplejson as json
except ImportErr... | bsd-3-clause | -7,166,083,372,488,460,000 | 35.911111 | 167 | 0.611078 | false |
nevil/edash-packager | packager/third_party/protobuf/python/google/protobuf/descriptor_database.py | 230 | 4411 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause | -8,719,473,828,288,866,000 | 35.758333 | 80 | 0.72818 | false |
dyyi/moneybook | venv/Lib/site-packages/pip/_vendor/distlib/manifest.py | 559 | 13598 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
from . import DistlibEx... | apache-2.0 | -8,514,432,104,207,264,000 | 36.051771 | 79 | 0.542065 | false |
0x46616c6b/ansible | lib/ansible/plugins/action/net_config.py | 137 | 4196 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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... | gpl-3.0 | 1,176,952,846,355,783,400 | 36.132743 | 85 | 0.617969 | false |
vCentre/vFRP-6233 | frappe/patches/v4_1/file_manager_fix.py | 29 | 3309 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os
from frappe.utils.file_manager import get_content_hash, get_file, get_file_name
from frappe.utils import get_files_path, get_site_path
# The files missed... | mit | 9,029,095,338,125,810,000 | 32.765306 | 108 | 0.688426 | false |
adazey/Muzez | libs/nltk/corpus/reader/timit.py | 4 | 17406 | # Natural Language Toolkit: TIMIT Corpus Reader
#
# Copyright (C) 2001-2007 NLTK Project
# Author: Haejoong Lee <haejoong@ldc.upenn.edu>
# Steven Bird <stevenbird1@gmail.com>
# Jacob Perkins <japerk@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# [xx] this doc... | gpl-3.0 | 807,967,345,690,794,500 | 36.68 | 85 | 0.58003 | false |
muff1nman/duplicity | duplicity/backends/ncftpbackend.py | 1 | 5129 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 | 4,047,611,509,393,753,600 | 42.10084 | 110 | 0.626048 | false |
mkalte666/Markkasse | setup.py | 1 | 3478 | #!/usr/bin/env python
import io
import sys
import os
import sqlite3
import hashlib
import binascii
print "Setting Up Mark System"
print "This will, delete all data but the ones in the backup-folder !"
print "If you are shure you want to continue, type \" YES \". yep, in capslock!\n"
ShouldInstall = unicode(raw_input(... | mit | 1,649,113,951,998,755,300 | 39.917647 | 181 | 0.735193 | false |
cloudcache/zstack-utility | kvmagent/kvmagent/test/test_nfs_primary_storage_create_root_volume.py | 3 | 2034 | '''
@author: Frank
'''
import unittest
import time
import os.path
from kvmagent import kvmagent
from kvmagent.plugins import nfs_primarystorage_plugin
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zstacklib.utils import log
from zstacklib.utils import uuidhelper
from zstackl... | apache-2.0 | 3,680,430,698,550,966,300 | 33.103448 | 124 | 0.643559 | false |
dmitry-r/incubator-airflow | airflow/ti_deps/deps/not_running_dep.py | 58 | 1332 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 | -1,236,148,100,036,173,600 | 40.625 | 83 | 0.717718 | false |
obadonke/pythonPlay | scripts/where_dat_ex_go/wheredatexgo.py | 2 | 2822 | import csv
class ExceptionStats:
def __init__(self):
self.status = None
self.owner = None
self.count = 0
self.hash = None
def inc_count(self):
self.count += 1
class ExceptionData:
def __init__(self, ident):
self.ident = ident
self.prev_stats = Exc... | gpl-3.0 | -5,940,291,306,676,327,000 | 26.940594 | 151 | 0.591425 | false |
hannorein/rebound | docs/generate_python_docs.py | 1 | 1054 | import rebound
import inspect
import docstring_to_markdown
def convert_code_blocks(doc):
new_doc = ""
lines = doc.split("\n")
first = True
for line in lines:
if first:
if line[:3]==">>>":
first = False
new_doc += "```python\n"
new_doc +... | gpl-3.0 | 9,207,667,706,578,794,000 | 26.025641 | 65 | 0.470588 | false |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/test/test_float.py | 2 | 62538 | import fractions
import operator
import os
import random
import sys
import struct
import time
import unittest
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from math import isinf, isnan, copysign, ldexp
INF = float("inf")... | mit | 8,006,852,908,241,265,000 | 43.542735 | 84 | 0.572868 | false |
nuagenetworks/vspk-python | vspk/v5_0/fetchers/nuinfrastructuregatewayprofiles_fetcher.py | 2 | 2247 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | bsd-3-clause | -5,783,161,004,879,334,000 | 41.415094 | 86 | 0.741878 | false |
gangadhar-kadam/lgnlvefrape | frappe/core/doctype/doctype/doctype.py | 6 | 14843 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields
from frappe.model.document import Document
from frappe.model.db... | mit | -197,055,989,850,605,540 | 34.594724 | 132 | 0.680927 | false |
Pakoach/Sick-Beard | cherrypy/lib/jsontools.py | 80 | 1574 | import sys
import cherrypy
if sys.version_info >= (2, 6):
# Python 2.6: simplejson is part of the standard library
import json
else:
try:
import simplejson as json
except ImportError:
json = None
if json is None:
def json_decode(s):
raise ValueError('No JSON library is avai... | gpl-3.0 | -5,036,942,576,542,986,000 | 30.48 | 66 | 0.649301 | false |
Subsets and Splits
Gradio Code Samples
Limits the results to entries containing the word 'gradio' in the repo_name, content, or path, providing a filtered subset of the dataset.