repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
fasaxc/felix | refs/heads/master | calico/felix/test/test_frules.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014 Metaswitch Networks
#
# 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 applicab... |
double12gzh/nova | refs/heads/master | nova/tests/unit/test_quota.py | 35 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
ianblenke/awsebcli | refs/heads/master | ebcli/core/completer.py | 5 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
EricMuller/mynotes-backend | refs/heads/master | requirements/twisted/Twisted-17.1.0/src/twisted/test/test_memcache.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test the memcache client protocol.
"""
from __future__ import absolute_import, division
from twisted.internet.error import ConnectionDone
from twisted.protocols.memcache import MemCacheProtocol, NoSuchCommand
from twisted.protocols.memcache... |
seungjin/app5-seungjin-net.appspot.com | refs/heads/master | django/contrib/gis/gdal/feature.py | 321 | # The GDAL C library, OGR exception, and the Field object
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gi... |
trevstanhope/row-assist | refs/heads/master | src/__init__.py | 20578 | |
aperigault/ansible | refs/heads/devel | lib/ansible/plugins/action/exos_config.py | 39 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.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) any... |
skibblenybbles/django-commando | refs/heads/master | commando/django/core/management/startapp.py | 1 | from commando import management
BaseStartAppCommand = management.get_command_class(
"startapp", exclude_packages=("commando",))
if BaseStartAppCommand is not None:
base = BaseStartAppCommand()
class StartAppCommandOptions(management.CommandOptions):
"""
StartApp command options.... |
catapult-project/catapult | refs/heads/master | telemetry/third_party/modulegraph/modulegraph_tests/testpkg-edgedata/function_import_existing.py | 728 | """ $fname """
|
yosukesuzuki/deep-link-app | refs/heads/master | project/kay/registration/urls.py | 10 | # -*- coding: utf-8 -*-
"""
Kay registration urls.
:Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from kay.routing import (
ViewGroup, Rule
)
view_groups = [
ViewGroup(
Rule('/activate/<activation_key>', endpoint='activate',
... |
jameskane05/bonjour_py | refs/heads/master | greetings/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
bharathramh92/shop | refs/heads/master | listing/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
edgarli/proj8 | refs/heads/master | env/lib/python3.4/site-packages/flask/testsuite/test_apps/flask_newext_package/__init__.py | 629 | ext_id = 'newext_package'
|
ArcherSys/ArcherSys | refs/heads/master | developer/addon-sdk-1.17/python-lib/cuddlefish/tests/test_xpi.py | 34 | # 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
import unittest
import zipfile
import pprint
import shutil
import simplejson as json
from cuddlefish import x... |
rbian/tp-libvirt | refs/heads/master | libvirt/tests/src/libvirt_bench/libvirt_bench_dump_with_netperf.py | 8 | import os
import logging
from autotest.client.shared import error
from virttest import utils_test, utils_misc
def run(test, params, env):
"""
Test steps:
1) Get the params from params.
2) Run netperf on guest.
3) Dump each VM and check result.
3) Clean up.
"""
vms = env.get_all_vms()... |
Kalimaha/pact-test | refs/heads/master | tests/acceptance/version_1/testcases/response/body/different_value_found_at_index.py | 1 | from pact_test.either import Left
from pact_test.models.response import PactResponse
from pact_test.matchers.response_matcher import match
from tests.acceptance.acceptance_test_loader import load_acceptance_test
def test_different_values():
data = load_acceptance_test(__file__)
response = PactResponse(body={... |
openiitbombayx/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/settings.py | 76 | """Settings for the third-party auth module.
The flow for settings registration is:
The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating
whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH.
If true, it:
a) loads this module.
b) calls apply_settings(), passi... |
arborh/tensorflow | refs/heads/master | tensorflow/python/eager/benchmarks/resnet50/resnet50_graph_test.py | 4 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
BrandonSmithJ/tensorflow-double-DQN | refs/heads/master | Double-DQN/run.py | 1 | from CNN import CNN
from double_dqn import DDQN
from time import time
from collections import defaultdict as dd
import matplotlib.pyplot as plt
import tensorflow as tf
import cPickle as pickle
import numpy as np
import ale_python_interface
import os, sys, tty, termios
import random
import cv... |
vingkan/MebiPenny2012Finals | refs/heads/master | 2012-mebipenny/finals/bj/greedy.py | 7 | from __future__ import division
from territory import *
import json
import collections
import itertools
class GameBot:
name = 'greedy'
def __init__(self, server, game, player_id):
self.server = server
self.game = game
self.player_id = player_id
def player(self):
return self.game.players[self.player_id]
d... |
cgimenop/Excel2Testlink | refs/heads/master | ExcelParser/lib/openpyxl/worksheet/dimensions.py | 13 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.compat import safe_string, deprecated
from openpyxl.utils import (
get_column_interval,
column_index_from_string,
)
from openpyxl.descriptors import (
Integer,
Float,
Bool,
Strict,
String,
Alias,
)
f... |
minhthuanit/selenium | refs/heads/master | py/test/selenium/__init__.py | 537 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
varunarya10/oslo.utils | refs/heads/master | oslo/utils/__init__.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
# d... |
Zeing/CaptchaReader | refs/heads/master | src/Control/config.py | 2 | # -*- coding: UTF-8 -*-
'''
Created on Jul 13, 2014
@author: Jason Guo E-mail: zqguo@zqguo.com
'''
LOGINURL = "http://xk.fudan.edu.cn/xk/loginServlet"
LOGINCAPTCHAURL = "http://xk.fudan.edu.cn/xk/image.do"
DATA_FILE_NAME = "../Model/identify.pkl"
FAIL_IMAGE = "../Model/fail/" |
StackStorm/st2contrib | refs/heads/st2contrib-deprecated-archive | archive/packs/elasticsearch/actions/lib/items_selector.py | 6 | # pylint: disable=no-member
from curator.api.utils import get_indices
from curator.api.utils import get_snapshots
from items_filter import ItemsFilter
from easydict import EasyDict
from utils import xstr
import sys
import logging
logger = logging.getLogger(__name__)
class ItemsSelector(object):
def __init__(se... |
zhangziang/django-allauth | refs/heads/master | allauth/socialaccount/providers/douban/models.py | 4209 | # Create your models here.
|
Livit/Livit.Learn.EdX | refs/heads/labster/develop | common/djangoapps/lang_pref/tests/test_middleware.py | 26 | from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.sessions.middleware import SessionMiddleware
from django.utils.translation import LANGUAGE_SESSION_KEY
from lang_pref.middleware import LanguagePreferenceMiddleware
from openedx.core.djangoapps.user_api.preferences.api i... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/veteran_reward/vehicle_transport_skiff.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/static/space/debris/tie_fighter_debris_c.py | 85615 | import sys
def setup(core, object):
return |
flavour/iscram | refs/heads/master | static/scripts/tools/closure.py | 23 | import os
import tempfile
tempdir = tempfile.gettempdir()
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "compiler.jar"))
if not os.path.exists(path):
raise Exception("No closure compiler.jar at %s; Download from http://closure-compiler.googlecode.com/files/compiler-latest.zip" % path)
extra_para... |
chrisndodge/edx-platform | refs/heads/master | lms/djangoapps/rss_proxy/views.py | 42 | """
Views for the rss_proxy djangoapp.
"""
import requests
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseNotFound
from rss_proxy.models import WhitelistedRssUrl
CACHE_KEY_RSS = "rss_proxy.{url}"
def proxy(request):
"""
Proxy requests ... |
salbertperso/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_scaling_policy.py | 51 | #!/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 distributed... |
andrew-szymanski/gae_django | refs/heads/master | django/contrib/localflavor/pe/pe_region.py | 422 | # -*- coding: utf-8 -*-
"""
A list of Peru regions as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
REGION_CHOICES = (
('AMA', u'Amazonas'),
('ANC', u'Ancash'),
('APU', u'Apurímac'),
('ARE', u'Arequipa'),
('AYA', u'... |
kreatorkodi/repository.torrentbr | refs/heads/master | plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/__init__.py | 1 | __all__ = ['SearchHistory', 'FavoriteList', 'WatchLaterList', 'FunctionCache', 'AccessManager', 'ViewManager',
'strip_html_from_text', 'create_path', 'create_uri_path', 'find_best_fit', 'to_unicode', 'to_utf8',
'datetime_parser', 'select_stream', 'get_http_server', 'is_httpd_live', 'YouTubeMonitor... |
Antiun/odoomrp-wip | refs/heads/8.0 | stock_picking_wave_management/models/stock_move.py | 27 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class StockMove(models... |
FeodorFitsner/coala | refs/heads/master | bears/linters/__init__.py | 2 | """
This package contains wrapper bears around usual linters.
"""
|
Eforcers/inbox-cleaner | refs/heads/master | src/lib/gdata/tlslite/utils/ASN1Parser.py | 281 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... |
fuziontech/sentry | refs/heads/master | src/sentry/migrations/0142_auto__add_field_project_organization__add_unique_project_organization_.py | 36 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.organization'
db.add_column('sentry_project', 'organization',
... |
KapecK/or-tools | refs/heads/master | examples/python/coins3.py | 7 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... |
chris-allan/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/src/omero/plugins/search.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
"""
Simple command-line searching. Similar to the hql plugin.
"""
import sys
from omero.cli import CLI
from omero.plugins.hql import HqlContro... |
PaulAYoung/f2014_iolab | refs/heads/master | pymongoProject/venv/lib/python2.7/site-packages/pymongo/collection.py | 7 | # Copyright 2009-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
bionikspoon/django-extensions | refs/heads/master | django_extensions/management/commands/validate_templates.py | 25 | import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import color_style
from django.template.base import add_to_builtins
from django.template.loader import get_template
from django_extensions.management.utils import signalcomman... |
PyAr/django-taggit-autosuggest | refs/heads/master | taggit_autosuggest/models.py | 8 | try:
from south.modelsinspector import add_ignored_fields
add_ignored_fields(["^taggit_autosuggest\.managers"])
except ImportError:
pass # without south this can fail silently
|
dpallot/async-websockets | refs/heads/master | examples/echo_client.py | 2 | import asyncio
import asyncws
@asyncio.coroutine
def echo(websocket):
while True:
yield from websocket.send('hello')
msg = yield from websocket.recv()
if msg is None:
break
print(msg)
loop = asyncio.get_event_loop()
websocket = loop.run_until_complete(
asyncws.conn... |
Xilinx/gdb | refs/heads/xlnx/gdb-7_6-branch | gdb/testsuite/gdb.python/source2.py | 34 | # This testcase is part of GDB, the GNU debugger.
# Copyright 2008-2013 Free Software Foundation, 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 3 of the License, or
... |
henryfjordan/django | refs/heads/master | django/contrib/humanize/__init__.py | 808 | default_app_config = 'django.contrib.humanize.apps.HumanizeConfig'
|
wolverineav/neutron | refs/heads/master | neutron/tests/__init__.py | 51 | # 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... |
scigghia/account-invoicing | refs/heads/8.0 | account_invoice_line_sort/tests/__init__.py | 30 | # -*- coding: utf-8 -*-
from . import test_account_invoice_line_sort
|
pilou-/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/proxysql.py | 44 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt
class ModuleDocFragment(object):
# Documentation fragment for ProxySQL connectivity
CONNECTIVITY = r'''
options:
login_user:
description:
- T... |
40223137/2015cbaa | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/sys.py | 109 | # hack to return special attributes
from _sys import *
from javascript import JSObject
has_local_storage=__BRYTHON__.has_local_storage
has_session_storage = __BRYTHON__.has_session_storage
has_json=__BRYTHON__.has_json
argv = ['__main__']
base_exec_prefix = __BRYTHON__.brython_path
base_prefix = __BRYTHON__.brython... |
koomik/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/gametrailers.py | 151 | from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class GametrailersIE(MTVServicesInfoExtractor):
_VALID_URL = r'http://www\.gametrailers\.com/(?P<type>videos|reviews|full-episodes)/(?P<id>.*?)/(?P<title>.*)'
_TEST = {
'url': 'http://www.gametrailers.com/videos/zbvr8i/... |
ntt-sic/neutron | refs/heads/master | neutron/plugins/hyperv/__init__.py | 128 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions SRL
# 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.ap... |
GitHublong/hue | refs/heads/master | desktop/libs/indexer/src/indexer/conf.py | 22 | #!/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... |
aneeshusa/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/delay.py | 187 | import time
def main(request, response):
delay = float(request.GET.first("ms", 500))
time.sleep(delay / 1E3);
return [("Content-type", "text/plain")], "TEST_DELAY"
|
teslaji/homebase | refs/heads/master | venv/HomeBase/lib/python3.5/site-packages/django/templatetags/l10n.py | 337 | from django.template import Library, Node, TemplateSyntaxError
from django.utils import formats
from django.utils.encoding import force_text
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Forces a value to be rendered as a localized value,
regardless of the value of ``setti... |
AGG2017/diaphora | refs/heads/master | pygments/lexers/_asy_builtins.py | 48 | # -*- coding: utf-8 -*-
"""
pygments.lexers._asy_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the asy-function names and asy-variable names of
Asymptote.
Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand.
TODO: perl/python script in Asymptote SVN similar to asy-list.pl but o... |
erickt/hue | refs/heads/master | desktop/core/ext-py/cx_Oracle-5.1.2/test/Cursor.py | 34 | """Module for testing cursor objects."""
import cx_Oracle
import sys
class TestCursor(BaseTestCase):
def testExecuteNoArgs(self):
"""test executing a statement without any arguments"""
result = self.cursor.execute("begin null; end;")
self.failUnlessEqual(result, None)
def testExecute... |
jinzekid/codehub | refs/heads/master | python/code_snippet/高级编程/装饰器-授权.py | 1 | # 授权装饰器
from functools import wraps
def requires_auth(f):
@wraps(f)
def decorated(*args, **kwargs):
auth = request.authorization
if not auth or not check_auth(auth.username, auth.password):
authenticate()
return f(*args, **kwargs)
return decorated
|
lshain-android-source/external-chromium_org | refs/heads/master | third_party/jinja2/ext.py | 114 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from collections impor... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-marketplaceordering/azure/mgmt/marketplaceordering/models/agreement_terms.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
tiancj/emesene | refs/heads/master | emesene/e3/base/Group.py | 1 | '''a module that defines a group object'''
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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
#... |
k3nnyfr/s2a_fr-nsis | refs/heads/master | s2a/Python/Lib/idlelib/ParenMatch.py | 158 | """ParenMatch -- An IDLE extension for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from idlelib.HyperParser import HyperParser
from idlelib.configHandler... |
mrquim/mrquimrepo | refs/heads/master | plugin.video.castaway/resources/lib/modules/jsunpack.py | 20 | """
urlresolver XBMC Addon
Copyright (C) 2013 Bstrdsmkr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.... |
simbs/edx-platform | refs/heads/master | common/lib/calc/calc/functions.py | 279 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... |
Silvian/samaritan | refs/heads/master | emailservice/views.py | 1 | """
@author: Silvian Dragan
@Date: 17/06/2016
@Copyright: Copyright 2016, Samaritan CMA - Published under GNU General Public Licence v3
@Details: https://github.com/Silvian/samaritan
"""
import json
from django.contrib.auth import get_user
from django.contrib.auth.decorators import login_required
from django.http impo... |
fsmi/odie-server | refs/heads/master | routes/documents.py | 1 | #! /usr/bin/env python3
import barcode
import config
import datetime
import json
import os
import marshmallow
from flask import request, send_file
from marshmallow import Schema, fields
from marshmallow.validate import OneOf
from sqlalchemy import asc, desc
from sqlalchemy.orm import subqueryload, undefer
from sqlalc... |
sidzan/netforce | refs/heads/master | netforce_cms/setup.py | 4 | #!/usr/bin/env python3
# Copyright (c) 2012-2015 Netforce Co. 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, co... |
momm3/WelcomeBot | refs/heads/master | welcomebot/Lib/encodings/iso2022_jp.py | 816 | #
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... |
BhallaLab/moose-full | refs/heads/master | moose-core/python/moose/neuroml2/test_reader.py | 2 | # test_reader.py ---
#
# Filename: test_reader.py
# Description:
# Author:
# Maintainer:
# Created: Wed Jul 24 16:02:21 2013 (+0530)
# Version:
# Last-Updated: Fri Jul 26 17:07:22 2013 (+0530)
# By: subha
# Update #: 111
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Cha... |
DamnWidget/mamba | refs/heads/master | mamba/test/test_deployer.py | 3 |
# Copyright (c) 2012 - 2013 Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
from twisted.trial import unittest
from mamba.deployment import deployer
class DummyDeployerTest(deployer.DeployerProvider):
"""A Dummy Deployer for testing purposes
"""
name = 'Dumb'
mode = 'loca... |
sridevikoushik31/nova | refs/heads/port_id_in_vif_on_devide | nova/console/vmrc_manager.py | 13 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# 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
#
# ... |
fullmar/corelib | refs/heads/master | tests/test_units/test_speed.py | 1 | #!/usr/bin/env python
# coding: utf-8
r"""speed.py tests"""
from corelib.units.speed import kmh
def test_speed():
r"""Test expected values"""
expected_value = 1.852
atol = 1e-10
assert expected_value - atol <= kmh(knots=1.) <= expected_value + atol
|
adminneyk/codificacionproyectando | refs/heads/master | application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/encodings/euc_kr.py | 816 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... |
szopu/django-rest-registration | refs/heads/master | rest_registration/settings_fields.py | 1 | import datetime
from collections import OrderedDict, namedtuple
from textwrap import dedent
_Field = namedtuple('_Field', [
'name',
'default',
'help',
'import_string',
])
class Field(_Field):
def __new__(
cls, name, *,
default=None,
help=None, # pylint: disab... |
sekikn/incubator-airflow | refs/heads/master | airflow/providers/ftp/hooks/__init__.py | 5130 | #
# 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... |
wndhydrnt/airflow | refs/heads/master | tests/contrib/operators/test_druid_operator.py | 15 | # -*- coding: utf-8 -*-
#
# 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
#... |
Neozaru/depot_tools | refs/heads/master | gcl.py | 4 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""\
Wrapper script around Rietveld's upload.py that simplifies working with groups
of files.
"""
import json
import optparse
impo... |
jpmml/jpmml-sparkml-package | refs/heads/master | pyspark2pmml/tests/__init__.py | 1 | import findspark
findspark.init()
import os
import tempfile
os.environ['PYSPARK_SUBMIT_ARGS'] = ("--master local[2] --jars " + os.environ['JPMML_SPARKML_JAR'] + " pyspark-shell")
from py4j.java_gateway import JavaObject
from pyspark.context import SparkContext
from pyspark.ml import Pipeline
from pyspark.ml.classif... |
timabbott/zulip | refs/heads/master | zerver/webhooks/gitea/tests.py | 4 | from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
class GiteaHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/giteae?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'gitea'
def test_multiple_commits(self) -> None... |
sidartaoliveira/ansible | refs/heads/devel | test/runner/lib/cloud/cs.py | 28 | """CloudStack plugin for integration tests."""
from __future__ import absolute_import, print_function
import json
import os
import re
import time
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.util import (
find_executable,
ApplicationError,
display,
SubprocessError,
... |
chelberserker/regexp | refs/heads/master | all_tests.py | 2 | #!/usr/bin/env python3
import unittest
from simple_match_test import SimpleMatchTest
from simple_search_test import SimpleSearchTest
from simple_findall_test import SimpleFindallTest
from simple_sub_test import SimpleSubTest
from advanced_sub_test import AdvancedSubTest
if __name__ == '__main__':
unittest.main... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/comment_tests/urls_admin.py | 174 | from django.conf.urls import patterns, include
from django.contrib import admin
from django.contrib.comments.admin import CommentsAdmin
from django.contrib.comments.models import Comment
# Make a new AdminSite to avoid picking up the deliberately broken admin
# modules in other tests.
admin_site = admin.AdminSite()
ad... |
berinhard/newfies-dialer | refs/heads/master | newfies/api/bulk_contact_api.py | 1 | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2013 Star2Bi... |
eugena/django | refs/heads/master | tests/gis_tests/inspectapp/models.py | 302 | from ..models import models
class AllOGRFields(models.Model):
f_decimal = models.FloatField()
f_float = models.FloatField()
f_int = models.IntegerField()
f_char = models.CharField(max_length=10)
f_date = models.DateField()
f_datetime = models.DateTimeField()
f_time = models.TimeField()
... |
pillowsham/studies | refs/heads/master | projecteuler/p21.py | 1 | # -*- coding: utf-8 -*-
from functools import lru_cache
@lru_cache(maxsize=None)
def d(n):
def is_divisor(i):
return n % i == 0
return 1 + sum(filter(is_divisor, range(2, n)))
def is_amicable_pair(x):
i, j = x
return i != j and i == d(j)
amicable_numbers = set([x[0] for x in filter(is_ami... |
yvaucher/maintainer-tools | refs/heads/master | tools/__init__.py | 22 | # -*- coding: utf-8 -*-
class colors:
GREEN = '\033[92m'
FAIL = '\033[91m'
WARNING = '\033[93m'
ENDC = '\033[0m'
|
openilabs/falconlab | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py | 208 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll
winterm = None
if windll is not None:
winterm = WinTerm()
def is_a_tty(stream):
r... |
piotrmaslanka/bellum | refs/heads/master | common/utils/mail.py | 1 | import email.message
import smtplib
def send(target_email, title, content):
'''@content unicode'''
co = smtplib.SMTP('some mail server',587)
co.login('some login', 'some password')
emsg = email.message.Message()
emsg.add_header('From', 'Administracja Bellum<admin@thebellum.pl>')
emsg.add_heade... |
Zaneh-/bearded-tribble-back | refs/heads/master | taiga/timeline/timeline_implementations.py | 3 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... |
FUSED-Wind/fusedwind-gui | refs/heads/master | fusedwindGUI/Tornado_Generator.py | 1 | """ Tornado_generator plugs into the DOEgenerator socket on a DOEdriver. Sets up a DOE for tornado plots"""
import numpy as np
from numpy import linspace,random
from openmdao.main.datatypes.api import Int
from openmdao.lib.casehandlers.api import ListCaseIterator
from openmdao.main.interfaces import implements, IDOEge... |
harlowja/urwid | refs/heads/master | urwid/listbox.py | 12 | #!/usr/bin/python
#
# Urwid listbox class
# Copyright (C) 2004-2012 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at ... |
ddico/odoo | refs/heads/master | addons/l10n_pe/models/res_partner.py | 12 | # Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
l10n_pe_district = fields.Many2one(
'l10n_pe.res.city.district', string='District',
help='Districts are part of a province or city... |
airbnb/airflow | refs/heads/master | tests/lineage/test_lineage.py | 5 | #
# 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... |
cryptogold/source | refs/heads/master | contrib/wallettools/walletchangepass.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2) |
navotsil/Open-Knesset | refs/heads/master | laws/templatetags/laws_tags.py | 7 | from django import template
from tagging.models import Tag, TaggedItem
from tagvotes.models import TagVote
from laws.models import VoteAction, VOTE_ACTION_TYPE_CHOICES, MemberVotingStatistics
from mks.models import Member, Knesset
from datetime import date, timedelta
from django.utils.translation import ugettext_lazy a... |
nevir/plexability | refs/heads/master | extern/depot_tools/tests/trychange_unittest.py | 3 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for trychange.py."""
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.pat... |
da1z/intellij-community | refs/heads/master | python/testData/quickFixes/PyRenameElementQuickFixTest/renameAsyncFunctionInPy36.py | 26 | def <warning descr="'async' and 'await' are not recommended to be used as variable, class, function or module names. They will become proper keywords in Python 3.7.">a<caret>sync</warning>():
pass |
VinceZK/phantomjs | refs/heads/decktape | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/executive_unittest.py | 124 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). 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 co... |
smartscheduling/scikit-learn-categorical-tree | refs/heads/master | sklearn/externals/joblib/hashing.py | 55 | """
Fast cryptographic hash of Python objects, with a special case for fast
hashing of numpy arrays.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import warnings
import pickle
import hashlib
import sys
import types
import ... |
ddico/odoo | refs/heads/master | addons/hr_fleet/models/fleet_vehicle_assignation_log.py | 10 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class FleetVehicleAssignationLog(models.Model):
_inherit = 'fleet.vehicle.assignation.log'
attachment_number = fields.Integer('Number of Attachments', compute='_compute_attachme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.