repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jalexvig/tensorflow | refs/heads/master | tensorflow/contrib/lookup/lookup_ops_test.py | 4 | # 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... |
collective/cyn.in | refs/heads/master | products/Plone4ArtistsCalendar/pythonlib/p4a/subtyper/__init__.py | 4 | from zope import component
from p4a.subtyper.interfaces import ISubtyper
from Products.CMFCore import DirectoryView
DirectoryView.registerDirectory('skins', globals())
class activated(property):
"""A descriptor for setting or getting whether a subtype
has been applied to an object.
"""
def __init__(s... |
richard-fisher/repository | refs/heads/master | xorg/library/libICE/actions.py | 6 | #!/usr/bin/python
from pisi.actionsapi import shelltools, get, autotools, pisitools
def setup():
autotools.configure("--disable-static")
def build():
autotools.make()
def install():
autotools.install()
|
swquinn/ronin | refs/heads/development | ronin/strategies/rsync.py | 1 | # Copyright (c) 2015 Sean Quinn
#
# Licensed under the MIT License (http://opensource.org/licenses/MIT)
#
# 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 with... |
orion1024/Sick-Beard | refs/heads/master | lib/requests/packages/urllib3/filepost.py | 64 | # urllib3/filepost.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... |
nisavid/bedframe | refs/heads/master | bedframe/auth/session/_connectors.py | 1 | """Connectors"""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
from .. import _connectors
class SessionSupplicant(_connectors.Supplicant):
"""An authentication supplicant for session-based HTTP authentication
:param session_manager:
The session-based authenti... |
jgmanzanas/CMNT_004_15 | refs/heads/master | project-addons/asperience_edi/models/edi_fields.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Comunitea Servicios Tecnológicos All Rights Reserved
# $Omar Castiñeira Saaevdra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it u... |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | refs/heads/master | orcid_api_v3/models/research_resources_v30_rc1.py | 1 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
sup95/zulip | refs/heads/master | scripts/lib/setup_path_on_import.py | 4 | """
Use libraries from a virtualenv (by modifying sys.path) in production.
Also add Zulip's root directory to sys.path
"""
import os
from os.path import dirname, abspath
import sys
BASE_DIR = dirname(dirname(dirname(abspath(__file__))))
activate_this = os.path.join(BASE_DIR, "zulip-venv", "bin", "activate_this.py")
i... |
patrickwind/My_Blog | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/local.py | 147 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... |
endlessm/chromium-browser | refs/heads/master | third_party/chromite/api/gen/device/model_id_pb2.py | 2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: device/model_id.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection a... |
Kaisuke5/chainer | refs/heads/master | chainer/functions/activation/sigmoid.py | 13 | import ctypes
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_mode = libcudnn.CUDNN_ACTIVATION_SIGMOID
class Sigmoid(function.Function):
"""Logistic sigmoid function."""
de... |
fernand/scipy | refs/heads/master | scipy/sparse/tests/test_sputils.py | 21 | """unit tests for sparse utility functions"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (TestCase, run_module_suite, assert_equal,
assert_array_equal)
from scipy.sparse import sputils
class TestSparseUtils(TestCase):
... |
KarolAntczak/DeepModel | refs/heads/master | deepmodel/trainers/Batch.py | 1 | import numpy as np
def get_next_batch(train_dataset, step, batch_size):
offset = (step * batch_size) % (train_dataset.shape[0] - batch_size)
return train_dataset[offset:(offset + batch_size), :]
def get_next_batch_noised(train_dataset, step, batch_size, noise_ratio=0.5):
batch = get_next_batch(train_dat... |
CAAD-RWTH/ClockworkForDynamo | refs/heads/master | nodes/2.x/python/Regex.SplitByRegularExpression.py | 4 | import clr
import re
if isinstance(IN[1], list): OUT = [IN[0].split(x) for x in IN[1]]
else: OUT = IN[0].split(IN[1]) |
computersalat/ansible | refs/heads/devel | test/support/integration/plugins/modules/lvg.py | 72 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# Based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
# 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... |
kartikp1995/gnuradio | refs/heads/master | gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py | 18 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
MobinRanjbar/hue | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/paste/recursive.py | 50 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Middleware to make internal requests and forward requests internally.
When applied, several keys are added to the environment that will allow
you ... |
martonw/phantomjs | refs/heads/master | src/breakpad/src/third_party/protobuf/protobuf/python/ez_setup.py | 454 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... |
dednal/chromium.src | refs/heads/nw12 | build/android/pylib/base/base_test_result_unittest.py | 134 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for TestRunResults."""
import unittest
from pylib.base.base_test_result import BaseTestResult
from pylib.base.base_test_result import Test... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/docutils/docutils/parsers/rst/languages/pt_br.py | 128 | # $Id: pt_br.py 7119 2011-09-02 13:00:23Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translate... |
timrichardson/google_charts_plugin | refs/heads/master | controllers/appadmin.py | 9 | # -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
try:
import pygraphvi... |
RJPercival/certificate-transparency | refs/heads/master | python/utilities/log_list/java_generator.py | 30 | import datetime
import textwrap
import base64
def _write_java_header(output, package):
year = datetime.date.today().year
output.write(
"/*\n"
" * Copyright (C) %(year)d The Android Open Source Project\n"
" *\n"
" * Licensed under the Apache License, Version 2.0 (the \"License\")... |
WandyYing/robotframework-selenium2library | refs/heads/master | test/run_tests.py | 14 | #!/usr/bin/env python
import env
import os
import sys
from subprocess import Popen, call
from tempfile import TemporaryFile
from run_unit_tests import run_unit_tests
ROBOT_ARGS = [
'--doc', 'SeleniumSPacceptanceSPtestsSPwithSP%(browser)s',
'--outputdir', '%(outdir)s',
'--variable', 'browser:%(browser)s',... |
jiajiax/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_font-src_cross-origin_multi_blocked-manual.py | 25 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set(
... |
dannyboi104/SickRage | refs/heads/master | sickbeard/show_name_helpers.py | 3 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/numpy/doc/glossary.py | 40 | """
========
Glossary
========
.. glossary::
along an axis
Axes are defined for arrays with more than one dimension. A
2-dimensional array has two corresponding axes: the first running
vertically downwards across rows (axis 0), and the second running
horizontally across columns (axis 1... |
npalermo10/auto_choice_assay_train-test | refs/heads/master | venv/lib/python2.7/site-packages/pip/utils/logging.py | 83 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... |
unlessbamboo/grocery-shop | refs/heads/master | language/python/src/logging/cgitbTest.py | 1 | #coding:utf-8
'''
cgitb模块用于日志信息调试,输出异常上下文所有相关变量的信息
'''
import cgitb
import sys
import traceback
def cgitbTest():
cgitb.enable(format='text')
list1 = [1, 2, 3]
list2 = list1
return 1/0
if __name__ == '__main__':
'''main'''
cgitbTest()
|
melissaihrig/namebench | refs/heads/master | nb_third_party/jinja2/runtime.py | 207 | # -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
import sys
from itertools import chain, imap
from jinja2.nodes import EvalContext
from jinja2.utils import Markup, partial, soft_unicode, escape, missing, \
co... |
kralf/morsel-ros | refs/heads/master | src/morsel/morsel_simulator/python/morsel_ros/output/ros_output.py | 1 | from morsel.nodes import Output
import re
import inspect
#-------------------------------------------------------------------------------
class ROSOutput(Output):
def __init__(self, node, name = "ROSOutput", topic = None, queueSize = 1000,
frame = None, **kargs):
Output.__init__(self, name, **kargs)
... |
chris-chris/tensorflow | refs/heads/master | tensorflow/contrib/integrate/__init__.py | 100 | # 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... |
vtlg/angulegis | refs/heads/master | angulegis/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... |
DirtyPiece/dancestudio | refs/heads/master | Build/Tools/Python27/Lib/lib2to3/fixes/fix_renames.py | 326 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... |
xodus7/tensorflow | refs/heads/master | tensorflow/contrib/tensor_forest/python/ops/data_ops.py | 90 | # 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... |
seanli9jan/tensorflow | refs/heads/master | tensorflow/python/ops/parallel_for/pfor.py | 2 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
luotao1/Paddle | refs/heads/develop | python/paddle/fluid/tests/unittests/test_imperative_group.py | 2 | # Copyright (c) 2020 PaddlePaddle 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 appli... |
WebSpider/headphones | refs/heads/master | lib/apscheduler/schedulers/tornado.py | 33 | from __future__ import absolute_import
from datetime import timedelta
from functools import wraps
from apscheduler.schedulers.base import BaseScheduler
from apscheduler.util import maybe_ref
try:
from tornado.ioloop import IOLoop
except ImportError: # pragma: nocover
raise ImportError('TornadoScheduler requi... |
cedk/odoo | refs/heads/8.0 | addons/payment_paypal/tests/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
mrquim/mrquimrepo | refs/heads/master | repo/script.module.exodus/lib/resources/lib/modules/pyaes/__init__.py | 138 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
fossoult/odoo | refs/heads/8.0 | addons/account/wizard/account_fiscalyear_close_state.py | 297 | # -*- 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... |
yuhcaesar/emacsrc | refs/heads/master | .emacs.d/.python-environments/default/Lib/encodings/iso8859_16.py | 93 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self... |
dablak/boto | refs/heads/develop | boto/dynamodb/table.py | 31 | # 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 ... |
mrshelly/openerp71313 | refs/heads/master | openerp/addons/base_gengo/res_company.py | 34 | # -*- 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... |
erinspace/osf.io | refs/heads/develop | admin_tests/common_auth/test_views.py | 30 | from nose import tools as nt
import mock
from django.test import RequestFactory
from django.http import Http404
from tests.base import AdminTestCase
from osf_tests.factories import AuthUserFactory
from admin_tests.utilities import setup_form_view
from osf.models.user import OSFUser
from admin.common_auth.views impor... |
merelinguist/ludolatin | refs/heads/master | app/misc/__init__.py | 3 | from flask import Blueprint
misc = Blueprint('misc', __name__)
from . import views
|
stefanw/froide | refs/heads/master | froide/bounce/signals.py | 1 | from django.dispatch import Signal
user_email_bounced = Signal(providing_args=['bounce', 'should_deactivate'])
email_bounced = Signal(providing_args=['bounce', 'should_deactivate'])
email_unsubscribed = Signal(providing_args=['email', 'reference'])
|
vineodd/PIMSim | refs/heads/master | GEM5Simulation/gem5/src/arch/x86/isa/insts/general_purpose/string/store_string.py | 91 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... |
rocketgithub/l10n_gt_extra | refs/heads/master | __openerp__.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2012 Soluciones Tecnologócias Prisma S.A. All Rights Reserved.
# José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A.
# (http://www.solucionesprisma.com)
#
# This program is ... |
RebeccaWPerry/vispy | refs/heads/master | vispy/visuals/filters/picking.py | 7 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import struct
import weakref
from ..shaders import Function
class PickingFilter(object):
"""Filter used to color visuals by a picking ID.
Note that the ID colo... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/inspections/PyDunderSlotsInspection/inheritedClassAttrAssignmentAndOwnWithAttrAndInheritedWithDictSlots.py | 35 | class B(object):
attr = 'baz'
__slots__ = ['f', 'b', '__dict__']
class C(B):
__slots__ = ['attr', 'bar']
C.attr = 'spam'
print(C.attr)
c = C()
c.attr = 'spam'
print(c.attr) |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-0.96/django/utils/itercompat.py | 33 | """
Providing iterator functions that are not in all version of Python we support.
Where possible, we try to use the system-native version and only fall back to
these implementations if necessary.
"""
import itertools
def compat_tee(iterable):
"""Return two independent iterators from a single iterable.
Based... |
hideshis/scripts_for_research | refs/heads/master | FOSE2016/dependency/dependencyFinder_exe.py | 1 | # -*- coding: utf-8 -*-
import subprocess
import os
pjt_path = '/Users/hideshi-s/Desktop/httpclient'
result = subprocess.check_output('find ' + pjt_path + ' | grep "\.jar$"', shell=True)
result = result.replace('\r', '')
result_list = result.split('\n')
result_list.pop()
for jar_file in result_list:
jar_path = jar... |
mewtaylor/django | refs/heads/master | tests/utils_tests/test_feedgenerator.py | 163 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... |
flberger/fabula | refs/heads/audioclient | fabula/interfaces/json_rpc.py | 1 | """Fabula JSON RPC Interface
Copyright 2012 Florian Berger <fberger@florian-berger.de>
"""
# This file is part of Fabula.
#
# Fabula 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... |
ajayaa/keystone | refs/heads/master | keystone/tests/unit/ksfixtures/cache.py | 2 | # 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
# distributed under the... |
tersmitten/ansible | refs/heads/devel | test/units/module_utils/common/validation/test_check_type_bytes.py | 83 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.module_utils._text import to_native
from ansible.m... |
vyscond/cocos | refs/heads/master | cocos/shader.py | 3 | # ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# Copyright (c) 2009-2015 Richard Jones, Claudio Canepa
# All rights reserved.
#
# Redistribution and use in source and binary forms, with o... |
erdc-cm/air-water-vv | refs/heads/master | 3d/Penny_Price_Diffraction/Penny_Price_Diffraction_01/redist_p.py | 4 | from proteus import *
from proteus.default_p import *
from math import *
from tank3D import *
from proteus.mprans import RDLS
"""
The redistancing equation in the sloshbox test problem.
"""
LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
... |
affo/nova | refs/heads/master | nova/tests/unit/objects/test_fixed_ip.py | 46 | # Copyright 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 a... |
rocky1001/PiBox | refs/heads/master | PiBox/PiHome/PiApp/forms.py | 4 | #coding=utf-8
'''
# The modules contains PiApp's forms
# Any issues or improvements please contact jacob-chen@iotwrt.com
'''
#/usr/bin/python
#coding: utf8
from django import forms
from models import *
class PiSettingsForm(forms.ModelForm):
class Meta:
model = PiSettings
fields = ('ip',... |
vmadura/salt-integration-testing | refs/heads/master | tests/sit/ecs_container_test.py | 1 | import unittest
from mock import MagicMock
from sit.ecs_container import Container
from helpers.sit_helper import SITHelper
class UserDataTest(unittest.TestCase):
def setUp(self):
configs_directory = 'tests/sit/configs'
self.container = Container(configs_directory)
self.container.mas... |
GoogleCloudPlatform/appengine-mapreduce | refs/heads/master | python/src/mapreduce/api/map_job/input_reader.py | 5 | #!/usr/bin/env python
# Copyright 2015 Google 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 required ... |
gimite/personfinder | refs/heads/master | app/vendors/chardet/euctwprober.py | 289 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
digitalocean/netbox | refs/heads/develop | netbox/virtualization/models.py | 1 | from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from taggit.managers import TaggableManager
from dcim.models import BaseInterface, Device
from extras.models im... |
wwiitanen/Catlang | refs/heads/master | cat/stack.py | 2 | """
Basic stack functionality.
"""
from collections import deque
class Stack:
def __init__(self, initial=None):
"""
>>> s = Stack()
>>> s
_empty_
>>> s = Stack([1,2,3])
>>> s
===> 1 2 3
"""
if initial is None:
... |
ioram7/keystone-federado-pgid2013 | refs/heads/master | build/sqlalchemy/test/orm/test_immediate_load.py | 2 | """basic tests of lazy loaded attributes"""
from test.lib import testing
from sqlalchemy.orm import mapper, relationship, create_session, immediateload
from test.lib.testing import eq_
from test.orm import _fixtures
class ImmediateTest(_fixtures.FixtureTest):
run_inserts = 'once'
run_deletes = None
def ... |
phenoxim/cinder | refs/heads/master | cinder/tests/unit/targets/test_iser_driver.py | 3 | # 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... |
Denisolt/IEEE-NYIT-MA | refs/heads/master | local/lib/python2.7/site-packages/pip/index.py | 336 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... |
xkmato/tracpro | refs/heads/master | tracpro/orgs_ext/constants.py | 2 | from __future__ import unicode_literals
from enum import Enum
class TaskType(Enum):
sync_contacts = 1
fetch_runs = 2
|
ofreshy/vast | refs/heads/master | vast/resources/__init__.py | 1 | from os import path
THIS_DIR = path.dirname(__file__)
SIMPLE_WRAPPER_XML = path.join(THIS_DIR, "simple_wrapper_v2.xml")
SIMPLE_INLINE_XML = path.join(THIS_DIR, "simple_inline_v2.xml")
INLINE_MULTI_FILES_XML = path.join(THIS_DIR, "inline_multi_media_files_v2.xml")
INLINE_WITH_TRACKING_EVENTS_XML = path.join(THIS_DIR, ... |
dalegregory/odoo | refs/heads/8.0 | addons/web_api/__openerp__.py | 384 | {
'name': 'OpenERP Web API',
'category': 'Hidden',
'description': """
Openerp Web API.
================
""",
'version': '2.0',
'depends': ['web'],
'installable': True,
'auto_install': False,
}
|
shaohung001/tornado | refs/heads/master | tornado/stack_context.py | 248 | #!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
40223136/w17test1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_socket.py | 742 | """Implementation module for socket operations.
See the socket module for documentation."""
AF_APPLETALK = 16
AF_DECnet = 12
AF_INET = 2
AF_INET6 = 23
AF_IPX = 6
AF_IRDA = 26
AF_SNA = 11
AF_UNSPEC = 0
AI_ADDRCONFIG = 1024
AI_ALL = 256
AI_CANONNAME = 2
AI_NUMERICHOST = 4
AI_NUMERICSERV = 8
AI_PASSIVE = 1... |
dmigo/incubator-superset | refs/heads/master | superset/legacy.py | 2 | # -*- coding: utf-8 -*-
# pylint: disable=C,R,W
"""Code related with dealing with legacy / change management"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
from superset import frontend_config
FORM_DATA... |
Microvellum/Fluid-Designer | refs/heads/master | win64-vc/2.78/Python/lib/site-packages/wheel/__init__.py | 233 | # __variables__ with double-quoted values will be available in setup.py:
__version__ = "0.29.0"
|
harrygg/plugin.program.tvbgpvr.backend | refs/heads/master | resources/lib/utils.py | 1 | # -*- coding: utf-8 -*-
import os
import sys
import json
import time
import xbmc
import xbmcaddon
reload(sys)
sys.setdefaultencoding('utf8')
class Settings():
def __getattr__(self, name):
temp = this.getSetting(name)
if (name != "debug"):
log ("getting setting %s=%s" % (name, temp))
if temp.low... |
kemalakyol48/python-for-android | refs/heads/master | python-modules/twisted/twisted/protocols/test/test_tls.py | 60 | # Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocols.tls}.
"""
try:
from twisted.protocols.tls import TLSMemoryBIOProtocol, TLSMemoryBIOFactory
except ImportError:
# Skip the whole test module if it can't be imported.
skip = "pyOpenSSL 0.10 or newe... |
transcranial/gensim | refs/heads/develop | gensim/test/test_doc2vec.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
from __future__ import with_statement
import logg... |
Hippu/pilttikronikka | refs/heads/master | kronikka/kronikka_conf/settings/local.py | 1 | from base import *
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': PROJECT_ROOT.ancestor(1).child("dev.sqlite"), # Or path to database file if using sqlite3.
# The following set... |
nop33/indico | refs/heads/master | indico/modules/events/models/settings.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... |
rherrick/XNATImageViewer | refs/heads/master | utility-scripts/python/_old/ImageGenerator/GenerateBySagittalReference.py | 4 | import sys
import os
from PIL import Image
import shutil
def generateCoronal(blankDir, genSize, refFileNames):
print("Generating coronal images in %s"%(blankDir))
for root, dirs, files in os.walk(blankDir):
for i in range(0, len(files)): # i is 256
fn = root + "/" + files[i]
... |
fpy171/django | refs/heads/master | tests/template_tests/syntax_tests/test_exceptions.py | 513 | from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
@setup({'exception01': "{% extends 'nonexistent' %}"})
def test_exception01(self):
... |
williamsjj/shiji | refs/heads/master | shiji/stats/vendor/txstatsd/tests/test_router.py | 3 | # Copyright (C) 2011-2012 Canonical Services Ltd
#
# 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, ... |
GustavoHennig/ansible | refs/heads/devel | lib/ansible/module_utils/azure_rm_common.py | 48 | #
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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, e... |
ales-erjavec/orange | refs/heads/master | Orange/OrangeCanvas/document/schemeedit.py | 6 | """
====================
Scheme Editor Widget
====================
"""
import sys
import logging
import itertools
import unicodedata
from operator import attrgetter
from contextlib import nested
from urllib import urlencode
from PyQt4.QtGui import (
QWidget, QVBoxLayout, QInputDialog, QMenu, QAction, QActionGr... |
mjbrewer/testindex | refs/heads/master | magnum/tests/unit/common/test_clients.py | 6 | # 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
# distributed under t... |
chrisfranzen/django | refs/heads/master | tests/regressiontests/mail/__init__.py | 45382 | |
alexlo03/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/_nxos_mtu.py | 71 | #!/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... |
CaringCaribou/caringcaribou | refs/heads/master | tool/tests/test_iso_15765_2.py | 1 | from __future__ import print_function
from tests.mock.mock_ecu_iso_tp import MockEcuIsoTp
from lib import iso15765_2
from lib.can_actions import DEFAULT_INTERFACE
import can
import unittest
class IsoTpTestCase(unittest.TestCase):
ARB_ID_REQUEST = 0x100A
ARB_ID_RESPONSE = 0x100B
def setUp(self):
... |
jabez1314/youtube-dl | refs/heads/master | youtube_dl/extractor/dhm.py | 110 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class DHMIE(InfoExtractor):
IE_DESC = 'Filmarchiv - Deutsches Historisches Museum'
_VALID_URL = r'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)'
_TESTS = [{
'url': 'http:... |
jamesorr/f90wrap | refs/heads/master | examples/example-arrays/tests.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 28 15:19:03 2015
@author: David Verelst
"""
from __future__ import print_function
import unittest
import numpy as np
import ExampleArray as lib
class TestExample(unittest.TestCase):
def setUp(self):
pass
def do_array_stuff(self, ndata):
x =... |
kwantam/rust | refs/heads/master | src/etc/lldb_rust_formatters.py | 15 | # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... |
ksachs/invenio | refs/heads/prod | modules/bibauthorid/lib/bibauthorid_personid_maintenance.py | 5 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012 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 (at your option) any... |
GrognardsFromHell/TemplePlus | refs/heads/master | tpdatasrc/co8infra/scr/Spell139 - Dominate Animal.py | 2 | from toee import *
def OnBeginSpellCast( spell ):
print "Dominate Animal OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-enchantment-conjure", spell.caster )
def OnSpellEffect( spell ):
print "Dominate ... |
jaredculp/faker | refs/heads/master | faker/providers/company/pt_BR/__init__.py | 16 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
'{{last_name}}',
'{{last_name}}',
)
catch_ph... |
chrishas35/django-travis-ci | refs/heads/master | tests/regressiontests/templates/nodelist.py | 122 | from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
from django.utils.unittest import TestCase
from django.test.utils import override_settings
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
... |
swcloud/api-client-staging | refs/heads/master | generated/python/googleapis-common-protos/google/rpc/code_pb2.py | 17 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/rpc/code.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import messa... |
ftl-toolbox/lib_openshift | refs/heads/master | lib_openshift/models/v1beta1_rollback_config.py | 2 | # coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... |
julianprabhakar/eden_car | refs/heads/master | languages/en-gb.py | 2 | # -*- coding: utf-8 -*-
{
"A volunteer is defined as active if they've participated in an average of 8 or more hours of Program work or Trainings per month in the last year": "A volunteer is defined as active if they've participated in an average of 8 or more hours of Programme work or Trainings per month in the last y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.