repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
HoracioAlvarado/fwd | refs/heads/master | venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | 198 | from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
... |
funbaker/astropy | refs/heads/master | astropy/modeling/tests/example_models.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Here are all the test parameters and values for the each
`~astropy.modeling.FittableModel` defined. There is a dictionary for 1D and a
dictionary for 2D models.
Explanation of keywords of the dictionaries:
"parameters" : list or dict
Model parame... |
samuelstjean/dipy | refs/heads/master | dipy/reconst/shore.py | 1 | from __future__ import division
from warnings import warn
from math import factorial
import numpy as np
from scipy.special import genlaguerre, gamma, hyp2f1
from .cache import Cache
from .multi_voxel import multi_voxel_fit
from .shm import real_sph_harm
from ..core.geometry import cart2sphere
from ..utils.optpkg i... |
johnhaddon/OpenShadingLanguage | refs/heads/master | testsuite/texture-interp/run.py | 78 | #!/usr/bin/env python
command += testshade("-g 256 256 --center -od uint8 -o Cout out.tif test")
outputs = [ "out.txt", "out.tif" ]
|
indexofire/gravoicy | refs/heads/master | gravoicy/apps/content_ext/chart/__init__.py | 1 | """
Implement Charts Content Type into Feincms
"""
__version__ = ['0', '0', '1', 'alpha']
|
MridulS/sympy | refs/heads/master | sympy/combinatorics/tensor_can.py | 20 | from __future__ import print_function, division
from sympy.combinatorics.permutations import Permutation, _af_rmul, _af_rmuln,\
_af_invert, _af_new
from sympy.combinatorics.perm_groups import PermutationGroup, _orbit, \
_orbit_transversal
from sympy.combinatorics.util import _distribute_gens_by_base, \
_or... |
rajrakeshdr/pychess | refs/heads/master | lib/pychess/Utils/lutils/TranspositionTable.py | 20 | from pychess.Utils.const import hashfALPHA, hashfBETA, hashfEXACT, hashfBAD
from pychess.Utils.lutils.ldata import MATE_VALUE, MAXPLY
from ctypes import create_string_buffer, memset
from struct import Struct, pack_into, unpack_from
# Store hash entries in buckets of 4. An entry consists of:
# key 32 bits deriv... |
glenn124f/treeherder | refs/heads/master | treeherder/autoclassify/management/commands/autoclassify.py | 2 | import logging
from collections import defaultdict
from django.core.management.base import (BaseCommand,
CommandError)
from django.db.utils import IntegrityError
from treeherder.model.derived import JobsModel
from treeherder.model.models import (FailureLine,
... |
duydb2/ZTC | refs/heads/master | atc/django-atc-profile-storage/atc_profile_storage/views2.py | 17 | #
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
#
from django.http impor... |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_importlib/source/__init__.py | 538 | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
|
jaredsburrows/cs-interview-questions | refs/heads/master | python/src/main/python/projecteuler/problem17.py | 1 | #!/usr/bin/python
"""
Number letter counts
https://projecteuler.net/problem=17
"""
units = ["", "one", "two", "three", "four", "five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen"]
tens = ["", "", "twenty"... |
rjhunter8285/nsc-cloudproject-s22016 | refs/heads/master | api/FlaskApp/FlaskApp/python_modules/flask/ext/__init__.py | 853 | # -*- coding: utf-8 -*-
"""
flask.ext
~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import bar`` i... |
Pulgama/supriya | refs/heads/master | tests/test_live_Direct_build_synthdef.py | 1 | import uqbar.strings
import supriya.live
def test_build_synthdef_01():
synthdef = supriya.live.Direct.build_synthdef(2, 2, [(0, 0), (1, 1)])
assert (
str(synthdef)
== uqbar.strings.normalize(
"""
synthdef:
name: mixer/direct/0:0,1:1
ugens:
... |
erigones/esdc-ce | refs/heads/master | gui/dc/image/forms.py | 1 | from django import forms
from django.utils.translation import ugettext_lazy as _
from api.dc.image.views import dc_image
from api.image.base.views import image_manage
from api.vm.utils import get_owners
from gui.forms import SerializerForm
from gui.fields import TagField
from gui.widgets import TagWidget
from vms.mode... |
prakritish/ansible | refs/heads/devel | lib/ansible/executor/task_executor.py | 5 | # (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... |
emidln/pixie | refs/heads/master | pixie/vm/compiler.py | 7 | from pixie.vm.object import affirm
from pixie.vm.primitives import nil, true, Bool
from pixie.vm.persistent_vector import EMPTY, PersistentVector
from pixie.vm.persistent_hash_set import PersistentHashSet
import pixie.vm.numbers as numbers
import pixie.vm.symbol as symbol
import pixie.vm.code as code
from pixie.vm.keyw... |
hzlf/django-guardian | refs/heads/master | guardian/backends.py | 34 | from __future__ import unicode_literals
from django.db import models
from guardian.compat import get_user_model
from guardian.conf import settings
from guardian.exceptions import WrongAppError
from guardian.core import ObjectPermissionChecker
class ObjectPermissionBackend(object):
supports_object_permissions = T... |
waheedahmed/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/__init__.py | 62 | # pylint: disable=wildcard-import
"All view functions for contentstore, broken out into submodules"
# Disable warnings about import from wildcard
# All files below declare exports with __all__
from .assets import *
from .component import *
from .course import *
from .entrance_exam import *
from .error import *
from .... |
conda/conda-ui | refs/heads/master | conda_ui/views.py | 2 | from __future__ import print_function, division, absolute_import
import re
import sys
import json
from io import StringIO
from os.path import isfile
from six import string_types
from flask import render_template, jsonify, redirect, abort, request, url_for
from . import blueprint
@blueprint.route('/')
def index_view... |
tinybearc/sdkbox-vungle-sample | refs/heads/master | js/frameworks/cocos2d-x/download-deps.py | 67 | #!/usr/bin/env python
#coding=utf-8
#
# ./download-deps.py
#
# Downloads Cocos2D-x 3rd party dependencies from github:
# https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin) and extracts the zip
# file
#
# Having the dependencies outside the official cocos2d-x repo helps prevent
# bloating the repo.
#
"""*********... |
40thoughts/Coin-QualCoin | refs/heads/master | qa/rpc-tests/test_framework/auxpow.py | 4 | #!/usr/bin/env python
# Copyright (c) 2014 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# General code for auxpow testing. This includes routines to
# solve an auxpow and to generate auxpow blocks.
import binasci... |
Yelp/love | refs/heads/master | testing/__init__.py | 12133432 | |
guettli/django | refs/heads/master | tests/logging_tests/__init__.py | 12133432 | |
jbl2024/django_sample_env | refs/heads/master | sample_project/__init__.py | 12133432 | |
saurabh6790/omnisys-app | refs/heads/master | patches/october_2012/__init__.py | 12133432 | |
myerpengine/odoo | refs/heads/master | addons/payment/models/payment_acquirer.py | 39 | # -*- coding: utf-'8' "-*-"
import logging
from openerp.osv import osv, fields
from openerp.tools import float_round, float_repr
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
def _partner_format_address(address1=False, address2=False):
return ' '.join((address1 or '', address2 or ... |
mlperf/training_results_v0.6 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/tests/python/relay/test_op_level5.py | 1 | """ Support level5 operator test cases.
"""
import tvm
from tvm import relay
def test_resize_infer_type():
ib = relay.ir_builder.IRBuilder()
n, c, h, w = tvm.var("n"), tvm.var("c"), tvm.var("h"), tvm.var("w")
x = ib.param("x", relay.ty.TensorType((n, c, h, w), "int8"))
th, tw = tvm.var("th"), tvm.var("... |
wdbm/shijian | refs/heads/master | shijian_examples_language.py | 1 | #!/usr/bin/env python
"""
################################################################################
# #
# shijian_examples_language #
# ... |
tictakk/servo | refs/heads/ticbranch | tests/wpt/css-tests/tools/pytest/_pytest/terminal.py | 176 | """ terminal reporting of the full testing process.
This is a good source for looking at the various reporting hooks.
"""
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, \
EXIT_USAGEERROR, EXIT_NOTESTSCOLLECTED
import pytest
import py
import sys
import time
import platform
import _pytest._pl... |
iguzu/gae-django | refs/heads/master | django/utils/html.py | 116 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... |
SummitKwan/python-neo | refs/heads/master | neo/test/coretest/test_block.py | 6 | # -*- coding: utf-8 -*-
"""
Tests of the neo.core.block.Block class
"""
# needed for python 3 compatibility
from __future__ import absolute_import, division, print_function
from datetime import datetime
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np
try:
from I... |
johankaito/fufuka | refs/heads/master | microblog/old-flask/venv/lib/python2.7/site-packages/kazoo/protocol/states.py | 50 | """Kazoo State and Event objects"""
from collections import namedtuple
class KazooState(object):
"""High level connection state values
States inspired by Netflix Curator.
.. attribute:: SUSPENDED
The connection has been lost but may be recovered. We should
operate in a "safe mode" until... |
akissa/baruwa2 | refs/heads/master | baruwa/lib/audit/msgs/status.py | 1 | # -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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 S... |
ARL-UTEP-OC/ecel | refs/heads/master | plugins/collectors/tshark/__init__.py | 12133432 | |
shrinidhi666/rbhus | refs/heads/experimental | rbhusUI/lib/loadingMod.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'loadingMod.ui'
#
# Created: Sun Nov 2 19:21:09 2014
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/resolve/QualifiedVar.py | 83 | class Foo:
bar = 0
Foo().<ref>bar
|
zhaoluxyz/Hugula | refs/heads/master | Client/tools/site-packages/xlwt/Cell.py | 87 | # -*- coding: windows-1252 -*-
from struct import unpack, pack
import BIFFRecords
class StrCell(object):
__slots__ = ["rowx", "colx", "xf_idx", "sst_idx"]
def __init__(self, rowx, colx, xf_idx, sst_idx):
self.rowx = rowx
self.colx = colx
self.xf_idx = xf_idx
self.sst_idx = sst... |
jbrains/trivia | refs/heads/master | python2/trivia.py | 24 | #!/usr/bin/env python
class Game:
def __init__(self):
self.players = []
self.places = [0] * 6
self.purses = [0] * 6
self.in_penalty_box = [0] * 6
self.pop_questions = []
self.science_questions = []
self.sports_questions = []
self.rock_questio... |
Xeralux/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/io_ops_test.py | 23 | # -*- coding: utf-8 -*-
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
pando85/gourmet | refs/heads/master | gourmet/importers/html_importer.py | 6 | import urllib, re, tempfile, os.path
import importer
import BeautifulSoup
import socket
from gourmet.gdebug import debug
from gettext import gettext as _
import traceback
DEFAULT_SOCKET_TIMEOUT=45.0
URLOPEN_SOCKET_TIMEOUT=15.0
socket.setdefaulttimeout(DEFAULT_SOCKET_TIMEOUT)
# To add additional HTML import sites, see... |
playm2mboy/edx-platform | refs/heads/master | common/lib/sandbox-packages/verifiers/tests_draganddrop.py | 173 | import unittest
import draganddrop
from .draganddrop import PositionsCompare
import json
class Test_PositionsCompare(unittest.TestCase):
""" describe"""
def test_nested_list_and_list1(self):
self.assertEqual(PositionsCompare([[1, 2], 40]), PositionsCompare([1, 3]))
def test_nested_list_and_list... |
fangxingli/hue | refs/heads/master | desktop/libs/libzookeeper/src/libzookeeper/models.py | 6 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
kensonman/IMCSmartHome | refs/heads/master | appliance/appliance/views.py | 1 | from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone as tz
import logging
import uuid
import requests
import json
FMT='%Y-%m-%dT%H:%M:%S%z'
@csrf_exempt
def command(req):
'''
Executing the command that this ap... |
jneight/django-mailchimp | refs/heads/master | mailchimp/settings.py | 1 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from mailchimp.exceptions import MailchimpWarning
import warnings
API_KEY = getattr(settings, 'MAILCHIMP_API_KEY', None)
if API_KEY is None:
raise ImproperlyConfigured('django-mailchimp requires the MAILCHIMP_API_KEY setting')... |
snakeleon/YouCompleteMe-x64 | refs/heads/master | third_party/ycmd/ycmd/tests/go/go_completer_test.py | 4 | # Copyright (C) 2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... |
mavit/ansible-modules-extras | refs/heads/devel | notification/pushbullet.py | 61 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
xocolatl/pgbarman | refs/heads/master | tests/test_hooks.py | 1 | # Copyright (C) 2013-2015 2ndQuadrant Italia (Devise.IT S.r.L.)
#
# This file is part of Barman.
#
# Barman 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... |
matiasb/django | refs/heads/master | django/conf/locale/sq/__init__.py | 12133432 | |
atzm/amazonas | refs/heads/master | amazonas/dbmod/__init__.py | 12133432 | |
shurihell/testasia | refs/heads/test1 | common/test/acceptance/pages/studio/login.py | 205 | """
Login page for Studio.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
class LoginPage(PageObject):
"""
Login page for Studio.
"""
url = BASE_URL + "/signin"
def is_browser_on_page(self):
return self.q(css='body.view-s... |
uclaros/QGIS | refs/heads/master | tests/src/python/test_qgslayoutview.py | 30 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutView.
.. note:: 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.
"""
__a... |
infinidb/autooam | refs/heads/master | autooam/vmi/vagstatus.py | 1 | # Copyright (C) 2014 InfiniDB, 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; version 2 of
# the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOU... |
techtonik/numpy | refs/heads/master | setupegg.py | 84 | #!/usr/bin/env python
"""
A setup.py script to use setuptools, which gives egg goodness, etc.
This is used to build installers for OS X through bdist_mpkg.
Notes
-----
Using ``python setupegg.py install`` directly results in file permissions being
set wrong, with nose refusing to run any tests. To run the tests anywa... |
mincoin-project/mincoin | refs/heads/master | qa/rpc-tests/p2p-segwit.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import MincoinTestFramework
from test... |
Foxugly/medagenda | refs/heads/master | users/migrations/0002_auto_20160112_0123.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='cur... |
michaellaier/pymor | refs/heads/master | src/pymortests/core/__init__.py | 34 | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
|
tersmitten/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_mgmt_interface.py | 52 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
bitmonk/rdiff-backup | refs/heads/master | rdiff_backup/FilenameMapping.py | 4 | # Copyright 2002, 2003 Ben Escoto
#
# This file is part of rdiff-backup.
#
# rdiff-backup is free software; you can redistribute it and/or modify
# 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.
... |
mikewiebe-ansible/ansible | refs/heads/devel | test/units/modules/network/ironware/test_ironware_config.py | 38 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
weidel-p/nest-simulator | refs/heads/master | extras/check_unused_names.py | 3 | # -*- coding: utf-8 -*-
#
# check_unused_names.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Lice... |
Zord13appdesa/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_pcp.py | 81 | # -*- Python -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
__version__ = '$Revision: 1.5 $'[11:-2]
from StringIO import StringIO
from twisted.trial import unittest
from twisted.protocols import pcp
# Goal:
# Take a Protocol instance. Own all outgoing data - anything that
# ... |
NexusIS/tempest | refs/heads/master | tempest/cmd/javelin.py | 1 | #!/usr/bin/env python
#
# 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, softwa... |
firebitsbr/infernal-twin | refs/heads/master | build/pillow/Tests/test_image_getim.py | 12 | from helper import unittest, PillowTestCase, hopper, py3
class TestImageGetIm(PillowTestCase):
def test_sanity(self):
im = hopper()
type_repr = repr(type(im.getim()))
if py3:
self.assertIn("PyCapsule", type_repr)
self.assertIsInstance(im.im.id, int)
if __name__ == ... |
litebitcoins/litebitcoin | refs/heads/master | test/functional/test_framework/__init__.py | 12133432 | |
toomoresuch/pysonengine | refs/heads/master | parts/app_lib/sitecustomize.py | 12133432 | |
jarofgreen/MyJobSeek | refs/heads/master | registration/forms.py | 25 | """
Forms and validation code for user registration.
"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from registration.models import RegistrationProfile
# I put this on all required fields, because it's easier to pick up
# on them wi... |
Nu3001/external_chromium_org | refs/heads/master | tools/telemetry/telemetry/page/actions/scroll_unittest.py | 29 | # 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.
import os
from telemetry.page import page as page_module
from telemetry.page.actions import scroll
from telemetry.unittest import tab_test_case
class Sc... |
pymo/pymo | refs/heads/master | symbian/PythonForS60/module-repo/standard-modules/encodings/zlib_codec.py | 533 | """ Python 'zlib_codec' Codec - zlib compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib modu... |
ntiufalara/openerp7 | refs/heads/master | openerp/addons/web_tests_demo/__init__.py | 423 | from openerp.osv import orm, fields
class TestObject(orm.TransientModel):
_name = 'web_tests_demo.model'
_columns = {
'name': fields.char("Name", required=True),
'thing': fields.char("Thing"),
'other': fields.char("Other", required=True)
}
_defaults = {
'other': "bob"
... |
pkimber/old_cms | refs/heads/master | cms/templatetags/__init__.py | 106 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
|
owtf/owtf | refs/heads/develop | owtf/plugins/web/external/Testing_for_ORM_Injection@OWTF-DV-007.py | 41 | from owtf.plugin.helper import plugin_helper
DESCRIPTION = "Plugin to assist manual testing"
def run(PluginInfo):
Content = plugin_helper.HtmlString("Intended to show helpful info in the future")
return Content
|
40423143/2016fallcadp_hw | refs/heads/gh-pages | plugin/summary/test_summary.py | 339 | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(unittest.TestCase... |
amishb/youtube-dl | refs/heads/master | youtube_dl/extractor/tinypic.py | 126 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TinyPicIE(InfoExtractor):
IE_NAME = 'tinypic'
IE_DESC = 'tinypic.com videos'
_VALID_URL = r'http://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+'
_TESTS = [
... |
GoogleCloudPlatform/training-data-analyst | refs/heads/master | blogs/babyweight_keras/trainer/__init__.py | 12133432 | |
slisson/intellij-community | refs/heads/master | python/testData/refactoring/move/relativeImportsToModulesInSameMovedPackageNotUpdated/before/src/pkg/m5.py | 12133432 | |
redreamality/deeppy | refs/heads/master | deeppy/siamese/__init__.py | 12133432 | |
tudennis/LeetCode---kamyu104-11-24-2015 | refs/heads/master | Python/print-binary-tree.py | 2 | # Time: O(h * 2^h)
# Space: O(h * 2^h)
# Print a binary tree in an m*n 2D string array following these rules:
#
# The row number m should be equal to the height of the given binary tree.
# The column number n should always be an odd number.
# The root node's value (in string format) should be put in the exactly middl... |
Codefans-fan/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py | 384 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
Giftingnation/GN-Oscar-Custom | refs/heads/master | sites/sandbox/settings.py | 3 | import os
# Path helper
PROJECT_DIR = os.path.dirname(__file__)
location = lambda x: os.path.join(
os.path.dirname(os.path.realpath(__file__)), x)
USE_TZ = True
DEBUG = True
TEMPLATE_DEBUG = True
SQL_DEBUG = True
SEND_BROKEN_LINK_EMAILS = False
ALLOWED_HOSTS = ['latest.oscarcommerce.com',
'sand... |
riteshshrv/django | refs/heads/master | tests/view_tests/app2/__init__.py | 12133432 | |
varunagrawal/azure-services | refs/heads/master | varunagrawal/site-packages/django/contrib/markup/models.py | 12133432 | |
FBRTMaka/ooi-ui | refs/heads/master | ooiui/core/__init__.py | 12133432 | |
rkmaddox/mne-python | refs/heads/master | mne/decoding/tests/__init__.py | 12133432 | |
barseghyanartur/vishap | refs/heads/master | src/vishap/contrib/plugins/youtube/__init__.py | 12133432 | |
ekiourk/ansible-modules-core | refs/heads/devel | cloud/linode/__init__.py | 12133432 | |
tudyzhb/yichui | refs/heads/master | django/conf/locale/en_GB/__init__.py | 12133432 | |
cs-au-dk/Artemis | refs/heads/master | WebKit/Tools/Scripts/webkitpy/common/thread/threadedmessagequeue.py | 134 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/python-ldap-2.3.13/Demo/Lib/ldap/async/ldifwriter.py | 40 | """
ldifwriter - using ldap.async module for output of LDIF stream
of LDAP search results
Written by Michael Stroeder <michael@stroeder.com>
$Id: ldifwriter.py,v 1.4 2006/03/26 12:23:07 stroeder Exp $
This example translates the naming context of data read from
input, sanitizes some attributes, maps/rem... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/unmanaged_models/models.py | 115 | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# All of these models are created in the database by Django.
@python_2_unicode_... |
ubaumgar/OKR | refs/heads/master | okr/domain.py | 1 | import datetime
import math
import warnings
import numbers
class Color:
def __init__(self, alpha_arg=255, arg_r=255, arg_g=255, arg_b=255):
super().__init__()
self._alpha = alpha_arg
self._r = arg_r
self._g = arg_g
self._b = arg_b
@property
def alpha(self):
... |
adaptivecomputing/torque-tests | refs/heads/master | check_tests.py | 1 | #!/usr/bin/python
from ace.suites import *
from ace.levels import *
import os, re, types, inspect
class_name_regex = re.compile('^Test[A-Z0-9][a-zA-Z0-9]+$')
function_name_regex = re.compile('^test_[a-z0-9_]+$')
file_name_regex = re.compile('^test_[a-z0-9_]+\.py$')
dir_name_regex = re.compile('^[a-z0-9_]+$')
adaptive... |
smalley/python | refs/heads/master | exercises/phone-number/example.py | 3 | import re
class Phone(object):
def __init__(self, number):
self.number = self._clean(number)
self.area_code = self.number[:3]
self.exchange_code = self.number[3:6]
self.subscriber_number = self.number[-4:]
def pretty(self):
return "({}) {}-{}".format(
self.... |
antoinevg/survival | refs/heads/master | widgets/asteditor/nodetree.py | 1 |
import cairo
import pango
import gtk
from core.world import TheWorld
from ontology.thing import Thing
from widgets.primitives import Primitives
class NodeTree(Thing):
def __init__(self, root_node):
Thing.__init__(self)
self.root_node = root_node
self.x_offset = 0.0
self.y_offset = 0.... |
frederick-masterton/django | refs/heads/master | django/contrib/redirects/__init__.py | 808 | default_app_config = 'django.contrib.redirects.apps.RedirectsConfig'
|
xydinesh/webdev | refs/heads/master | werkzeug/testsuite/contrib/securecookie.py | 66 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the secure cookie.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.utils import... |
mPowering/django-orb | refs/heads/master | orb/tags/__init__.py | 12133432 | |
hafeez3000/zulip | refs/heads/master | zilencer/migrations/__init__.py | 12133432 | |
r8921039/bitcoin | refs/heads/master | test/functional/p2p_leak.py | 14 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERSION... |
OmeGak/indico-plugins | refs/heads/master | importer_invenio/indico_importer_invenio/connector.py | 8 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (... |
ewels/MultiQC | refs/heads/master | multiqc/modules/hicup/hicup.py | 1 | #!/usr/bin/env python
""" MultiQC module to parse output from HiCUP """
from __future__ import print_function
from collections import OrderedDict
import logging
from multiqc import config
from multiqc.plots import bargraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = loggin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.