repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/asm.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.asm
~~~~~~~~~~~~~~~~~~~
Lexers for assembly languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL... |
wenottingham/ansible | refs/heads/devel | lib/ansible/executor/playbook_executor.py | 24 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
discoking/avalanche | refs/heads/master | avalance.py | 1 | #!/usr/bin/env python
#This script will discover the vlans on an 802.1Q trunk and print them
#it will add interfaces, and do DHCP discovery, and start responder
#this is a proof of concept and this program will be refined
#only works on Linux
#needs tcpdump installed
import StringIO
import sys
import shlex
import subp... |
WeblateOrg/weblate | refs/heads/main | weblate/trans/models/suggestion.py | 2 | #
# Copyright © 2012 - 2021 Michal Čihař <[email protected]>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... |
sn1k/app_mundial | refs/heads/master | lib/python2.7/site-packages/django/db/models/signals.py | 74 | from django.apps import apps
from django.dispatch import Signal
from django.utils import six
class_prepared = Signal(providing_args=["class"])
class ModelSignal(Signal):
"""
Signal subclass that allows the sender to be lazily specified as a string
of the `app_label.ModelName` form.
"""
def __in... |
dancingdan/tensorflow | refs/heads/master | tensorflow/python/training/checkpoint_ops.py | 46 | # 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... |
yk5/incubator-airflow | refs/heads/master | airflow/contrib/kubernetes/pod_generator.py | 10 | # 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 u... |
Britefury/scikit-image | refs/heads/master | skimage/io/tests/test_freeimage.py | 33 | import os
import skimage as si
import skimage.io as sio
from skimage import data_dir
import numpy as np
from numpy.testing import *
from numpy.testing.decorators import skipif
from tempfile import NamedTemporaryFile
try:
import skimage.io._plugins.freeimage_plugin as fi
FI_available = True
sio.use_plugin(... |
biodrone/plex-desk | refs/heads/master | desk/flask/lib/python3.4/site-packages/sqlalchemy/testing/suite/test_ddl.py | 203 |
from .. import fixtures, config, util
from ..config import requirements
from ..assertions import eq_
from sqlalchemy import Table, Column, Integer, String
class TableDDLTest(fixtures.TestBase):
__backend__ = True
def _simple_fixture(self):
return Table('test_table', self.metadata,
... |
ojarva/django-websocket-redis | refs/heads/master | ws4redis/websocket.py | 1 | # -*- coding: utf-8 -*-
# This code was generously pilfered from https://bitbucket.org/Jeffrey/gevent-websocket
# written by Jeffrey Gelens (http://noppo.pro/) and licensed under the Apache License, Version 2.0
import six
import struct
from socket import error as socket_error
from django.core.handlers.wsgi import logge... |
nicksergeant/snipt-old | refs/heads/master | django_authopenid/urls.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext as _
urlpatterns = patterns('django_authopenid.views',
# yadis rdf
url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'),
# manage account registration
url(r'^%s$' % _('signin/'), 'signi... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/test/test_userdict.py | 56 | # Check every path through every method of UserDict
from test import test_support, mapping_tests
import UserDict
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py | 356 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE
def to_genshi(walker):
text = []
for token in walker:
type = token["type"]
if type in ("Characters", "SpaceCharacters"):
... |
neillc/memberdb-ng | refs/heads/master | backend/views/members.py | 1 | from datetime import datetime
from flask import flash, redirect, render_template, request
from flask_mail import Message
from flask_login import login_required, current_user
from backend import app, db, mail
from backend.models import Members
from backend.models.members import OrgMembers, MemberTypes
app.api_manager... |
hn8841182/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/unittest/__main__.py | 737 | """Main entry point"""
import sys
if sys.argv[0].endswith("__main__.py"):
import os.path
# We change sys.argv[0] to make help message more useful
# use executable without path, unquoted
# (it's just a hint anyway)
# (if you have spaces in your executable you get what you deserve!)
executable = ... |
olafhauk/mne-python | refs/heads/master | examples/forward/plot_source_space_morphing.py | 19 | """
=========================
Use source space morphing
=========================
This example shows how to use source space morphing (as opposed to
:class:`~mne.SourceEstimate` morphing) to create data that can be compared
between subjects.
.. warning:: Source space morphing will likely lead to source spaces that ar... |
dredgar/ss-info-fetcher | refs/heads/master | lib/bs4/tests/test_soup.py | 62 | # -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""
from pdb import set_trace
import logging
import unittest
import sys
import tempfile
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
SoupStrainer,... |
chauffer/pyamazonclouddrive | refs/heads/master | test-cojp.py | 10 | #!/usr/bin/env python
#
# Copyright (c) 2011 anatanokeitai.com(sakurai_youhei)
#
# 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 right... |
2014c2g2/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py | 727 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... |
jelugbo/hebs_master | refs/heads/master | lms/envs/devgroups/h_cs50.py | 74 |
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .courses import *
DATABASES = course_db_for('HarvardX/CS50x/2012')
|
LudovicRousseau/pyscard | refs/heads/master | smartcard/test/framework/testcase_ulist.py | 1 | #! /usr/bin/env python3
"""Unit tests for ulist
This test case can be executed individually, or with all other test cases
thru testsuite_framework.py.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:[email protected]
This file is part of pyscard.
py... |
oscarolar/odoo | refs/heads/master | addons/account/wizard/account_report_general_ledger.py | 75 | # -*- 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... |
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/django/utils/functional.py | 36 | import copy
import operator
import sys
import warnings
from functools import wraps
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.six.moves import copyreg
# You can't trivially replace this with `functools.partial` because this binds
# to classes and retu... |
Spiderlover/Toontown | refs/heads/master | toontown/speedchat/TTSCBoardingMenu.py | 6 | from direct.showbase import PythonUtil
from otp.speedchat.SCMenu import SCMenu
from otp.speedchat.SCMenuHolder import SCMenuHolder
from otp.speedchat.SCStaticTextTerminal import SCStaticTextTerminal
from otp.otpbase import OTPLocalizer
BoardingMenuGuide = [(OTPLocalizer.BoardingMenuSections[0], []),
(OTPLocalizer.Boar... |
lofar-astron/factor | refs/heads/master | factor/scripts/copy_column.py | 3 | #! /usr/bin/env python
"""
Script to copy a column between MS files
"""
import argparse
from argparse import RawTextHelpFormatter
import casacore.tables as pt
import numpy
import sys
import os
def copy_column_to_ms(ms, inputcol, outputcol, ms_from=None, use_compression=False):
"""
Copies one column to another... |
russellmayhew/satchmo | refs/heads/master | satchmo/apps/payment/views/cron.py | 8 | from datetime import datetime, timedelta
from decimal import Decimal
from django.http import HttpResponse
from django.utils.translation import ugettext, ugettext_lazy as _
from livesettings import config_get_group, config_value
from satchmo_store.shop.models import Order, OrderItem, OrderPayment
from satchmo_utils.view... |
blambov/cassandra | refs/heads/trunk | pylib/cqlshlib/test/winpty.py | 62 | # 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 u... |
tridao/cvxpy | refs/heads/master | cvxpy/atoms/lambda_sum_largest.py | 12 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
roaet/quark | refs/heads/master | quark/tests/cache/test_security_groups_client.py | 2 | # Copyright 2014 Rackspace Hosting Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
gsarma/PyOpenWorm | refs/heads/dev | OpenWormData/__init__.py | 1 | from rdflib.namespace import Namespace
BIO_ENT_NS = Namespace('http://openworm.org/entities/bio#')
|
bgxavier/nova | refs/heads/master | nova/tests/unit/fake_crypto.py | 78 | # Copyright 2012 Nebula, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
mdhaber/scipy | refs/heads/master | scipy/cluster/tests/test_hierarchy.py | 12 | #
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this... |
CamAndPineapple/starrynight | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 395 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildmac/Resources/env/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 412 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools import namespaces
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(namespaces.Installer, Command):
"""Install an .egg-info directory for the package"""
description = "In... |
EvanzzzZ/mxnet | refs/heads/master | plugin/opencv/opencv.py | 15 | # coding: utf-8
# pylint: disable=too-many-arguments,no-member,invalid-name
"""Opencv plugin for mxnet"""
import random
import ctypes
import cv2
import mxnet as mx
from mxnet.base import _LIB
from mxnet.base import mx_uint, NDArrayHandle, check_call
def imdecode(str_img, flag=1):
"""Decode image from str buffer.
... |
captainpete/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-entrypointsymbol.py | 342 | #!/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 entrypointsymbol setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.... |
jaja14/project4 | refs/heads/master | lib/flask/testsuite/test_apps/config_module_app.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
arkanus/selenium-sunbro | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from setuptools import setup
import os
ROOT = os.path.abspath(os.path.dirname(__file__))
README = os.path.join(ROOT, 'README.md')
try:
long_description = open(README).read()
except IOError:
long_description = None
setup(
name='selenium-sunbro',
version='0.0.4',
author='Mar... |
wldcordeiro/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-access-control.py | 78 | import base64
import json
def main(request, response):
headers = []
headers.append(('X-ServiceWorker-ServerHeader', 'SetInTheServer'))
if "ACAOrigin" in request.GET:
for item in request.GET["ACAOrigin"].split(","):
headers.append(("Access-Control-Allow-Origin", item))
for suffix i... |
tkerola/chainer | refs/heads/master | tests/chainer_tests/datasets_tests/test_concatenated_dataset.py | 13 | import numpy as np
import six
import unittest
from chainer.datasets import ConcatenatedDataset
from chainer import testing
@testing.parameterize(
# basic usage
{'datasets': (
np.random.uniform(size=(5, 3, 48, 32)),
np.random.uniform(size=(15, 3, 64, 48)),
)},
# more than two datasets... |
julian-seward1/servo | refs/heads/master | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/support/fonts/makegsubfonts.py | 1616 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... |
jlanecox/googletest | refs/heads/master | googletest/test/googletest-catch-exceptions-test.py | 81 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
jbair34/moose | refs/heads/devel | gui/gui/InputFileTreeWidget.py | 31 | #!/usr/bin/python
import os, sys, getopt
try:
from PyQt4 import QtCore, QtGui
QtCore.Signal = QtCore.pyqtSignal
QtCore.Slot = QtCore.pyqtSlot
except ImportError:
try:
from PySide import QtCore, QtGui
QtCore.QString = str
except ImportError:
raise ImportError("Cannot load eit... |
aliyun/oss-ftp | refs/heads/master | python27/unix/lib/urllib3/util/response.py | 199 | from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check vi... |
serpilliere/miasm | refs/heads/master | example/expression/simplification_add.py | 5 | from __future__ import print_function
import miasm.expression.expression as m2_expr
from miasm.expression.simplifications import expr_simp
from pdb import pm
print("""
Expression simplification demo: Adding a simplification:
a + a + a == a * 3
More detailed examples can be found in miasm/expression/simplification*.
"... |
xxshutong/openerp-7.0 | refs/heads/master | openerp/addons/process/__openerp__.py | 65 | # -*- 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... |
wjr1005/p2pool | refs/heads/master | wstools/tests/test_wstools.py | 308 | #!/usr/bin/env python
############################################################################
# Joshua R. Boverhof, David W. Robertson, LBNL
# See LBNLCopyright for copyright notice!
###########################################################################
import unittest, tarfile, os, ConfigParser
import test... |
danakj/chromium | refs/heads/master | build/gyp_chromium_test.py | 27 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
SRC_DIR = os.path.dirname(SCRIPT_DIR)
sy... |
ChinaQuants/pyfolio | refs/heads/master | pyfolio/plotting.py | 1 | #
# Copyright 2015 Quantopian, 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 wr... |
rsharo/floodlight | refs/heads/master | example/graphDeps.py | 148 | #!/usr/bin/python
import urllib2
import json
import sys
def simple_json_get(url):
return json.loads(urllib2.urlopen(url).read())
def shorten(s):
return s.replace('net.floodlightcontroller','n.f'
).replace('com.bigswitch','c.b')
def usage(s):
sys.stderr.write("Usage:\ngrahDeps.py hostname ... |
Omegaphora/external_chromium_org | refs/heads/lp5.1 | tools/traceline/traceline/scripts/split.py | 186 | #!/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.
"""Splits a single json file (read from stdin) into separate files of 40k
records, named split.X.
"""
import sys
def main():
f... |
jrief/django-cms | refs/heads/master | cms/extensions/__init__.py | 82 | from .models import PageExtension # nopyflakes
from .models import TitleExtension # nopyflakes
from .extension_pool import extension_pool # nopyflakes
from .admin import PageExtensionAdmin # nopyflakes
from .admin import TitleExtensionAdmin # nopyflakes
|
nicolargo/intellij-community | refs/heads/master | python/testData/addImport/newThirdPartyImportInBetween/main.after.py | 75 | import sys
import third_party
import a
print(sys, third_party, a) |
vprime/puuuu | refs/heads/master | env/lib/python2.7/site-packages/south/db/firebird.py | 93 | # firebird
from __future__ import print_function
import datetime
from django.db import connection, models
from django.core.management.color import no_style
from django.db.utils import DatabaseError
from south.db import generic
from south.utils.py3 import string_types
class DatabaseOperations(generic.DatabaseOperat... |
umago/kabukiman | refs/heads/master | kabukiman/core/shortcut/__init__.py | 4 | #!/usr/bin/python
# coding: utf-8
# Copyright (C) 2010 Lucas Alvares Gomes <[email protected]>
#
# 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 you... |
epantry/django-sql-explorer | refs/heads/master | explorer/tests/test_schema.py | 2 | # -*- coding: utf-8 -*-
from unittest.mock import patch
from django.core.cache import cache
from django.db import connection
from django.test import TestCase
from explorer.app_settings import EXPLORER_DEFAULT_CONNECTION as CONN
from explorer import schema
class TestSchemaInfo(TestCase):
def setUp(self):
... |
cpina/science-cruise-data-management | refs/heads/master | ScienceCruiseDataManagement/main/views.py | 1 | import glob
import json
import datetime
import geojson
import os
from django.conf import settings
from django.db.models import Q
from django.http import JsonResponse
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView, View, ListView
from django.core.exce... |
Tejal011089/digitales_erpnext | refs/heads/develop | erpnext/accounts/report/accounts_payable/accounts_payable.py | 18 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, nowdate, flt, cstr
from frappe import msgprint, _
from erpnext.accounts.report.accounts_receivable.ac... |
ajoaoff/django | refs/heads/master | tests/postgres_tests/test_ranges.py | 98 | import datetime
import json
import unittest
from django import forms
from django.core import exceptions, serializers
from django.db import connection
from django.db.models import F
from django.test import TestCase, override_settings
from django.utils import timezone
from . import PostgreSQLTestCase
from .models impor... |
fayf/pyload | refs/heads/stable | module/plugins/hoster/MultishareCz.py | 12 | # -*- coding: utf-8 -*-
import random
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MultishareCz(SimpleHoster):
__name__ = "MultishareCz"
__type__ = "hoster"
__version__ = "0.42"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?multi... |
x1ah/Daily_scripts | refs/heads/master | Newtouch/atouch.py | 2 | #!/usr/bin/env python
# coding:utf-8
import os
import argparse
header_msg = {
'py': ("#!/usr/bin/env python\n"
"# coding:utf-8\n"),
'c': ("#include <stdio.h>\n\n"
"int main (void)\n"
"{\n return 0;\n}\n"),
'scm': ";;;\n",
"html": "<!DOCTYPE HTML>",
'm': '',
'... |
singlerider/cloudbrain | refs/heads/master | cloudbrain/publishers/PipePublisher.py | 6 | import json
import sys, os
import os.path
import stat
from cloudbrain.publishers.PublisherInterface import Publisher
from threading import Lock
class PipePublisher(Publisher):
"""
Publisher implementation for writing data to pipe
"""
PIPE_WRITING_LOCKS = dict()
def __init__(self, device_name, device_id, ... |
maurofaccenda/ansible | refs/heads/devel | lib/ansible/modules/notification/twilio.py | 36 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <[email protected]>
#
# 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 ... |
pedrobaeza/odoo | refs/heads/master | addons/product_extended/product_extended.py | 59 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero G... |
manaris/jythonMusic | refs/heads/master | 24. oscOut.py | 1 | # oscOut.py
from osc import *
oscOut = OscOut("localhost", 57110)
oscOut.sendMessage("/helloWorld")
oscOut.sendMessage("/test", 1, 2, 3)
oscOut.sendMessage("/itsFullOfStars", 1, 2.35, "wow!", True) |
shanot/imp | refs/heads/develop | modules/domino/test/test_order.py | 2 | from __future__ import print_function
import IMP
import IMP.test
import IMP.domino
import IMP.core
class Tests(IMP.test.TestCase):
def _print_order(self, order, s):
for i in order:
print(s[order[i]].get_name(), end=' ')
def _test_global_min2(self):
"""Testing ordering"""
... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/base/service.py | 166 | #!/usr/bin/python
#
# Copyright (C) 2006 Google 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 ... |
TalShafir/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_policy.py | 8 | # -*- 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... |
ryano144/intellij-community | refs/heads/master | python/lib/Lib/distutils/tests/test_dist.py | 88 | """Tests for distutils.dist."""
import distutils.cmd
import distutils.dist
import os
import shutil
import StringIO
import sys
import tempfile
import unittest
from test.test_support import TESTFN
class test_dist(distutils.cmd.Command):
"""Sample distutils extension command."""
user_options = [
("sam... |
araseyuta/Newsstand-analytics | refs/heads/master | gdata/tlslite/utils/Python_RSAKey.py | 239 | """Pure-Python RSA implementation."""
from cryptomath import *
import xmltools
from ASN1Parser import ASN1Parser
from RSAKey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if (n and not e) or (e and not n):
raise AssertionError()
... |
emedinaa/contentbox | refs/heads/master | third_party/modeltranslation/tests/test_settings.py | 15 | """
Get test settings in dict format (for use with settings_override).
"""
from . import settings as _settings
TEST_SETTINGS = dict((k, getattr(_settings, k)) for k in dir(_settings) if k == k.upper())
|
madafoo/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/generator-output/gyptest-copies.py | 66 | #!/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.
"""
Verifies file copies with --generator-output using an explicit build
target of 'all'.
"""
import TestGyp
# Android doesn't support --g... |
axbaretto/beam | refs/heads/master | sdks/python/apache_beam/io/gcp/datastore/v1new/helper_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"); you may not us... |
guiquanz/httpie | refs/heads/master | tests/test_ssl.py | 46 | import os
import pytest
import pytest_httpbin.certs
from requests.exceptions import SSLError
from httpie import ExitStatus
from utils import http, HTTP_OK, TESTS_ROOT
CLIENT_CERT = os.path.join(TESTS_ROOT, 'client_certs', 'client.crt')
CLIENT_KEY = os.path.join(TESTS_ROOT, 'client_certs', 'client.key')
CLIENT_PEM =... |
marratj/ansible | refs/heads/devel | lib/ansible/modules/network/junos/junos_banner.py | 22 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... |
adelcast/opkg | refs/heads/master | tests/core/11_virtual_conflicts_second.py | 7 | #! /usr/bin/env python
#
# Install a package 'x' which PROVIDES 'v'. Then try to install 'y' which
# PROVIDES and CONFLICTS 'v', indicating that no other provider of the virtual
# package 'v' should be installed at the same time as 'y'.
import os
import opk, cfg, opkgcl
opk.regress_init()
o = opk.OpkGroup()
o.add(Pa... |
ciex/motor | refs/heads/master | lib/werkzeug/testsuite/formparser.py | 63 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.formparser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the form parsing facilities.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from StringIO import StringIO
... |
andrewsosa/hackfsu_com | refs/heads/master | api/api/views/hacker/get/__init__.py | 2 | from .profile import ProfileView
from . import csv
|
hooting/show-me-the-code-python | refs/heads/master | ddkangfu/0003/0003.py | 40 | #coding=utf-8
import uuid
import redis
"""
003, 将 0001 题生成的 200 个激活码(或者优惠券)保存到 **Redis** 非关系型数据库中.
"""
def get_redis_instance(host='localhost', port=6379):
return redis.StrictRedis(host=host, port=port)
def generate_activation_code(count):
code_list = []
for i in xrange(count):
code = str(uui... |
pwarren/AGDeviceControl | refs/heads/master | agdevicecontrol/thirdparty/site-packages/linux2/twisted/cred/identity.py | 19 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""DEPRECATED.
Base authentication mechanisms for Twisted.
Maintainer: U{Glyph Lefkowitz<mailto:[email protected]>}
Stability: semi-stable
Future Plans: There needs to be more pluggable support for different, disparate
authen... |
hungtt57/matchmaker | refs/heads/master | lib/python2.7/site-packages/django/contrib/gis/geoip/base.py | 106 | import os
import re
from ctypes import c_char_p
from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS
from django.contrib.gis.geoip.prototypes import (
GeoIP_country_code_by_addr, GeoIP_country_code_by_name,
GeoIP_country_name_by_addr, GeoIP_country_name_by_name,
GeoIP_database_info, GeoIP_delete, G... |
C-Blu/npyscreen | refs/heads/master | npyscreen/wgtexttokens.py | 15 | import curses
import sys
from . import wgwidget
from . import wgtextbox
from . import wgtitlefield
class TextTokens(wgtextbox.Textfield,wgwidget.Widget):
"""This is an experiemental widget"""
# NB IT DOES NOT CURRENTLY SUPPORT THE HIGHLIGHTING COLORS
# OF THE TEXTFIELD CLASS.
def __init_... |
kennethgillen/ansible | refs/heads/devel | test/units/plugins/test_plugins.py | 104 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
caktus/django-styleguide | refs/heads/develop | styleguide/management/commands/copypattern.py | 1 | import os
import shutil
from django.apps import apps
from django.core.management.base import LabelCommand, CommandError
from django import template
from styleguide.utils import get_styleguide_templates
class Command(LabelCommand):
help = 'Copy built-in pattern from the styleguide to project templates'
def h... |
daasbank/swift | refs/heads/master | swift/account/replicator.py | 43 | # Copyright (c) 2010-2012 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
pacificIT/mopidy | refs/heads/develop | mopidy/core/library.py | 6 | from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import logging
import operator
import urlparse
from mopidy import compat, exceptions, models
from mopidy.internal import deprecation, validation
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def _backen... |
ldtri0209/robotframework | refs/heads/master | src/robot/result/__init__.py | 6 | # Copyright 2008-2014 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... |
kwlzn/rpyc | refs/heads/master | rpyc/utils/registry.py | 8 | """
RPyC **registry server** implementation. The registry is much like
`Avahi <http://en.wikipedia.org/wiki/Avahi_(software)>`_ or
`Bonjour <http://en.wikipedia.org/wiki/Bonjour_(software)>`_, but tailored to
the needs of RPyC. Also, neither of them supports (or supported) Windows,
and Bonjour has a restrictive licen... |
dariemp/odoo | refs/heads/8.0 | addons/account/account_cash_statement.py | 283 | # encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... |
podemos-info/odoo | refs/heads/6.1 | addons/point_of_sale/__init__.py | 9 | # -*- 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... |
mjg/PyX | refs/heads/grid-with-axisat | pyx/pdfextra.py | 2 | # -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2006 Michael Schindler <[email protected]>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX 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 ... |
quentinlautischer/291MiniProject2 | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/html5lib/treebuilders/_base.py | 915 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... |
cedk/odoo | refs/heads/8.0 | openerp/modules/module.py | 199 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
hutchison/bp_mgmt | refs/heads/public | bp_cupid/migrations/0018_praxis_related_names.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bp_cupid', '0017_block_unique'),
]
operations = [
migrations.AlterField(
model_name='praxis',
name='... |
jcoady9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_operator.py | 67 | import operator
import unittest
from test import support
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def __getitem__(self, i):
return self.lst[i]
def __add__(self, other):
return self.lst + other.lst
def __mul__(self, ... |
peralmq/olloapi | refs/heads/master | models.py | 1 | from google.appengine.ext import ndb
class Token(ndb.Model):
facebook_id = ndb.IntegerProperty()
facebook_access_token = ndb.StringProperty()
access_token = ndb.StringProperty()
class Location(ndb.Model):
longitude = ndb.FloatProperty()
latitude = ndb.FloatProperty()
message = ndb.TextProperty... |
s0undt3ch/Deluge | refs/heads/master | deluge/plugins/AutoAdd/deluge/plugins/autoadd/webui.py | 8 | #
# webui.py
#
# Copyright (C) 2009 GazpachoKing <[email protected]>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <[email protected]>
# Copyright (C) 2007-2009 Andrew Resch <[email protected]>
# Copyright (C) 2009 Damien Churchill <[email protected]>
#
# Deluge is free software.... |
pambros/CNN-2D-X-Ray-Catheter-Detection | refs/heads/master | python/common/System.py | 1 | import subprocess
import platform
def CallCommand(_command, _getOutput=False, _verbose=True):
if _verbose == True:
print(_command)
if _getOutput == True:
ret = subprocess.Popen(_command, shell=True, stdout=subprocess.PIPE)
# tmp = ret.stdout.read()
out, err = ret.communicate()
# print(out)
# print(err)
... |
pataquets/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/__init__.py | 6014 | # Required for Python to search this directory for module files
|
huntxu/neutron | refs/heads/master | neutron/agent/l3/keepalived_state_change.py | 3 | # Copyright (c) 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.