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 |
|---|---|---|---|---|---|---|---|---|---|---|
shihuai/TCAI-2017 | preprocess/detect_candidate_nodules.py | 1 | 4560 | # -*- coding:UTF-8 -*-
# !/usr/bin/env python
#########################################################################
# File Name: get_candidate_nodules.py
# Author: Banggui
# mail: liubanggui92@163.com
# Created Time: 2017年04月26日 星期三 11时20分01秒
########################################################################... | mit | -2,745,840,713,393,295,400 | 29.164384 | 105 | 0.497502 | false |
nugget/home-assistant | homeassistant/components/locative/__init__.py | 3 | 4634 | """Support for Locative."""
import logging
from typing import Dict
import voluptuous as vol
from aiohttp import web
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import \
DOMAIN as DEVICE_TRACKER
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY, ATTR_LA... | apache-2.0 | -6,280,436,999,402,288,000 | 29.090909 | 79 | 0.625162 | false |
rsnakamura/theape | theape/parts/storage/socketstorage.py | 1 | 3091 |
# python standard library
import os
import socket
# this package
from base_storage import BaseStorage
#from ape import BaseClass
from theape import ApeError
from theape.infrastructure.code_graphs import module_diagram, class_diagram
NEWLINE = '\n'
SPACE = ' '
EOF = ''
IN_PWEAVE = __name__ == '__builtin__'
TIMED_OUT... | mit | -7,270,611,174,592,695,000 | 23.935484 | 83 | 0.559689 | false |
CapOM/ChromiumGStreamerBackend | tools/telemetry/third_party/gsutilz/third_party/boto/boto/ec2/autoscale/instance.py | 151 | 2428 | # Copyright (c) 2009 Reza Lotun http://reza.lotun.name/
#
# 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, ... | bsd-3-clause | 2,338,791,677,647,003,000 | 40.152542 | 74 | 0.63715 | false |
chaincoin/chaincoin | share/rpcauth/rpcauth.py | 61 | 1575 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from argparse import ArgumentParser
from base64 import urlsafe_b64encode
from binascii import hexlify
fro... | mit | -8,203,315,831,419,480,000 | 33.23913 | 134 | 0.699683 | false |
krishna11888/ai | third_party/gensim/gensim/examples/dmlcz/gensim_genmodel.py | 82 | 2971 | #!/usr/bin/env python
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s LANGUAGE METHOD
Generate topic models for the specified subcorpus. METHOD is currently one \
of 'tfidf', 'lsi', 'lda', 'rp'.
Example... | gpl-2.0 | -8,743,145,574,804,582,000 | 35.231707 | 91 | 0.674184 | false |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/testing/jpl_units/StrConverter.py | 23 | 5293 | #===========================================================================
#
# StrConverter
#
#===========================================================================
"""StrConverter module containing class StrConverter."""
#===========================================================================
# Place al... | gpl-3.0 | 3,446,476,517,280,366,600 | 31.27439 | 79 | 0.533535 | false |
danielneis/osf.io | website/addons/s3/views/crud.py | 24 | 1774 | import httplib
from flask import request
from boto import exception
from website.addons.s3 import utils
from website.project.decorators import must_have_addon
from website.project.decorators import must_have_permission
from website.project.decorators import must_be_contributor_or_public
@must_be_contributor_or_pub... | apache-2.0 | -5,970,969,116,717,391,000 | 32.471698 | 83 | 0.648253 | false |
Ashald/uwsgi | tests/testapp.py | 13 | 4946 | import uwsgi
import time
import sys
import os
sys.path.insert(0, '/opt/apps')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
#import django.core.handlers.wsgi
#uwsgi.load_plugin(0, "plugins/example/example_plugin.so", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa")
from threading import Thread
class testthrea... | gpl-2.0 | -8,189,510,516,076,097,000 | 23.73 | 252 | 0.595835 | false |
hrantzsch/signature-verification | tools/ProbitScale.py | 1 | 2228 | # Credit to gnilson
# https://github.com/gnilson/ProbitScale
#
import matplotlib.scale as mscale
import matplotlib.transforms as mtransforms
from matplotlib.ticker import FormatStrFormatter
from scipy.stats import norm
import matplotlib.ticker as ticker
from numpy import *
class ProbitScale (mscale.ScaleBase):
n... | gpl-3.0 | -508,820,480,456,343,400 | 26.170732 | 75 | 0.568671 | false |
desirable-objects/hotwire-shell | hotwire/builtins/json.py | 3 | 2681 | # This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.org>
# 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, includin... | gpl-2.0 | -4,805,663,399,636,510,000 | 42.241935 | 96 | 0.648266 | false |
suto/infernal-twin | build/reportlab/build/lib.linux-i686-2.7/reportlab/graphics/renderbase.py | 29 | 12869 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/renderbase.py
__version__=''' $Id $ '''
__doc__='''Superclass for renderers to factor out common functionality and default implementations.''... | gpl-3.0 | -2,666,000,873,780,196,400 | 35.047619 | 123 | 0.572306 | false |
actuino/PiBuzz | shutdown-agent/python/httpserver.py | 1 | 2266 | '''
A minimal http server for basic audio feedback
'''
import atexit
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from SocketServer import ThreadingMixIn
import threading
#import argparse
import re
import cgi
__version__ = '0.1.0'
# Events handlers
_on_buzzer_command = None
class HTTPRequestHandler(... | gpl-3.0 | 3,159,567,876,270,656,500 | 21.888889 | 74 | 0.701677 | false |
clouserw/olympia | apps/bandwagon/urls.py | 6 | 2811 | from django.conf.urls import include, patterns, url
from . import views, feeds
from stats.urls import collection_stats_urls
edit_urls = patterns('',
url('^$', views.edit, name='collections.edit'),
url('^addons$', views.edit_addons, name='collections.edit_addons'),
url('^privacy$', views.edit_privacy, nam... | bsd-3-clause | 9,027,097,391,450,291,000 | 40.955224 | 77 | 0.631448 | false |
sander76/home-assistant | homeassistant/components/foscam/__init__.py | 4 | 2835 | """The foscam component."""
import asyncio
from libpyfoscam import FoscamCamera
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_registry impo... | apache-2.0 | 144,465,885,342,311,200 | 29.483871 | 84 | 0.657848 | false |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/skia/infra/bots/recipes/swarm_housekeeper.py | 2 | 3070 | # 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.
# Recipe for the Skia PerCommit Housekeeper.
DEPS = [
'core',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_e... | gpl-3.0 | 4,083,636,854,006,223,400 | 26.657658 | 80 | 0.594463 | false |
AsherBond/MondocosmOS | grass_trunk/scripts/v.build.all/v.build.all.py | 2 | 1448 | #!/usr/bin/env python
############################################################################
#
# MODULE: v.build.all
# AUTHOR(S): Glynn Clements, Radim Blazek
# PURPOSE: Build all vectors in current mapset
# COPYRIGHT: (C) 2004, 2008-2009 by the GRASS Development Team
#
# This program is free software under the ... | agpl-3.0 | 4,986,356,673,089,680,000 | 26.846154 | 80 | 0.540746 | false |
psachin/swift | swift/common/internal_client.py | 5 | 34491 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 | -4,113,138,261,663,722,500 | 38.508591 | 79 | 0.571917 | false |
SpaceAppsXploration/rdfendpoints | scripts/remote/remote.py | 1 | 3309 | """
Tools for remote interaction with the server/datastore
"""
__author__ = 'lorenzo'
import sys
sys.path.insert(0, '../..')
from config.config import _CLIENT_TOKEN
def dump_to_ds_post(url, data):
"""
NOTE: better to use PYcURL for this operations, avoid a lot of encoding and conflicts
:param url: the s... | apache-2.0 | 3,877,002,401,135,792,600 | 27.042373 | 105 | 0.644001 | false |
liorvh/golismero | thirdparty_libs/geopy/distance.py | 51 | 13537 | from math import atan, tan, sin, cos, pi, sqrt, atan2, acos, asin
from geopy.units import radians
from geopy import units, util
from geopy.point import Point
# Average great-circle radius in kilometers, from Wikipedia.
# Using a sphere with this radius results in an error of up to about 0.5%.
EARTH_RADIUS = 6372.795
... | gpl-2.0 | 2,518,377,361,398,993,400 | 32.590571 | 101 | 0.531063 | false |
kasioumis/invenio | invenio/legacy/oaiharvest/utils.py | 13 | 17737 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 CERN.
#
# Invenio 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 | 3,846,215,048,383,315,000 | 33.642578 | 117 | 0.623443 | false |
EBII/account-invoicing | stock_invoice_picking_incoterm/stock.py | 20 | 3785 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 | -9,181,173,981,527,525,000 | 35.747573 | 78 | 0.597094 | false |
TalShafir/ansible | lib/ansible/modules/remote_management/wakeonlan.py | 99 | 3629 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Dag Wieers <dag@wieers.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 | 5,876,967,895,088,605,000 | 26.70229 | 103 | 0.645908 | false |
LaoZhongGu/kbengine | kbe/res/scripts/common/Lib/test/test_http_cookiejar.py | 54 | 69586 | """Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJar, Mozilla... | lgpl-3.0 | -7,044,232,432,456,763,000 | 40.89404 | 101 | 0.549018 | false |
rlefevre1/hpp-rbprm-corba | script/scenarios/demos/siggraph_asia/twister/twister_spidey.py | 1 | 5419 | from twister_geom import *
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
from hpp.gepetto import PathPlayer
from numpy import array, sort
from numpy.linalg import norm
import twister_spidey_path as path_planner
import spid... | lgpl-3.0 | 1,042,248,563,817,421,600 | 32.450617 | 159 | 0.610629 | false |
dentaku65/plugin.video.sod | servers/adfly.py | 2 | 1857 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para adfly (acortador de url)
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import urllib
from core import logger
fr... | gpl-3.0 | 3,778,202,068,027,592,700 | 37.6875 | 125 | 0.547119 | false |
mayank-johri/LearnSeleniumUsingPython | Section 2 - Advance Python/Chapter S2.05 - REST API - Server & Clients/code/servers/old/rest-server.py | 4 | 3383 | #!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
return 'python'
return Non... | gpl-3.0 | 4,054,016,926,582,832,000 | 30.036697 | 91 | 0.602719 | false |
mayankcu/Django-social | venv/Lib/site-packages/django/contrib/gis/geos/geometry.py | 76 | 24261 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
# Python, ctypes and types dependencies.
import warnings
from ctypes import addressof, byref, c_double
# super-class for mutable list behavior
from django.contrib.gis.geos.mutable_list import ListMixin
# GEO... | bsd-3-clause | -3,197,890,669,737,648,000 | 34.31441 | 109 | 0.612423 | false |
Arable/evepod | lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/hooks/framework_pylons.py | 4 | 2661 | import sys
import types
import newrelic.api.transaction
import newrelic.api.transaction_name
import newrelic.api.function_trace
import newrelic.api.error_trace
import newrelic.api.object_wrapper
import newrelic.api.import_hook
def name_controller(self, environ, start_response):
action = environ['pylons.routes_dic... | apache-2.0 | 6,977,760,848,219,934,000 | 36.478873 | 80 | 0.633972 | false |
artur-shaik/qutebrowser | qutebrowser/browser/rfc6266.py | 3 | 9770 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 | -4,444,345,497,991,309,300 | 29.247678 | 79 | 0.664688 | false |
PMBio/warpedLMM | warpedlmm/util/linalg.py | 2 | 19589 | # Copyright (c) 2012, GPy authors (see https://github.com/sheffieldml/gpy/AUTHORS.txt).
# Licensed under the BSD 3-clause license (see https://github.com/sheffieldml/gp/LICENSE.txt)
# tdot function courtesy of Ian Murray:
# Iain Murray, April 2013. iain contactable via iainmurray.net
# http://homepages.inf.ed.ac.uk/im... | apache-2.0 | 7,872,543,403,622,748,000 | 30.242424 | 158 | 0.563939 | false |
fossoult/odoo | addons/hr_recruitment/__openerp__.py | 260 | 2780 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | 1,002,002,454,647,811,600 | 41.121212 | 373 | 0.62554 | false |
thedrow/flanker | flanker/mime/bounce.py | 3 | 1840 | import regex as re
from collections import deque
from contextlib import closing
from cStringIO import StringIO
from flanker.mime.message.headers.parsing import parse_stream
from flanker.mime.message.headers import MimeHeaders
def detect(message):
headers = collect(message)
return Result(
score=len(hea... | apache-2.0 | -8,613,844,126,444,723,000 | 26.462687 | 69 | 0.616304 | false |
radecker/Etch-A-Pic | TestProject/MotorTest.py | 1 | 4427 |
import sys
import time
import RPi.GPIO as GPIO
delay = 0.001
class Motor:
# Use BCM GPIO references
# instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
# Define GPIO signals to use
# Physical pins 35, 36, 37, 38, 29, 31, 32, 33, 13, 15, 16, 18
# GPIO19, GPIO16, GPIO26, GPIO20, GPIO5, GPIO6, GPIO1... | gpl-3.0 | -3,509,546,272,427,741,000 | 31.052239 | 144 | 0.647617 | false |
jelugbo/hebs_repo | common/lib/xmodule/xmodule/tests/test_poll.py | 227 | 1133 | # -*- coding: utf-8 -*-
"""Test for Poll Xmodule functional logic."""
from xmodule.poll_module import PollDescriptor
from . import LogicTest
class PollModuleTest(LogicTest):
"""Logic tests for Poll Xmodule."""
descriptor_class = PollDescriptor
raw_field_data = {
'poll_answers': {'Yes': 1, 'Dont_kn... | agpl-3.0 | 4,723,584,778,178,978,000 | 34.40625 | 79 | 0.624007 | false |
BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/site_configuration/models.py | 8 | 6027 | """
Django models for site configurations.
"""
import collections
from logging import getLogger
from django.contrib.sites.models import Site
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from jsonfield.fields import JSONField
from model_utils.models im... | agpl-3.0 | 7,045,462,147,742,422,000 | 36.434783 | 111 | 0.656877 | false |
UQ-UQx/edx-platform_lti | lms/djangoapps/verify_student/views.py | 8 | 43784 | """
Views for the verification flow
"""
import json
import logging
import decimal
import datetime
from collections import namedtuple
from pytz import UTC
from edxmako.shortcuts import render_to_response, render_to_string
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http i... | agpl-3.0 | -5,840,974,628,600,776,000 | 37.508355 | 126 | 0.638932 | false |
shahrzadmn/skia | tools/skp/webpages_playback.py | 38 | 22705 | #!/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.
"""Archives or replays webpages and creates SKPs in a Google Storage location.
To archive webpages and store SKP files (archives s... | apache-2.0 | -3,760,080,900,609,468,400 | 38.418403 | 80 | 0.64466 | false |
rajarahulray/iDetector | tests_and_ References/iDetector_GUI_exp.py | 1 | 11602 | from tkinter import Tk, Text, Button, Label, filedialog, messagebox, Menu, StringVar, Scrollbar,\
LEFT, RIGHT, Frame, PhotoImage,Canvas, HORIZONTAL, VERTICAL, Toplevel
from clarifai.rest import ClarifaiApp, Image as ClImage, Video as ClVid
from timeit import default_timer
from terminaltables import DoubleTable
fro... | mit | -3,883,235,968,095,798,000 | 37.039344 | 167 | 0.576108 | false |
buzzfeed/facepy | tests/test_signed_request.py | 6 | 5969 | """Tests for the ``signed_request`` module."""
from datetime import datetime, timedelta
from nose.tools import *
from facepy import SignedRequest
TEST_ACCESS_TOKEN = '181259711925270|1570a553ad6605705d1b7a5f.1-499729129|8XqMRhCWDKtpG-i_zRkHBDSsqqk'
TEST_SIGNED_REQUEST = u'' \
'mnrG8Wc9CH_rh-GCqq97GFAPOh6AY7cM... | mit | 5,193,474,009,726,772,000 | 31.091398 | 106 | 0.705311 | false |
daniel-leschkowski/generateDSv2 | django/gends_generate_django.py | 10 | 3748 | #!/usr/bin/env python
"""
Synopsis:
Generate Django model and form definitions.
Write to forms.py and models.py.
Usage:
python gen_model.py [options]
Options:
-f, --force
Overwrite models.py and forms.py without asking.
-h, --help
Show this help message.
"""
import sys
impo... | mit | 6,726,231,179,372,203,000 | 24.671233 | 105 | 0.592049 | false |
cs2c-zhangchao/nkwin1.0-anaconda | pyanaconda/ui/gui/spokes/network.py | 1 | 63351 | # Network configuration spoke classes
#
# Copyright (C) 2011 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is d... | gpl-2.0 | -4,113,955,795,056,762,000 | 39.661746 | 170 | 0.578665 | false |
cooniur/ansible-modules-core | system/service.py | 7 | 59487 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (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... | gpl-3.0 | -3,853,146,307,173,028,000 | 36.865691 | 150 | 0.55123 | false |
stvstnfrd/edx-platform | openedx/core/djangoapps/xblock/runtime/runtime.py | 1 | 19276 | """
Common base classes for all new XBlock runtimes.
"""
import logging
import crum
from completion.waffle import ENABLE_COMPLETION_TRACKING_SWITCH
from completion.models import BlockCompletion
from completion.services import CompletionService
from django.contrib.auth import get_user_model
from django.core.exceptions... | agpl-3.0 | -3,680,931,071,695,051,300 | 43.723898 | 133 | 0.645518 | false |
wagnerand/olympia | scripts/crontab/gen-cron.py | 6 | 1448 | #!/usr/bin/env python
import os
from optparse import OptionParser
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-z", "--zamboni",
help="Location of zamboni (required)")
parser.add_option("-u", "... | bsd-3-clause | -4,066,741,745,875,668,500 | 28.55102 | 78 | 0.52279 | false |
isra17/DIE | DIE/UI/ParserView.py | 8 | 2400 | from DIE.Lib import DataParser
from idaapi import PluginForm
from PySide import QtGui, QtCore
class ParserView(PluginForm):
"""
DIE Value View
"""
def __init__(self):
super(ParserView, self).__init__()
self.data_parser = None
self.ptable_widget = None
def S... | mit | 9,214,079,550,462,052,000 | 26.571429 | 64 | 0.57375 | false |
pmuellr/cf-buildpack-nodejs | bin/semver.py | 2 | 2559 | # from: https://github.com/k-bx/python-semver/blob/master/semver.py
# license: BSD, it appears
# -*- coding: utf-8 -*-
import re
_REGEX = re.compile('^(?P<major>[0-9]+)'
'\.(?P<minor>[0-9]+)'
'\.(?P<patch>[0-9]+)'
'(\-(?P<prerelease>[0-9A-Za-z]+(\.[0-9A-... | apache-2.0 | -4,886,968,551,253,336,000 | 28.767442 | 82 | 0.499805 | false |
zsiciarz/django | django/contrib/gis/geos/prototypes/prepared.py | 178 | 1184 | from ctypes import c_char
from django.contrib.gis.geos.libgeos import (
GEOM_PTR, PREPGEOM_PTR, GEOSFuncFactory,
)
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
# Prepared geometry constructor and destructors.
geos_prepare = GEOSFuncFactory('GEOSPrepare', argtypes=[GEOM_PTR], restype=PRE... | bsd-3-clause | 1,891,297,549,099,203,600 | 41.285714 | 88 | 0.817568 | false |
AOSPU/external_chromium_org | sync/tools/testserver/xmppserver.py | 150 | 19562 | # Copyright 2013 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.
"""A bare-bones and non-compliant XMPP server.
Just enough of the protocol is implemented to get it to work with
Chrome's sync notification system.
"""
imp... | bsd-3-clause | -4,241,787,867,646,241,300 | 31.441128 | 79 | 0.672017 | false |
wrouesnel/ansible | test/units/modules/network/netscaler/test_netscaler_server.py | 23 | 24833 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 | -1,016,881,283,588,128,800 | 34.679598 | 133 | 0.583941 | false |
rosarior/mayan | apps/common/templatetags/subtemplates_tags.py | 2 | 1983 | import re
from django.template import Node, TemplateSyntaxError, Library, \
Variable, Context
from django.template.loader import get_template
register = Library()
class RenderSubtemplateNode(Node):
def __init__(self, template_name, template_context, var_name):
self.template_name = template_name
... | gpl-3.0 | 1,433,666,353,295,330,800 | 37.882353 | 107 | 0.672214 | false |
pyfisch/servo | tests/wpt/web-platform-tests/cookies/resources/helpers.py | 26 | 2020 | import urlparse
def setNoCacheAndCORSHeaders(request, response):
"""Set Cache-Control, CORS and Content-Type headers appropriate for the cookie tests."""
headers = [("Content-Type", "application/json"),
("Access-Control-Allow-Credentials", "true")]
origin = "*"
if "origin" in request.he... | mpl-2.0 | -8,792,705,026,962,760,000 | 35.727273 | 93 | 0.640099 | false |
haudren/scipy | scipy/signal/tests/test_savitzky_golay.py | 105 | 9924 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (run_module_suite, assert_allclose, assert_equal,
assert_almost_equal, assert_array_equal,
assert_array_almost_equal)
from scipy.ndimage import convolve1d... | bsd-3-clause | -436,312,131,757,271,100 | 32.755102 | 77 | 0.553204 | false |
flyingk/mavlink | pymavlink/generator/mavgen_javascript.py | 35 | 17546 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a Node.js javascript module implementation
Based on original work Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import sys, textwrap, os
from . import mavparse, mavtemplate
from shutil import copyfile
t = mavtempl... | lgpl-3.0 | 3,778,180,128,814,407,000 | 29.567944 | 168 | 0.602929 | false |
grhawk/ASE | ase/calculators/aims.py | 2 | 15283 | """This module defines an ASE interface to FHI-aims.
Felix Hanke hanke@liverpool.ac.uk
Jonas Bjork j.bjork@liverpool.ac.uk
"""
import os
import numpy as np
from ase.io.aims import write_aims, read_aims
from ase.data import atomic_numbers
from ase.calculators.calculator import FileIOCalculator, Parameters, kpts2mp, ... | gpl-2.0 | -8,088,546,191,165,111,000 | 34.875587 | 79 | 0.534123 | false |
Nikoli/youtube-dl | youtube_dl/extractor/muenchentv.py | 160 | 2133 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
)
class MuenchenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?muenchen\.tv/livestream'
IE_DESC = 'münchen.tv'
_TEST = {... | unlicense | 4,326,576,661,594,557,400 | 27.413333 | 95 | 0.469733 | false |
somic/paasta | paasta_tools/cli/cmds/docker_inspect.py | 1 | 1797 | #!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 | 516,058,054,266,636,600 | 35.673469 | 96 | 0.69783 | false |
hdinsight/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Cipher/Blowfish.py | 116 | 4460 | # -*- coding: utf-8 -*-
#
# Cipher/Blowfish.py : Blowfish
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty... | apache-2.0 | 6,346,879,347,698,017,000 | 35.859504 | 86 | 0.653363 | false |
NickelMedia/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/handlers/menu.py | 129 | 2770 | # Copyright (C) 2010 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 ... | bsd-3-clause | 1,158,996,517,148,061,400 | 39.735294 | 72 | 0.697473 | false |
damiansoriano/odoo | openerp/tools/osutil.py | 103 | 5594 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 | 2,797,539,386,983,918,600 | 36.046358 | 101 | 0.603504 | false |
partofthething/home-assistant | tests/components/hue/test_device_trigger.py | 6 | 5675 | """The tests for Philips Hue device triggers."""
import pytest
from homeassistant.components import hue
import homeassistant.components.automation as automation
from homeassistant.components.hue import device_trigger
from homeassistant.setup import async_setup_component
from .conftest import setup_bridge_for_sensors ... | mit | 2,345,986,612,930,602,000 | 32.382353 | 88 | 0.560352 | false |
111pontes/ydk-py | cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_UBE_MIB.py | 1 | 3416 | """ CISCO_UBE_MIB
This MIB describes objects used for managing Cisco
Unified Border Element (CUBE).
The Cisco Unified Border Element (CUBE) is a Cisco
IOS Session Border Controller (SBC) that interconnects
independent voice over IP (VoIP) and video over IP
networks for data, voice, and video transport
"""
impor... | apache-2.0 | 1,541,664,907,865,182,500 | 25.48062 | 247 | 0.609485 | false |
zhenzhai/edx-platform | common/djangoapps/microsite_configuration/tests/test_logic.py | 19 | 1559 | """
Some additional unit tests for Microsite logic. The LMS covers some of the Microsite testing, this adds
some additional coverage
"""
import ddt
from mock import patch
from microsite_configuration.microsite import (
get_value_for_org,
get_backend,
)
from microsite_configuration.backends.base import BaseMicr... | agpl-3.0 | -7,151,813,794,050,783,000 | 32.891304 | 103 | 0.67864 | false |
Zlash65/erpnext | erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py | 2 | 32514 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe, erpnext
import frappe.model
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from frap... | gpl-3.0 | 6,742,455,134,874,050,000 | 33.117524 | 131 | 0.697792 | false |
mircealungu/Zeeguu-Core | zeeguu_core_test/test_language.py | 1 | 1511 | from unittest import TestCase
import zeeguu_core
from sqlalchemy.orm.exc import NoResultFound
from zeeguu_core_test.model_test_mixin import ModelTestMixIn
from zeeguu_core_test.rules.language_rule import LanguageRule
from zeeguu_core_test.rules.user_rule import UserRule
from zeeguu_core.model.language import Language... | mit | 8,869,608,811,967,583,000 | 31.847826 | 72 | 0.700199 | false |
Workday/OpenFrame | tools/memory_inspector/memory_inspector/core/backends_unittest.py | 107 | 1769 | # 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.
import unittest
from memory_inspector.core import backends
class MockDevice(backends.Device): # pylint: disable=W0223
def __init__(self, backend, devic... | bsd-3-clause | 1,553,547,598,921,424,100 | 30.589286 | 75 | 0.712267 | false |
alexissmirnov/donomo | donomo_archive/lib/offlineimap/imapserver.py | 1 | 18628 | # IMAP server support
# Copyright (C) 2002 - 2007 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | bsd-3-clause | 7,633,417,813,898,546,000 | 40.954955 | 99 | 0.559749 | false |
sarvex/tensorflow | tensorflow/python/kernel_tests/eig_op_test.py | 9 | 9610 | # Copyright 2019 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 | -416,651,329,489,054,200 | 34.072993 | 80 | 0.624662 | false |
Jorge-Rodriguez/ansible | test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py | 21 | 4709 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 | -6,196,944,750,160,116,000 | 29.577922 | 103 | 0.625823 | false |
Ted1993/Flasky | venv/lib/python2.7/site-packages/flask/testsuite/appctx.py | 558 | 3116 | # -*- coding: utf-8 -*-
"""
flask.testsuite.appctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the application context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class AppContextTestCase(Flask... | mit | -4,643,217,391,139,670,000 | 29.851485 | 75 | 0.576701 | false |
sachintaware/sublime-wakatime | packages/wakatime/packages/pytz/reference.py | 839 | 3649 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | bsd-3-clause | 4,844,494,929,134,123,000 | 27.732283 | 76 | 0.619622 | false |
mattcaldwell/django-cms | cms/migrations/0030_limit_visibility_in_menu_step3of3.py | 385 | 19523 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Dummy migration
pass
def backwards(self, orm):
# Dummy migration
pass
models = {
... | bsd-3-clause | 3,044,572,503,978,610,700 | 54.463068 | 93 | 0.451928 | false |
ocefpaf/conda-smithy | tests/test_variant_algebra.py | 2 | 11511 | import pytest
from textwrap import dedent
from conda_smithy.variant_algebra import parse_variant, variant_add
tv1 = parse_variant(
"""\
foo:
- 1.10
bar:
- 2
"""
)
tv2 = parse_variant(
"""\
foo:
- 1.2
bar:
- 3
"""
)
tv3 = parse_variant(
"""\
baz:
- 1
bar:
- 3
"""
)
tv4 = parse_v... | bsd-3-clause | 4,264,264,593,126,436,400 | 18.477157 | 82 | 0.406568 | false |
denys-duchier/Scolar | scolog.py | 1 | 2495 | # -*- mode: python -*-
# -*- coding: iso8859-15 -*-
##############################################################################
#
# Gestion scolarite IUT
#
# Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the term... | gpl-2.0 | -885,323,745,185,365,000 | 40.583333 | 204 | 0.642485 | false |
gunan/tensorflow | tensorflow/python/ops/nccl_ops_test.py | 4 | 7068 | # Copyright 2016 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 | -28,349,630,289,062,120 | 34.69697 | 80 | 0.663413 | false |
ifarup/tc1-82 | webapi/description.py | 2 | 2822 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
description: Generate html description strings for the tc1_97 package.
Copyright (C) 2019 Ivar Farup
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... | gpl-3.0 | -7,969,079,706,868,879,000 | 28.705263 | 70 | 0.71297 | false |
alxgu/ansible | lib/ansible/module_utils/network/nso/nso.py | 37 | 30015 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Cisco and/or its affiliates.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import open_url
from ansible.module_utils._text import to_text
im... | gpl-3.0 | 8,622,640,578,190,564,000 | 35.514599 | 109 | 0.535199 | false |
pyjs/pyjs | examples/kitchensink/sink/Trees.py | 6 | 4694 | from pyjamas.ui.Sink import Sink, SinkInfo
from pyjamas.ui.Tree import Tree
from pyjamas.ui.TreeItem import TreeItem
class Trees(Sink):
def __init__(self):
Sink.__init__(self)
self.fProto = [
Proto("Beethoven", [
Proto("Concertos", [
Proto("No. 1 - C"... | apache-2.0 | -3,685,946,013,218,815,000 | 32.528571 | 111 | 0.454197 | false |
yongshengwang/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt/Workbook.py | 57 | 20514 | # -*- coding: windows-1252 -*-
'''
Record Order in BIFF8
Workbook Globals Substream
BOF Type = workbook globals
Interface Header
MMS
Interface End
WRITEACCESS
CODEPAGE
DSF
TABID
FNGROUPCOUNT
Workbook Protection Block
WINDOWPROTECT
PRO... | apache-2.0 | 7,327,411,666,094,557,000 | 31.254717 | 109 | 0.522131 | false |
adambrenecki/django | django/db/backends/sqlite3/base.py | 1 | 23152 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import warnings
import re
from django.conf import settings
from django.db import utils
from django.db.backends import (util,... | bsd-3-clause | -2,162,113,576,616,748,800 | 40.049645 | 120 | 0.637915 | false |
albertrdixon/CouchPotatoServer | libs/guessit/transfo/split_explicit_groups.py | 150 | 1738 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 | -1,245,070,533,514,728,700 | 38.5 | 84 | 0.713464 | false |
barnsnake351/nova | nova/virt/ironic/ironic_states.py | 6 | 4453 | # Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2010 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/l... | apache-2.0 | 7,525,230,527,219,536,000 | 29.292517 | 79 | 0.733663 | false |
peterschriever/project_embed_systems | userpanel/ajax_api/json_views.py | 1 | 5896 | from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpRequest
import json
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from control_unit.submodels.CommandIdentifier import *
from control_unit.submodels.UnitCommunication import... | gpl-3.0 | -6,650,582,442,707,577,000 | 38.306667 | 154 | 0.652307 | false |
angelapper/edx-platform | openedx/features/course_experience/tests/views/test_course_updates.py | 2 | 4871 | """
Tests for the course updates page.
"""
from courseware.courses import get_course_info_usage_key
from django.core.urlresolvers import reverse
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
from openedx.features.course_experience.views.course_updates import STATUS_VISIBLE
from student.models... | agpl-3.0 | -7,887,302,097,177,038,000 | 35.901515 | 105 | 0.678916 | false |
nmishkin/tosca-vcloud-plugin | tests/integration/__init__.py | 1 | 3021 | from testconfig import config
import mock
import time
import unittest
from cloudify import mocks as cfy_mocks
from cloudify.exceptions import OperationRetry
from vcloud_plugin_common import Config, VcloudAirClient
SUBSCRIPTION = 'subscription'
ONDEMAND = 'ondemand'
class IntegrationSubscriptionTestConfig(Config):
... | apache-2.0 | 3,280,203,216,842,358,300 | 35.39759 | 79 | 0.63853 | false |
cloudera/Impala | tests/query_test/test_sort.py | 1 | 10722 | # 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 | -9,164,145,075,564,962,000 | 44.820513 | 90 | 0.698937 | false |
caesar2164/edx-platform | lms/djangoapps/instructor/enrollment_report.py | 73 | 3294 | """
Defines abstract class for the Enrollment Reports.
"""
from django.contrib.auth.models import User
from student.models import UserProfile
import collections
import json
import abc
class AbstractEnrollmentReportProvider(object):
"""
Abstract interface for Detailed Enrollment Report Provider
"""
__... | agpl-3.0 | -3,992,095,889,236,124,000 | 32.272727 | 81 | 0.622951 | false |
bpgc-cte/python2017 | Week 7/django/lib/python3.6/site-packages/django/template/library.py | 115 | 12790 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... | mit | 6,993,642,506,882,489,000 | 37.524096 | 96 | 0.570446 | false |
dataxu/ansible | test/units/modules/remote_management/oneview/test_oneview_san_manager.py | 77 | 9119 | # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.compat.tests import unittest, mock
from oneview_module_loader import SanManagerModule
from hpe_test_utils import OneViewBaseTestCase
from copy im... | gpl-3.0 | 5,183,652,222,601,824,000 | 37.154812 | 113 | 0.667507 | false |
Agent007/deepchem | examples/kaggle/KAGGLE_tf_robust.py | 6 | 3237 | """
Script that trains Tensorflow Robust Multitask models on KAGGLE datasets.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import tempfile
import shutil
import deepchem as dc
from deepchem.molnet import load_kaggle
###L... | mit | 3,353,310,661,229,279,000 | 30.427184 | 78 | 0.657708 | false |
tedder/ansible | test/units/modules/network/onyx/test_onyx_l2_interface.py | 68 | 5130 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 | -571,976,393,989,972,300 | 42.109244 | 78 | 0.640741 | false |
r-praveen-jain/paparazzi | sw/ground_segment/python/real_time_plot/plotpanel.py | 50 | 14196 | from __future__ import absolute_import, print_function, division
import wx
from ivy.std_api import *
import logging
from textdroptarget import *
import math
import random
import sys
import os
import messagepicker
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
import messages_xml_map
class plot_data... | gpl-2.0 | -6,703,213,814,101,404,000 | 30.337748 | 129 | 0.528529 | false |
pwaller/pgi | pgi/properties.py | 1 | 8841 | # Copyright 2012,2013 Christoph Reiter
#
# 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 your option) any later version.
from warnings import ... | lgpl-2.1 | -5,016,693,142,234,353,000 | 28.178218 | 105 | 0.563624 | false |
Scan-o-Matic/scanomatic | setup.py | 1 | 2375 | #!/usr/bin/env python
from __future__ import absolute_import
import os
from setuptools import find_packages, setup
from scanomatic import get_version
setup(
name="Scan-o-Matic",
version=get_version(),
description="High Throughput Solid Media Image Phenotyping Platform",
long_description="""Scan-o-M... | gpl-3.0 | 5,038,031,324,969,458,000 | 27.614458 | 77 | 0.555789 | false |
shanzhenren/ClusType | candidate_generation/EntityExtraction/HeapDictionary2.py | 2 | 2844 | __author__ = 'xiang'
import collections
def doc(s):
if hasattr(s, '__call__'):
s = s.__doc__
def f(g):
g.__doc__ = s
return g
return f
class heapdict(collections.MutableMapping):
__marker = object()
@staticmethod
def _parent(i):
return ((i - 1) >> 1)
@stat... | gpl-3.0 | 2,928,633,867,549,315,000 | 24.630631 | 130 | 0.49121 | false |
titiushko/readthedocs.org | readthedocs/projects/version_handling.py | 8 | 5152 | from collections import defaultdict
from packaging.version import Version
from packaging.version import InvalidVersion
from readthedocs.builds.constants import LATEST_VERBOSE_NAME
from readthedocs.builds.constants import STABLE_VERBOSE_NAME
def get_major(version):
return version._version.release[0]
def get_min... | mit | 1,274,775,187,567,306,200 | 31 | 100 | 0.632764 | false |
runt18/mojo | third_party/cython/src/Cython/Plex/Errors.py | 104 | 1120 | #=======================================================================
#
# Python Lexical Analyser
#
# Exception classes
#
#=======================================================================
class PlexError(Exception):
message = ""
class PlexTypeError(PlexError, TypeError):
pass
class PlexValueError(P... | bsd-3-clause | 9,123,908,587,062,548,000 | 21.4 | 77 | 0.590179 | false |
gazpachoking/Flexget | flexget/components/trakt/db.py | 4 | 42551 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, absolute_import, print_function
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import time
from datetime import datetime, timedelta
from dateutil.parser import parse as dateutil_parse
from sqlalc... | mit | 8,042,398,476,442,170,000 | 36.130017 | 119 | 0.589998 | false |
proxysh/Safejumper-for-Mac | buildlinux/env32/lib/python2.7/site-packages/Crypto/SelfTest/Protocol/test_AllOrNothing.py | 120 | 3024 | #
# Test script for Crypto.Protocol.AllOrNothing
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew Kuchling and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public do... | gpl-2.0 | 3,265,472,060,835,525,000 | 38.789474 | 77 | 0.703373 | false |
havatv/QGIS | python/core/additions/projectdirtyblocker.py | 43 | 1534 | # -*- coding: utf-8 -*-
"""
***************************************************************************
projectdirtyblocker.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
*****************************... | gpl-2.0 | 3,423,250,102,780,197,400 | 31.638298 | 75 | 0.436767 | 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.