repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
KonishchevDmitry/vkfeed | refs/heads/master | tests/html_parser.py | 17 | #!/usr/bin/env python
'''Tests HTMLPageParser.'''
from __future__ import unicode_literals
import os
import unittest
from vkfeed.tools.html_parser import HTMLPageParser
class TestHTMLPageParser(unittest.TestCase):
'''Tests HTMLPageParser.'''
def test(self):
'''Testing HTMLPageParser.'''
... |
mouhb/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py | 165 | #!/usr/bin/env python
# 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.
"""
Make sure paths are normalized with VS macros properly expanded on Windows.
"""
import TestGyp
import sys
if sys.platform == 'win32':... |
sumedh123/debatify | refs/heads/UI | venv/lib/python2.7/site-packages/setuptools/command/upload_docs.py | 110 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import socket
import zipfile
import tempfile
import ... |
AlvinNorin/limbo-android | refs/heads/master | jni/glib/gio/tests/gdbus-testserver.py | 46 | #!/usr/bin/env python
import gobject
import time
import dbus
import dbus.service
import dbus.mainloop.glib
class TestException(dbus.DBusException):
_dbus_error_name = 'com.example.TestException'
class TestService(dbus.service.Object):
# ---------------------------------------------------------------------... |
RPGOne/Skynet | refs/heads/Miho | scikit-learn-0.18.1/sklearn/isotonic.py | 24 | # Authors: Fabian Pedregosa <fabian@fseoane.net>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import interpolate
from scipy.stats import spearmanr
from .base import BaseEstimator, TransformerMixi... |
sriprasanna/django-1.3.1 | refs/heads/master | tests/regressiontests/forms/localflavor/sk.py | 89 | from django.contrib.localflavor.sk.forms import (SKRegionSelect,
SKPostalCodeField, SKDistrictSelect)
from utils import LocalFlavorTestCase
class SKLocalFlavorTests(LocalFlavorTestCase):
def test_SKRegionSelect(self):
f = SKRegionSelect()
out = u'''<select name="regions">
<option value="BB">B... |
yeming233/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/groups/constants.py | 89 | # 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... |
nicholasserra/sentry | refs/heads/master | src/sentry/migrations/0095_rebase.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):
pass
def backwards(self, orm):
pass
models = {
'sentry.user': {
'Meta': {'obje... |
shakamunyi/neutron-vrrp | refs/heads/master | neutron/tests/unit/ml2/drivers/mechanism_logger.py | 27 | # Copyright (c) 2013 OpenStack Foundation
# 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 ... |
nsol-nmsu/ns3-smartgrid | refs/heads/ndnSIM-v2 | preproc-case39cyber-ndn.py | 1 | import sys, csv
FLOW_TYPES = {
#'PMU_AGG' : "/direct/agg/pmu/",
#'PMU_COM' : "/direct/com/pmu/",
#'AMI_AGG' : "/direct/agg/ami/",
#'AMI_COM' : "/direct/com/ami/",
'WAC' : "/power/wac/",
'PDC' : "/power/pdc/",
'BGD' : "/power/bgd/"
#'DATA' : "/overlay/com/subscription"... |
stuaxo/cmdln | refs/heads/master | test/foo.py | 3 | # This is just a play file for mucking around with cmdln.py
"""this is the module docstring"""
import os
import sys
import cmdln
import pprint
import getopt
from optparse import OptionParser
import logging
class Error(Exception):
pass
log = logging.getLogger("foo")
from optparse import OptionParser
class Cmd... |
jcpowermac/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_tenant.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
xiaokeng/robotframework | refs/heads/master | src/robot/reporting/jsmodelbuilders.py | 17 | # Copyright 2008-2015 Nokia Solutions and 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 applicable l... |
b4stien/asyncio-join-processes | refs/heads/master | main.py | 1 | #!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
import asyncio
from asyncio import subprocess
import datetime
loop = asyncio.get_event_loop()
async def exhaust_stream_reader(stream_reader, name, input):
while True:
line = await stream_reader.readline()
if not line and stream_reader.at_eof():
... |
jk1/intellij-community | refs/heads/master | python/testData/completion/staticMethodSpecialAttributes.py | 80 | class MyClass(object):
@staticmethod
def method(self):
pass
MyClass().method.__<caret> |
tarttelin/pyrestmodels | refs/heads/master | json_models/__init__.py | 2 | from json_models import * |
sathnaga/virt-test | refs/heads/next | libguestfs/common.py | 2 | import os, sys
def load_setup_modules(client_dir):
try:
sys.path.insert(0, client_dir)
import setup_modules
finally:
sys.path.pop(0)
return setup_modules
dirname = os.path.dirname(sys.modules[__name__].__file__)
virt_test_dir = os.path.abspath(os.path.join(dirname, ".."))
sys.path.... |
snyderr/robotframework | refs/heads/Robotframework_SkipExecution | src/robot/output/pyloggingconf.py | 22 | # Copyright 2008-2015 Nokia Solutions and 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 applicable l... |
sharad/calibre | refs/heads/master | src/calibre/ebooks/rtf2xml/configure_txt.py | 24 | import os, sys
class Configure:
def __init__( self,
configuration_file,
bug_handler,
debug_dir = None,
show_config_file = None,
):
"""
Requires:
file --file to be read
output... |
gius-italy/openload-dl | refs/heads/master | openload_dl/__version__.py | 1 | # openload_dl
__title__ = "openload_dl"
__description__ = "openload downloader"
__version__ = "2.0.1"
__author__ = "Giuseppe Lumia"
__author_email__ = "glumia@protonmail.com"
__license__ = "MIT License"
__copyright__ = "Copyright 2019 Giuseppe Lumia"
|
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/guacamole-server/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class GuacamoleServer(AutotoolsPackage):
"""The guacamole-server package is a set of software wh... |
YannickB/odoo-hosting | refs/heads/master | __unfinished__/__init__.py | 386048 | |
openwsn-berkeley/coap | refs/heads/develop | tests/func/test_dummy_func.py | 10 | import logging
import testUtils as utils
#============================ logging ===============================
log = logging.getLogger(utils.getMyLoggerName())
log.addHandler(utils.NullHandler())
#============================ defines ===============================
#============================ fixtures =... |
partofthething/home-assistant | refs/heads/dev | tests/components/coronavirus/__init__.py | 21 | """Tests for the Coronavirus integration."""
|
andreabedini/PyTables | refs/heads/develop | examples/earray2.py | 13 | #!/usr/bin/env python
"""Small example that shows how to work with extendeable arrays of different
types, strings included."""
from __future__ import print_function
import numpy as np
import tables
# Open a new empty HDF5 file
filename = "earray2.h5"
fileh = tables.open_file(filename, mode="w")
# Get the root group
... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/plugins/terminal/bigip.py | 89 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
40223247/2015_w11 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/optparse.py | 728 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... |
renebentes/Python4Zumbis | refs/heads/master | Exercícios/Lista IV/questao03.py | 1 | # coding=utf-8
import random
lista1, lista2, lista = [], [], []
for x in range(10):
valor1 = random.randint(1, 100)
lista1.append(valor1)
lista.append(valor1)
valor2 = random.randint(1, 100)
lista2.append(valor2)
lista.append(valor2)
print(lista1)
print(lista2)
print(lista)
|
cloudbau/nova | refs/heads/master | nova/api/openstack/compute/plugins/v3/personalities.py | 10 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
# 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/licen... |
rackerlabs/horizon | refs/heads/master | openstack_dashboard/dashboards/project/images_and_snapshots/snapshots/tests.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
home-assistant/home-assistant | refs/heads/dev | homeassistant/components/syncthing/sensor.py | 2 | """Support for monitoring the Syncthing instance."""
import logging
import aiosyncthing
from homeassistant.components.sensor import SensorEntity
from homeassistant.core import callback
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from hom... |
fhirschmann/penchy | refs/heads/master | penchy/tests/test_hooks.py | 1 | from penchy.compat import unittest
from penchy.jobs import hooks
class ExecuteHookTest(unittest.TestCase):
def test_termination(self):
hook = hooks.ExecuteHook('python')
hook.setup()
self.assertIsNone(hook.proc.returncode)
hook.teardown()
self.assertEqual(hook.proc.returnco... |
iivic/BoiseStateX | refs/heads/master | common/djangoapps/course_action_state/tests/test_managers.py | 126 | # pylint: disable=invalid-name, attribute-defined-outside-init
"""
Tests for basic common operations related to Course Action State managers
"""
from ddt import ddt, data
from django.test import TestCase
from collections import namedtuple
from opaque_keys.edx.locations import CourseLocator
from course_action_state.mode... |
RafaelTorrealba/odoo | refs/heads/8.0 | addons/google_calendar/__openerp__.py | 299 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
Thhhza/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_chart_format11.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
FreeBirdLjj/dianping-spider | refs/heads/master | conv.py | 1 | #!/usr/bin/env python3
import pickle
dump_file_name = "result.txt"
if __name__ == "__main__":
dump_file = open(dump_file_name, "rb")
shops = pickle.load(dump_file)
dump_file.close()
print("shop_id/member_id/rank/taste/environment/service")
for shop in shops:
shop_id = shop[0]
for... |
birsoyo/conan | refs/heads/develop | conans/server/service/user_service.py | 10 | from conans.errors import AuthenticationException
class UserService(object):
def __init__(self, authenticator, credentials_manager):
self.authenticator = authenticator
self.credentials_manager = credentials_manager
def authenticate(self, username, password):
valid = self.authenticato... |
brady-vitrano/ecommerce-demo | refs/heads/master | api/urls.py | 1 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('api.views',
url(r'v1/products/$', 'products'),
url(r'v1/products/(?P<cid>[\d]+)/$', 'product'),
url(r'v1/categories/$', 'categories'),
url(r'v1/categor... |
yash-nisar/coala-bears | refs/heads/master | bears/go/GoVetBear.py | 24 | from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.GoRequirement import GoRequirement
@linter(executable='go',
use_stdout=False,
use_stderr=True,
output_format='regex',
output_regex=r'.+:(?P<line>\d+): (?P<message>.*)')
class GoVetBear:
""... |
biomodels/BIOMD0000000134 | refs/heads/master | BIOMD0000000134/__init__.py | 1209 | from model import * |
clumsy/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/kn/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'h:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =... |
ArnossArnossi/django | refs/heads/master | django/conf/locale/ml/formats.py | 1007 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... |
pedrobaeza/odoomrp-wip | refs/heads/8.0 | product_variants_sale/__openerp__.py | 2 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Licen... |
FibercorpLabs/FibercorpDevops | refs/heads/master | vmware/nsx/utils/nsx/EdgeRouting.py | 1 | import sys
import json
# from pprint import pprint
# sys.path.append("../common")
# from jinja import render
# from nsx_rest import *
from pprint import pprint
from .NsxRest import *
from ..common.Jinja import render
# BGP_ROUTING
# TODO: definir que parametros de bgp se quieren tocar
def get_nsx_edge_bgp(edgeId):... |
onitake/ansible | refs/heads/devel | lib/ansible/module_utils/storage/emc/emc_vnx.py | 79 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
razvanphp/arangodb | refs/heads/devel | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/pickletools.py | 50 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... |
charbeljc/OCB | refs/heads/8.0 | addons/stock/procurement.py | 8 | # -*- 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... |
ow2-mirrors/compatibleone | refs/heads/master | testsuite/basic/copaas.py | 3 | # vim: set et sw=4 ts=4 ai:
import unittest
import utils
from testbin import TestBin
class TestBinCopaas(TestBin, unittest.TestCase):
def setUp(self):
self.bin = 'copaas'
def tearDown(self):
pass
|
baberthal/CouchPotatoServer | refs/heads/master | couchpotato/core/plugins/wizard/__init__.py | 81 | from .main import Wizard
def autoload():
return Wizard()
config = [{
'name': 'core',
'groups': [
{
'tab': 'general',
'name': 'advanced',
'options': [
{
'name': 'show_wizard',
'label': 'Run the wizard',
... |
mach0/QGIS | refs/heads/master | tests/src/python/test_qgsvirtuallayertask.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVirtualLayerTask.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"... |
SophieIPP/openfisca-france | refs/heads/master | openfisca_france/tests/reforms/test_landais_piketty_saez.py | 2 | # -*- coding: utf-8 -*-
import datetime
from openfisca_core import periods
from openfisca_core.tools import assert_near
from openfisca_france.tests.base import tax_benefit_system
from openfisca_france.reforms.landais_piketty_saez import build_reform
def test():
year = 2013
reform = build_reform(tax_benefi... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/formats/_xls.py | 34 | # -*- coding: utf-8 -*-
""" Tablib - XLS Support.
"""
import sys
from tablib.compat import BytesIO, xlwt, xlrd, XLRDError
import tablib
title = 'xls'
extensions = ('xls',)
# special styles
wrap = xlwt.easyxf("alignment: wrap on")
bold = xlwt.easyxf("font: bold on")
def detect(stream):
"""Returns True if give... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/site-packages/pylint/test/functional/non_iterator_returned.py | 12 | """Check non-iterators returned by __iter__ """
# pylint: disable=too-few-public-methods, missing-docstring, no-self-use
import six
class FirstGoodIterator(object):
""" yields in iterator. """
def __iter__(self):
for index in range(10):
yield index
class SecondGoodIterator(object):
... |
mbauskar/omnitech-erpnext | refs/heads/master | erpnext/stock/doctype/batch/__init__.py | 37694 | from __future__ import unicode_literals
|
Nowheresly/odoo | refs/heads/8.0 | addons/account/wizard/account_automatic_reconcile.py | 340 | # -*- 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... |
dataunity/dataunity-messaging | refs/heads/master | jobs/job_queue.py | 1 | import sys
import zmq
import logging
from os.path import expanduser, join
from daemon import Daemon
# ToDo: read end points from args
# ToDo: set job status to 'queued'
# ToDo: change to load balancing for workers, not round robin
class JobQueueDaemon(Daemon):
def run(self):
print("Starting job queue...")... |
ComerciaGP/addonpayments-Python-SDK | refs/heads/master | setup.py | 1 | # -*- encoding: utf-8 -*-
import os
import re
import codecs
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = codecs.open(os.path.ab... |
40223136/w17test1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/dom/NodeFilter.py | 926 | # This is the Python mapping for interface NodeFilter from
# DOM2-Traversal-Range. It contains only constants.
class NodeFilter:
"""
This is the DOM2 NodeFilter interface. It contains only constants.
"""
FILTER_ACCEPT = 1
FILTER_REJECT = 2
FILTER_SKIP = 3
SHOW_ALL = 0x... |
recognai/spaCy | refs/heads/master | examples/training/train_ner.py | 1 | #!/usr/bin/env python
# coding: utf8
"""Example of training spaCy's named entity recognizer, starting off with an
existing model or a blank model.
For more details, see the documentation:
* Training: https://spacy.io/usage/training
* NER: https://spacy.io/usage/linguistic-features#named-entities
Compatible with: spaC... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/tensorflow/models/tutorials/rnn/translate/data_utils.py | 22 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
ihsanudin/odoo | refs/heads/8.0 | addons/edi/controllers/__init__.py | 829 | import main
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
prziborowski/pyvmomi-community-samples | refs/heads/master | samples/tools/datacenter.py | 15 | """
Written by Michael Rice
Github: https://github.com/michaelrice
Website: https://michaelrice.github.io/
Blog: http://www.errr-online.com/
This code has been released under the terms of the Apache 2.0 license
http://opensource.org/licenses/Apache-2.0
This sample can be run directly to create a datacenter, but may be... |
bbockelm/glideinWMS | refs/heads/master | factory/tools/find_StartdLogs.py | 2 | #!/usr/bin/env python
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# Print out the StartdLogs for a certain date
#
# Usage: find_StartdLogs.py <factory> YY/MM/DD [hh:mm:ss]
#
import sys
import os
import os.path
import time
STARTUP_DIR=sys.path[0]
sys.path.append(os.path.join(STARTUP_DIR,"../../..... |
WesleyyC/RestaurantRevenuePrediction | refs/heads/master | Ari/Preprocessing/SignificantVecs.py | 4 | import numpy as np
import pandas as pd
import scipy as sci
df = pd.read_csv("test.csv")
for vector in df:
for value in vector:
print value |
dahlstrom-g/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_idioms.py | 327 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... |
g2p/bedup | refs/heads/master | bedup/platform/btrfs.py | 1 | # vim: set fileencoding=utf-8 sw=4 ts=4 et :
# bedup - Btrfs deduplication
# Copyright (C) 2015 Gabriel de Perthuis <g2p.code+bedup@gmail.com>
#
# This file is part of bedup.
#
# bedup is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... |
HiSPARC/station-software | refs/heads/master | user/python/Lib/encodings/cp855.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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_map)
def decode(self,input,errors='strict'):
... |
mrlb05/Nifty4Gemini | refs/heads/master | nifty/pipeline/nifsLowMemoryPipeline.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# MIT License
# Copyright (c) 2015, 2017 Marie Lemoine-Busserolle
# 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, includi... |
Timmenem/micropython | refs/heads/master | tests/basics/int_big_and.py | 63 | print(0 & (1 << 80))
print(0 & (1 << 80) == 0)
print(bool(0 & (1 << 80)))
a = 0xfffffffffffffffffffffffffffff
print(a & (1 << 80))
print((a & (1 << 80)) >> 80)
print((a & (1 << 80)) >> 80 == 1)
# test negative on rhs
a = 123456789012345678901234567890
print(a & -1)
print(a & -2)
print(a & -234567890123456789012345678... |
sebfung/yellowpillowcase | refs/heads/master | vendor/cache/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/styles/friendly.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.friendly
~~~~~~~~~~~~~~~~~~~~~~~~
A modern style based on the VIM pyte theme.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyw... |
hflynn/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... |
izonder/intellij-community | refs/heads/master | python/testData/intentions/beforeTypeAssertion.py | 166 | def foo(a, b):
a<caret>.
b = 1 |
felixonmars/braintree_python | refs/heads/master | braintree/signature_service.py | 5 | import urllib
from braintree.util.crypto import Crypto
class SignatureService(object):
def __init__(self, private_key, hashfunc=Crypto.sha1_hmac_hash):
self.private_key = private_key
self.hmac_hash = hashfunc
def sign(self, data):
equalities = ['%s=%s' % (str(key), str(data[key])) for... |
foursquare/pants | refs/heads/master | tests/python/pants_test/backend/jvm/targets/test_jvm_app.py | 1 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from builtins import str
from textwrap import dedent
from pants.backend.jvm.ta... |
unseenlaser/linuxcnc | refs/heads/add-hal-ethercat | configs/sim/remap/manual-toolchange-with-tool-length-switch/python/gladevcp-handler.py | 22 | #!/usr/bin/env python
import hal
class HandlerClass:
def on_led_change(self,hal_led,data=None):
'''
the gladevcp.change led had a transition
'''
if hal_led.hal_pin.get():
if self.halcomp["number"] > 0.0:
self.change_text.set_label("Insert too number %d"... |
danbeam/catapult | refs/heads/master | tracing/third_party/tvcm/tvcm/module_unittest.py | 7 | #!/usr/bin/env python
# Copyright 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.
"""Tests for the module module, which contains Module and related classes."""
import os
import unittest
from tvcm import fake_fs
from... |
rtfd/readthedocs.org | refs/heads/master | readthedocs/rtd_tests/tests/test_core_utils.py | 1 | """Test core util functions."""
from unittest import mock
import pytest
from django.test import TestCase
from django_dynamic_fixture import get
from readthedocs.builds.constants import BUILD_STATE_BUILDING, LATEST
from readthedocs.builds.models import Build, Version
from readthedocs.core.utils import slugify, trigge... |
campenberger/boto | refs/heads/develop | boto/s3/tagging.py | 236 | from boto import handler
import xml.sax
class Tag(object):
def __init__(self, key=None, value=None):
self.key = key
self.value = value
def startElement(self, name, attrs, connection):
return None
def endElement(self, name, value, connection):
if name == 'Key':
... |
benrudolph/commcare-hq | refs/heads/master | custom/ilsgateway/views.py | 1 | import base64
import StringIO
from datetime import datetime
import json
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django.http.response import HttpResponseRedirect, Http404
from django.utils.decorators import method_decorator
from django.v... |
uberlaggydarwin/bugfree-wookie | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
111pontes/ydk-py | refs/heads/master | cisco-ios-xe/ydk/models/__init__.py | 179 | import pkg_resources
pkg_resources.declare_namespace(__name__)
|
erlimar/prototypeguide | refs/heads/master | src/lib/wtforms/fields/core.py | 12 | from __future__ import unicode_literals
import datetime
import decimal
import itertools
import time
from wtforms import widgets
from wtforms.compat import text_type, izip
from wtforms.validators import StopValidation
__all__ = (
'BooleanField', 'DecimalField', 'DateField', 'DateTimeField', 'FieldList',
'Flo... |
mskrzypkows/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/element_state/properties.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class GetElementPropertiesTest(base_test.WebDriverBaseTest):
def test_get_element_text(self):
self.driver.get(self.webserver.where_is("element_state/res/elements_text.html"))
... |
tealover/nova | refs/heads/master | nova/api/openstack/compute/schemas/v3/server_metadata.py | 109 | # Copyright 2014 NEC 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 ... |
graziano-giuliani/pythoncode | refs/heads/master | mirto/mirto_code_compute_F.py | 1 | #!/usr/bin/env python
# mirto_code_compute_F.py
import numpy as np
import os
import sys
class radiance:
"""radiance class
This function is part of the Python implementation of the MTG-IRS Real Time
Operational code
Compute the radiance vector F using the selected forward model
control is a data structure containi... |
toscanini/maestro | refs/heads/master | tests/test_py_backend.py | 2 | import unittest, sys, StringIO
sys.path.append('.')
from maestro import py_backend, exceptions, utils
from requests.exceptions import HTTPError
utils.setQuiet(True)
class TestContainer(unittest.TestCase):
#@unittest.skip("skipping")
def testStartStopRm(self):
p = py_backend.PyBackend()
c = p.create_c... |
oink/SmartQQBot | refs/heads/master | src/tests/constant.py | 5 | # coding: utf-8
GROUP_RESPONSE = {
"result":
[
{
"poll_type": "group_message",
"value": {
"content": [
[
"font",
{
"color": "000000... |
kittiu/odoo | refs/heads/8.0 | addons/resource/tests/test_resource.py | 47 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_elementsw_check_connections.py | 9 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
shtiyu/biubiubiu | refs/heads/master | game_funcitons.py | 1 | import sys
import pygame
from time import sleep
from random import randint
from bullet import Bullet
from alien import Alien
# 监听按键按下事件
def check_keydown_event(event, ai_settings, screen, ship, bullets):
if event.key == pygame.K_d:
ship.moving_right = True
ship.set_image('right')
elif event.ke... |
t3wz/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/rules-dirname/gyptest-dirname.py | 134 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
import os
test = TestGyp.TestGyp(formats=['make... |
cloudwork/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Scanner/Dir.py | 61 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... |
Centreon-Community/centreon-discovery | refs/heads/master | modPython/pycrypto-2.5/lib/Crypto/SelfTest/Hash/__init__.py | 116 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/__init__.py: Self-test for hash modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to t... |
bittorrent/needy | refs/heads/master | needy/generators/xcconfig.py | 3 | from ..generator import Generator
from ..platforms import available_platforms
from ..target import Target
import os
class XCConfigGenerator(Generator):
@staticmethod
def identifier():
return 'xcconfig'
def __xcconfig(self, needy, target, sdk, arch):
header_search_paths = []
libr... |
Revanth47/addons-server | refs/heads/master | src/olympia/translations/tests/testapp/models.py | 5 | from django.db import models
from olympia.amo.models import ModelBase
from olympia.translations.fields import (
LinkifiedField, PurifiedField, save_signal, TranslatedField)
class TranslatedModel(ModelBase):
name = TranslatedField()
description = TranslatedField()
default_locale = models.CharField(max... |
flexiant/xen | refs/heads/master | tools/python/xen/xend/xenstore/xswatch.py | 48 | # Copyright (C) 2005 Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
# Copyright (C) 2005 XenSource Ltd
# This file is subject to the terms and conditions of the GNU General
# Public License. See the file "COPYING" in the main directory of
# this archive for more details.
import errno
import threading
from xen.xe... |
jonasjberg/autonameow | refs/heads/master | autonameow/vendor/unidecode/x069.py | 252 | data = (
'Wan ', # 0x00
'Guo ', # 0x01
'Lu ', # 0x02
'Hao ', # 0x03
'Jie ', # 0x04
'Yi ', # 0x05
'Chou ', # 0x06
'Ju ', # 0x07
'Ju ', # 0x08
'Cheng ', # 0x09
'Zuo ', # 0x0a
'Liang ', # 0x0b
'Qiang ', # 0x0c
'Zhi ', # 0x0d
'Zhui ', # 0x0e
'Ya ', # 0x0f
'Ju ', # 0x10
'Be... |
Gui13/CouchPotatoServer | refs/heads/master | libs/html5lib/treewalkers/lxmletree.py | 618 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
elif isin... |
Hawaii-Smart-Energy-Project/Smart-Grid-PV-Inverter | refs/heads/master | src/insertMultiMeterDataFile.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Insert multiple data files of meter data by recursively locating available
files.
Usage:
insertMultiMeterDataFile.py --basepath ${PATH}
The naming of this script is unusual on purpose to be consistent with the
single file version.
"""
__author__ = 'Daniel Zhan... |
adykstra/mne-python | refs/heads/master | examples/forward/plot_source_space_morphing.py | 12 | """
=========================
Use source space morphing
=========================
This example shows how to use source space morphing (as opposed to
SourceEstimate morphing) to create data that can be compared between
subjects.
.. warning:: Source space morphing will likely lead to source spaces that are
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.