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 |
|---|---|---|---|---|---|---|---|---|---|---|
rmanocha/bajar-de-peso | appengine_django/models.py | 7 | 6618 | #!/usr/bin/python2.4
#
# Copyright 2008 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... | gpl-2.0 | 6,459,591,442,539,491,000 | 31.282927 | 80 | 0.680568 | false |
simbs/edx-platform | common/djangoapps/util/tests/test_request.py | 113 | 2390 | """Tests for util.request module."""
import unittest
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.test.client import RequestFactory
from util.request import course_id_from_url, safe_get_host
class ResponseTestCase(unittest.TestCase):
""" Tests for response... | agpl-3.0 | -412,616,250,623,211,970 | 40.929825 | 104 | 0.671548 | false |
home-assistant/home-assistant | homeassistant/components/blink/sensor.py | 5 | 2650 | """Support for Blink system camera sensors."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
DEVICE_CLASS_SIGNAL_STRENGTH,
DEVICE_CLASS_TEMPERATURE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
TEMP_FAHRENHEIT,
)
from .const import DOMAIN, TYPE_TEMPER... | apache-2.0 | 2,636,285,967,818,578,000 | 28.444444 | 88 | 0.618113 | false |
jandebleser/django-wiki | testproject/testproject/wsgi.py | 3 | 1401 | """
WSGI config for testproject project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | gpl-3.0 | 7,407,470,621,448,738,000 | 36.864865 | 79 | 0.792291 | false |
bencharb/AutobahnPython | examples/asyncio/wamp/rpc/decorators/backend.py | 2 | 2883 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit | -5,870,782,239,336,593,000 | 33.73494 | 88 | 0.641346 | false |
shubhdev/edx-platform | common/test/acceptance/pages/studio/users.py | 9 | 8778 | """
Page classes to test either the Course Team page or the Library Team page.
"""
from bok_choy.promise import EmptyPromise
from bok_choy.page_object import PageObject
from ...tests.helpers import disable_animations
from .course_page import CoursePage
from . import BASE_URL
def wait_for_ajax_or_reload(browser):
... | agpl-3.0 | -4,130,812,168,403,367,000 | 34.682927 | 109 | 0.626225 | false |
diogocs1/comps | web/addons/mrp/wizard/__init__.py | 374 | 1199 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | apache-2.0 | -3,557,226,663,214,984,000 | 38.966667 | 78 | 0.6397 | false |
PatrickChrist/scikit-learn | examples/tree/plot_tree_regression_multioutput.py | 206 | 1800 | """
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... | bsd-3-clause | -6,350,680,587,520,597,000 | 31.727273 | 76 | 0.637778 | false |
beiko-lab/gengis | bin/Lib/site-packages/scipy/spatial/tests/test_distance.py | 1 | 74493 | #! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the... | gpl-3.0 | -7,757,114,548,794,692,000 | 36.960774 | 115 | 0.546105 | false |
elkingtonmcb/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 259 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause | -1,067,319,031,694,019,500 | 36.965116 | 79 | 0.661868 | false |
Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/feed/sphinxcontrib/feed/fsdict.py | 5 | 3256 | # −*− coding: UTF−8 −*−
from path import path
import os
import pickle
"""
A class providing dictionary access to a folder.
cribbed from http://bitbucket.org/howthebodyworks/fsdict
"""
def get_tmp_dir():
import tempfile
return tempfile.mkdtemp()
class FSDict(dict):
"""
provide dictionary access to ... | mit | -4,122,688,703,179,123,700 | 28.518182 | 90 | 0.530191 | false |
Alwnikrotikz/secure-gappproxy | localproxy/cxsetup.py | 2 | 1671 | # A simple setup script to create an executable running wxPython. This also
# demonstrates the method for creating a Windows executable that does not have
# an associated console.
#
# wxapp.py is a very simple "Hello, world" type wxPython application
#
# Run the build process by running the command 'python setup.... | gpl-3.0 | 6,729,866,919,611,062,000 | 31.42 | 78 | 0.516457 | false |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_2/tests/regressiontests/views/views.py | 38 | 2055 | import sys
from django import forms
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import get_resolver
from django.shortcuts import render_to_response
from django.template import TemplateDoesNotExist
from django.views.debug import technical_500_response
from django.views.gener... | mit | 6,592,410,772,739,753,000 | 29.220588 | 77 | 0.704136 | false |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/email/base64mime.py | 54 | 5792 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Base64 content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
ch... | apache-2.0 | 594,013,251,556,668,000 | 29.973262 | 78 | 0.680421 | false |
ulif/ulif.openoffice | tests/conftest.py | 1 | 5507 | import logging
import os
import py.path
import pytest
import subprocess
import sys
import tempfile
import time
from py.io import TextIO
from ulif.openoffice import oooctl
from ulif.openoffice.oooctl import check_port
from ulif.openoffice.testing import envpath_wo_virtualenvs
@pytest.fixture(scope='session')
def tmpdi... | gpl-2.0 | -3,797,958,222,271,758,000 | 29.594444 | 77 | 0.665335 | false |
torinfs/Py_Chem | response.py | 1 | 4641 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Function to build the A and B response matrices
# Torin Stetina
# June 1st, 2017
import numpy as np
def spin_eri(eriMO, sdim):
# ** Original algorithm based on function
# ** from joshuagoings.com/2013/05/27/tdhf-cis-in-python/
#
# Makes spin adapted 2 electr... | gpl-3.0 | -219,312,512,918,201,250 | 27.213415 | 82 | 0.474606 | false |
xodus7/tensorflow | tensorflow/contrib/opt/python/training/elastic_average_optimizer_test.py | 25 | 11942 | # 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 | 1,414,583,703,732,661,500 | 39.208754 | 80 | 0.6344 | false |
indictranstech/internal-erpnext | erpnext/hr/report/monthly_salary_register/monthly_salary_register.py | 52 | 4104 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr
from frappe import msgprint, _
def execute(filters=None):
if not filters: filters = {}
salary_slip... | agpl-3.0 | 5,626,381,408,156,792,000 | 37.364486 | 104 | 0.657651 | false |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/twisted/trial/_dist/disttrial.py | 12 | 8711 | # -*- test-case-name: twisted.trial._dist.test.test_disttrial -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module contains the trial distributed runner, the management class
responsible for coordinating all of trial's behavior at the highest level.
@since: 12.3
"""
import os
i... | gpl-2.0 | 5,578,153,389,127,167,000 | 32.763566 | 80 | 0.616806 | false |
ngsutils/ngsutils | ngsutils/fastq/t/test_split.py | 1 | 3450 | #!/usr/bin/env python
'''
Tests for fastqutils split
'''
import os
import unittest
import ngsutils.fastq.split
from ngsutils.fastq import FASTQ
class SplitTest(unittest.TestCase):
def testSplit(self):
fname = os.path.join(os.path.dirname(__file__), 'test.fastq')
templ = os.path.join(os.path.dirn... | bsd-3-clause | -6,152,383,414,905,397,000 | 32.173077 | 88 | 0.578551 | false |
AndroidOpenDevelopment/android_external_chromium_org | chrome/browser/test_presubmit.py | 11 | 20952 | #!/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.
"""Unit tests for Web Development Style Guide checker."""
import os
import re
import sys
import unittest
test_dir = os.path.dirna... | bsd-3-clause | 6,838,799,621,255,495,000 | 30.459459 | 80 | 0.624809 | false |
nightjean/Deep-Learning | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | 31 | 6072 | # 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 | -7,841,920,246,143,825,000 | 34.928994 | 80 | 0.641304 | false |
alexteodor/odoo | addons/project/res_partner.py | 334 | 1953 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 1,421,378,029,705,978,600 | 40.553191 | 101 | 0.600614 | false |
wannaphongcom/flappy | flappy/events/keyboardevent.py | 2 | 1615 |
from event import Event
class KeyboardEvent(Event):
KEY_DOWN = "keyDown"
KEY_UP = "keyUp"
def __init__(self, etype, bubbles=False, cancelable=False,
charCodeValue=0, keyCodeValue=0, keyLocationValue=0,
ctrlKeyValue=False, altKeyValue=False,
... | mit | 3,190,524,814,200,542,700 | 39.4 | 79 | 0.56904 | false |
hagabbar/pycbc_copy | pycbc/io/inference_hdf.py | 1 | 27471 | # Copyright (C) 2016 Christopher M. Biwer
# 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
# self.option) any later version.
#
# This program is distr... | gpl-3.0 | 1,501,965,317,192,820,200 | 35.530585 | 80 | 0.572313 | false |
tedder/ansible | lib/ansible/plugins/lookup/onepassword.py | 23 | 9110 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Scott Buchanan <sbuchanan@ri.pn>
# Copyright: (c) 2016, Andrew Zenk <azenk@umn.edu> (lastpass.py used as starting point)
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ imp... | gpl-3.0 | 1,590,871,122,510,003,500 | 37.765957 | 139 | 0.619759 | false |
tianocore/buildtools-BaseTools | Source/Python/UPT/Parser/InfDefineSectionParser.py | 6 | 7396 | ## @file
# This file contained the parser for define sections in INF file
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distributio... | bsd-2-clause | -9,087,760,676,836,834,000 | 35.553299 | 103 | 0.51947 | false |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/bcrypt/__about__.py | 4 | 1296 | # Author:: Donald Stufft (<donald@stufft.io>)
# Copyright:: Copyright (c) 2013 Donald Stufft
# License:: Apache License, Version 2.0
#
# 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:/... | gpl-3.0 | 9,183,270,858,452,311,000 | 36.028571 | 74 | 0.692901 | false |
LiaoPan/scikit-learn | sklearn/utils/linear_assignment_.py | 214 | 9413 | """
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux.
# Heavily refactored by Lars Buitinck.
# Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>, Gael Varoquaux
# Autho... | bsd-3-clause | 3,884,081,739,507,262,500 | 32.498221 | 78 | 0.615957 | false |
AlphaSmartDog/DeepLearningNotes | Note-1 RNN-DNC择时/Note-1-2 PonderingDNCore L2正则化示例/sonnet/python/modules/experimental.py | 10 | 1343 | # Copyright 2017 The Sonnet 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 applicable l... | mit | -8,938,363,221,257,467,000 | 36.305556 | 78 | 0.721519 | false |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/numpy/linalg/linalg.py | 3 | 82838 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | mit | 1,167,103,187,656,267,500 | 30.56936 | 85 | 0.570559 | false |
siliconsmiley/QGIS | python/pyplugin_installer/qgsplugininstallerpluginerrordialog.py | 11 | 1767 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerpluginerrordialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright... | gpl-2.0 | 1,776,995,904,072,294,400 | 42.097561 | 95 | 0.447651 | false |
tunneln/CarnotKE | jyhton/lib-python/2.7/unittest/suite.py | 243 | 9809 | """TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
def __init__(se... | apache-2.0 | -5,398,500,771,567,927,000 | 31.372937 | 80 | 0.580589 | false |
s-store/sstore-soft | third_party/python/boto/ec2/reservedinstance.py | 31 | 4028 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, including
# without limitation the rights to use, copy, modi... | gpl-3.0 | -1,904,682,091,582,560,000 | 40.525773 | 91 | 0.64424 | false |
mumer92/AFE | internals/urlgrabber/mirror.py | 4 | 17958 | # 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.
#
# This library is distributed in the hope that it w... | gpl-3.0 | 6,985,521,752,191,124,000 | 38.468132 | 78 | 0.620114 | false |
shollen/evennia | evennia/contrib/tutorial_examples/red_button_scripts.py | 6 | 10290 | """
Example of scripts.
These are scripts intended for a particular object - the
red_button object type in contrib/examples. A few variations
on uses of scripts are included.
"""
from evennia import DefaultScript
from evennia.contrib.tutorial_examples import cmdset_red_button as cmdsetexamples
#
# Scripts as state-m... | bsd-3-clause | -7,650,562,300,088,496,000 | 36.692308 | 88 | 0.64276 | false |
yoshinorim/mysql-5.6 | xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/ib_databases_test_disabled.py | 24 | 5057 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... | gpl-2.0 | 7,119,365,881,278,728,000 | 40.45082 | 109 | 0.576626 | false |
w1r0x/ansible | lib/ansible/new_inventory/__init__.py | 53 | 11203 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 | 8,415,652,017,501,464,000 | 31.56686 | 124 | 0.56592 | false |
edx/edx-platform | openedx/core/djangoapps/site_configuration/tests/test_models.py | 4 | 14171 | """
Tests for site configuration's django models.
"""
from unittest.mock import patch
import pytest
from django.contrib.sites.models import Site
from django.db import IntegrityError, transaction
from django.test import TestCase
from openedx.core.djangoapps.site_configuration.models import (
SiteConfiguration,
S... | agpl-3.0 | 730,517,831,171,825,400 | 43.146417 | 118 | 0.647731 | false |
mathemage/h2o-3 | h2o-py/tests/testdir_hdfs/pyunit_INTERNAL_HDFS_timestamp_date_orc.py | 4 | 2826 | from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
import time
from tests import pyunit_utils
#----------------------------------------------------------------------
# This test will parse orc files containing timestamp and date information into
# H2O frame. Next, it will take the ... | apache-2.0 | 7,347,966,183,590,986,000 | 44.596774 | 113 | 0.604034 | false |
amenonsen/ansible | lib/ansible/modules/network/cloudengine/ce_ntp.py | 7 | 20789 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 | -572,358,867,990,793,100 | 32.968954 | 120 | 0.522728 | false |
davehunt/kuma | vendor/packages/pyflakes/checker.py | 19 | 33324 | """
Main module.
Implement the central Checker class.
Also, it models the Bindings and Scopes.
"""
import doctest
import os
import sys
PY2 = sys.version_info < (3, 0)
PY32 = sys.version_info < (3, 3) # Python 2.5 to 3.2
PY33 = sys.version_info < (3, 4) # Python 2.5 to 3.3
builtin_vars = dir(__import__('__builti... | mpl-2.0 | 70,781,471,663,605,720 | 35.221739 | 88 | 0.577032 | false |
petr-muller/beakerlib | src/python/rlMemAvg.py | 1 | 1621 | #!/usr/bin/python
# Authors: Petr Muller <pmuller@redhat.com>
#
# Description: Prints memory consumption average for an executed program
#
# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted
# material is made available to anyone wishing to use, modify, copy, or
# redistribute it subject to t... | gpl-2.0 | 7,980,078,684,630,369,000 | 25.145161 | 80 | 0.688464 | false |
awkspace/ansible | lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py | 8 | 4695 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Julien Stroheker <juliens@microsoft.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_ve... | gpl-3.0 | -1,778,897,405,392,063,200 | 25.525424 | 92 | 0.594036 | false |
sharkerz/capablanca | test/test_piece.py | 1 | 2560 | # -*- coding: utf-8 -*-
# Copyright 2015, Dario Blanco
"""
This module tests capablanca.piece
"""
from capablanca import piece
def test_king_positions():
"""Should return proper threat positions when moving a King"""
king = piece.King(3, 3)
assert king.get_threats((1, 1)) == set([
(0, 0), (1, 0)... | gpl-2.0 | -5,928,936,661,073,684,000 | 34.068493 | 79 | 0.471094 | false |
kijiproject/kiji-mapreduce | kiji-mapreduce/src/test/profiling/scripts/test_kijistats.py | 2 | 5307 | #!/usr/bin/python
# Copyright 2013 WibiData, 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 agr... | apache-2.0 | 7,223,133,083,273,848,000 | 43.225 | 132 | 0.634822 | false |
interactiveinstitute/watthappened | python_modules/restkit/conn.py | 2 | 3307 | # -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
import logging
import random
import select
import socket
import ssl
import time
import cStringIO
from socketpool import Connector
from socketpool.util import is_connected
CHUNK_SIZE = 16 * 10... | mit | -1,902,879,507,942,835,700 | 25.886179 | 75 | 0.566374 | false |
yanirs/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_cookies.py | 299 | 1996 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestResponseSetCookie(TestUsingServer):
def test_name_value(self):
@wptserve.handlers.handler
def handler(request, response):
response.set_cookie("name", "value")
... | mpl-2.0 | 4,045,811,312,499,012,000 | 29.707692 | 75 | 0.600701 | false |
rscnt/django-cms | cms/tests/test_site.py | 46 | 5902 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import copy
from cms.utils.urlutils import admin_reverse
from django.contrib.sites.models import Site
from cms.api import create_page
from cms.models import Page, Placeholder
from cms.utils import get_cms_setting
from cms.test_utils.testcases import CMSTes... | bsd-3-clause | 2,859,997,326,191,792,000 | 47.377049 | 149 | 0.531006 | false |
israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/miomio.py | 15 | 4681 | # coding: utf-8
from __future__ import unicode_literals
import random
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
xpath_text,
int_or_none,
ExtractorError,
sanitized_Request,
)
class MioMioIE(InfoExtractor):
IE_NAME = 'miomio.tv'
_VALID_URL = r... | gpl-3.0 | 867,398,286,127,248,400 | 33.679389 | 118 | 0.531367 | false |
adamrj/Debate-Sentiment-Analysis | project/sentiment/views.py | 1 | 3556 | from django.shortcuts import render, redirect
from django.views.generic import View
from sentiment.models import Tweet, Word
from sentiment.bayes import *
from django.db.models import Avg
from django.http import JsonResponse
class IndexView(View):
template = 'sentiment/index.html'
def get(self, request):
... | mit | 352,480,835,070,348,900 | 31.633028 | 119 | 0.671822 | false |
vipul-sharma20/oh-mainline | vendor/packages/python-openid/openid/test/test_ax.py | 77 | 21540 | """Tests for the attribute exchange extension module
"""
import unittest
from openid.extensions import ax
from openid.message import NamespaceMap, Message, OPENID2_NS
from openid.consumer.consumer import SuccessResponse
class BogusAXMessage(ax.AXMessage):
mode = 'bogus'
getExtensionArgs = ax.AXMessage._newAr... | agpl-3.0 | 8,735,427,961,169,537,000 | 33.408946 | 78 | 0.57182 | false |
marqueedev/django | tests/template_tests/filter_tests/test_striptags.py | 324 | 1338 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
def test_striptags01(self):
output ... | bsd-3-clause | 2,265,540,682,281,347,600 | 30.857143 | 107 | 0.538864 | false |
LokiNetworks/empower-runtime | empower/lvnf_ems/lvnf_set.py | 2 | 4546 | #!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# 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 applicabl... | apache-2.0 | 7,073,972,392,130,851,000 | 24.829545 | 76 | 0.598988 | false |
poppogbr/genropy | resources/common/print_utils.py | 1 | 8971 | #!/usr/bin/env python
# encoding: utf-8
"""
print_utils.py
Created by Saverio Porcari on 2009-06-29.
Copyright (c) 2009 __MyCompanyName__. All rights reserved.
"""
from gnr.web.gnrbaseclasses import BaseComponent
class PrintUtils(BaseComponent):
py_requires = 'batch_runner:BatchRunner'
def serverPrint(self,... | lgpl-2.1 | 9,216,027,770,163,716,000 | 54.726708 | 129 | 0.559692 | false |
Signbank/BSL-signbank | signbank/dictionary/urls.py | 1 | 2739 | from django.conf.urls import *
from django.contrib.auth.decorators import login_required, permission_required
from signbank.dictionary.models import *
from signbank.dictionary.forms import *
from signbank.dictionary.views import feature_search
from signbank.dictionary.adminviews import GlossListView, GlossDetailView
... | bsd-3-clause | -7,015,777,633,625,190,000 | 49.722222 | 131 | 0.688572 | false |
theakholic/ThinkStats2 | code/chap12soln.py | 68 | 4459 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import pandas
import numpy as np
import statsmodels.formula.api as smf
import t... | gpl-3.0 | 4,692,363,360,533,789,000 | 27.767742 | 76 | 0.644539 | false |
martinbuc/missionplanner | Lib/site-packages/numpy/distutils/misc_util.py | 53 | 84156 | import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
from distutils.errors import DistutilsError
try:
set
except NameError:
from sets import Set as set
from numpy.distutils.compat import get_exception
__all__ = ['Configuration', 'get... | gpl-3.0 | -1,621,246,622,756,569,000 | 34.644219 | 96 | 0.543253 | false |
natanielruiz/android-yolo | jni-build/jni/include/tensorflow/contrib/distributions/python/kernel_tests/mvn_test.py | 4 | 16522 | # 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 | -7,674,969,143,571,331,000 | 35.312088 | 80 | 0.635395 | false |
rhattersley/iris | lib/iris/tests/unit/fileformats/grib/message/test__MessageLocation.py | 7 | 1806 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 | 5,064,957,271,441,345,000 | 36.625 | 74 | 0.689369 | false |
melon-li/openstack-dashboard | openstack_dashboard/dashboards/project/access_and_security/views.py | 66 | 1224 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 | 2,045,930,631,823,238,000 | 33.971429 | 78 | 0.75 | false |
charlievieth/GoSubl | something_borrowed/diff_match_patch/python3/diff_match_patch_test.py | 284 | 41615 | #!/usr/bin/python3
"""Test harness for diff_match_patch.py
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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://ww... | mit | -1,186,103,648,178,383,400 | 46.778416 | 407 | 0.64395 | false |
ansible/ansible | test/support/integration/plugins/module_utils/database.py | 54 | 5942 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 | 4,164,076,394,211,513,000 | 40.84507 | 134 | 0.657523 | false |
beacloudgenius/edx-platform | common/lib/xmodule/xmodule/video_module/video_module.py | 13 | 30566 | # -*- coding: utf-8 -*-
# pylint: disable=abstract-method
"""Video is ungraded Xmodule for support video content.
It's new improved video module, which support additional feature:
- Can play non-YouTube video sources via in-browser HTML5 video player.
- YouTube defaults to HTML5 mode from the start.
- Speed changes in ... | agpl-3.0 | -6,469,149,810,638,977,000 | 44.215976 | 157 | 0.613296 | false |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_shelve.py | 8 | 6389 | import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
de... | gpl-2.0 | 6,071,719,900,430,498,000 | 27.013158 | 79 | 0.544074 | false |
pilou-/ansibullbot | ansibullbot/utils/file_tools.py | 1 | 17290 | #!/usr/bin/env python
import copy
import logging
import os
import re
from fuzzywuzzy import fuzz as fw_fuzz
from textblob import TextBlob
from ansibullbot.parsers.botmetadata import BotMetadataParser
from ansibullbot.utils.systemtools import run_command
from ansibullbot.utils.moduletools import ModuleIndexer
import... | gpl-3.0 | 6,040,604,606,355,507,000 | 33.305556 | 86 | 0.449104 | false |
evaschalde/odoo | addons/l10n_be_invoice_bba/__openerp__.py | 312 | 2621 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 | 6,194,152,912,256,153,000 | 42.683333 | 120 | 0.581076 | false |
abhinavp13/IITBX-edx-platform-dev | lms/djangoapps/foldit/tests.py | 2 | 12192 | import json
import logging
from functools import partial
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
from foldit.views import foldit_ops, verify_code
from foldit.models import PuzzleComplete, Sc... | agpl-3.0 | -3,310,598,215,180,677,000 | 33.440678 | 82 | 0.56939 | false |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/numpy/lib/polynomial.py | 82 | 37957 | """
Functions to operate on polynomials.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import re
import warnings
import numpy.core.... | artistic-2.0 | 8,971,880,863,353,280,000 | 28.723571 | 79 | 0.556814 | false |
sallaire/Sick-Beard | lib/jsonrpclib/jsonclass.py | 87 | 5116 | import types
import inspect
import re
import traceback
from lib.jsonrpclib import config
iter_types = [
types.DictType,
types.ListType,
types.TupleType
]
string_types = [
types.StringType,
types.UnicodeType
]
numeric_types = [
types.IntType,
types.LongType,
types.FloatType
]
value_t... | gpl-3.0 | -4,635,661,714,888,920,000 | 34.282759 | 74 | 0.587959 | false |
MTDEV-KERNEL/abenagiel-android_kernel_fih_msm7x30 | scripts/build-all.py | 282 | 8889 | #! /usr/bin/env python
# Copyright (c) 2009, Code Aurora Forum. 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... | gpl-2.0 | 6,366,083,084,930,585,000 | 33.858824 | 81 | 0.594218 | false |
miing/mci_migo_packages_gargoyle | docs/django_settings.py | 9 | 2903 | import os.path
import sys
# Django settings for example_project project.
DEBUG = True
TEMPLATE_DEBUG = True
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
INTERNAL_IPS = ('127.0.0.1',)
MANAGERS = ADMINS
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_RO... | apache-2.0 | -5,413,557,926,892,390,000 | 32.367816 | 122 | 0.665863 | false |
darktears/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/backward.py | 64 | 4324 | """Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of lintisms.
# pylint: disable=F0401,W0611,W0622
# F0401: Unable to import blah
# W0611: Unused import blah
# W0622: Redefining built-in blah
import os, sys
# Python 2.3 doesn't have `set`
try:
... | bsd-3-clause | -654,504,979,793,299,000 | 28.414966 | 78 | 0.617946 | false |
horacioMartinez/dakara-client | tools/misc/traductor de indices y mapas/mapas/conversor_mapas.py | 1 | 3414 | import json
import struct
import os
extra_info = [0 for x in range(10000)]
extra_data = open("./extra_data", "r")
for line in extra_data:
line = line.rstrip()
numeroMapa = line.split('=')[0]
data = line.split('=')[1]
extra_info[int(numeroMapa)] = data
def getExtraData (mapa):
return extra_info[mapa]
for fn i... | mit | 7,295,419,276,420,980,000 | 22.544828 | 122 | 0.512888 | false |
anryko/ansible | lib/ansible/modules/network/vyos/vyos_interfaces.py | 20 | 27002 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | gpl-3.0 | -4,741,998,864,174,278,000 | 29.718999 | 131 | 0.569254 | false |
peraktong/Cannon-Experiment | 0304_anna_cannon.py | 1 | 1152 | from TheCannon import apogee
from TheCannon import dataset
import numpy as np
from TheCannon import model
tr_ID, wl, tr_flux, tr_ivar = apogee.load_spectra("/Users/caojunzhi/Downloads/example_DR10/Data")
tr_label = apogee.load_labels("/Users/caojunzhi/Downloads/example_DR10/reference_labels.csv")
test_ID = tr_ID
te... | mit | 5,205,430,080,983,756,000 | 25.181818 | 97 | 0.715278 | false |
aysenurbilgin/tilt_api | src/engine/distributionalsemantics/ModelConstants.py | 1 | 5884 | import gensim
import numpy as np
from scipy.stats.stats import spearmanr
# global parameters for word2vec
ALPHA = 0.01 # initial learning rate, drops to min_alpha
MIN_ALPHA = 0.0001
CBOW_MEAN = 1 # http://stackoverflow.com/questions/34249586/the-accuracy-test-of-word2vec-in-gensim
... | apache-2.0 | -5,999,230,452,759,362,000 | 39.868056 | 141 | 0.622026 | false |
datalogics/scons | test/SideEffect/basic.py | 2 | 3266 | #!/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 | -1,876,427,757,661,345,300 | 29.240741 | 76 | 0.657073 | false |
zaqwes8811/matlab_ext | identification/dals/os_io/for_analyse/FileOperationsLib.py | 1 | 1102 | #-*- coding: utf-8 -*-
import usaio
''' добавляет строку в фиксирванный файл '''
def printStrToFile(string, fname):
filename = fname
# Create a file object:
# in "write" mode
FILE = open(filename,"at")
# Write all the lines at once:
FILE.writelines(string)
# Alternatively write them one by one:
FILE.clos... | apache-2.0 | 3,664,129,208,576,423,400 | 21.644444 | 53 | 0.579568 | false |
rrrrrr8/vnpy | vnpy/trader/app/ctaStrategy/ctaBacktesting.py | 1 | 56364 | # encoding: UTF-8
'''
本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致,
可以使用和实盘相同的代码进行回测。
'''
from __future__ import division
from __future__ import print_function
from datetime import datetime, timedelta
from collections import OrderedDict
from itertools import product
import multiprocessing
import copy
import pymongo
import pa... | mit | -1,119,099,334,924,795,000 | 35.785094 | 101 | 0.463667 | false |
Qalthos/ansible | test/units/modules/storage/netapp/test_na_ontap_export_policy_rule.py | 37 | 9740 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | gpl-3.0 | -4,813,992,375,875,950,000 | 35.893939 | 92 | 0.591273 | false |
fernandezcuesta/ansible | lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py | 45 | 3943 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 | -8,364,704,240,516,247,000 | 29.804688 | 134 | 0.625666 | false |
simpsonjulian/bofhtools | office365.py | 2 | 1252 | import webbrowser
from time import sleep
from os import environ
import requests
application_id = environ.get('O365_APP_ID')
secret = environ.get('O365_APP_SECRET')
tenant_id = environ.get('O365_APP_TENANT_ID')
headers = {'Content-type': 'application/json'}
payload = {'grant_type': 'client_credentials',
'... | gpl-3.0 | 8,459,739,871,161,473,000 | 36.969697 | 152 | 0.700479 | false |
apophys/ipaqe-provision-hosts | ipaqe_provision_hosts/backend/base.py | 1 | 1212 | # author: Milan Kubik
""" Backend base class
The class provides the contract for backend modules
implementing the provisioning of dynamic resources.
"""
from ipaqe_provision_hosts.errors import IPAQEProvisionerError
NOT_IMPLEMENTED_MSG = "You need to override this method in a subclass"
class VMsNotCreatedError(IPA... | mit | 961,110,038,377,611,900 | 27.186047 | 70 | 0.679868 | false |
mrquim/mrquimrepo | repo/script.module.pycryptodome/lib/Crypto/SelfTest/Cipher/test_Blowfish.py | 5 | 6124 | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_Blowfish.py: Self-test for the Blowfish cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... | gpl-2.0 | 3,381,023,938,963,768,300 | 48.387097 | 79 | 0.707381 | false |
AnnalisaS/migration_geonode | geonode/maps/tests.py | 2 | 20777 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 | 2,470,530,162,807,450,000 | 36.983547 | 119 | 0.61828 | false |
abo-abo/edx-platform | common/djangoapps/track/backends/mongodb.py | 88 | 2917 | """MongoDB event tracker backend."""
from __future__ import absolute_import
import logging
import pymongo
from pymongo import MongoClient
from pymongo.errors import PyMongoError
from track.backends import BaseBackend
log = logging.getLogger(__name__)
class MongoBackend(BaseBackend):
"""Class for a MongoDB e... | agpl-3.0 | -3,334,378,588,981,111,000 | 29.072165 | 71 | 0.612273 | false |
metacloud/molecule | test/unit/test_util.py | 1 | 10072 | # Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | mit | -2,166,138,975,894,124,800 | 25.858667 | 79 | 0.620433 | false |
anusornc/vitess | py/vtdb/dbapi.py | 6 | 1054 | from vtdb import dbexceptions
# A simple class to trap and re-export only variables referenced from
# the sql statement since bind dictionaries can be *very* noisy. This
# is a by-product of converting the DB-API %(name)s syntax to our
# :name syntax.
class BindVarsProxy(object):
def __init__(self, bind_vars):
... | bsd-3-clause | 964,610,198,337,482,000 | 30 | 70 | 0.688805 | false |
maferelo/saleor | saleor/order/migrations/0009_auto_20151201_0820.py | 3 | 1093 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("order", "0008_auto_20151026_0820")]
operations = [
migrations.RenameField(
model_name="order", old_name="total", new_name="to... | bsd-3-clause | -648,011,631,843,567,000 | 27.763158 | 75 | 0.520586 | false |
collex100/odoo | addons/event_sale/event_sale.py | 55 | 13527 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 7,675,841,343,332,855,000 | 51.430233 | 310 | 0.608635 | false |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 78 | 3643 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from . import base
from ..constants import namespaces, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class Filter(base.Filter):
"""Lints the token stream fo... | apache-2.0 | -8,705,006,044,932,209,000 | 38.172043 | 98 | 0.536097 | false |
kizkoh/wsgi_status | wsgi_status/monitor.py | 1 | 4718 | # -*- coding: utf-8 -*-
import fcntl
import json
import os
import psutil
import stat
import signal
import sys
import time
import threading
class Monitor:
def __init__(self, app, filename):
self.app = app
self.pid = os.getpid()
self.filename = filename
self.thread = False
se... | mit | -8,309,121,226,856,309,000 | 32.942446 | 93 | 0.520136 | false |
henriquemiranda/yambo-py | yamboparser/yambofolder.py | 2 | 1401 | # Copyright (C) 2018 Henrique Pereira Coutada Miranda
# All rights reserved.
#
# This file is part of yamboparser
#
from __future__ import print_function
import os
import numpy as np
from .yambofile import *
class YamboFolder():
"""
Takes as input a folder name that is the folder where yambo saved r-* o-* l-*... | bsd-3-clause | -7,309,706,522,821,433,000 | 30.133333 | 98 | 0.584582 | false |
SergeyPirogov/testcontainers-python | testcontainers/core/docker_client.py | 1 | 2904 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 | -2,635,904,878,001,448,400 | 39.333333 | 122 | 0.572314 | false |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/events/event.py | 2 | 2010 | """Base class for all OpenGLContext event objects."""
class Event(object):
"""Base class for all local event objects.
This is an abstract class from which all local event objects are
derived. It defines the base API for each event type, as understood
by the event dispatch system.
Attributes:
... | mit | 2,336,772,479,516,156,000 | 36.240741 | 80 | 0.633831 | false |
austinhartzheim/gravel | api/models.py | 1 | 1489 | import os
import time
import base64
import hashlib
import datetime
from django.db import models
from django.contrib.auth.models import User
class RequestToken(models.Model):
user = models.ForeignKey(User)
token = models.CharField(max_length=64)
expires = models.DateTimeField()
@classmethod
def ... | gpl-3.0 | -909,008,443,448,060,900 | 26.574074 | 78 | 0.627938 | false |
python-dirbtuves/Misago | misago/fixtures/accountssetings.py | 3 | 5180 | from misago.utils.fixtures import load_settings_fixture, update_settings_fixture
from misago.utils.translation import ugettext_lazy as _
settings_fixture = (
# Register and Sign-In Settings
('accounts', {
'name': _("Users Accounts Settings"),
'description': _("Those settings allow you to increa... | gpl-3.0 | -1,337,304,491,035,387,100 | 46.1 | 222 | 0.390734 | false |
jdramani/599-2 | q8/metadata_score.py | 1 | 1281 | import os
import tika
from tika import parser
tika.initVM()
def get_metadata_score(metadata):
score = 0
for field in metadata.keys():
field = field.lower()
if "description" in field:
score += 1 / 3
if "title" in field or "name" in field:
score += 1 / 3
... | apache-2.0 | 3,531,654,927,642,433,000 | 28.113636 | 98 | 0.544887 | false |
Ayub-Khan/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py | 23 | 108271 | """
Test split modulestore w/o using any django stuff.
"""
from mock import patch
import datetime
from importlib import import_module
from path import Path as path
import random
import re
import unittest
import uuid
import ddt
from contracts import contract
from nose.plugins.attrib import attr
from django.core.cac... | agpl-3.0 | 3,004,183,547,988,640,300 | 46.844012 | 134 | 0.573154 | 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.