repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ahaym/eden | refs/heads/master | modules/tests/person/__init__.py | 24 | from search_person import *
from create_person import * |
sergei-maertens/django | refs/heads/master | tests/mutually_referential/tests.py | 581 | from django.test import TestCase
from .models import Parent
class MutuallyReferentialTests(TestCase):
def test_mutually_referential(self):
# Create a Parent
q = Parent(name='Elizabeth')
q.save()
# Create some children
c = q.child_set.create(name='Charles')
q.chil... |
balena/python-smime | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.r... |
chambakari/xblog | refs/heads/master | mysite/blog/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
liuhewei/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes-master/hooks/__init__.py | 723 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
swift-lang/swift-e-lab | refs/heads/master | parsl/tests/__init__.py | 8 | import os
if str(os.environ.get('PARSL_TESTING', False)).lower() != 'true':
raise RuntimeError("must first run 'export PARSL_TESTING=True'")
|
Jumpscale/jumpscale_examples7 | refs/heads/master | examples/zdaemon/zdaemon_ssl_init.py | 2 |
from JumpScale import j
import JumpScale.grid.zdaemon
j.application.start("zdaemon")
j.logger.consoleloglevel = 2
j.core.zdaemon.initSSL4Server("myorg", "servertest")
j.application.stop()
|
Silight/ComicEnv | refs/heads/master | ComicEnv/lib/python3.2/site-packages/pip/_vendor/html5lib/ihatexml.py | 1727 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... |
h2oai/h2o-dev | refs/heads/master | h2o-py/tests/testdir_misc/pyunit_na_omit.py | 6 | from future import standard_library
standard_library.install_aliases()
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
import urllib.request, urllib.parse, urllib.error
################################################################################
#
# Verifying that we can use na_omi... |
gorbinphilip/PyRegistrar | refs/heads/master | pyregistrar/test/test_plain.py | 1 | from ..extensions import plain
import os
def test_plain():
p=plain.Export()
file="/tmp/test454654.txt"
data=[("name","me"), ("age","0")]
p.export(data, file)
f=open(file)
data=f.read()
assert data.__contains__("name")
os.remove(file)
|
dylanlesko/youtube-dl | refs/heads/master | youtube_dl/extractor/planetaplay.py | 113 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class PlanetaPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?planetaplay\.com/\?sng=(?P<id>[0-9]+)'
_API_URL = 'http://planetaplay.com/action/playlist/?sng={0:}'
... |
skevy/django | refs/heads/master | tests/modeltests/fixtures/tests.py | 51 | import StringIO
import sys
from django.conf import settings
from django.contrib.sites.models import Site
from django.core import management
from django.db import DEFAULT_DB_ALIAS
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from models import Article, Blog, Book, Category, Person, Spy, T... |
wilkinsg/piweb | refs/heads/master | watched.py | 1 | #!/usr/bin/python
import hash
import os
import config
import video_info
watched_cache = {}
def prepwatched( conn ):
global watched_cache
result = conn.execute( "SELECT * FROM history" )
queueitem = result.fetchone()
while( queueitem ):
watched_cache[ queueitem[ 0 ] ] = True
queueitem ... |
beepee14/scikit-learn | refs/heads/master | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... |
wendlers/tinr2d2 | refs/heads/master | src/pyremote/tinr2d2.py | 1 | import serial
class TinR2D2:
def __init__(self, port):
#self.s = serial.Serial(port=port, timeout=10)
#self.send("+p")
pass
def send(self, msg):
'''
self.s.flushInput()
l = self.s.write(msg + "\r")
return l
'''
return 0
def rece... |
trabacus-softapps/openerp-8.0-cc | refs/heads/master | openerp/addons/sale/__init__.py | 72 | # -*- 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... |
pawelmhm/splash | refs/heads/master | splash/pool.py | 2 | from __future__ import absolute_import
from twisted.internet import defer
from twisted.python import log
class RenderPool(object):
"""A pool of renders. The number of slots determines how many
renders will be run in parallel, at the most."""
def __init__(self, slots, network_manager_factory, splash_proxy... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/armor_appearance_rebel_specforce_bracer_l.py | 85615 | import sys
def setup(core, object):
return |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/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('"\... |
hassanibi/erpnext | refs/heads/develop | erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py | 5 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe import msgprint, _
from frappe.utils import cstr, flt, cint
from erpnext.stock.stock_ledger import upda... |
sauloal/pycluster | refs/heads/master | pypy-1.9_64/lib-python/2.7/lib-tk/ttk.py | 35 | """Ttk wrapper.
This module provides classes to allow using Tk themed widget set.
Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.
Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
ap... |
scottmcmaster/catapult | refs/heads/master | third_party/html5lib-python/utils/spider.py | 436 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... |
erichegt/askbot-devel | refs/heads/master | askbot/views/context.py | 4 | """functions, preparing parts of context for
the templates in the various views"""
from django.utils import simplejson
from django.utils.translation import ugettext as _
from askbot.conf import settings as askbot_settings
from askbot import const
from askbot.const import message_keys as msg
from askbot.models import Gr... |
lyceel/engine | refs/heads/master | build/android/gyp/insert_chromium_version.py | 77 | #!/usr/bin/env python
#
# Copyright 2014 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.
"""Insert a version string into a library as a section '.chromium.version'.
"""
import optparse
import os
import sys
import tempfile... |
Zubieta/CPP | refs/heads/master | Google_Code_Jam/2020/Qualifier_Round/03_Parenting_Partnering_Returns.py | 2 | # 03 - Parenting Partening Returns
# Scheduling kid activities and domestic necesities is a challenge for a couple
# parents of a 3 year old child. They have a list of N activities to take care
# during the day, each activity happens during a specified interval in the day.
# Thet need to assign each activity to any o... |
johren/RackHD | refs/heads/master | test/tests/api/v2_0/obm_settings.py | 11 | from config.api2_0_config import *
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0 import rest
from modules.logger import Log
from json import dumps, loads
LOG = Log(__name__)
"""
Class to abstract the RackHD Out-of-Band settings
"""
class obmSettings(object):
def __init__(self, *args, **kwargs):
... |
gencer/python-phonenumbers | refs/heads/dev | python/phonenumbers/shortdata/region_AD.py | 2 | """Auto-generated file, do not edit by hand. AD metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AD = PhoneMetadata(id='AD', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_length=(3,)),
em... |
hrishioa/Aviato | refs/heads/master | kartograph/kartograph/layersource/shapefile.py | 4 | """
shapefile.py
Provides read and write support for ESRI Shapefiles.
author: jlawhead<at>geospatialpython.com
date: 20110927
version: 1.1.4
Compatible with Python versions 2.4-3.x
"""
from struct import pack, unpack, calcsize, error
import os
import sys
import time
import array
#
# Constants for shape types
NULL = 0
... |
suyashphadtare/sajil-final-erp | refs/heads/develop | erpnext/support/doctype/newsletter/newsletter.py | 31 | # 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
import frappe.utils
from frappe.utils import cstr
from frappe import throw, _
from frappe.model.document import Document
import erpnex... |
patacrep/patacrep | refs/heads/master | patacrep/content/songsection.py | 1 | """Allow 'songchapter' and 'songsection' as content of a songbook."""
from patacrep.content import ContentItem, ContentList, validate_parser_argument
KEYWORDS = [
"songchapter",
"songsection",
]
class SongSection(ContentItem):
"""A songsection or songchapter."""
# pylint: disable=too-few-public-m... |
kimoonkim/spark | refs/heads/branch-2.1-kubernetes | examples/src/main/python/mllib/regression_metrics_example.py | 158 | #
# 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... |
nwjs/chromium.src | refs/heads/nw45-log | third_party/Python-Markdown/markdown/extensions/codehilite.py | 100 | """
CodeHilite Extension for Python-Markdown
========================================
Adds code/syntax highlighting to standard Python-Markdown code blocks.
See <https://pythonhosted.org/Markdown/extensions/code_hilite.html>
for documentation.
Original code Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/... |
apark263/tensorflow | refs/heads/master | tensorflow/python/keras/losses_test.py | 2 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mgit-at/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/rds_param_group.py | 3 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
nelmiux/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/idlelib/CallTips.py | 43 | """CallTips.py - An IDLE Extension to Jog Your Memory
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import re
import sys
import types
from idlelib import C... |
demarle/VTK | refs/heads/master | ThirdParty/Twisted/twisted/conch/test/test_agent.py | 42 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.agent}.
"""
import struct
from twisted.trial import unittest
try:
import OpenSSL
except ImportError:
iosim = None
else:
from twisted.test import iosim
try:
import Crypto.Cipher.DES3
except Impo... |
bhairavmehta95/flashcard-helper-alexa-skill | refs/heads/master | pymysql/connections.py | 10 | # Python implementation of the MySQL client-server protocol
# http://dev.mysql.com/doc/internals/en/client-server-protocol.html
# Error codes:
# http://dev.mysql.com/doc/refman/5.5/en/error-messages-client.html
from __future__ import print_function
from ._compat import PY2, range_type, text_type, str_type, JYTHON, IRON... |
pkimber/checkout | refs/heads/master | example_checkout/forms.py | 1 | # -*- encoding: utf-8 -*-
from django import forms
from checkout.forms import CheckoutForm
from .models import SalesLedger
class EmptyForm(forms.Form):
pass
class SalesLedgerCheckoutForm(CheckoutForm):
class Meta:
model = SalesLedger
fields = (
'action',
)
class Sales... |
android-ia/platform_external_chromium | refs/heads/master | chrome/browser/sync/PRESUBMIT.py | 67 | #!/usr/bin/python
# Copyright (c) 2011 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.
"""Chromium presubmit script for src/chrome/browser/sync.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
... |
Northrend/mxnet | refs/heads/master | plugin/opencv/opencv.py | 61 | # 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... |
mcs07/ChemDataExtractor | refs/heads/master | chemdataextractor/reader/plaintext.py | 1 | # -*- coding: utf-8 -*-
"""
chemdataextractor.reader.plaintext
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Plain text document reader.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import six
from ..doc.docu... |
LFPy/LFPy | refs/heads/master | examples/bioRxiv281717/figure_2.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simulation and plotting script reproducing figure 2 of:
Multimodal modeling of neural network activity: computing LFP, ECoG, EEG and
MEG signals with LFPy2.0
Espen Hagen, Solveig Næss, Torbjørn V Ness, Gaute T Einevoll
bioRxiv 281717; doi: https://doi.org/10.1101/28171... |
glatard/nipype | refs/heads/master | nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py | 9 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import TemporalFilter
def test_TemporalFilter_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
highpass_sigma=dict(arg... |
agile-geoscience/striplog | refs/heads/master | tests/test_plots.py | 1 | """
Defines a suite a tests for images run with:
py.test --mpl
To generate new test images, see the instructions in
striplog/run_tests.py
https://pypi.python.org/pypi/pytest-mpl/0.3
"""
import random
import matplotlib.pyplot as plt
import pytest
from striplog import Striplog, Lexicon
from striplog import Legen... |
dbestm/mbed | refs/heads/master | workspace_tools/host_tests/echo.py | 122 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... |
CasparLi/sshuttle | refs/heads/master | version/__init__.py | 20 | from _version import COMMIT, TAG, DATE
|
meiordac/ecommerce | refs/heads/master | catalog/admin.py | 1 | from django.contrib import admin
# Register your models here.
from .models import Comment
from .models import Category
from .models import Product
admin.site.register(Category)
admin.site.register(Product)
admin.site.register(Comment)
|
Venturi/oldcms | refs/heads/master | env/lib/python2.7/site-packages/cmsplugin_filer_image/migrations/0010_auto__add_field_filerimage_target_blank.py | 11 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
cms_plugin_table_mapping = (
# (old_name, new_name),
('cmsplugin_... |
whitepyro/debian_server_setup | refs/heads/master | sickbeard/name_parser/parser.py | 1 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... |
Habatchii/PTVS | refs/heads/master | Python/Tests/TestData/AbsolutePath/Program.py | 692 | print('hello world') |
mcpool/p2pool-dgb | refs/heads/master | p2pool/bitcoin/networks/__init__.py | 94 | import pkgutil
nets = dict((name, __import__(name, globals(), fromlist="dummy"))
for module_loader, name, ispkg in pkgutil.iter_modules(__path__))
for net_name, net in nets.iteritems():
net.NAME = net_name
|
hydroshare/hydroshare_temp | refs/heads/master | hs_core/migrations/0008_auto__add_bags.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Bags'
db.create_table(u'hs_core_bags', (
(u'i... |
zombihello/lifeRadiant | refs/heads/master | libxml2-2.9.2/python/tests/tstmem.py | 35 | #!/usr/bin/python -u
import libxml2
import libxml2mod
import sys
def error(msg, data):
pass
# Memory debug specific
libxml2.debugMemory(1)
dtd="""<!ELEMENT foo EMPTY>"""
instance="""<?xml version="1.0"?>
<foo></foo>"""
dtd = libxml2.parseDTD(None, 'test.dtd')
ctxt = libxml2.newValidCtxt()
libxml2mod.xmlSetValid... |
jwilk/pdf2djvu | refs/heads/master | tests/test-crop-text.py | 1 | # encoding=UTF-8
# Copyright © 2009-2018 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of pdf2djvu.
#
# pdf2djvu is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# pdf2djvu is distributed in t... |
kvar/ansible | refs/heads/seas_master_2.9.5 | test/units/modules/network/cnos/test_cnos_vlan.py | 23 | # (c) 2018 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 dis... |
clstl/servo | refs/heads/master | tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py | 282 | import time
def main(request, response):
time.sleep(0.1)
return [("Content-Type", "text/plain")], "FAIL"
|
jimberlage/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/mod_pywebsocket/common.py | 23 | # Copyright 2012, 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 of conditions and the f... |
itsjeyd/edx-platform | refs/heads/master | openedx/core/djangoapps/ccxcon/tests/test_signals.py | 36 | """
Test for contentstore signals receiver
"""
import mock
from nose.plugins.attrib import attr
from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore, SignalHandler
@attr(shard=2)
class CCXConSignalTestCase(TestCase):
"""
The only test... |
cisco-openstack/tempest | refs/heads/proposed | tempest/api/compute/security_groups/test_security_group_rules.py | 3 | # Copyright 2012 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 requ... |
atsao72/sympy | refs/heads/master | sympy/simplify/radsimp.py | 46 | from __future__ import print_function, division
from collections import defaultdict
from sympy import SYMPY_DEBUG
from sympy.core.evaluate import global_evaluate
from sympy.core.compatibility import iterable, ordered, as_int, default_sort_key
from sympy.core import expand_power_base, sympify, Add, S, Mul, Derivative... |
JohnGeorgiadis/invenio | refs/heads/master | invenio/modules/scheduler/config.py | 7 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... |
minhphung171093/GreenERP | refs/heads/master | openerp/addons/account_check_printing/__init__.py | 45 | # -*- coding: utf-8 -*-
import account_journal
import account_journal_dashboard
import account_payment
import wizard
|
blademainer/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/admin/options.py | 69 | from django import forms, template
from django.forms.formsets import all_valid
from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory
from django.forms.models import BaseInlineFormSet
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin import widg... |
yamt/ryu | refs/heads/master | ryu/services/protocols/bgp/utils/other.py | 42 | def bytes2hex(given_bytes):
return ''.join(["%02X " % ord(x) for x in given_bytes]).strip()
def hex2byte(given_hex):
given_hex = ''.join(given_hex.split())
result = []
for offset in range(0, len(given_hex), 2):
result.append(chr(int(given_hex[offset:offset + 2], 16)))
return ''.join(resul... |
formiano/enigma2-4.4 | refs/heads/master | lib/python/Components/Converter/CryptoInfo.py | 67 | from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config
from Tools.GetEcmInfo import GetEcmInfo
from Poll import Poll
class CryptoInfo(Poll, Converter, object):
def __init__(self, type):
Converter.__init__(self, type)
Poll.__init__(self)
... |
PKRoma/python-for-android | refs/heads/master | pythonforandroid/recipes/android/src/android/storage.py | 3 | from jnius import autoclass, cast
import os
Environment = autoclass('android.os.Environment')
File = autoclass('java.io.File')
def _android_has_is_removable_func():
VERSION = autoclass('android.os.Build$VERSION')
return (VERSION.SDK_INT >= 24)
def _get_sdcard_path():
""" Internal function to return ge... |
damoti/shipmaster | refs/heads/master | shipmaster/plugins/log/log.py | 1 | import logging
from shipmaster.core.plugins import Plugin
logger = logging.getLogger('shipmaster.builder')
class LogPlugin(Plugin):
def handle_log_output(self, b, line):
logger.info(line)
def before_build(self, b):
logger.info('BUILDING {} FROM {}'.format(b.config.name, b.config.from_image)... |
ndardenne/pymatgen | refs/heads/master | pymatgen/io/feff/__init__.py | 10 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
This package provides the modules to perform FEFF IO.
FEFF: http://feffproject.org/feffproject-feff.html
"""
from .inputs import *
from .outputs import *
|
intip/django-cms | refs/heads/develop | cms/test_utils/project/bunch_of_plugins/south_migrations/0001_initial.py | 46 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TestPlugin1'
db.create_table(u'bunch_of_plugins_testplugi... |
azjps/bokeh | refs/heads/master | examples/models/glyph2_server.py | 6 | from __future__ import print_function
from numpy import pi, arange, sin, cos
from bokeh.client import push_session
from bokeh.document import Document
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, Grid,
ColumnDataSource, PanTool, WheelZoomTool
)
document = D... |
2ndy/RaspIM | refs/heads/master | usr/lib/python2.7/distutils/ccompiler.py | 30 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
__revision__ = "$Id$"
import sys
import os
import re
from distutils.errors import (CompileError, LinkError, UnknownFileError,
DistutilsPlatformE... |
markslwong/tensorflow | refs/heads/master | tensorflow/contrib/keras/python/keras/datasets/boston_housing.py | 31 | # 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... |
HonzaKral/django | refs/heads/master | django/utils/module_loading.py | 30 | import copy
import os
import sys
from importlib import import_module
from django.utils import six
def import_string(dotted_path):
"""
Import a dotted module path and return the attribute/class designated by the
last name in the path. Raise ImportError if the import failed.
"""
try:
module... |
Tejal011089/huntercamp_erpnext | refs/heads/develop | erpnext/hr/doctype/offer_term/offer_term.py | 115 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class OfferTerm(Document):
pass
|
flar2/m7 | refs/heads/Bulletproof | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
robintw/scikit-image | refs/heads/master | skimage/io/manage_plugins.py | 17 | """Handle image reading, writing and plotting plugins.
To improve performance, plugins are only loaded as needed. As a result, there
can be multiple states for a given plugin:
available: Defined in an *ini file located in `skimage.io._plugins`.
See also `skimage.io.available_plugins`.
partial definiti... |
Manojkumar91/odoo_inresto | refs/heads/master | addons/account_payment/account_payment.py | 4 | # -*- 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... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.5/tests/regressiontests/conditional_processing/models.py | 51 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 21 Oct 2007 23:21:47 GMT'
LAST_MODIFIED_NEWER_STR = 'Mon, 18 Oct ... |
ka7eh/django-oscar | refs/heads/master | src/oscar/apps/promotions/conf.py | 63 | from oscar.core.loading import get_class
SingleProduct = get_class('promotions.models', 'SingleProduct')
RawHTML = get_class('promotions.models', 'RawHTML')
Image = get_class('promotions.models', 'Image')
PagePromotion = get_class('promotions.models', 'PagePromotion')
AutomaticProductList = get_class('promotions.model... |
PopCap/GameIdea | refs/heads/master | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/cp720.py | 417 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... |
kfoss/neon | refs/heads/master | neon/hyperopt/gen_config.py | 12 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... |
ministryofjustice/PyGithub | refs/heads/master | github/InputFileContent.py | 72 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
sertac/django | refs/heads/master | tests/test_runner/test_debug_sql.py | 210 | import sys
import unittest
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
from django.utils import six
from django.utils.encoding import force_text
from .models import Person
@unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w... |
HPCGISLab/pcml | refs/heads/master | pcml/lib/FocalOperationExecutors.py | 1 | """Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Authors and contributors: Eric Shook (eshook@kent.edu); Jayakrishnan Ajayakumar (jajayaku@kent.edu)
"""
from ..core.Opera... |
HarborYuan/cashier | refs/heads/master | env/Lib/encodings/kz1048.py | 101 | """ Python Character Mapping Codec kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ1048.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, input, ... |
ActiveState/code | refs/heads/master | recipes/Python/502204_Module_Running_Simple/recipe-502204.py | 1 | '''Module for running simple proxies.
This module provides a single class that can build
proxy objects capable of being started and stopped.'''
__version__ = '1.0'
import select as _select
import socket as _socket
import sys as _sys
import thread as _thread
##########################################################... |
spektom/incubator-airflow | refs/heads/master | airflow/providers/slack/hooks/slack.py | 4 | #
# 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... |
phenoxim/nova | refs/heads/master | nova/api/openstack/compute/schemas/fixed_ips.py | 79 | # 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 require... |
zchee/python-client | refs/heads/uvloop | pynvim/msgpack_rpc/session.py | 2 | """Synchronous msgpack-rpc session layer."""
import logging
import threading
from collections import deque
from traceback import format_exc
import greenlet
from ..compat import check_async
logger = logging.getLogger(__name__)
error, debug, info, warn = (logger.error, logger.debug, logger.info,
... |
fitermay/intellij-community | refs/heads/master | python/testData/completion/classPrivateNotPublic.after.py | 53 | class Foo:
__BOO = 1
z = Foo.__B
|
Psybrus/RakNet | refs/heads/master | DependentExtensions/miniupnpc-1.6.20120410/setupmingw32.py | 33 | #! /usr/bin/python
# $Id: setupmingw32.py,v 1.7 2012/03/05 04:54:00 nanard Exp $
# the MiniUPnP Project (c) 2007-2012 Thomas Bernard
# http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/
#
# python script to build the miniupnpc module under windows (using mingw32)
#
from distutils.core import setup, Extension
fr... |
binarydud/django-oscar | refs/heads/master | src/oscar/apps/customer/app.py | 48 | from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views import generic
from oscar.core.application import Application
from oscar.core.loading import get_class
class CustomerApplication(Application):
name = 'customer'
summary_view = get_class('customer.view... |
ct-23/home-assistant | refs/heads/dev | homeassistant/components/apcupsd.py | 9 | """
Support for status output of APCUPSd via its Network Information Server (NIS).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/apcupsd/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import (CONF... |
ivanhorvath/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_health_checker/test/kibana_test.py | 39 | import pytest
import json
# pylint can't find the package when its installed in virtualenv
from ansible.module_utils.six.moves.urllib import request # pylint: disable=import-error
# pylint: disable=import-error
from ansible.module_utils.six.moves.urllib.error import HTTPError, URLError
from openshift_checks.logging.... |
stuart-knock/bokeh | refs/heads/master | scripts/test_matrix.py | 16 | from __future__ import print_function
import argparse
import os
import shutil
import subprocess
import textwrap
OPTIONS = {
"dry-run" : False,
}
def call_wrapper(cmd_str, *args, **kw):
"""A wrapper for subprocess.call to support 'dry-run' option"""
if OPTIONS["dry-run"]:
print(cmd_str)
... |
jraiskin/TF_screenshots_object_detector | refs/heads/master | object_detection/box_coders/faster_rcnn_box_coder.py | 26 | # 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... |
n0trax/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_mon_notification.py | 29 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
Pulgama/supriya | refs/heads/master | supriya/daw/Device.py | 1 | from typing import List, Tuple
from .DawNode import DawNode
from .Note import Note
class Device(DawNode):
### PUBLIC METHODS ###
def delete(self):
self.parent.remove(self)
def next_device(self):
current_device = self
while current_device.parent is not None:
device_i... |
IllusionRom-deprecated/android_platform_tools_idea | refs/heads/master | python/testData/copyPaste/multiLine/IndentMulti12.src.py | 332 | class C:
def foo(self):
<selection>x = 1
y = 2</selection>
|
yongshengwang/hue | refs/heads/master | build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/gis/sitemaps/views.py | 114 | from __future__ import unicode_literals
from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.contrib.gis.db.models.fields i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.