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 |
|---|---|---|---|---|---|---|---|---|---|---|
unseenlaser/python-for-android | python3-alpha/python3-src/Lib/test/test_linecache.py | 60 | 4141 | """ Tests for the linecache module """
import linecache
import unittest
import os.path
from test import support
FILENAME = linecache.__file__
INVALID_NAME = '!@$)(!@#_1'
EMPTY = ''
TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
TESTS = TESTS.split()
TEST_PATH = os.path.dirname(support.__file__)
MODULES = "li... | apache-2.0 | 1,061,221,310,709,960,200 | 30.135338 | 75 | 0.608066 | false |
partofthething/home-assistant | homeassistant/components/minio/minio_helper.py | 19 | 6523 | """Minio helper methods."""
from collections.abc import Iterable
import json
import logging
from queue import Queue
import re
import threading
import time
from typing import Iterator, List
from urllib.parse import unquote
from minio import Minio
from urllib3.exceptions import HTTPError
_LOGGER = logging.getLogger(__n... | mit | -2,285,734,473,164,289,800 | 30.210526 | 82 | 0.561092 | false |
7ing/kubernetes | cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 31 | 4256 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 | 5,406,414,411,615,785,000 | 36.663717 | 78 | 0.675282 | false |
gazpachoking/Flexget | flexget/plugins/output/download.py | 4 | 22908 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import unquote
import hashlib
import io
import logging
import mimetypes
import os
import shutil
import socket
import sys
import tempfile
fro... | mit | 4,065,167,264,209,045,500 | 38.909408 | 117 | 0.556181 | false |
eusoubrasileiro/fatiando | cookbook/gravmag_normal_gravity.py | 3 | 1882 | """
GravMag: Calculate the gravity disturbance and Bouguer anomaly for Hawaii
"""
from fatiando.gravmag import normal_gravity
from fatiando.vis import mpl
import numpy as np
import urllib
# Download the gravity and topography data
url = 'https://raw.githubusercontent.com/leouieda/geofisica1/master/data/'
urllib.urlret... | bsd-3-clause | 8,917,095,756,816,872,000 | 37.408163 | 78 | 0.705632 | false |
SUNET/SATOSA | src/satosa/backends/saml2.py | 2 | 17798 | """
A saml2 backend module for the satosa proxy
"""
import copy
import functools
import json
import logging
from base64 import urlsafe_b64encode
from urllib.parse import urlparse
from saml2.client_base import Base
from saml2.config import SPConfig
from saml2.extension.ui import NAMESPACE as UI_NAMESPACE
from saml2.met... | apache-2.0 | -5,558,705,722,460,401,000 | 40.199074 | 145 | 0.612147 | false |
crmccreary/openerp_server | openerp/addons/project/project.py | 3 | 61446 | # -*- 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 | -2,654,828,284,303,702,500 | 48.633279 | 340 | 0.567376 | false |
audip/lunr | lunr/common/lock.py | 2 | 5070 | # Copyright (c) 2011-2016 Rackspace US, 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 ... | apache-2.0 | 1,208,548,641,831,169,000 | 25.968085 | 76 | 0.566469 | false |
imcsk8/kubernetes | hack/update_owners.py | 149 | 9054 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 | -4,748,505,062,060,572,000 | 36.882845 | 120 | 0.612878 | false |
kybriainfotech/iSocioCRM | addons/crm_partner_assign/__openerp__.py | 244 | 2369 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | -4,792,252,942,377,611,000 | 39.152542 | 103 | 0.598565 | false |
chrisnatali/networkx | networkx/algorithms/tests/test_threshold.py | 4 | 6663 | #!/usr/bin/env python
"""Threshold Graphs
================
"""
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx as nx
import networkx.algorithms.threshold as nxt
from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
cnlti = nx.convert_no... | bsd-3-clause | -4,157,776,275,340,729,000 | 35.211957 | 79 | 0.580519 | false |
makinacorpus/ionyweb | ionyweb/administration/views/plugin.py | 2 | 17535 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.template import RequestContext
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from djangorestframework.response import Response, ErrorResponse
from django... | bsd-3-clause | -5,889,127,506,386,623,000 | 41.664234 | 99 | 0.501169 | false |
whummer/moto | moto/iam/responses.py | 1 | 74425 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import iam_backend, User
class IamResponse(BaseResponse):
def attach_role_policy(self):
policy_arn = self._get_param('PolicyArn')
role_name = self._get_param('RoleName')
iam_backend.attach_... | apache-2.0 | 8,506,189,469,481,606,000 | 37.205852 | 138 | 0.652146 | false |
wuwenbin2/onos_bgp_evpn | tools/test/scenarios/bin/create-flow.py | 22 | 1317 | #! /usr/bin/env python
import requests
from requests.auth import HTTPBasicAuth
import sys
if len(sys.argv) != 6:
print "usage: create-flow onos-node name device in-port out-port"
sys.exit(1)
node = sys.argv[1]
name = sys.argv[2]
device = sys.argv[3]
inPort = sys.argv[4]
outPort = sys.argv[5]
flowJsonTemp... | apache-2.0 | 8,150,495,518,616,966,000 | 22.517857 | 81 | 0.441913 | false |
anguoyang/SMQTK | python/smqtk/indexing/naive_bayes.py | 1 | 9147 | """
LICENCE
-------
Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
from . import Indexer
import cPickle
import os.path as osp
import numpy
from sklearn.naive... | bsd-3-clause | -7,521,449,847,189,371,000 | 37.594937 | 92 | 0.612223 | false |
openweave/happy | bin/happy-node-edit.py | 1 | 1893 | #!/usr/bin/env python3
#
# Copyright (c) 2021 Google LLC.
# 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/LICE... | apache-2.0 | -2,883,105,358,376,392,000 | 28.123077 | 81 | 0.611199 | false |
LEDS/millennium-falcon | millenium_falcon_old/gestao/models.py | 1 | 2775 | from __future__ import unicode_literals
from django.db import models
class Parceiro(models.Model):
#Na verdade é o Cliente com nome mais bonito
nome_parceiro = models.CharField(max_length=255)
nome_representante = models.CharField(max_length=255)
telefone = models.CharField(max_length=255)
email = ... | apache-2.0 | 5,653,396,323,496,103,000 | 35.025974 | 89 | 0.709084 | false |
rjsproxy/wagtail | wagtail/wagtailusers/views/groups.py | 11 | 4499 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.models import Group
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.views.decorators.vary import ... | bsd-3-clause | 2,178,598,698,591,185,700 | 32.827068 | 97 | 0.625028 | false |
huanghao/mic | mic/3rdparty/pykickstart/handlers/fc5.py | 10 | 1066 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2007 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. This program is distributed in the hope that it
# will be usef... | gpl-2.0 | 5,761,095,836,744,157,000 | 43.416667 | 79 | 0.772045 | false |
HugoMMRabson/fonsa | src/my/installer/copyintomaple/die.py | 1 | 1324 | #!/usr/bin/python3
'''
Created on Aug 18, 2019
@author: johnrabsonjr
'''
# potential colors are WHITE, PERIWINKLE, YELLOW, GREEN, VIOLET, BLUE, RED, BLACK
import os
from time import sleep
from atxraspisettings import *
os.system('systemctl stop atxraspihello') # Stop the shutdownirq.py script daemon
setup_gpio()... | gpl-3.0 | 8,108,408,421,022,500,000 | 34.783784 | 165 | 0.715257 | false |
olomix/django-navbar | navbar/utils.py | 3 | 2177 |
def _Qperm(user=None):
from django.db.models.query import Q
exQ = Q()
if user is None or user.is_anonymous():
exQ = (Q(user_type__exact = 'A') | Q(user_type__exact = 'E')) & Q(
groups__isnull=True)
elif user.is_superuser:
exQ = ~Q(user_type__exact = 'A')
elif user.is_sta... | mit | 2,713,013,052,791,323,000 | 37.875 | 83 | 0.579237 | false |
wooster/django-topsoil | topsoil/middleware.py | 1 | 2874 | from django.conf import settings
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import AnonymousUser
from django.utils.translation import ugettext as _
from oauth.oauth import OAuthError
from oauth_provider.decorators import CheckOAuth
from oauth_provider.utils impor... | bsd-3-clause | -3,492,830,300,303,750,000 | 42.545455 | 102 | 0.663883 | false |
timsnyder/bokeh | examples/reference/models/multi_select_server.py | 1 | 1279 | ## Bokeh server for MultiSelect
import pandas as pd
from bokeh.io import curdoc
from bokeh.layouts import row
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import MultiSelect
from bokeh.plotting import figure
x=[3,4,6,12,10,1]
y=[7,1,3,4,1,6]
label=['Red', 'Orange', 'Red', 'Orange','Red', 'Orange... | bsd-3-clause | 7,208,058,080,993,141,000 | 32.657895 | 101 | 0.702893 | false |
9929105/KEEP | keep_backend/vocab/vocab_to_mongo.py | 2 | 3250 | '''
This is a standalone script that is to be
used to load the vocab into the server's
mongo database. This only needs to be run
once, with the appropriate vocabulary on the
filesystem as a one column flat list text file.
'''
import re
import sys
import pymongo as pm
from optparse import OptionParser
'''
Thi... | mit | -4,434,208,511,232,968,700 | 30.25 | 102 | 0.677231 | false |
labase/vitollino | src/_spy/vitollino/__init__.py | 1 | 1232 | #! /usr/bin/env python
# -*- coding: UTF8 -*-
# Este arquivo é parte do programa Vittolino
# Copyright 2011-2017 Carlo Oliveira <carlo@nce.ufrj.br>,
# `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__.
#
# Vittolino é um software livre; você pode redistribuí-lo e/ou
# modificá-lo dentro dos termos da ... | gpl-3.0 | 8,361,982,584,944,868,000 | 37.870968 | 73 | 0.762656 | false |
ytaben/cyphesis | rulesets/acorn/world/objects/buildings/FarmHouse1.py | 2 | 2955 | #This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2001 Al Riddoch (See the file COPYING for details).
from cyphesis.Thing import Thing
from atlas import *
from Vector3D import Vector3D
# bbox = 8,8,2.5
# bmedian = 7.5,7.5,2.5
# offset = SW corner = -0.5,-0.5,0
class Farmhous... | gpl-2.0 | -6,498,353,729,055,440,000 | 46.66129 | 97 | 0.632487 | false |
mkrupcale/ansible | lib/ansible/modules/web_infrastructure/ejabberd_user.py | 11 | 7573 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com>
#
# 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 ... | gpl-3.0 | -8,624,252,629,437,274,000 | 32.069869 | 79 | 0.602007 | false |
erdc-cm/air-water-vv | 2d/numericalTanks/nonlinearWaves/ls_consrv_n.py | 12 | 1901 | from proteus.default_n import *
from proteus import (StepControl,
TimeIntegration,
NonlinearSolvers,
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
import ls_consrv_p as physics
from proteus import Context
ct = ... | mit | 1,320,758,513,522,598,700 | 25.774648 | 70 | 0.759074 | false |
bssthu/L5MapEditor | editor/main_window.py | 1 | 18257 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Module : main.py
# Author : bssthu
# Project : L5MapEditor
# Creation date : 2015-09-24
# Description :
#
import math
import os
import sqlite3
from PyQt5 import QtWidgets
from PyQt5.QtCore import pyqtSlot, Qt, QObject
from PyQt5.QtGui import QCur... | lgpl-3.0 | -183,757,946,792,789,000 | 35.36875 | 100 | 0.593515 | false |
neechbear/ansible | roles/zabbix-agent/library/zabbix_host2.py | 1 | 18982 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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
# (... | bsd-3-clause | 2,014,225,572,630,204,200 | 38.545833 | 177 | 0.590928 | false |
Changaco/oh-mainline | vendor/packages/twisted/twisted/runner/topfiles/setup.py | 48 | 1292 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
try:
from twisted.python.dist import setup, ConditionalExtension as Extension
except ImportError:
raise SystemExit("twisted.python.dist module not found. Make sure you "
"have installed the Twisted core package before... | agpl-3.0 | -6,715,053,716,431,560,000 | 35.914286 | 79 | 0.650155 | false |
j0gurt/ggrc-core | src/ggrc_workflows/service_specs/steps/factories.py | 7 | 2339 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from behave import given
from factory.fuzzy import FuzzyChoice
import tests.ggrc.behave.factories as factories
from ggrc import models
from ggrc_workflows.models import (
Workflow, TaskGroup,
Work... | apache-2.0 | -3,031,759,561,034,017,300 | 28.2375 | 78 | 0.819581 | false |
dmitriy-serdyuk/fuel | fuel/converters/mnist.py | 18 | 6073 | import gzip
import os
import struct
import h5py
import numpy
from fuel.converters.base import fill_hdf5_file, check_exists
MNIST_IMAGE_MAGIC = 2051
MNIST_LABEL_MAGIC = 2049
TRAIN_IMAGES = 'train-images-idx3-ubyte.gz'
TRAIN_LABELS = 'train-labels-idx1-ubyte.gz'
TEST_IMAGES = 't10k-images-idx3-ubyte.gz'
TEST_LABELS =... | mit | 7,364,431,629,561,683,000 | 32.185792 | 75 | 0.641034 | false |
alanjw/GreenOpenERP-Win-X86 | python/Lib/bsddb/test/test_fileid.py | 7 | 1891 | """TestCase for reseting File ID.
"""
import os
import shutil
import unittest
from test_all import db, test_support, get_new_environment_path, get_new_database_path
class FileidResetTestCase(unittest.TestCase):
def setUp(self):
self.db_path_1 = get_new_database_path()
self.db_path_2 =... | agpl-3.0 | -7,372,049,874,196,722,000 | 29 | 89 | 0.592808 | false |
Mafarricos/Mafarricos-modded-xbmc-addons | plugin.video.streamajoker/resources/site-packages/bs4/element.py | 438 | 61538 | import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@property
def alias... | gpl-2.0 | 6,052,050,034,346,847,000 | 37.198634 | 113 | 0.558939 | false |
ybdesire/apk_sdk_analysis | common/Androguard-2.0/tests/test_sign.py | 23 | 2170 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | gpl-3.0 | -4,293,607,425,360,213,000 | 39.185185 | 108 | 0.708756 | false |
rreimann/electron | script/upload-node-headers.py | 12 | 2019 | #!/usr/bin/env python
import argparse
import glob
import os
import shutil
import sys
from lib.config import PLATFORM, get_target_arch, s3_config
from lib.util import safe_mkdir, scoped_cwd, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist'... | mit | 8,495,122,263,236,470,000 | 30.546875 | 76 | 0.643883 | false |
fkorotkov/pants | src/python/pants/reporting/report.py | 17 | 4044 | # 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 threading
imp... | apache-2.0 | -3,886,782,184,865,251,300 | 29.179104 | 96 | 0.66271 | false |
FDio/vpp | test/test_arping.py | 2 | 8702 | from scapy.layers.l2 import ARP
from scapy.layers.inet6 import ICMPv6ND_NS, ICMPv6ND_NA, IPv6
from framework import VppTestCase
""" TestArping is a subclass of VPPTestCase classes.
Basic test for sanity check of arping.
"""
class TestArping(VppTestCase):
""" Arping Test Case """
@classmethod
def set... | apache-2.0 | -7,294,436,567,894,238,000 | 33.669323 | 75 | 0.504137 | false |
OaklandPeters/dist-map-reduce | endgame/indexes/shared.py | 1 | 2001 | from __future__ import absolute_import
import os
import json
import collections
import itertools
__all__ = [
'dirpath_to_confpath',
'confpath_to_dirpath',
'directory_to_config'
]
def dirpath_to_confpath(dirpath):
if dirpath[-1] == os.sep:
confpath = dirpath[:-1] + ".json"
else:
co... | mit | -8,796,803,960,878,455,000 | 27.197183 | 88 | 0.649175 | false |
shapiromatron/tblBuilder | src/private/scripts/reports/epi/ResultTable.py | 1 | 4586 | from textwrap import dedent
from docxUtils.reports import DOCXReport
from docxUtils.tables import TableMaker
class EpiResultTables(DOCXReport):
COLUMN_WIDTHS = [1.0, 1.7, 0.75, 0.75, 1.0, 1.2, 2.6]
def _build_result(self, res):
rows = 0
tbl = TableMaker(
self.COLUMN_WIDTHS, num... | mit | -6,234,415,254,715,766,000 | 32.474453 | 86 | 0.523768 | false |
pgmillon/ansible | lib/ansible/modules/cloud/google/gcp_compute_region_disk.py | 2 | 22530 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 | -2,764,237,630,027,040,000 | 35.873977 | 156 | 0.664936 | false |
sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/tokenize/toktok.py | 7 | 8031 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Python port of the tok-tok.pl tokenizer.
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Jon Dehdari
# Contributors: Liling Tan, Selcuk Ayguney, ikegami, Martijn Pieters
#
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
"""
The tok-... | mit | -3,743,298,247,724,550,700 | 50.483871 | 172 | 0.584033 | false |
olemis/brython | www/src/Lib/test/test_importlib/extension/test_finder.py | 26 | 1223 | from importlib import machinery
from .. import abc
from . import util
import unittest
class FinderTests(abc.FinderTests):
"""Test the finder for extension modules."""
def find_module(self, fullname):
importer = machinery.FileFinder(util.PATH,
(machinery.Extens... | bsd-3-clause | -8,619,705,632,392,975,000 | 25.586957 | 71 | 0.619787 | false |
Limags/MissionPlanner | Lib/site-packages/scipy/linalg/basic.py | 53 | 17691 | #
# Author: Pearu Peterson, March 2002
#
# w/ additions by Travis Oliphant, March 2002
__all__ = ['solve', 'solve_triangular', 'solveh_banded', 'solve_banded',
'inv', 'det', 'lstsq', 'pinv', 'pinv2']
from numpy import asarray, zeros, sum, conjugate, dot, transpose, \
asarray_chkfinite, single
imp... | gpl-3.0 | -235,574,555,175,603,400 | 31.282847 | 93 | 0.557628 | false |
activitycentral/ebookreader | src/overlaywidget.py | 1 | 1061 | from gi.repository import Gtk
from gi.repository import Gdk
from sugar3.graphics.icon import Icon
class OverlayWidget(Gtk.Window):
def __init__(self, widget_to_overlay):
Gtk.Window.__init__(self)
self._box = Gtk.VBox()
self._widget_to_overlay = widget_to_overlay
self.set_decorate... | gpl-2.0 | 2,324,138,393,370,847,000 | 23.113636 | 72 | 0.595664 | false |
Maistho/CouchPotatoServer | libs/rsa/pkcs1.py | 110 | 13153 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 | -7,779,271,901,157,771,000 | 32.809769 | 97 | 0.644921 | false |
bartvm/pylearn2 | pylearn2/sandbox/rnn/costs/tests/test_gradient_clipping.py | 44 | 1513 | """
Unit tests for the gradient clipping cost
"""
import unittest
import numpy as np
from theano import function
from pylearn2.costs.mlp import Default
from pylearn2.models.mlp import MLP, Linear
from pylearn2.sandbox.rnn.costs.gradient_clipping import GradientClipping
class TestGradientClipping(unittest.TestCase):... | bsd-3-clause | -1,990,803,378,583,373,000 | 29.26 | 78 | 0.592201 | false |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Mac/Modules/cf/cfsupport.py | 35 | 26266 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
#error missing SetActionFilter
import... | mit | -5,219,492,836,018,192,000 | 38.438438 | 169 | 0.692987 | false |
drpngx/tensorflow | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | 12 | 22234 | # 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 | -1,857,121,471,236,700,400 | 37.334483 | 118 | 0.672124 | false |
ingadhoc/openerp-travel | travel_rental_car/travel_rental_car.py | 2 | 3163 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 | -5,668,648,254,516,096,000 | 40.077922 | 79 | 0.534303 | false |
jgmize/bedrock | lib/l10n_utils/management/commands/l10n_extract.py | 11 | 7162 | # 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/.
import os
from textwrap import dedent
from django.conf import settings
from django.core.management import call_command
... | mpl-2.0 | -4,840,215,133,305,055,000 | 40.398844 | 80 | 0.59704 | false |
Andrew-McNab-UK/DIRAC | ResourceStatusSystem/PolicySystem/Actions/BaseAction.py | 4 | 1493 | # $HeadURL: $
''' BaseAction
Base class for Actions.
'''
from DIRAC import gLogger
__RCSID__ = '$Id: $'
class BaseAction( object ):
'''
Base class for all actions. It defines a constructor an a run main method.
'''
def __init__( self, name, decisionParams, enforcementResult, singlePolicyResults, cl... | gpl-3.0 | 3,157,440,614,549,836,300 | 26.648148 | 94 | 0.544541 | false |
kuiwei/edx-platform | common/test/acceptance/performance/test_lms_performance.py | 62 | 4375 | """
Single page performance tests for LMS.
"""
from bok_choy.web_app_test import WebAppTest, with_cache
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.dashboard import DashboardPage
from ..pages.lms.course_info import CourseInfoPage
from ..pages.lms.log... | agpl-3.0 | 6,211,259,696,951,714,000 | 37.377193 | 110 | 0.629943 | false |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/beanstalk/layer1.py | 7 | 56243 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-3.0 | 6,011,695,317,854,797,000 | 45.830142 | 97 | 0.641573 | false |
bsmr-misc-forks/letsencrypt | certbot-apache/certbot_apache/tests/obj_test.py | 11 | 5342 | """Tests for certbot_apache.obj."""
import unittest
class VirtualHostTest(unittest.TestCase):
"""Test the VirtualHost class."""
def setUp(self):
from certbot_apache.obj import Addr
from certbot_apache.obj import VirtualHost
self.addr1 = Addr.fromstring("127.0.0.1")
self.addr2... | apache-2.0 | 3,736,118,856,041,064,000 | 37.157143 | 91 | 0.627855 | false |
gbaty/pyside2 | tests/QtWidgets/qabstracttextdocumentlayout_test.py | 3 | 1258 | import unittest
import py3kcompat as py3k
from PySide2.QtCore import QSizeF, QTimer
from PySide2.QtGui import QTextFormat, QTextCharFormat, QPyTextObject
from PySide2.QtWidgets import QTextEdit
from helper import UsesQApplication
class Foo(QPyTextObject):
called = False
def intrinsicSize(self, doc, posInDocu... | lgpl-2.1 | 2,886,299,942,025,083,000 | 25.765957 | 120 | 0.697138 | false |
kokogaga/arducopter | mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py | 215 | 9526 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code... | gpl-3.0 | 3,757,402,372,455,354,000 | 37.104 | 242 | 0.660403 | false |
wangzhe0417/shadowsocks | utils/autoban.py | 22 | 2086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# 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 u... | mit | -5,559,736,389,618,015,000 | 39.901961 | 79 | 0.649089 | false |
wangyum/tensorflow | tensorflow/contrib/sparsemax/python/kernel_tests/sparsemax_loss_test.py | 36 | 8009 | # 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 | -8,964,060,297,548,343,000 | 34.754464 | 80 | 0.632663 | false |
burakbayramli/quant_at | data/simple.py | 1 | 7677 | from pymongo import MongoClient
import logging, Quandl, random, os
import datetime, glob, pandas as pd
from pandas_datareader import data, wb
import numpy as np, sys
from memo import *
MONGO_STAT = "C:\\Progra~1\\MongoDB\\Server\\3.2\\bin\\mongostat.exe /rowcount:1"
@memo # so that we dont constantly read the .quand... | gpl-3.0 | -2,716,200,956,057,216,500 | 34.054795 | 133 | 0.541618 | false |
40223142/2015cad0623 | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_result.py | 788 | 19069 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... | gpl-3.0 | -5,831,061,583,145,449,000 | 32.572183 | 94 | 0.60816 | false |
rossjones/ScraperWikiX | web/frontend/migrations/0014_add_message.py | 2 | 7348 |
from south.db import db
from django.db import models
from frontend.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Message'
db.create_table('frontend_message', (
('id', orm['frontend.message:id']),
('text', orm['frontend.message:text'... | agpl-3.0 | -4,826,512,290,525,118,000 | 67.672897 | 174 | 0.544366 | false |
rarbg/ZeroNet | src/lib/geventwebsocket/resource.py | 21 | 1865 | import re
from .protocols.base import BaseProtocol
from .exceptions import WebSocketError
class WebSocketApplication(object):
protocol_class = BaseProtocol
def __init__(self, ws):
self.protocol = self.protocol_class(self)
self.ws = ws
def handle(self):
self.protocol.on_open()
... | gpl-2.0 | -1,222,167,107,170,577,400 | 24.202703 | 61 | 0.566756 | false |
Mirdrack/4chanscrapper | lib/python2.7/site-packages/setuptools/archive_util.py | 409 | 6601 | """Utilities for extracting common archive formats"""
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",
"UnrecognizedFormat", "extraction_drivers", "unpack_directory",
]
import zipfile, tarfile, os, shutil, posixpath
from pkg_resources import ensure_directory
from distutils.... | mit | -1,108,851,942,571,551,900 | 30.433333 | 91 | 0.593698 | false |
jjlee3/openthread | tests/scripts/thread-cert/ipv6.py | 5 | 35645 | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# 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 above copyright
# not... | bsd-3-clause | 3,207,308,108,372,481,500 | 30.049652 | 138 | 0.596044 | false |
wgwoods/lorax | src/pylorax/api/bisect.py | 2 | 1682 | #
# Copyright (C) 2018 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 i... | gpl-2.0 | -3,630,619,490,488,201,700 | 33.326531 | 72 | 0.668847 | false |
stackforge/monasca-api | monasca_api/tests/test_alarms.py | 1 | 94731 | # -*- coding: utf-8 -*-
# Copyright 2015 Cray Inc.
# (C) Copyright 2015,2017 Hewlett Packard Enterprise Development LP
# Copyright 2016-2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of t... | apache-2.0 | 6,726,417,622,426,602,000 | 44.23327 | 100 | 0.501141 | false |
Cedev/a10-neutron-lbaas | a10_neutron_lbaas/db/migration/alembic_migrations/versions/2a280aba7701_create_orchestration.py | 4 | 2753 | # 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
# d... | apache-2.0 | 8,301,221,216,927,320,000 | 37.236111 | 78 | 0.658918 | false |
bealdav/OpenUpgrade | addons/project/res_config.py | 34 | 4484 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 | -125,987,516,927,427,020 | 57.233766 | 131 | 0.643176 | false |
apyrgio/ganeti | lib/rapi/client_utils.py | 3 | 3149 | #
#
# Copyright (C) 2010 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | bsd-2-clause | -8,132,536,413,171,266,000 | 28.429907 | 76 | 0.702445 | false |
eyalfa/spark | python/pyspark/java_gateway.py | 6 | 7460 | #
# 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,617,165,365,728,913,400 | 42.882353 | 100 | 0.653887 | false |
elijah513/ice | csharp/test/Ice/enums/run.py | 9 | 1064 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 | -4,659,555,647,704,027,000 | 37 | 103 | 0.574248 | false |
atlashealth/ansible-modules-extras | cloud/lxc/lxc_container.py | 3 | 54951 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 | 8,947,162,173,079,785,000 | 30.966841 | 79 | 0.545814 | false |
sgml/popcorn_maker | vendor-local/lib/python/debug_toolbar/utils/sqlparse/lexer.py | 12 | 12456 | # -*- coding: utf-8 -*-
# Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""SQL Lexer"""
# This code is based on the SqlLexer in pygments.
# http://pygments.org/
# It's s... | bsd-3-clause | -1,397,337,605,464,588,800 | 36.616314 | 77 | 0.471528 | false |
richm/designate | designate/openstack/common/systemd.py | 1 | 3061 | # Copyright 2012-2014 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... | apache-2.0 | 8,341,662,083,653,353,000 | 28.432692 | 78 | 0.638353 | false |
siddharths067/HuHubaProject | lib/chardet/mbcsgroupprober.py | 343 | 2012 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit | -2,178,346,903,148,681,700 | 36.259259 | 70 | 0.689364 | false |
diogommartins/ryu | ryu/hooks.py | 43 | 2575 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://... | apache-2.0 | -5,769,537,061,037,428,000 | 34.763889 | 75 | 0.703689 | false |
zimmerman-zimmerman/OIPA | OIPA/iati/management/commands/set_searchable_activities.py | 2 | 1970 | from django.conf import settings
from django.core.management.base import BaseCommand
from iati.models import Activity
from iati.transaction.models import Transaction
class Command(BaseCommand):
def update_searchable_activities(self):
"""
Set all activities to searchable if the reporting org is i... | agpl-3.0 | 1,210,355,010,073,460,700 | 32.965517 | 79 | 0.645178 | false |
jotes/ansible | v2/ansible/plugins/action/fail.py | 16 | 1140 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... | gpl-3.0 | -8,751,845,188,212,194,000 | 33.545455 | 70 | 0.711404 | false |
webjunkie/python-social-auth | social/backends/github_enterprise.py | 53 | 1330 | """
Github Enterprise OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/github_enterprise.html
"""
from six.moves.urllib.parse import urljoin
from social.utils import append_slash
from social.backends.github import GithubOAuth2, GithubOrganizationOAuth2, \
GithubTeamOAuth2
class GithubEnter... | bsd-3-clause | -8,843,889,233,986,437,000 | 30.666667 | 76 | 0.717293 | false |
jdavisp3/TigerShark | tigershark/tools/surveyPyX12.py | 2 | 1592 | #!/usr/bin/env python
"""Survey PyX12 Segment Definitions.
Read ALL pyx12 message definitions, accumulate all Segment definitions.
"""
from __future__ import print_function
import xml.dom.minidom as DOM
import os, glob
segmentTypes= {}
segmentUse= {}
def getDef( aFile ):
"""Get the Segment Definitions from an XM... | bsd-3-clause | 4,362,793,367,533,122,600 | 32.87234 | 76 | 0.588568 | false |
ThiefMaster/indico | indico/util/json.py | 4 | 1603 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from collections import UserDict
from datetime import date, datetime
from speaklater import _LazyString
... | mit | -7,501,291,205,235,424,000 | 27.122807 | 86 | 0.612601 | false |
h3llrais3r/SickRage | lib/sqlalchemy/dialects/drizzle/mysqldb.py | 154 | 1270 | """
.. dialect:: drizzle+mysqldb
:name: MySQL-Python
:dbapi: mysqldb
:connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
:url: http://sourceforge.net/projects/mysql-python
"""
from sqlalchemy.dialects.drizzle.base import (
DrizzleDialect,
DrizzleExecutionContext,
... | gpl-3.0 | 6,924,218,553,018,723,000 | 25.458333 | 80 | 0.713386 | false |
dvliman/jaikuengine | .google_appengine/lib/django-1.3/django/core/management/commands/runserver.py | 158 | 5632 | from optparse import make_option
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException
from django.utils import autoreload
nai... | apache-2.0 | 22,242,666,567,532,124 | 39.811594 | 90 | 0.572976 | false |
WarmongeR1/pyvideo.ru | proposal/parsers.py | 2 | 6473 | # coding: utf-8
import re
from django.core.serializers import SerializerDoesNotExist
from django.conf import settings
from rest_framework.settings import api_settings
from richard.videos.models import Category
from .serializers import CategorySerializer, VideoSerializer
from .utils import force_path
from .exceptions ... | bsd-3-clause | 422,308,131,745,253,000 | 35.778409 | 114 | 0.606365 | false |
cloudbase/nova-virtualbox | nova/virt/configdrive.py | 2 | 6568 | # Copyright 2012 Michael Still and Canonical Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 | -11,050,023,819,671,520 | 34.122995 | 78 | 0.556486 | false |
YarnSeemannsgarn/pyshorteners | pyshorteners/shorteners/readability.py | 1 | 1691 | # encoding: utf-8
"""
Readbility url shortner api implementation
Located at: https://readability.com/developers/api/shortener
Doesnt' need anything from the app
"""
from .base import BaseShortener
from ..exceptions import ShorteningErrorException, ExpandingErrorException
class ReadabilityShortener(BaseShortener):
... | mit | -2,453,184,003,707,161,000 | 40.243902 | 78 | 0.532229 | false |
jumpojoy/neutron | neutron/tests/functional/cmd/test_netns_cleanup.py | 52 | 2634 | # Copyright (c) 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 | -919,154,765,469,178,400 | 38.909091 | 78 | 0.703493 | false |
prometheanfire/portage | pym/portage/util/_eventloop/PollSelectAdapter.py | 4 | 1908 | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from .PollConstants import PollConstants
import select
class PollSelectAdapter(object):
"""
Use select to emulate a poll object, for
systems that don't support poll().
"""
def __init__(self):
self._regi... | gpl-2.0 | -4,619,254,813,475,953,000 | 24.783784 | 66 | 0.589099 | false |
sdecoder/CMDS-HDFS | common/contrib/hod/hodlib/GridServices/mapred.py | 182 | 8167 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 | 5,463,127,910,138,170,000 | 29.025735 | 85 | 0.657157 | false |
pedropva/AIprojects | sources/Main.py | 1 | 6236 | import os
from Node import Node
from Search import Search
from Data import Data
from Utils import Utils
cities = Data.cities()
situations = Data.cfg()
def Main():
option = 0
option1 = 0
start = None
finisht = None
while True:
os.system('cls')
if(option == 0):
option=0
... | gpl-3.0 | -7,550,451,735,646,712,000 | 39.764706 | 192 | 0.439224 | false |
mscelnik/exercises | exercises/random_list.py | 1 | 2865 | """ Python training exercise
Random list
Below is a list of random numbers between 0 and 100. Using built-in funcions
and the list sub-functions, can you?:
(a) Sort the list?
HINT: Use the sorted() built-in function.
(b) What are the smallest and largest numbers?
HINT: There are two ways to do t... | gpl-3.0 | -5,797,117,732,401,037,000 | 33.8125 | 80 | 0.589878 | false |
ridfrustum/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/custom_columns_regress/tests.py | 91 | 2919 | from django.test import TestCase
from django.core.exceptions import FieldError
from models import Author, Article
def pks(objects):
""" Return pks to be able to compare lists"""
return [o.pk for o in objects]
class CustomColumnRegression(TestCase):
def assertRaisesMessage(self, exc, msg, func, *args, **... | gpl-3.0 | -370,435,799,108,982,000 | 33.75 | 129 | 0.592669 | false |
lowiki-org/localwiki-backend-server | localwiki/pages/fields.py | 3 | 3448 | from django import forms
from django.utils.translation import ugettext_lazy as _
from ckeditor.models import HTML5FragmentField
class WikiHTMLField(HTML5FragmentField):
allowed_elements = [
'p', 'br', 'a', 'em', 'strong', 'u', 'img', 'h1', 'h2', 'h3',
'h4', 'h5', 'h6', 'hr', 'ul', 'ol', 'li', 'p... | gpl-2.0 | 2,657,964,547,923,429,400 | 33.138614 | 81 | 0.535093 | false |
Jusedawg/SickRage | lib/tmdb_api/test_tmdb_api.py | 52 | 5468 | """
test.py contains unit tests for tmdbsimple.py
Fill in Global Variables below before running tests.
Created by Celia Oakley on 2013-11-05
"""
import unittest
import sys
from tmdb_api import TMDB
#
# Global Variables (fill in or put in keys.py)
#
TMDB_API_KEY = 'edc5f123313769de83a71e157758030b'
try:
from k... | gpl-3.0 | -2,301,955,426,940,610,300 | 28.879781 | 73 | 0.600402 | false |
angelman/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/filters/webkit_extras.py | 121 | 2830 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-3-clause | 7,476,411,747,161,653,000 | 36.733333 | 146 | 0.740989 | false |
UITools/saleor | saleor/order/migrations/0045_auto_20180329_0142.py | 1 | 1425 | # Generated by Django 2.0.3 on 2018-03-29 06:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_prices.models
class Migration(migrations.Migration):
dependencies = [
('product', '0054_merge_20180320_1108'),
('order', '0044_... | bsd-3-clause | -1,244,785,552,744,516,900 | 31.386364 | 152 | 0.599298 | false |
maxsocl/django | django/db/backends/mysql/operations.py | 26 | 7908 | from __future__ import unicode_literals
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import six, timezone
from django.utils.encoding import force_text
class DatabaseOperations(BaseDatabaseOperations):
compiler_module = "djan... | bsd-3-clause | 3,610,785,483,899,464,000 | 38.54 | 113 | 0.586748 | false |
apache/incubator-airflow | tests/providers/amazon/aws/operators/test_emr_terminate_job_flow.py | 10 | 1847 | #
# 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... | apache-2.0 | -3,932,947,647,206,544,400 | 40.044444 | 101 | 0.730374 | 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.