repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jpaton/xen-4.1-LJX1
refs/heads/master
tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py
42
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Dan Smith <danms@us.ibm.com> from XmTestLib import * from XmTestLib.block_utils import block_detach if ENABLE_HVM_SUPPORT: SKIP("Block-detach not supported for HVM domains") config = {"disk":"phy:/dev/ram0,xvda1,w"} domain =...
nvazquez/Turtlebots
refs/heads/master
plugins/rodi/pyfirmata/mockup.py
11
from collections import deque import pyfirmata class MockupSerial(deque): """ A Mockup object for python's Serial. Functions as a fifo-stack. Push to it with ``write``, read from it with ``read``. >>> s = MockupSerial('someport', 4800) >>> s.read() '' >>> s.write(chr(100)) >>> s.w...
PandaWei/avocado-vt
refs/heads/master
virttest/qemu_devices/qcontainer.py
7
""" Autotest qdev-structure representation. This is the main class which represent qdev-structure. It allows to create, interact and verify the qemu qdev structure. :copyright: 2012-2013 Red Hat Inc. """ # Python imports import logging import re import os import shutil # Avocado imports from avocado.core import exc...
gtko/Sick-Beard
refs/heads/development
lib/requests/packages/chardet/hebrewprober.py
215
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
BhupeshGupta/erpnext
refs/heads/develop
erpnext/manufacturing/doctype/production_plan_item/__init__.py
37694
from __future__ import unicode_literals
rsouza/pypln.web
refs/heads/develop
setup.py
4
# -*- coding:utf-8 -*- # # Copyright 2012 NAMD-EMAP-FGV # # This file is part of PyPLN. You can get more information at: http://pypln.org/. # # PyPLN 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 vers...
BryanQuigley/sos
refs/heads/master
sos/report/plugins/fcoe.py
5
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
mesnilgr/cgt
refs/heads/master
cgt/numeric_diff.py
21
import numpy as np def numeric_grad(f,x,eps=1e-9,method="central"): if method == "central": xpert = x.copy() out = np.zeros_like(x) for i in xrange(x.size): xpert.flat[i] = x.flat[i] + eps yplus = f(xpert) xpert.flat[i] = x.flat[i] - eps yminu...
berkus/enso
refs/heads/master
tests/test_memoize.py
10
""" Unit tests for enso.utils.memoize. """ # ---------------------------------------------------------------------------- # Imports # ---------------------------------------------------------------------------- import unittest from enso.utils.memoize import memoized # ------------------------------------------...
ebar0n/django
refs/heads/master
tests/urlpatterns_reverse/urls_without_full_import.py
452
# A URLs file that doesn't use the default # from django.conf.urls import * # import pattern. from django.conf.urls import url from .views import bad_view, empty_view urlpatterns = [ url(r'^test_view/$', empty_view, name="test_view"), url(r'^bad_view/$', bad_view, name="bad_view"), ]
janelia-flyem/gala
refs/heads/master
gala/imio.py
2
# built-ins import os import json from os.path import split as split_path, join as join_path from fnmatch import filter as fnfilter import logging import itertools as it import subprocess import tempfile as tmp # libraries import h5py from PIL import Image from scipy.ndimage.measurements import label from numpy impo...
mdakin/engine
refs/heads/master
build/android/gyp/package_resources.py
29
#!/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. # pylint: disable=C0301 """Package resources into an apk. See https://android.googlesource.com/platform/tools/base/+/master/legacy/a...
fubarwrangler/group-quota
refs/heads/master
gqweb/db/models.py
1
# =========================================================================== # Database model and tree-object with HTML hooks from group-class and info # about field-types and validation methods used for form data # # (C) 2015 William Strecker-Kellogg <willsk@bnl.gov> # ================================================...
Kilhog/odoo
refs/heads/8.0
addons/website_sale_options/__openerp__.py
322
{ 'name': 'eCommerce Optional Products', 'category': 'Website', 'version': '1.0', 'website': 'https://www.odoo.com/page/e-commerce', 'description': """ OpenERP E-Commerce ================== """, 'author': 'OpenERP SA', 'depends': ['website_sale'], 'data': [ 'views/views....
drdelta/notenso
refs/heads/master
enso/platform/osx/selection/__init__.py
7
import ctypes import time import os import AppKit from enso.platform.osx.utils import sendMsg key_utils = ctypes.CDLL( os.path.join( __path__[0], "key_utils.so" ) ) def _getClipboardText(): pb = AppKit.NSPasteboard.generalPasteboard() if pb.availableTypeFromArray_( [AppKit.NSStringPboardType] ): ret...
lazywei/scikit-learn
refs/heads/master
examples/gaussian_process/gp_diabetes_dataset.py
223
#!/usr/bin/python # -*- coding: utf-8 -*- """ ======================================================================== Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset ======================================================================== In this example, we fit a Gaussian Process model onto...
Matt-Deacalion/django
refs/heads/master
tests/forms_tests/tests/test_error_messages.py
145
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import ( BooleanField, CharField, ChoiceField, DateField, DateTimeField, DecimalField, EmailField, FileField, FloatField, Form, GenericIPAddressField, IntegerField...
kronenpj/python-for-android
refs/heads/master
pythonforandroid/recipes/jedi/__init__.py
1
from pythonforandroid.recipe import PythonRecipe class JediRecipe(PythonRecipe): version = 'v0.9.0' url = 'https://github.com/davidhalter/jedi/archive/{version}.tar.gz' depends = [('python2', 'python3crystax', 'python3')] patches = ['fix_MergedNamesDict_get.patch'] # This apparently should be fi...
pschmitt/home-assistant
refs/heads/dev
homeassistant/components/telnet/__init__.py
36
"""The telnet component."""
CloudServer/nova
refs/heads/master
nova/tests/unit/virt/libvirt/test_imagecache.py
19
# Copyright 2012 Michael Still and Canonical 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 # # ...
erictg/CardsAgainstHumanity
refs/heads/master
CardsAgainstHumanity/CardsAgainstHumanity/obj/Debug/__init__.py
32
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If ...
horance-liu/tensorflow
refs/heads/master
tensorflow/contrib/crf/python/ops/__init__.py
189
# 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...
sertac/django
refs/heads/master
tests/template_tests/syntax_tests/test_verbatim.py
521
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class VerbatimTagTests(SimpleTestCase): @setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'}) def test_verbatim_tag01(self): output = self.engine.render_to_string('verb...
python-parsley/parsley
refs/heads/master
doc/calc.py
4
import math from parsley import makeGrammar def calculate(start, pairs): result = start for op, value in pairs: if op == '+': result += value elif op == '-': result -= value elif op == '*': result *= value e...
pupboss/xndian
refs/heads/master
deploy/site-packages/pip/_vendor/html5lib/treewalkers/dom.py
1229
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node import gettext _ = gettext.gettext from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYP...
RonEld/mbed
refs/heads/master
tools/compliance/ioper_test_fs.py
106
""" mbed SDK Copyright (c) 2011-2015 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...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/bsddb/test/test_db.py
73
import unittest import os, glob from test_all import db, test_support, get_new_environment_path, \ get_new_database_path #---------------------------------------------------------------------- class DB(unittest.TestCase): def setUp(self): self.path = get_new_database_path() self.db = db.D...
liuliwork/django
refs/heads/master
tests/properties/models.py
542
""" Using properties on models Use properties on models just like on any other Python object. """ from django.db import models class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) def _get_full_name(self): return "%s %s" % (self.fi...
frc1418/2015-vision
refs/heads/master
scratchpad/rio-mjpg/server.py
2
#!/usr/bin/env python3 #import ... cannot import wpilib, will die # .. maybe not. but, don't want to deal with GIL import cv2 import socket import struct import threading import time import logging logger = logging.getLogger('cvserver') class CameraServer: kPort = 1180 kMagicNumber = bytes([0x01, 0x00, 0x0...
kdwink/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/conf/app_template/models.py
10644
from django.db import models # Create your models here.
teoreteetik/api-snippets
refs/heads/master
rest/taskrouter/workspaces/list/get/example-1/example-1.6.x.py
1
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" client = Client(...
DevinDewitt/pyqt5
refs/heads/master
examples/graphicsview/diagramscene/diagramscene.py
3
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
Mixser/django
refs/heads/master
tests/template_tests/filter_tests/test_iriencode.py
388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import iriencode, urlencode from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class IriencodeTests(SimpleTestCase): """ Ensure iriencode keeps safe...
ariestiyansyah/python-social-auth
refs/heads/master
social/tests/backends/test_github.py
80
import json from httpretty import HTTPretty from social.exceptions import AuthFailed from social.tests.backends.oauth import OAuth2Test class GithubOAuth2Test(OAuth2Test): backend_path = 'social.backends.github.GithubOAuth2' user_data_url = 'https://api.github.com/user' expected_username = 'foobar' ...
JoePelz/SAM
refs/heads/dev
spec/python/models/test_links.py
2
import time from datetime import datetime from spec.python import db_connection from sam import common from sam.models.links import Links db = db_connection.db sub_id = db_connection.default_sub ds_full = db_connection.dsid_default ds_empty = db_connection.dsid_short def test_get_protocol_list(): l_model = Link...
Senseg/Py4A
refs/heads/master
python3-alpha/python3-src/Lib/test/test_curses.py
51
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import sys, tempfile, os ...
saurabh6790/ON-RISAPP
refs/heads/master
accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
14
# 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 webnotes from webnotes import _, msgprint from webnotes.utils import flt def execute(filters=None): if not filters: filters = {} columns...
openstack/rally
refs/heads/master
rally/common/db/migrations/versions/2018_01_44169f4d455e_deleted_worker_table.py
1
# 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 applicable law or agreed to in...
seraphlnWu/in_trip
refs/heads/master
in_trip/admin/controllers/auth.py
1
# coding=utf-8 import os import hashlib import datetime import pymongo from bottle import request, redirect from in_trip.lib.store import mongo from admin.model import Auth from admin.lib.utils import render from admin.config.consts import RECORD_STATUS, DUMP_FILE_PATH, ROLE @render('auth/index.html') def index(pag...
retomerz/intellij-community
refs/heads/master
python/testData/formatter/hangingIndentInNamedArgumentValue_after.py
75
funcWithLongName(x=[ ], y=42)
abhiii5459/sympy
refs/heads/master
sympy/physics/mechanics/body.py
45
from sympy import Symbol from sympy.physics.mechanics import (RigidBody, Particle, ReferenceFrame, inertia) from sympy.physics.vector import Point, Vector __all__ = ['Body'] class Body(RigidBody, Particle): """ Body is a common representation of RigidBody or a Particle. ...
cgstudiomap/cgstudiomap
refs/heads/develop
main/parts/odoo/addons/mass_mailing/__init__.py
481
# -*- coding: utf-8 -*- import models import wizard import controllers
daxia4444/djangospider
refs/heads/master
djangospider/utils/util.py
1
import chardet import commands import time def getmemory(): command1="top -b -n 1 | grep python | awk -F \" \" '{ print $6 }'" i=0 (status, output) = commands.getstatusoutput(command1) b=output.split("\n")[-1] b=int(b)/1024 print str(b)+":MB" time.sleep(1) def record_failure(content): fp=open("fail.log","a...
mohammed52/something.pk
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
#!/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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
alxgu/ansible
refs/heads/devel
test/units/module_utils/hwc/test_hwc_utils.py
6
# -*- coding: utf-8 -*- import os import sys from units.compat import unittest from ansible.module_utils.hwc_utils import (navigate_hash, remove_empty_from_dict, remove_nones_from_dict, ...
atruberg/django-custom
refs/heads/master
django/forms/extras/widgets.py
117
""" Extra HTML Widget classes """ from __future__ import unicode_literals import datetime import re from django.forms.widgets import Widget, Select from django.utils import datetime_safe from django.utils.dates import MONTHS from django.utils.encoding import force_str from django.utils.safestring import mark_safe fro...
zamattiac/osf.io
refs/heads/develop
tests/modular_templates/test_routing.py
87
import unittest from framework.routing import Rule, json_renderer class RuleTestCase(unittest.TestCase): def _make_rule(self, **kwargs): def vf(): return {} return Rule( kwargs.get('routes', ['/', ]), kwargs.get('methods', ['GET', ]), kwargs.get('v...
JimCircadian/ansible
refs/heads/devel
lib/ansible/module_utils/lxd.py
104
# -*- coding: utf-8 -*- # (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com> # # 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 th...
LouTheBrew/troposphere
refs/heads/master
troposphere/cloudwatch.py
24
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Ref from .validators import positive_integer, boolean class MetricDimension(AWSProperty): props = { 'Name': (basestring, True), 'Value': (basestring,...
ngokevin/three-dev
refs/heads/master
utils/exporters/blender/addons/io_three/dialogs.py
299
from bpy import context CONTEXT = { 0: { 'title': "Error Message", 'icon': 'CANCEL' }, 1: { 'title': "Warning Message", 'icon': 'ERROR' # I prefer this icon for warnings }, 2: { 'title': "Message", 'icon': 'NONE' }, 3: { 'title': "Ques...
jhbez/ProjectV
refs/heads/master
app/v/habit/rest/habitRst.py
1
# -*- coding: utf-8 -*- # Copyright 2017 ProjectV 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 requi...
openiitbombayx/edx-platform
refs/heads/master
common/djangoapps/student/migrations/0008__auto__add_courseregistration.py
188
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseRegistration' db.create_table('student_courseregistration', ( ('id', self....
pblottiere/QGIS
refs/heads/master
scripts/qgis_fixes/fix_future_standard_library.py
77
from libfuturize.fixes.fix_future_standard_library import FixFutureStandardLibrary
UMDLinguistics/EyePy
refs/heads/master
sort_da1.py
1
'''This file sorts a folder of DA1 files into sentence, question and rejected DA1s. ''' ##by: Shevaun Lewis ##date updated: 3/11/11 ##updated by: Shayne Sloggett ## revised 5/2014 by Ilia Kurenkov # Structure: # 1. Main functtion # 2. Dealing with unsorted DA1 files # 3. Loading sorted DA1s # 4. Selecting items for ju...
kvar/ansible
refs/heads/seas_master_2.9.5
lib/ansible/plugins/cliconf/nxos.py
18
# # (c) 2017 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...
Ballz0fSteel/Umeko
refs/heads/master
lib/chardet/euckrfreq.py
342
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gradel/mezzanine
refs/heads/master
mezzanine/twitter/management/commands/poll_twitter.py
2
from __future__ import print_function, unicode_literals from optparse import make_option from django.core.management.base import BaseCommand from django import db from mezzanine.twitter.models import Query, TwitterQueryException class Command(BaseCommand): """ Polls the Twitter API for tweets associated to...
rebstar6/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/testing/io_/test_capture.py
163
from __future__ import with_statement import os, sys import py needsdup = py.test.mark.skipif("not hasattr(os, 'dup')") from py.builtin import print_ if sys.version_info >= (3,0): def tobytes(obj): if isinstance(obj, str): obj = obj.encode('UTF-8') assert isinstance(obj, bytes) ...
temasek/android_external_chromium_org
refs/heads/cm-11.0
chrome/common/extensions/docs/server2/template_renderer.py
23
# 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. from data_source_registry import CreateDataSources from third_party.handlebar import Handlebar from url_constants import GITHUB_BASE, EXTENSIONS_SAMPLES cl...
zhuzhezhe/weibobash
refs/heads/master
env/lib/python3.4/site-packages/wheel/test/complex-dist/setup.py
220
from setuptools import setup try: unicode def u8(s): return s.decode('unicode-escape') except NameError: def u8(s): return s setup(name='complex-dist', version='0.1', description=u8('Another testing distribution \N{SNOWMAN}'), long_description=u8('Another testing distribu...
harmsm/pytc-gui
refs/heads/master
pytc_gui/widgets/experiment_box/experiment_dialog/__init__.py
2
__description__ = \ """ Experiment fit parameter and properties dialog box. """ __author__ = "Michael J. Harms" __date__ = "2017-06-01" __all__ = ["connector_dialog","experiment_dialog","experiment_meta_wrapper","experiment_settable","fit_param_wrapper","global_dialog"] from .experiment_dialog import ExperimentOptions...
cnsoft/kbengine-cocos2dx
refs/heads/cocos2dx-cnsoft
kbe/src/lib/python/Lib/unittest/signals.py
1016
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
anagno/EyeTab
refs/heads/master
EyeTab_Python/image_utils.py
2
import cv2, numpy as np def get_contour_centre(contour): """ Robustly get centre of contour. Returns centroid if possible, otherwise centre of bounding box """ moments = cv2.moments(contour) if moments['m00'] != 0.0: centroid_x = moments['m10'] / moments['m00'] centroid_y = ...
avoinsystems/odoo
refs/heads/8.0
addons/l10n_at/account_wizard.py
379
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
salah-ghanim/pyechonest
refs/heads/master
doc/source/conf.py
21
# -*- coding: utf-8 -*- # # pyechonest documentation build configuration file, created by # sphinx-quickstart on Thu Sep 30 15:51:03 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
undoware/neutron-drive
refs/heads/master
google_appengine/lib/django_1_3/tests/regressiontests/admin_scripts/app_with_import/models.py
102
from django.contrib.comments.models import Comment from django.db import models # Regression for #13368. This is an example of a model # that imports a class that has an abstract base class. class CommentScore(models.Model): comment = models.OneToOneField(Comment, primary_key=True)
sbusso/rethinkdb
refs/heads/next
external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_throw_on_failure_test.py
2917
#!/usr/bin/env python # # Copyright 2009, 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...
indictranstech/erpnext
refs/heads/develop
erpnext/buying/doctype/purchase_order_item/__init__.py
37694
from __future__ import unicode_literals
mbauskar/alec_frappe5_erpnext
refs/heads/develop
erpnext/manufacturing/doctype/production_plan_item/__init__.py
37694
from __future__ import unicode_literals
GbalsaC/bitnamiP
refs/heads/master
venv/lib/python2.7/site-packages/sympy/utilities/tests/test_source.py
14
from sympy.utilities.source import get_mod_func, get_class def test_get_mod_func(): assert get_mod_func('sympy.core.basic.Basic') == ('sympy.core.basic', 'Basic') def test_get_class(): _basic = get_class('sympy.core.basic.Basic') assert _basic.__name__ == 'Basic'
aikramer2/spaCy
refs/heads/master
spacy/tests/regression/test_issue514.py
3
# coding: utf-8 from __future__ import unicode_literals from ..util import get_doc import pytest @pytest.mark.skip @pytest.mark.models('en') def test_issue514(EN): """Test serializing after adding entity""" text = ["This", "is", "a", "sentence", "about", "pasta", "."] vocab = EN.entity.vocab doc = g...
denfromufa/PTVS
refs/heads/master
Python/Product/Pyvot/Sample/Program.py
18
import os.path import xl sample_workbook_path = os.path.join(os.path.dirname(__file__), 'PyvotSample.xlsx') def main(): w = xl.Workbook(sample_workbook_path) w.range("A1").set("Hello World!") def doubled(x): return 2*x def alpha(x): return "abcdefgh"[int(x) - 1] xl.map(doubled, w.get...
crito/syrianarchive
refs/heads/master
homepage/views.py
1
from homepage.models import * from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required from page.models import * def index(request): sections = Section.objects.all() blog_posts = Post.objects.all() return r...
google-code/android-scripting
refs/heads/master
python/src/Lib/ctypes/macholib/dyld.py
253
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### """ dyld emulation """ import os from framework import framework_info from dylib import dylib_info from it...
catsop/CATMAID
refs/heads/blockwise-sopnet
scripts/dev/make-release.py
1
#!/usr/bin/env python # # This script will create a new CATMAID release based on the current branch and # date. Specifically, it does the following: # # 1. Determines release name from date and prompts for confirmation # 2. Creates release branch # 3. Creates release commit updating CHANGELOG.md and API_CHANGELOG.md he...
DirtyUnicorns/android_external_chromium-org
refs/heads/kitkat
chrome/common/extensions/docs/server2/blob_reference_store.py
146
# 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. from appengine_wrappers import db from appengine_wrappers import BlobReferenceProperty BLOB_REFERENCE_BLOBSTORE = 'BlobReferenceBlobstore' class _Model...
sujeet4github/MyLangUtils
refs/heads/master
LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/wtforms/form.py
140
import itertools try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict from wtforms.compat import with_metaclass, iteritems, itervalues from wtforms.meta import DefaultMeta __all__ = ( 'BaseForm', 'Form', ) class BaseForm(object): """ Base Form Clas...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/intangible/pet/shared_gulginaw_hue.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/intangible/pet/shared_gulginaw_hue.iff" result.attribute_template_id = -1 ...
jolyonb/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_user_state_client.py
1
""" Black-box tests of the DjangoUserStateClient against the semantics defined in edx_user_state_client. """ from collections import defaultdict from edx_user_state_client.tests import UserStateClientTestBase from courseware.tests.factories import UserFactory from courseware.user_state_client import DjangoXBlockUser...
tankisleva/python_training
refs/heads/master
check_db_connection.py
1
# import mysql.connector #import pymysql.cursors from model.group import Group #from fixture.db import DbFixture from fixture.orm import ORMFixture # connection = mysql.connector.connect(host="127.0.0.1", database="addressbook", user="root", password="") db = ORMFixture(host="127.0.0.1", name="addressbook", user="ro...
bev-a-tron/pledge_service
refs/heads/master
build/mailchimp/requests/packages/chardet/euckrprober.py
2930
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
bieberg0n/bjdns
refs/heads/bjdns3
ipincn.py
1
# -*- coding: utf-8 -*- import IPy class CnIpChecker: def __init__(self): self.dat_file = 'cn_ip.txt' self.pool = dict() self.read_file() def read_file(self): with open(self.dat_file) as f: txt = f.read() for line in txt.split('\n'): parts = l...
stuarteberg/numpy
refs/heads/master
numpy/doc/indexing.py
33
"""============== Array indexing ============== Array indexing refers to any use of the square brackets ([]) to index array values. There are many options to indexing, which give numpy indexing great power, but with power comes some complexity and the potential for confusion. This section is just an overview of the va...
googleads/googleads-dfa-reporting-samples
refs/heads/master
python/v3_4/get_userprofiles.py
3
#!/usr/bin/python # # Copyright 2015 Google 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 b...
shiroyuki/passerine
refs/heads/master
passerine/decorator/common.py
1
""" :Author: Juti Noppornpitak This package contains decorators for common use. """ import inspect from passerine.exception import * class BaseDecoratorForCallableObject(object): """ Base decorator based from an example at http://www.artima.com/weblogs/viewpost.jsp?thread=240808. """ def __init__(s...
andybrnr/QuantEcon.py
refs/heads/master
examples/tsh_hg.py
3
import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from quantecon import LinearStateSpace phi_1, phi_2, phi_3, phi_4 = 0.5, -0.2, 0, 0.5 sigma = 0.1 A = [[phi_1, phi_2, phi_3, phi_4], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]] C = [[sigma...
srinathv/vispy
refs/heads/master
vispy/util/frozen.py
20
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # Class adapted from: # http://stackoverflow.com/questions/3603502/ class Frozen(object): __isfrozen = False def __setattr__(self, key, value): if self.__is...
pieleric/dacontrol-a3
refs/heads/master
andorcam_test.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 12 Mar 2012 @author: Éric Piel Testing class for pi.py and dacontrol.py . Copyright © 2012 Éric Piel, Delmic This file is part of Delmic Acquisition Software. Delmic Acquisition Software is free software: you can redistribute it and/or modify it under the...
mancoast/CPythonPyc_test
refs/heads/master
cpython/264_test_threaded_import.py
77
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
andrewfernie/quantracker
refs/heads/master
air/osd/hardware/64_pin_lite/air_osd_v2_2/scripts/schematic_to_pdf.py
2
import os import os.path src_dir = "../schematic/postscript/" target_dir = "../schematic/pdf/" ps_files = \ ["osd-camera.ps", "osd-mavlink_port.ps", "osd.ps", "osd-video_circuit.ps", "osd-expansion.ps", "osd-MCU.ps", "osd-psu.ps", "osd-video_out.ps"] for f in ps_files: # if os.path.exists(...
IllusionRom-deprecated/android_platform_external_chromium_org
refs/heads/illusion-4.4
chrome/test/functional/gpu.py
58
#!/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. import logging import os import pyauto_functional # Must be imported before pyauto import pyauto class GpuTest(pyauto.PyUITest)...
gnowxilef/Wox
refs/heads/master
PythonHome/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
559
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mkl-/scioncc
refs/heads/master
src/putil/rabbithelper.py
3
#!/usr/bin/python from putil.rabbitmqadmin import Management, make_parser, LISTABLE, DELETABLE import shlex import simplejson class RabbitManagementHelper(object): def __init__(self, parser, options): self.parser = parser self.options = options def list_names(self, listable_type): lis...
TangHao1987/intellij-community
refs/heads/master
python/testData/quickFixes/PyMakeFunctionFromMethodQuickFixTest/usageImport2_after.py
83
from test import foo foo()
resmo/ansible
refs/heads/devel
packaging/sdist/check-link-behavior.py
114
#!/usr/bin/env python """Checks for link behavior required for sdist to retain symlinks.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import platform import shutil import sys import tempfile def main(): """Main program entry point.""" temp_dir = tempf...
gem/geonode
refs/heads/2.6.x
geonode/people/admin.py
11
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gunchleoc/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/app2/1_auto.py
770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("app1", "1_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
almosthumangames/rapid_sublime
refs/heads/master
rapid_output.py
1
import sublime, sublime_plugin import re import os import sublime_api class RapidOutputView(): name = "Rapid Output" analyze_view_name = "Analyze Result" analyze_file_name = "analyze_result.lua" messageQueue = [] @classmethod def getOutputView(self, create): for window in sublime.windows(): for view in ...
labordoc/labordoc-next
refs/heads/labordoc-next
modules/miscutil/lib/miscutil_config.py
27
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011 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 ## ...
nhenezi/kuma
refs/heads/master
kuma/core/translations/search/filter/firefox-desktop/name.py
5
# -*- coding: utf-8 -*- gettext("""Firefox for Desktop""")