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 |
|---|---|---|---|---|---|---|---|---|---|---|
indhub/mxnet | tests/python/unittest/test_gluon_data_vision.py | 7 | 3323 | # 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 | 942,687,604,895,165,400 | 36.337079 | 77 | 0.676497 | false |
DavidNorman/tensorflow | tensorflow/python/distribute/collective_all_reduce_strategy.py | 1 | 23809 | # Copyright 2018 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 | -8,948,848,603,491,015,000 | 40.697023 | 114 | 0.675711 | false |
ayeganov/SmartFlappy | kivy_fix.py | 1 | 1228 | import os
import json
from os.path import dirname, join
from kivy.atlas import Atlas, Logger
from kivy.core.image import Image as CoreImage
class SpriteAtlas(Atlas):
def _load(self):
# must be a name finished by .atlas ?
filename = self._filename
assert(filename.endswith('.atlas'))
... | mit | -7,277,527,500,010,486,000 | 30.487179 | 71 | 0.57329 | false |
ThiagoLopes/uniso-semana-engenharia | uniso/urls.py | 1 | 1271 | """uniso URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | gpl-3.0 | 3,893,934,406,690,880,500 | 36.382353 | 79 | 0.675846 | false |
chrisjaquet/FreeCAD | src/Mod/PartDesign/FeatureHole/HoleGui.py | 12 | 3688 | #/******************************************************************************
# * Copyright (c)2012 Jan Rheinlaender <jrheinlaender@users.sourceforge.net> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This library is free software; you can redistribute it and/or *
# * modify it und... | lgpl-2.1 | -6,249,564,738,716,002,000 | 41.883721 | 119 | 0.636388 | false |
XBMC-Addons/service.scrobbler.lastfm | helpers.py | 2 | 1177 | from urlparse import urlparse
import re
def is_local(path):
""" Returns True if the given path is a local address, otherwise False. """
parse_result = urlparse(path)
# only analyze http(s)/rtmp streams
if (not parse_result.scheme == 'http') and (not parse_result.scheme == 'https') and (not parse_result... | gpl-2.0 | -3,682,357,508,327,625,700 | 44.269231 | 124 | 0.624469 | false |
davidzchen/tensorflow | tensorflow/python/keras/benchmarks/keras_examples_benchmarks/mnist_hierarchical_rnn_benchmark_test.py | 5 | 4580 | # Copyright 2020 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 | -5,688,871,444,955,991,000 | 35.062992 | 80 | 0.661572 | false |
google/sling | sling/nlp/parser/trainer/parser_state.py | 1 | 13871 | # Copyright 2017 Google 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 or agreed to in writing, s... | apache-2.0 | 8,518,184,749,541,436,000 | 32.424096 | 80 | 0.620503 | false |
melvon22/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.skinshortcuts/resources/lib/datafunctions.py | 8 | 49118 | # coding=utf-8
import os, sys, datetime, unicodedata, re, types
import xbmc, xbmcaddon, xbmcgui, xbmcvfs, urllib
import xml.etree.ElementTree as xmltree
import hashlib, hashlist
import ast
from xml.dom.minidom import parse
from traceback import print_exc
from htmlentitydefs import name2codepoint
from unidecode import u... | gpl-2.0 | 1,424,236,759,551,068,200 | 47.631683 | 268 | 0.522334 | false |
ecuvelier/PPAT | mathTools/field.py | 1 | 34962 | # -*- coding: utf-8 -*-
"""
Created on 2013-2014
Author : Edouard Cuvelier
Affiliation : Université catholique de Louvain - ICTEAM - UCL Crypto Group
Address : Place du Levant 3, 1348 Louvain-la-Neuve, BELGIUM
email : firstname.lastname@uclouvain.be
"""
from numpy import *
import gmpy
from Crypto.Random.random import... | apache-2.0 | 8,680,854,202,601,265,000 | 32.616346 | 132 | 0.490461 | false |
blueboxgroup/keystone | keystone/tests/test_v3_endpoint_policy.py | 2 | 10121 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 | 5,333,776,213,407,170,000 | 39.322709 | 79 | 0.571386 | false |
niwinz/niwi-web | src/niwi/settings/common.py | 1 | 5109 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
import os, sys
ADMINS = (
('Andrei Antoukh', 'niwi@niwi.be'),
)
MANAGERS = ADMINS
PROJECT_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
LOGS_PATH = os.path.join(PROJECT_ROOT, 'logs')
if not os.path.exi... | bsd-3-clause | 544,266,203,126,640,500 | 24.673367 | 84 | 0.607947 | false |
wolkstein/OpenDroneMap-GCP_LIST.TXT-generator | gcp_txt_gen.py | 1 | 12053 | import numpy as np
import cv2
import argparse
import glob
from commands import getstatusoutput
import os
import errno
# --qr_code_compare need "zbar-tools"
# ---Helper---
def roundTraditional(val,digits):
return round(val+10**(-len(str(val))-1))
# ---~Helper---
GCP_DEBUGMODE = False
MIN_MATCH_COUNT = 12
USE_QRCO... | gpl-3.0 | -6,089,335,881,260,830,000 | 31.578378 | 215 | 0.584087 | false |
psiinon/addons-server | src/olympia/amo/cron.py | 1 | 4394 | import itertools
from datetime import datetime, timedelta
from django.core.files.storage import default_storage as storage
from django.db import connection
import waffle
import olympia.core.logger
from olympia import amo
from olympia.activity.models import ActivityLog
from olympia.amo.utils import chunked
from olym... | bsd-3-clause | 6,036,610,290,732,364,000 | 32.287879 | 76 | 0.616523 | false |
DarkPrince304/MozDef | rest/index.py | 6 | 19047 | # 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/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Jeff Bryner jbryner@mozilla.com
# Anthony Verez averez@mozil... | mpl-2.0 | 8,868,509,190,980,001,000 | 33.948624 | 121 | 0.579199 | false |
kunaltyagi/Leap | src/Leap/leap/leap_start.py | 1 | 7125 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Module to detect gestures from Leap Motion Controller
"""
import inspect
import os
import sys
SRC_DIR = os.path.dirname(inspect.getfile(inspect.currentframe()))
LIB_DIR = os.path.abspath(os.path.join(SRC_DIR, '../../../lib'))
sys.path.insert(0, LIB_DIR)
import Leap... | gpl-3.0 | 3,953,385,202,132,790,000 | 34.272277 | 84 | 0.580211 | false |
alexanderfefelov/nav | python/nav/colors.py | 1 | 2493 | #
# Copyright (C) 2013 UNINETT
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope th... | gpl-2.0 | -2,158,333,708,684,524,500 | 30.961538 | 79 | 0.658644 | false |
charanpald/wallhack | wallhack/rankingexp/RegularisationExp.py | 1 | 7825 | import numpy
import logging
import sys
import os
import multiprocessing
import itertools
from sandbox.recommendation.MaxLocalAUC import MaxLocalAUC
from sandbox.recommendation.IterativeSoftImpute import IterativeSoftImpute
from sandbox.util.MCEvaluator import MCEvaluator
from sandbox.util.PathDefaults import PathDefau... | gpl-3.0 | 6,259,649,822,501,241,000 | 32.297872 | 229 | 0.639617 | false |
singulared/aiohttp | tests/test_web_functional.py | 1 | 36053 | import asyncio
import json
import pathlib
import zlib
from unittest import mock
import pytest
from multidict import MultiDict
from yarl import URL
from aiohttp import FormData, HttpVersion10, HttpVersion11, multipart, web
try:
import ssl
except:
ssl = False
@asyncio.coroutine
def test_simple_get(loop, test... | apache-2.0 | -3,177,248,093,099,355,000 | 27.323113 | 78 | 0.639326 | false |
StackStorm/st2contrib | archive/packs/circle_ci/actions/run_build.py | 6 | 1384 | import httplib
import json
from lib.action import CircleCI
class RunBuild(CircleCI):
def run(self, project, branch=None, tag=None, vcs_revision=None, build_parameters=None):
"""
Run build for a SHA in project.
"""
# Add some explicit mutually-exclusive checks.
if not(bra... | apache-2.0 | -611,335,320,396,927,100 | 31.952381 | 94 | 0.59104 | false |
opesci/devito | devito/ir/equations/equation.py | 1 | 9325 | from cached_property import cached_property
import sympy
from devito.ir.equations.algorithms import dimension_sort, lower_exprs
from devito.finite_differences.differentiable import diff2sympy
from devito.ir.support import (IterationSpace, DataSpace, Interval, IntervalGroup,
Stencil, dete... | mit | 3,284,389,200,212,844,500 | 32.303571 | 90 | 0.598928 | false |
hbldh/hitherdither | hitherdither/ordered/yliluoma/_utils.py | 1 | 1201 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
_utils
-----------
:copyright: 2016-09-23 by hbldh <henrik.blidh@nedomkull.com>
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import numpy as np
# CCIR 601 lu... | mit | -5,919,380,891,119,812,000 | 27.595238 | 88 | 0.601998 | false |
leongold/lago | ovirtlago/testlib.py | 1 | 7597 | #
# Copyright 2014 Red Hat, Inc.
#
# 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 your option) any later version.
#
# This program is distributed in th... | gpl-2.0 | -7,734,913,691,153,139,000 | 27.776515 | 79 | 0.634593 | false |
whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/twisted/positioning/_sentence.py | 13 | 4003 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Generic sentence handling tools: hopefully reusable.
"""
from __future__ import absolute_import, division
class _BaseSentence(object):
"""
A base sentence class for a particular protocol.
Using this base class, specific sentence... | mit | 901,539,691,734,564,900 | 31.811475 | 79 | 0.632526 | false |
transifex/openformats | openformats/utils/json.py | 1 | 15248 | from __future__ import absolute_import
import json
import re
import six
class DumbJson(object):
""" A utility to help iterate over a JSON string. The main focuses are:
1. Return the exact contents of each encountered string, don't unescape
double quotes ('"')
2. Also return the posit... | gpl-3.0 | -29,226,295,603,232,036 | 36.281174 | 79 | 0.50846 | false |
Juniper/nova | nova/tests/unit/api/openstack/compute/test_virtual_interfaces.py | 3 | 6996 | # Copyright (C) 2011 Midokura KK
# 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 ... | apache-2.0 | 4,546,904,235,726,762,500 | 38.525424 | 79 | 0.658376 | false |
starwels/starwels | test/functional/test_framework/address.py | 2 | 2846 | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Encode and decode BASE58, P2PKH and P2SH addresses."""
from .script import hash256, hash160, sha256, CScri... | mit | 6,424,822,730,027,099,000 | 31.712644 | 73 | 0.659522 | false |
duhzecca/cinder | cinder/tests/unit/objects/test_base.py | 8 | 3746 | # Copyright 2015 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 required by applicable law or a... | apache-2.0 | 1,232,266,410,977,952,500 | 36.838384 | 78 | 0.640416 | false |
preparationh67/youtube-dl | youtube_dl/extractor/eagleplatform.py | 8 | 4080 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
)
class EaglePlatformIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
eagleplatform:(?P<custom_host>[^/]+):|
... | unlicense | 4,116,274,861,903,518,000 | 35.881818 | 121 | 0.552132 | false |
orbitvu/django-extensions | django_extensions/management/commands/graph_models.py | 2 | 3651 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django_extensions.management.modelviz import generate_dot
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--disable-fields', '-d', action='store_true', dest='disable_f... | mit | -8,109,666,665,435,858,000 | 50.422535 | 198 | 0.6149 | false |
aam-at/tensorflow | tensorflow/python/debug/lib/debug_v2_ops_test.py | 5 | 30428 | # 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 | -492,491,242,545,354,900 | 37.860792 | 80 | 0.632312 | false |
SEJeff/home-assistant | homeassistant/components/automation/__init__.py | 4 | 2246 | """
homeassistant.components.automation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to setup simple automation rules via the config file.
"""
import logging
from homeassistant.bootstrap import prepare_setup_platform
from homeassistant.helpers import config_per_platform
from homeassistant.util import split_entity_id
fr... | mit | -8,727,834,822,800,919,000 | 29.351351 | 79 | 0.597507 | false |
garywu/exparse | exparse/helper.py | 1 | 2450 | __author__ = 'Gary Wu'
import logging
mylogger = logging.getLogger(__name__)
from itertools import chain
from functools import partial
from lxml import etree
from lxml import html
def currency(elm):
if elm is not None and elm.text:
text = elm.text.strip()
if text.startswith('$'):
tex... | mit | -3,763,255,534,705,272,300 | 27.835294 | 112 | 0.554286 | false |
rosswhitfield/mantid | Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py | 3 | 24469 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# py... | gpl-3.0 | 41,515,017,078,706,024 | 46.055769 | 114 | 0.632269 | false |
megaserg/pants | tests/python/pants_test/build_graph/test_build_file_aliases.py | 5 | 5962 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | apache-2.0 | -2,236,530,595,974,118,100 | 40.402778 | 93 | 0.580678 | false |
wryoung412/CS294_Deep_RL | hw1/policy/base.py | 1 | 1167 | import datetime
import numpy as np
import inspect, os
import tensorflow as tf
from abc import ABC, abstractmethod
class BasePolicy(ABC):
def __init__(self, env_name):
# __file__
policy_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
model_dir = os.path.join(p... | mit | -1,533,891,416,255,348,200 | 34.363636 | 94 | 0.616967 | false |
prestontimmons/django-email-template | email_template/email.py | 2 | 2513 | from functools import partial
from django.conf import settings
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.template import Context, RequestContext
from django.template.loader import select_template
from .util import render_node
def send_base(template_name, context_data, send_method... | mit | 3,266,218,043,247,853,000 | 24.907216 | 78 | 0.6538 | false |
Checksum/landfill | landfill.py | 1 | 14954 | import os
import re
import sys
import imp
import pwiz
import peewee
import inspect
import logging
import pkgutil
import datetime
import importlib
import playhouse
from peewee import *
from peewee import Node
from playhouse.migrate import *
from types import ModuleType
from io import StringIO
__version__ = '0.2.1'
... | mit | -8,818,175,679,522,130,000 | 32.604494 | 131 | 0.601511 | false |
mawimawi/datadjables | datadjables/datadjable_testing/urls.py | 1 | 1167 | from django.conf.urls import patterns, url
from django.views.generic import TemplateView, DetailView
from .models import Person
from django.conf import settings
from datadjables.datadjable_testing.views import DPersons, DPersonsFilterTop, \
DSimplePersons, DPurchases
urlpatterns = patterns(
'',
url(r'^$',
... | mit | -4,885,345,186,190,190,000 | 35.46875 | 79 | 0.681234 | false |
vuolter/pyload | src/pyload/plugins/decrypters/ChipDe.py | 2 | 1093 | # -*- coding: utf-8 -*-
import re
from ..base.decrypter import BaseDecrypter
class ChipDe(BaseDecrypter):
__name__ = "ChipDe"
__type__ = "decrypter"
__version__ = "0.17"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?chip\.de/video/.+\.html"
__config__ = [
("enabled", "boo... | agpl-3.0 | -133,262,766,905,910,980 | 27.025641 | 87 | 0.516011 | false |
cgimenop/Excel2Testlink | ExcelParser/lib/et_xmlfile/tests/test_incremental_xmlfile.py | 7 | 11376 | from __future__ import absolute_import
"""
Tests for the incremental XML serialisation API.
Adapted from the tests from lxml.etree.xmlfile
"""
try:
import lxml
except ImportError:
raise ImportError("lxml is required to run the tests.")
from io import BytesIO
import unittest
import tempfile, os, sys
from .... | mit | 2,728,526,013,529,476,000 | 30.955056 | 82 | 0.545271 | false |
sorig/shogun | examples/undocumented/python/classifier_svmlight_linear_term.py | 7 | 2066 | #!/usr/bin/env python
import numpy
traindna=['CGCACGTACGTAGCTCGAT',
'CGACGTAGTCGTAGTCGTA',
'CGACGGGGGGGGGGTCGTA',
'CGACCTAGTCGTAGTCGTA',
'CGACCACAGTTATATAGTA',
'CGACGTAGTCGTAGTCGTA',
'CGACGTAGTTTTTTTCGTA',
'CGACGTAGTCGTAGCCCCA',
'CAAAAAAAAAAAAAAAATA',
... | bsd-3-clause | 2,411,005,545,091,394,000 | 31.793651 | 110 | 0.648596 | false |
TNT-Samuel/Coding-Projects | Panda3DTesting/Perlin.py | 1 | 3727 | from noise import pnoise2, snoise2
class ThreeDpoint:
def __init__(self,x=0,y=0,z=0):
self.set(x,y,z)
def set(self,x,y,z):
self.x = x
self.y = y
self.z = z
class ThreeDline:
def __init__(self,p1=ThreeDpoint(),p2=ThreeDpoint()):
self.set(p1,p2)
def set(self,p1,p2... | gpl-3.0 | 2,906,160,465,336,398,300 | 33.201835 | 89 | 0.529917 | false |
jweste/odoo-addons-cpo | purchase_compute_order/model/__init__.py | 3 | 1288 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase - Computed Purchase Order Module for Odoo
# Copyright (C) 2013-Today GRAP (http://www.grap.coop)
# @author Julien WESTE
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# Thi... | agpl-3.0 | -3,637,871,586,111,579,600 | 43.413793 | 78 | 0.642081 | false |
thomazs/geraldo | site/newsite/site-geraldo/django/db/models/sql/subqueries.py | 11 | 16588 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models.sql.query import Query
from django.db.models.sql.where import AN... | lgpl-3.0 | -7,065,108,444,840,858,000 | 39.360097 | 121 | 0.580781 | false |
sailthru/relay | relay/relay_logging.py | 1 | 2013 | import logging
import json
from colorlog import ColoredFormatter
from relay import log
def configure_logging(add_handler, log=log):
"""
Configure log records. If adding a handler, make the formatter print all
passed in key:value data.
ie log.extra('msg', extra=dict(a=1))
generates 'msg ... | apache-2.0 | -4,460,430,520,419,536,400 | 32.55 | 79 | 0.622454 | false |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/SQLAlchemy-0.8.0b2-py2.7-linux-x86_64.egg/sqlalchemy/orm/collections.py | 6 | 55323 | # orm/collections.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for collections of mapped entities.
The collections package supplies th... | gpl-2.0 | -7,346,996,607,321,575,000 | 33.598499 | 84 | 0.599696 | false |
drayanaindra/django-shop | shop/util/cart.py | 11 | 3099 | # -*- coding: utf-8 -*-
from shop.models.cartmodel import Cart
from django.contrib.auth.models import AnonymousUser
def get_cart_from_database(request):
database_cart = Cart.objects.filter(user=request.user)
if database_cart:
database_cart = database_cart[0]
else:
database_cart = None
r... | bsd-3-clause | 9,081,044,432,204,280,000 | 37.259259 | 98 | 0.581478 | false |
Parisson/Telemeta | telemeta/management/commands/telemeta-import-collections-from-crem.py | 2 | 9978 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Guillaume Pellerin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://svn.parisson.org/telemeta/TelemetaLicense.
#
... | agpl-3.0 | 2,723,525,549,494,444,500 | 39.336032 | 126 | 0.520225 | false |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/nose/config.py | 5 | 25280 | import logging
import optparse
import os
import re
import sys
import configparser
from optparse import OptionParser
from nose.util import absdir, tolist
from nose.plugins.manager import NoPlugins
from warnings import warn, filterwarnings
log = logging.getLogger(__name__)
# not allowed in config files
option_blacklist... | gpl-3.0 | -4,801,810,994,073,172,000 | 37.245083 | 82 | 0.564043 | false |
marcel-dancak/QGIS | python/plugins/processing/algs/qgis/VectorLayerHistogram.py | 12 | 3471 | # -*- coding: utf-8 -*-
"""
***************************************************************************
VectorLayerHistogram.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 | 1,966,366,486,805,850,400 | 38 | 131 | 0.539326 | false |
truthbk/dd-agent | resources/__init__.py | 34 | 10025 | # stdlib
from collections import namedtuple
from datetime import datetime, timedelta
import time
from types import DictType, ListType, StringTypes
class agg(object):
@staticmethod
def avg(args):
if len(args) > 0:
return sum(args)/len(args)
else:
return 0
@staticm... | bsd-3-clause | 7,545,313,935,478,577,000 | 32.416667 | 101 | 0.538354 | false |
moto-timo/ironpython3 | Tests/modules/io_related/cStringIO_test.py | 3 | 8995 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | apache-2.0 | -1,809,442,349,359,093,000 | 23.916898 | 96 | 0.567204 | false |
Lujeni/ansible | lib/ansible/modules/cloud/amazon/cloudformation_info.py | 2 | 13010 | #!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... | gpl-3.0 | -8,098,881,714,089,724,000 | 38.424242 | 154 | 0.662183 | false |
shyaken/cp.eaemcb | controllers/ldap/urls.py | 2 | 4402 | # Author: Zhang Huangbin <zhb@iredmail.org>
from libs.iredutils import reEmail, reDomain
urls = [
# Make url ending with or without '/' going to the same class.
'/(.*)/', 'controllers.utils.redirect',
# used to display jpegPhoto.
'/img/(.*)', 'controll... | gpl-2.0 | -1,928,722,124,327,327,700 | 53.345679 | 145 | 0.52408 | false |
nirmeshk/oh-mainline | mysite/search/migrations/0012_search_result_sized_project_icons.py | 17 | 3571 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | agpl-3.0 | -2,338,245,943,986,589,000 | 52.298507 | 145 | 0.601512 | false |
SLongofono/448_Project4 | Documentation/Prototype/Toy_Playlist.py | 1 | 1529 | ## @file Toy_Playlist.py
# @brief An example of using the Spotipy module to create and access a playlist
# @author Paul Lamere
# @details From the Spotipy documentation
# Accessed October 2016
# https://github.com/plamere/spotipy/blob/master/examples/user_playlists.py
# Modified by Stephen Longo... | mit | 3,914,714,023,291,097,600 | 24.065574 | 83 | 0.626553 | false |
TsinghuaX/edx-platform | common/djangoapps/django_comment_common/tests.py | 11 | 2216 | from django.test import TestCase
from django_comment_common.models import Role
from student.models import CourseEnrollment, User
class RoleAssignmentTest(TestCase):
"""
Basic checks to make sure our Roles get assigned and unassigned as students
are enrolled and unenrolled from a course.
"""
def s... | agpl-3.0 | 444,933,011,076,009,860 | 37.206897 | 80 | 0.640794 | false |
Raviyanto/sunflower-fm | application/gui/preferences/plugins.py | 7 | 9055 | import os
import gtk
import locale
from ConfigParser import ConfigParser
from widgets.settings_page import SettingsPage
class Column:
ACTIVE = 0
LOCATION = 1
NAME = 2
AUTHOR = 3
VERSION = 4
CONTACT = 5
SITE = 6
DESCRIPTION = 7
class Section:
NAME = 'Name'
DESCRIPTION = 'Description'
VERSION = 'Version'
... | gpl-3.0 | -6,595,831,597,563,156,000 | 30.660839 | 101 | 0.696963 | false |
nirmeshk/oh-mainline | vendor/packages/twisted/twisted/internet/test/test_address.py | 18 | 7490 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import re
import os
from twisted.trial import unittest
from twisted.internet.address import IPv4Address, UNIXAddress
try:
os.symlink
except AttributeError:
symlinkSkip = "Platform does not support symlinks"
else:
symlinkSkip = None
... | agpl-3.0 | -5,277,088,138,837,497,000 | 31.850877 | 91 | 0.62016 | false |
janplus/xbmc-addons-chinese | plugin.audio.1ting/music.py | 7 | 12549 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2, re, json
from bs4 import BeautifulSoup
from xml.sax.saxutils import unescape
webHtml = "http://www.1ting.com"
SingerHtml = "/group.html"
randHtml = "/rand.php"
rankHtml = "/rank.html"
tagHtml = "/tag"
genreHtml = "/genre"
imgBaseHtml = "http://img.1ting.c... | gpl-2.0 | -3,288,996,919,135,510,000 | 28.915254 | 97 | 0.55864 | false |
ContinuumIO/pydata-apps | embedded_apps/02_bokeh_server/linked_tap_server.py | 2 | 2312 | from __future__ import print_function
import numpy as np
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Circle, VBox, HBox, Button, TapTool
from bokeh.document import Document
from bokeh.session import Session
from bokeh.browserlib import view
document = Document()
session = Session()... | mit | 2,414,830,226,760,235,000 | 29.025974 | 115 | 0.682958 | false |
mastizada/kuma | vendor/packages/pylint/checkers/imports.py | 6 | 15398 | # Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | mpl-2.0 | -5,708,072,512,566,238,000 | 39.627968 | 85 | 0.581244 | false |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/django-extensions-0.5/django_extensions/utils/uuid.py | 9 | 20321 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | apache-2.0 | -3,320,657,386,343,334,000 | 36.149909 | 79 | 0.601447 | false |
paolodedios/tensorflow | tensorflow/python/data/kernel_tests/get_single_element_test.py | 6 | 4654 | # Copyright 2017 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 | -3,730,049,455,417,787,000 | 34.526718 | 80 | 0.663086 | false |
timj/scons | test/MSVS/vs-7.0-files.py | 5 | 3388 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit | -6,432,081,839,195,521,000 | 30.962264 | 79 | 0.735832 | false |
QuakeMan/3123 | qa/rpc-tests/getblocktemplate.py | 8 | 3715 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy ... | mit | -3,679,790,004,888,795,000 | 38.521277 | 113 | 0.653836 | false |
henzk/ape | ape/installtools/venv.py | 1 | 2084 | from subprocess import check_call
import glob
import os
import sys
class VirtualEnv(object):
def __init__(self, venv_dir):
self.venv_dir = venv_dir
self.bin_dir = os.path.join(venv_dir, 'Scripts' if os.name == 'nt' else 'bin')
def call_bin(self, script_name, args):
check_call([os.pat... | mit | -2,250,576,364,328,804,600 | 30.575758 | 118 | 0.589251 | false |
HighwayThree/ckanext-bcgov | ckanext/bcgov/logic/auth/create.py | 3 | 1678 | import ckan.model as model
from ckan.common import c
import ckan.logic as logic
import ckan.authz as authz
import ckan.logic.auth as logic_auth
from ckan.logic.auth.create import _check_group_auth
from ckan.common import _
import pprint
@logic.auth_allow_anonymous_access
def package_create(context, data_dict=None... | agpl-3.0 | 5,681,177,048,385,416,000 | 32.56 | 112 | 0.665077 | false |
SarathM1/modbus | setup.py | 1 | 2254 | #!/usr/bin/env python
# Do not import non-standard modules here, as it will mess up the installation in clients.
import re
from distutils.core import setup
with open('README.txt') as readmefile:
long_description = readmefile.read()
# Read version number etc from other file
# http://stackoverflow.com/questions/20... | apache-2.0 | 5,582,982,210,738,911,000 | 39.981818 | 117 | 0.638421 | false |
Motsai/neblina-python | neblina.py | 1 | 11677 | #!/usr/bin/env python
###################################################################################
# @package neblina
# Copyright (c) 2010-2016 Motsai
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation ... | mit | 489,607,470,711,761,700 | 38.053512 | 117 | 0.602723 | false |
sbkro/alc | doc/conf.py | 1 | 8162 | # -*- coding: utf-8 -*-
#
# alc documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 27 18:28:17 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | bsd-3-clause | -3,891,476,031,534,156,000 | 30.635659 | 79 | 0.706199 | false |
indico/indico-migrate | indico_migrate/steps/events/participants.py | 1 | 12515 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | gpl-3.0 | 6,717,323,560,343,502,000 | 46.950192 | 117 | 0.611666 | false |
chuan9/chromium-crosswalk | tools/perf/page_sets/memory_health_story.py | 4 | 3094 | # Copyright 2015 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.
from telemetry.core import util
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
util... | bsd-3-clause | 6,420,285,747,655,815,000 | 34.976744 | 79 | 0.705882 | false |
naparuba/kunai | data/global-configuration/packs/mongodb/collectors/pymongo/ssl_match_hostname.py | 21 | 4688 | # Backport of the match_hostname logic from python 3.5, with small
# changes to support IP address matching on python 2.6, 2.7, 3.3, and 3.4.
import re
import sys
try:
# Python 3.3+, or the ipaddress module from pypi.
from ipaddress import ip_address
except ImportError:
ip_address = lambda address: None
... | mit | 1,537,955,165,270,300,700 | 33.725926 | 78 | 0.611561 | false |
cshallue/models | research/object_detection/models/ssd_mobilenet_v2_feature_extractor.py | 2 | 5582 | # Copyright 2018 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 | 8,653,641,700,252,111,000 | 40.044118 | 80 | 0.667861 | false |
ManiacalLabs/BiblioPixel | bibliopixel/project/aliases.py | 2 | 1085 | import operator, os, re
from .. util import log
ALIAS_MARKERS = '@$'
SEPARATORS = re.compile(r'([./#]|[^./#]+)')
PROJECT_ALIASES = {}
BUILTIN_ALIASES = {
'apa102': 'bibliopixel.drivers.SPI.APA102.APA102',
'lpd8806': 'bibliopixel.drivers.SPI.LPD8806.LPD8806',
'pi_ws281x': 'bibliopixel.drivers.PiWS281X.PiW... | mit | 5,223,890,905,001,399,000 | 27.552632 | 67 | 0.656221 | false |
atodorov/blivet | blivet/tasks/fsresize.py | 6 | 4420 | # fsresize.py
# Filesystem resizing classes.
#
# Copyright (C) 2015 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 progr... | gpl-2.0 | 6,244,816,000,194,422,000 | 30.347518 | 86 | 0.661765 | false |
mattvvhat/Euler | 057/solution.py | 2 | 1482 | # Greatest Common Divisor
# Computes the Greatest Common Divisor between two integers using Euclid's
# Algorithm. If the innards are wrapped in more efficient methods, then it'd
# likely work quickly for very large integers!
def gcd (a, b):
# Let us compute the gcd of negative numbers
if a < 0: a = -a
if b < 0: b... | unlicense | 5,498,299,158,501,828,000 | 21.8 | 77 | 0.605938 | false |
delmic/odemis | src/odemis/driver/pwrcomedi.py | 2 | 9849 | # -*- coding: utf-8 -*-
'''
Created on 17 Nov 2016
@author: Éric Piel
Copyright © 2016 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Odemis is... | gpl-2.0 | -2,405,489,135,356,883,000 | 43.754545 | 226 | 0.578103 | false |
dkodnik/arp | addons/website_quote/models/order.py | 1 | 11878 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-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 | -5,836,896,972,187,375,000 | 45.948617 | 167 | 0.605405 | false |
BrandonY/python-docs-samples | storage/cloud-client/acl_test.py | 5 | 3897 | # Copyright 2016 Google, 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 or agreed to in writing, ... | apache-2.0 | 699,143,596,099,644,700 | 27.23913 | 75 | 0.703105 | false |
kcavagnolo/astroML | astroML/datasets/hogg2010test.py | 5 | 1684 | """
Data from Hogg et al 2010; useful for testing robust regression methods
"""
import numpy as np
def fetch_hogg2010test(structured=False):
"""Fetch the Hogg et al 2010 test data
"""
data = np.array([[1, 201, 592, 61, 9, -0.84],
[2, 244, 401, 25, 4, 0.31],
[3, 47... | bsd-2-clause | -3,344,771,847,954,435,000 | 36.422222 | 71 | 0.383017 | false |
zedshaw/librelist | tests/handlers/admin_tests.py | 1 | 1665 | from nose.tools import *
from lamson.testing import *
from config import settings
import time
from app.model import archive, confirmation
queue_path = archive.store_path('test.list', 'queue')
sender = "sender-%s@sender.com" % time.time()
host = "librelist.com"
list_name = "test.list"
list_addr = "test.list@%s" % host... | agpl-3.0 | -3,435,780,747,800,284,700 | 30.415094 | 101 | 0.655255 | false |
kwagyeman/openmv | scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_up_test.py | 2 | 1955 | # Image Scaling Up Drawing Test
#
# This script tests the performance and quality of the draw_image()
# method which can perform nearest neighbor, bilinear, bicubic, and
# area scaling along with color channel extraction, alpha blending,
# color palette application, and alpha palette application.
# DISABLE THE FRAME B... | mit | -1,167,906,425,871,766,000 | 30.031746 | 96 | 0.628133 | false |
anthraxx/pwndbg | pwndbg/commands/procinfo.py | 1 | 5954 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import string
import gdb
import pwndbg.auxv
import pwndbg.commands
import pwndbg.file
import pwndbg.memoize
import pwndbg.net
import pwndbg.proc
try:
import psutil
except:
psutil = None
"""
PEDA prints it out like this:
exe = /bin/bash
fd[0] -> /dev/... | mit | -3,907,581,068,090,045,000 | 23.401639 | 88 | 0.512261 | false |
fxstein/SoCo | tests/test_new_datastructures.py | 8 | 14756 | # -*- coding: utf-8 -*-
"""Module to test the data structure classes with pytest."""
from __future__ import unicode_literals
import pytest
from soco import data_structures
from soco.exceptions import DIDLMetadataError
from soco.xml import XML
def assert_xml_equal(left, right, explain=None):
"""Helper function ... | mit | 2,753,686,613,637,451,300 | 42.020408 | 88 | 0.529954 | false |
brandonlogan/octavia | octavia/openstack/common/middleware/correlation_id.py | 1 | 1206 | # Copyright (c) 2013 Rackspace Hosting
# 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 req... | apache-2.0 | 7,255,085,551,083,900,000 | 37.903226 | 78 | 0.713101 | false |
ssorgatem/burrito | burrito/tests/test_parameters.py | 2 | 26499 | # ----------------------------------------------------------------------------
# Copyright (c) 2014--, burrito development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------------------------------------... | bsd-3-clause | 2,778,190,990,815,583,000 | 39.210926 | 79 | 0.52919 | false |
GenericStudent/home-assistant | homeassistant/components/neato/const.py | 9 | 6449 | """Constants for Neato integration."""
NEATO_DOMAIN = "neato"
CONF_VENDOR = "vendor"
NEATO_CONFIG = "neato_config"
NEATO_LOGIN = "neato_login"
NEATO_MAP_DATA = "neato_map_data"
NEATO_PERSISTENT_MAPS = "neato_persistent_maps"
NEATO_ROBOTS = "neato_robots"
SCAN_INTERVAL_MINUTES = 1
SERVICE_NEATO_CUSTOM_CLEANING = "cu... | apache-2.0 | 358,210,031,476,361,200 | 40.876623 | 69 | 0.663204 | false |
amitaekbote/dcos | ssh/runner.py | 5 | 11246 | import asyncio
import copy
import logging
import os
try:
import pty
except ImportError:
pass
import sys
from contextlib import contextmanager
import ssh.validate
from pkgpanda.util import is_windows
from ssh.utils import CommandChain, JsonDelegate
if not is_windows:
assert 'pty' in sys.modules
log = log... | apache-2.0 | -4,540,312,619,662,744,600 | 37.77931 | 113 | 0.575227 | false |
openstack/manila | manila/api/openstack/versioned_method.py | 7 | 1717 | # Copyright 2014 IBM Corp.
# Copyright 2015 Clinton Knight
# 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... | apache-2.0 | 1,038,882,171,824,815,900 | 34.040816 | 79 | 0.65696 | false |
cazacov/InternetOfThings | raspberry/lcd2004/lcddriver.py | 3 | 2469 | import i2c_lib
from time import *
# LCD Address
ADDRESS = 0x27
# commands
LCD_CLEARDISPLAY = 0x01
LCD_RETURNHOME = 0x02
LCD_ENTRYMODESET = 0x04
LCD_DISPLAYCONTROL = 0x08
LCD_CURSORSHIFT = 0x10
LCD_FUNCTIONSET = 0x20
LCD_SETCGRAMADDR = 0x40
LCD_SETDDRAMADDR = 0x80
# flags for display entry mode
LCD_ENTRYRIGHT = 0x00
... | mit | 1,334,149,586,357,087,200 | 23.205882 | 78 | 0.671932 | false |
kdwyer/issue-forwarder | issueforwarder/tests.py | 1 | 2814 | import unittest
from . import issues
class InboundMessageStub(object):
"""
Stub InboundEmailMessage class.
(google.appengine.api.mail.InboundEmailMessage)
"""
def __init__(self):
self.subject = u'It doesn\'t work'
def bodies(self, content_type):
return iter([(u'plain/text... | mit | 1,855,969,977,791,344,600 | 27.14 | 76 | 0.625444 | false |
jefftc/changlab | Betsy/Betsy/modules/normalize_samples_with_shiftscale.py | 1 | 2065 | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
from genomicode import shiftscalenorm
import arrayio
from Be... | mit | 5,571,050,032,569,931,000 | 34.603448 | 84 | 0.549637 | false |
dhanunjaya/neutron | neutron/tests/unit/plugins/ml2/drivers/test_helpers.py | 24 | 6250 | # Copyright (c) 2014 Thales Services SAS
# 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 r... | apache-2.0 | 865,339,620,647,921,400 | 42.706294 | 79 | 0.6448 | false |
acquia/Diamond | src/collectors/monit/monit.py | 25 | 4568 | # coding=utf-8
"""
Collect the monit stats and report on cpu/memory for monitored processes
#### Dependencies
* monit serving up /_status
"""
import urllib2
import base64
from xml.dom.minidom import parseString
import diamond.collector
from diamond.collector import str_to_bool
class MonitCollector(diamond.col... | mit | 2,472,413,119,821,895,000 | 37.711864 | 78 | 0.459501 | false |
janezhango/BigDataMachineLearning | py/testdir_single_jvm/test_GLM2_hastie_shuffle.py | 2 | 4276 | # Dataset created from this:
# Elements of Statistical Learning 2nd Ed.; Hastie, Tibshirani, Friedman; Feb 2011
# example 10.2 page 357
# Ten features, standard independent Gaussian. Target y is:
# y[i] = 1 if sum(X[i]) > .34 else -1
# 9.34 is the median of a chi-squared random variable with 10 degrees of freedom
# ... | apache-2.0 | 5,590,009,522,787,584,000 | 38.592593 | 93 | 0.658326 | false |
apache/beam | sdks/python/apache_beam/runners/portability/stager_test.py | 5 | 25459 | #
# 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 us... | apache-2.0 | 2,944,914,557,811,300,400 | 38.532609 | 80 | 0.645705 | false |
rootmos/qcd | optionparser.py | 1 | 6944 | #!/usr/bin/env python
# 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 in the hope that ... | gpl-3.0 | -392,014,345,883,910,700 | 30 | 105 | 0.587414 | 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.