repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
johnnoone/aioconsul | refs/heads/master | tests/test_members.py | 1 | import pytest
@pytest.mark.asyncio
async def test_endpoint(client):
assert repr(client.members) == "<MembersEndpoint(%r)>" % str(client.address)
@pytest.mark.asyncio
async def test_members(client, server):
result = await client.members.items()
assert isinstance(result, list)
assert result[0]["Addr"]... |
sparkslabs/kamaelia | refs/heads/master | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/Compose/__init__.py | 20578 | |
Lh4cKg/sl4a | refs/heads/master | python/src/Tools/freeze/bkfile.py | 48 | _orig_open = open
class _BkFile:
def __init__(self, file, mode, bufsize):
import os
self.__filename = file
self.__backup = file + '~'
try:
os.unlink(self.__backup)
except os.error:
pass
try:
os.rename(file, self.__backup)
e... |
espadrine/opera | refs/heads/master | chromium/src/third_party/python_26/Lib/email/message.py | 54 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Basic message object for the email package object model."""
__all__ = ['Message']
import re
import uu
import binascii
import warnings
from cStringIO import StringIO
# Intrapackage imports
import email.char... |
dyrock/trafficserver | refs/heads/master | tests/gold_tests/basic/copy_config2.test.py | 2 | '''
'''
# 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");... |
frouty/odoogoeen | refs/heads/prod | addons/base_vat/__init__.py | 440 | # -*- 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... |
valkyriesavage/gasustainability | refs/heads/master | django/contrib/gis/geos/prototypes/threadsafe.py | 513 | import threading
from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR
class GEOSContextHandle(object):
"""
Python object representing a GEOS context handle.
"""
def __init__(self):
# Initializing the context handler for this thread with
# the notice and erro... |
denniszollo/mavlink | refs/heads/master | pymavlink/generator/lib/minixsv/xsvalSchema.py | 79 | #
# minixsv, Release 0.9.0
# file: xsvalSchema.py
#
# Derived validator class (for validation of schema files)
#
# history:
# 2004-10-07 rl created
# 2006-08-18 rl W3C testsuite passed for supported features
# 2007-05-24 rl Features for release 0.8 added, several bugs fixed
#
# Copyright (c) 2004-2008 ... |
molobrakos/home-assistant | refs/heads/master | homeassistant/components/blink/camera.py | 7 | """Support for Blink system camera."""
import logging
from homeassistant.components.camera import Camera
from . import BLINK_DATA, DEFAULT_BRAND
_LOGGER = logging.getLogger(__name__)
ATTR_VIDEO_CLIP = 'video'
ATTR_IMAGE = 'image'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a... |
rock-planning/planning-fd_uniform | refs/heads/master | src/translate/pddl/predicates.py | 6 | from . import pddl_types
class Predicate(object):
def __init__(self, name, arguments):
self.name = name
self.arguments = arguments
def parse(alist):
name = alist[0]
arguments = pddl_types.parse_typed_list(alist[1:], only_variables=True)
return Predicate(name, arguments)
... |
newfies-dialer/newfies-dialer | refs/heads/develop | newfies/apirest/view_gateway.py | 4 | # -*- 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-2015 Star2Bil... |
AgataGibas/python101 | refs/heads/master | quiz2/quiz2_pw/main.py | 2 | # -*- coding: utf-8 -*-
# quiz_pw/main.py
from app import app, baza
from models import *
from views import *
import os
from dane import *
if __name__ == '__main__':
if not os.path.exists('quiz.db'):
baza.create_tables([Pytanie, Odpowiedz],True) # tworzymy tabele
dodaj_pytania(pobierz_dane('pytania... |
benfinkelcbt/CPD200 | refs/heads/master | CPD200-Lab12-Python/rsa/pkcs1.py | 81 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
mlyundin/schematics | refs/heads/development | tests/test_validation.py | 1 | import pytest
import datetime
from schematics.models import Model
from schematics.exceptions import (
ConversionError, ValidationError, StopValidationError, DataError)
from schematics.types import StringType, DateTimeType, BooleanType, IntType
from schematics.types.compound import ModelType, ListType, DictType
fro... |
canassa/django-rest-framework | refs/heads/master | rest_framework/negotiation.py | 71 | """
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from rest_framework.set... |
vikas1885/test1 | refs/heads/master | cms/djangoapps/contentstore/features/problem-editor.py | 116 | # disable missing docstring
# pylint: disable=missing-docstring
import json
from lettuce import world, step
from nose.tools import assert_equal, assert_true # pylint: disable=no-name-in-module
from common import type_in_codemirror, open_new_course
from advanced_settings import change_value, ADVANCED_MODULES_KEY
from ... |
dulems/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_sreg.py | 86 | from openid.extensions import sreg
from openid.message import NamespaceMap, Message, registerNamespaceAlias
from openid.server.server import OpenIDRequest, OpenIDResponse
import unittest
class SRegURITest(unittest.TestCase):
def test_is11(self):
self.failUnlessEqual(sreg.ns_uri_1_1, sreg.ns_uri)
class Ch... |
Yelp/pyleus | refs/heads/develop | tests/cli/storm_cluster_test.py | 8 | import os
import pytest
from pyleus.cli.storm_cluster import _get_storm_cmd_env
from pyleus.cli.storm_cluster import STORM_JAR_JVM_OPTS
from pyleus.cli.storm_cluster import StormCluster
from pyleus.cli.storm_cluster import TOPOLOGY_BUILDER_CLASS
from pyleus.testing import mock
class TestGetStormCmdEnd(object):
... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-iothub/azure/mgmt/iothub/models/job_response.py | 4 | # 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 ... |
cedi4155476/QGIS | refs/heads/master | src/plugins/plugin_builder.py | 9 | #!/usr/bin/python
"""
***************************************************************************
plugin_builder.py
A script to automate creation of a new QGIS plugin using the plugin_template
--------------------------------------
Date : Sun Sep 16 12:11:04 AKDT 2007
Copyright ... |
Antiun/odoo | refs/heads/8.0 | addons/marketing_campaign/__openerp__.py | 260 | # -*- 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... |
Makeblock-official/mDrawBot | refs/heads/master | mDrawGui/ScaraGui.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ScaraGui.ui'
#
# Created by: PyQt5 UI code generator 5.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("... |
oguzy/mycli | refs/heads/master | tests/test_smart_completion_public_schema_only.py | 17 | # coding: utf-8
from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
metadata = {
'users': ['id', 'email', 'first_name', 'last_name'],
'orders': ['id', 'ordered_date', 'status'],
... |
ashhher3/pylearn2 | refs/heads/master | pylearn2/scripts/tutorials/deep_trainer/run_deep_trainer.py | 44 | #!/usr/bin/env python
from __future__ import print_function
__author__ = "Li Yao"
"""
See readme.txt
A small example of how to glue shining features of pylearn2 together
to train models layer by layer.
"""
MAX_EPOCHS_UNSUPERVISED = 1
MAX_EPOCHS_SUPERVISED = 2
from pylearn2.config import yaml_parse
from pylearn2.cor... |
richelbilderbeek/TankBattalion | refs/heads/master | direction.py | 1 | from enum import Enum, auto
class Direction(Enum):
UP = auto()
RIGHT = auto()
DOWN = auto()
LEFT = auto()
|
mbrubeck/servo | refs/heads/master | tests/wpt/web-platform-tests/eventsource/resources/status-reconnect.py | 253 | def main(request, response):
status_code = request.GET.first("status", "204")
name = request.GET.first("id", status_code)
headers = [("Content-Type", "text/event-stream")]
cookie_name = "request" + name
if request.cookies.first(cookie_name, "") == status_code:
status = 200
respons... |
jbedorf/tensorflow | refs/heads/master | tensorflow/python/keras/engine/input_spec.py | 10 | # 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... |
MadsackMediaStore/connector-magento | refs/heads/7.0 | magentoerpconnect/consumer.py | 5 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
tmerrick1/spack | refs/heads/develop | lib/spack/external/yaml/lib/yaml/reader.py | 425 | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... |
tkrajca/PUG-ELK | refs/heads/master | examples/example3.py | 1 | import logging
logging.basicConfig(level=logging.DEBUG)
@app.route('/magic/<number>/')
def do_magic(number):
try:
logging.debug("About to do some magic with {0}".format(number))
response = magic(number)
except Exception as e:
logging.exception("Got an exception {0} :(".format(e))
... |
kun--hust/libcloud_with_cn | refs/heads/development | libcloud/test/dns/test_hostvirtual.py | 7 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
0asa/gittle | refs/heads/master | gittle/utils/git.py | 1 | # Python imports
import os
from StringIO import StringIO
from functools import partial
# Dulwich imports
from dulwich import patch
from dulwich.objects import Blob
from dulwich.patch import is_binary
# Funky imports
from funky import first, true_only, rest, negate, transform
def is_readable(store):
def fn(info)... |
lets-software/shinken | refs/heads/master | test/test_spaces_in_commands.py | 18 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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... |
NL66278/odoo | refs/heads/8.0 | addons/account/wizard/account_move_line_reconcile_select.py | 385 | # -*- 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... |
malthe/google-protobuf | refs/heads/master | python/google/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
fanghuaqi/rt-thread | refs/heads/master | bsp/nrf51822/rtconfig.py | 26 | import os
# toolchains options
ARCH='arm'
CPU='cortex-m0'
CROSS_TOOL='keil'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = '... |
asen6/amartyasenguptadotcom | refs/heads/master | django/utils/simplejson/tool.py | 409 | r"""Using simplejson from the shell to validate and
pretty-print::
$ echo '{"json":"obj"}' | python -msimplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -msimplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
from django.utils import simplejson
def main():
i... |
valentin-krasontovitsch/ansible | refs/heads/devel | lib/ansible/module_utils/cloud.py | 194 | #
# (c) 2016 Allen Sanabria, <asanabria@linuxdynasty.org>
#
# 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... |
metachris/py2app | refs/heads/master | py2app/bundletemplate/plist_template.py | 10 | import sys
import py2app
__all__ = ['infoPlistDict']
def infoPlistDict(CFBundleExecutable, plist={}):
CFBundleExecutable = CFBundleExecutable
NSPrincipalClass = ''.join(CFBundleExecutable.split())
version = sys.version[:3]
pdict = dict(
CFBundleDevelopmentRegion='English',
CFBundleDispl... |
t3dev/odoo | refs/heads/master | addons/test_website/controllers/__init__.py | 1535 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import main
|
whiteear/cloudbase-init | refs/heads/master | cloudbaseinit/plugins/common/createuser.py | 4 | # Copyright 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
hunter007/django | refs/heads/master | django/core/mail/backends/filebased.py | 558 | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import \
EmailBackend as ConsoleEmailBackend
from django.utils import six
class EmailBackend(ConsoleEmailB... |
klahnakoski/TestLog-ETL | refs/heads/dev | vendor/jx_elasticsearch/es52/expressions/case_op.py | 3 | # encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... |
josanly/python-module-project | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# python-module-project documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 25 15:53:52 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are presen... |
vitaly-krugl/nupic | refs/heads/master | examples/opf/clients/hotgym/prediction/one_gym/cleanup.py | 15 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
jeffreyjinfeng/scrapy | refs/heads/master | scrapy/core/downloader/webclient.py | 115 | from time import time
from six.moves.urllib.parse import urlparse, urlunparse, urldefrag
from twisted.web.client import HTTPClientFactory
from twisted.web.http import HTTPClient
from twisted.internet import defer
from scrapy.http import Headers
from scrapy.utils.httpobj import urlparse_cached
from scrapy.responsetype... |
boyuegame/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_json/test_scanstring.py | 88 | import sys
from test.test_json import PyTest, CTest
class TestScanstring:
def test_scanstring(self):
scanstring = self.json.decoder.scanstring
self.assertEqual(
scanstring('"z\U0001d120x"', 1, True),
('z\U0001d120x', 5))
self.assertEqual(
scanstring('"\... |
eenchev/idea-note-taking-app | refs/heads/master | env/lib/python2.7/site-packages/gunicorn/reloader.py | 98 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import re
import sys
import time
import threading
class Reloader(threading.Thread):
def __init__(self, extra_files=None, interval=1, callback=None):
super(Reloader, sel... |
QianBIG/odoo | refs/heads/8.0 | addons/report_webkit/wizard/report_webkit_actions.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Vincent Renaville
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the... |
laayis/yowsup | refs/heads/master | yowsup/layers/protocol_media/protocolentities/iq_requestupload.py | 48 | from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity
from yowsup.structs import ProtocolTreeNode
import hashlib
import base64
import os
from yowsup.common.tools import WATools
class RequestUploadIqProtocolEntity(IqProtocolEntity):
'''
<iq to="s.whatsapp.net" type="set" xmlns="w:m">
<m... |
dezynetechnologies/odoo | refs/heads/8.0 | openerp/addons/base/module/wizard/base_module_update.py | 392 | # -*- coding: utf-8 -*-
from openerp import models, fields, api
class base_module_update(models.TransientModel):
_name = "base.module.update"
_description = "Update Module"
updated = fields.Integer('Number of modules updated', readonly=True)
added = fields.Integer('Number of modules added', readonly=... |
goodwinxp/ATFGenerator | refs/heads/master | ATFGen/pida_types/tstr.py | 1 | from abc_type import IdaTypes
from ida_types import IDA_TYPES
class IdaTStr(IdaTypes):
def __init__(self, ida_type=IDA_TYPES['str']):
self.ida_type = {'idt': ida_type, 'value': ''}
def decode(self, data):
count = ord(data[0])
offset = 1
for i in range(0, count):
im... |
ShinySide/HispAsian_5.1.1 | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
ivkos/kernel_i9500 | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
JohnDenker/brython | refs/heads/master | www/src/Lib/test/test_unary.py | 179 | """Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
import unittest
from test.support import run_unittest
class UnaryOpTestCase(unittest.TestCase):
def test_negative(self):
self.assertTrue(-2 == 0 - 2)
self.assertEqual(-0, 0)
self.assertEqual(--2, 2)
self.... |
congma/pypar | refs/heads/cma-devel | examples/mandelbrot_example/test_calculate_point.py | 2 | """Test of calculate_point within mandelbrot.py
"""
import unittest
from mandelbrot import calculate_point
class TestCase(unittest.TestCase):
def setUp(self):
pass
def test_basic(self):
"""Test that c==0 always returns kmax
"""
c = complex(0, 0)
for kmax in [0, 1, ... |
wsmith323/django | refs/heads/master | tests/model_permalink/models.py | 543 | from django.db import models
def set_attr(name, value):
def wrapper(function):
setattr(function, name, value)
return function
return wrapper
class Guitarist(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
@models.permalink
def url... |
yongshengwang/builthue | refs/heads/master | desktop/core/ext-py/Django-1.4.5/django/contrib/gis/gdal/datasource.py | 92 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... |
pacoqueen/ginn | refs/heads/master | extra/install/ipython2/ipython-5.10.0/IPython/utils/tokenize2.py | 30 | """Load our patched versions of tokenize.
"""
import sys
if sys.version_info[0] >= 3:
from ._tokenize_py3 import *
else:
from ._tokenize_py2 import *
|
chugle/myapp | refs/heads/master | gluon/contrib/pysimplesoap/__init__.py | 11 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"PySimpleSOAP"
import client
import server
import simplexml
import transport |
habeanf/Open-Knesset | refs/heads/upmaster | video/management/commands/sub_commands/GetYoutubeToken.py | 14 | # encoding: utf-8
import gdata.youtube.service
import urlparse
from video.management.commands.sub_commands import SubCommand
class GetYoutubeToken(SubCommand):
def __init__(self,command,committees=None):
SubCommand.__init__(self,command)
ytService=gdata.youtube.service.YouTubeService()
au... |
renaldopringle/python_koans | refs/heads/master | python2/koans/about_classes.py | 72 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual(__, ... |
duncanwp/iris | refs/heads/master | docs/iris/src/userguide/plotting_examples/cube_blockplot.py | 17 |
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
import matplotlib.pyplot as plt
import iris
import iris.quickplot as qplt
# Load the data for a single value of model level number.
fname = iris.sample_data_path('hybrid_height.nc')
tem... |
manashmndl/kivy | refs/heads/master | kivy/input/provider.py | 50 | '''
Motion Event Provider
=====================
Abstract class for the implemention of a
:class:`~kivy.input.motionevent.MotionEvent`
provider. The implementation must support the
:meth:`~MotionEventProvider.start`, :meth:`~MotionEventProvider.stop` and
:meth:`~MotionEventProvider.update` methods.
'''
__all__ = ('Mot... |
perrygeo/python-raster-stats | refs/heads/master | tests/test_io.py | 1 | import sys
import os
import fiona
import rasterio
import json
import pytest
from shapely.geometry import shape
from rasterstats.io import read_features, read_featurecollection, Raster # todo parse_feature
from rasterstats.io import boundless_array, window_bounds, bounds_window, rowcol
sys.path.append(os.path.dirname... |
damdam-s/rma | refs/heads/8.0 | __unported__/crm_claim_ext/__init__.py | 14 | # -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
... |
goofwear/P2P-Streams-Kodi | refs/heads/master | plugin.video.p2p-streams/resources/core/favourites.py | 6 | # -*- coding: utf-8 -*-
""" p2p-streams (c) 2014 enen92 fightnight
This file contains the the code for favourites used in the addon
Functions:
addon_favourites() -> Main menu. It parses the userdata/Favourites folder for items and lists them
manual_add_to_favourites() -> Add a favourite to list ... |
luiscbr92/algorithmic-challenges | refs/heads/master | TuentiChallenge6/03/code.py | 1 | import yaml
stream = file('submitInput', 'r')
inpt = yaml.load(stream)
tapes = inpt['tapes']
code = inpt['code']
for i in tapes:
output_header = "Tape #" + str(i) + ":"
tape = list(tapes[i])
current_state = 'start'
index = 0
while(current_state <> 'end'):
if index < len(tape):
... |
exaile/exaile | refs/heads/master | xl/player/gst/engine.py | 1 | # Copyright (C) 2008-2010 Adam Olsen
# Copyright (C) 2014-2015 Dustin Spicuzza
#
# 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, or (at your option)
# any later version.
#
# Th... |
felixma/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/280_add_nullable_false_to_keypairs_name.py | 81 | # Copyright 2015 Intel Corporation
# 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... |
JarbasAI/jarbas-core | refs/heads/dev | mycroft/util/__init__.py | 1 | # Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... |
mnieper/endpoints-proto-datastore | refs/heads/master | endpoints_proto_datastore/endpoints_proto_datastore_test_runner.py | 26 | # Copyright 2013 Google Inc. All Rights Reserved.
"""Run all unittests.
Idea borrowed from ndb project:
code.google.com/p/appengine-ndb-experiment/source/browse/ndb/ndb_test.py
"""
import os
import subprocess
import sys
import unittest
import test_utils
MODULES_TO_TEST = ['utils']
NO_DEVAPPSERVER_TEMPLATE = ('Ei... |
xzYue/odoo | refs/heads/8.0 | addons/product/tests/__init__.py | 315 | from . import test_uom, test_pricelist
|
D3f0/coreemu | refs/heads/master | daemon/core/xen/xenconfig.py | 11 | #
# CORE
# Copyright (c)2011-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
xenconfig.py: Implementation of the XenConfigManager class for managing
configurable items for XenNodes.
Configuration for a XenNode is available... |
ProtractorNinja/qutebrowser | refs/heads/master | scripts/dev/gen_resources.py | 20 | #!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# copyright 2014 florian bruhin (the compiler) <mail@qutebrowser.org>
# this file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the gnu general public license as publishe... |
omriabnd/UCCA-App | refs/heads/master | docker/build-images.py | 1 | #!/usr/bin/python
from __future__ import print_function
import argparse
import os
def parse_args():
parser = argparse.ArgumentParser(description='Builds the UCCA Docker Images, and potentially pushes them to Dockerhub')
parser.add_argument('version', type=str, help='Version number to tag')
parser.add_argum... |
burke-software/odfpy | refs/heads/master | tests/testwrite.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in th... |
agry/NGECore2 | refs/heads/master | scripts/mobiles/lairs/naboo_chuba_lair_neutral_small.py | 2 | import sys
def addTemplate(core):
core.spawnService.addLairTemplate('naboo_chuba_lair_neutral_small', 'chuba', 15, 'object/tangible/lair/base/shared_poi_all_lair_brambles_small.iff')
return |
colinnewell/odoo | refs/heads/8.0 | openerp/release.py | 284 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
jhseu/tensorflow | refs/heads/master | tensorflow/python/data/util/nest.py | 10 | # 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... |
ogenstad/ansible | refs/heads/devel | contrib/inventory/cobbler.py | 30 | #!/usr/bin/env python
"""
Cobbler external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use t... |
arrabito/DIRAC | refs/heads/integration | FrameworkSystem/Agent/SystemLoggingDBCleaner.py | 6 | """ SystemLoggingDBCleaner erases records whose messageTime column
contains a time older than 'RemoveDate' days, where 'RemoveDate'
is an entry in the Configuration Service section of the agent.
"""
__RCSID__ = "$Id$"
from DIRAC import S_OK
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.Cor... |
darktears/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/modulegraph/modulegraph_tests/test_util.py | 23 | import unittest
import encodings
import encodings.aliases
from modulegraph import util
import sys
try:
from io import BytesIO
except ImportError:
from cStringIO import StringIO as BytesIO
class TestUtil (unittest.TestCase):
def test_imp_find_module(self):
fn = util.imp_find_module('encodings.alias... |
ujenmr/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_http.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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',
... |
Sigmapoint/notos | refs/heads/master | src/notos/decorators.py | 1 | '''
Created on 25-07-2013
@author: kamil
'''
def push_with_policy(policy_class):
def decorator(klass):
old_finalize_response = klass.finalize_response
def method(_self, request, response, *args, **kwargs):
response = old_finalize_response(_self, request, response, *args, **kwargs)
... |
SchrodingersGat/InvenTree | refs/heads/master | InvenTree/stock/migrations/0001_initial.py | 2 | # Generated by Django 2.2 on 2019-05-20 12:04
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('part', '0001_initial'),
('company',... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/docutils/docutils/languages/he.py | 148 | # Author: Meir Kriheli
# Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $
# 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
# translated for each language:... |
allevin/PyGithub | refs/heads/master | github/GitAuthor.py | 5 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
sarthakmeh03/django | refs/heads/master | django/templatetags/static.py | 45 | from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.html import conditional_escape
from django.utils.six.moves.urllib.parse import quote, urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return ... |
demianw/tract_querier | refs/heads/master | doc/conf.py | 1 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... |
sanjuro/RCJK | refs/heads/master | vendor/django/core/management/commands/sqlcustom.py | 26 | from django.core.management.base import AppCommand
class Command(AppCommand):
help = "Prints the custom table modifying SQL statements for the given app name(s)."
output_transaction = True
def handle_app(self, app, **options):
from django.core.management.sql import sql_custom
return u'\n'... |
gaocegege/treadmill | refs/heads/dev/2017-5-18 | treadmill/newnet.py | 3 | """Creates new network subsystem with virtual eth device."""
import errno
import os
import logging
import multiprocessing
from . import utils
from . import iptables
from . import netdev
from .syscall import unshare
_LOGGER = logging.getLogger(__name__)
def create_newnet(veth, dev_ip, gateway_ip, service_ip=None... |
mnutt/emacs-starter-kit | refs/heads/master | vendor/pycomplexity/tests/test_exceptions.py | 4 | from tests.utils import complexity
class describe_exception_handling:
def test_try(self):
assert complexity(
"""
try: 1
except: 2
""").score == 2
def test_try_with_multiple_excepts(self):
assert complexity(
"""
try: 1
... |
pandeyadarsh/sympy | refs/heads/master | sympy/ntheory/residue_ntheory.py | 58 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
from sympy.core.singleton import S
from sympy.core.numbers import igcd, igcdex
from sympy.core.compatibility import as_int, range
from sympy.core.function import Function
from .primetest import isprime
from .factor_ import factorint, trailing, to... |
Spacecup/shadowsocks | refs/heads/master | tests/nose_plugin.py | 1072 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... |
raphaelrpl/portal | refs/heads/master | backend/test/discuss_tests/discuss_edit_tests.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from base import GAETestCase
from datetime import datetime, date
from decimal import Decimal
from discuss_app.discuss_model import Discuss
from routes.discusses.edit import index, save
from mommygae import mommy
from tekton.gae.middleware.... |
AlmostBetterNetwork/podmaster-host | refs/heads/master | podcasts/tests/models/helpers.py | 3 | import datetime
import uuid
from assets.helpers.factory import create_asset_from_url
from podcasts.models import Podcast, PodcastEpisode
i = 0
def podcast(slug=None, save=True):
global i
if not slug:
slug = 'podcast_{id}'.format(id=i)
i += 1
id_ = uuid.uuid4()
art = create_asset_fro... |
NewpTone/stacklab-nova | refs/heads/master | debian/tmp/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/scheduler_hints.py | 10 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
#
# 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
#
... |
gauribhoite/personfinder | refs/heads/master | app/pytz/zoneinfo/Africa/Libreville.py | 9 | '''tzinfo timezone information for Africa/Libreville.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Libreville(DstTzInfo):
'''Africa/Libreville timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Libr... |
lmyrefelt/CouchPotatoServer | refs/heads/develop | couchpotato/core/providers/torrent/awesomehd/main.py | 3 | from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
import re
import traceback
log = CPLog(__name__)
class AwesomeHD(TorrentProvider):
urls = {
'test' : 'https://a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.