repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
yousafsyed/casperjs | refs/heads/master | bin/Lib/lib2to3/tests/data/infinite_recursion.py | 341 | # This file is used to verify that 2to3 falls back to a slower, iterative pattern matching
# scheme in the event that the faster recursive system fails due to infinite recursion.
from ctypes import *
STRING = c_char_p
OSUnknownByteOrder = 0
UIT_PROMPT = 1
P_PGID = 2
P_PID = 1
UIT_ERROR = 5
UIT_INFO = 4
UIT_NONE = 0
P... |
d-lee/airflow | refs/heads/master | airflow/contrib/hooks/__init__.py | 19 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
etzhou/edx-platform | refs/heads/master | lms/djangoapps/class_dashboard/dashboard_data.py | 99 | """
Computes the data to display on the Instructor Dashboard
"""
from util.json_request import JsonResponse
import json
from courseware import models
from django.db.models import Count
from django.utils.translation import ugettext as _
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.inheri... |
yimingpeng/rl-library | refs/heads/master | system/common/libs/mwclient/simplejson/tests/test_dump.py | 4 | from cStringIO import StringIO
import simplejson as S
def test_dump():
sio = StringIO()
S.dump({}, sio)
assert sio.getvalue() == '{}'
def test_dumps():
assert S.dumps({}) == '{}'
|
gautam1858/tensorflow | refs/heads/master | tensorflow/python/ops/distributions/laplace.py | 15 | # 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... |
yxtj/Neuron | refs/heads/master | dataInit/db.py | 2 | import string,math
import db_base as base
######################
#initial
def read_raw_time_data(file_name,sepper=','):
fin=open(file_name,'r');
length=fin.readline().count(',')+1;
fin.seek(0);
print 'number of item each line:',length
res=[];
for line in fin:
items=line.split(sepper);
for i in range(length)... |
MSM8226-Samsung/android_kernel_samsung_kmini3g_old | refs/heads/cm-12.1 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
Ozerich/ajenti | refs/heads/master | ajenti/plugins/core/root.py | 2 | import re
from ajenti.ui import UI
from ajenti.com import *
from ajenti import version
from ajenti.app.api import ICategoryProvider, IContentProvider
from ajenti.ui.template import BasicTemplate
from ajenti.app.helpers import EventProcessor, SessionPlugin, event
from ajenti.app.urlhandler import URLHandler, url, get_e... |
acebrianm/MinimaList | refs/heads/master | Crypto/SelfTest/Hash/test_MD5.py | 116 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/MD5.py: Self-test for the MD5 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... |
mohanrex/pykalappai | refs/heads/master | EkEngine/Engine.py | 1 | import pyHook
import pythoncom
from threading import Thread
from EkEngine import WinPipe
from EkEngine.ScimTableParser import ScimTableParser
class Engine(Thread):
def __init__(self, filepath=""):
Thread.__init__(self)
self.file_name = filepath
self.conv_state = True
self.key_sta... |
rubyinhell/brython | refs/heads/master | www/src/Lib/decimal.py | 623 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... |
sergecodd/FireFox-OS | refs/heads/master | B2G/gecko/media/webrtc/trunk/tools/gyp/test/subdirectory/gyptest-subdir-all.py | 74 | #!/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 building a subsidiary dependent target from a .gyp file in a
subdirectory, without specifying an explicit output build director... |
valentin-krasontovitsch/ansible | refs/heads/devel | test/units/module_utils/basic/test_platform_distribution.py | 14 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017-2018 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_func... |
HPPTECH/hpp_IOSTressTest | refs/heads/master | Resources/ssh/pexpect-3.2/tests/platform_tests/test_middle_buffer.py | 5 | #!/usr/bin/env python2
import expyct
import time
e = expyct.expyct ('/bin/sh -i')
e.timeout=60
e.expect(['#', '\$'])
e.send ('ls -la /\n')
i = e.expect (['foo','(d[aeiou]v)'])
print '\nRead before match>%s<' % e.before
print 'Matched:>%s<' % e.matched
print 'index:', i
i = e.expect(['#', '\$'])
print '\nRead before... |
derek-schaefer/django-json-field | refs/heads/master | test_project/app/tests.py | 5 | from __future__ import unicode_literals, division
import inspect
from json_field.fields import JSON_DECODE_ERROR
from test_project.app.models import Test
from test_project.app.forms import TestForm, OptionalForm, \
EvalForm, ModelForm
from django.test import TestCase
from django.db.utils import IntegrityError
i... |
JetBrains/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/Indent21.after.py | 747 | class C:
def foo(self):
x = 1
y = 2
|
emidln/django_roa | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/sitemaps/tests/__init__.py | 299 | from django.contrib.sitemaps.tests.basic import *
|
mancoast/CPythonPyc_test | refs/heads/master | fail/333_test_utils.py | 26 | import datetime
from email import utils
import test.support
import time
import unittest
import sys
import os.path
class DateTimeTests(unittest.TestCase):
datestring = 'Sun, 23 Sep 2001 20:10:55'
dateargs = (2001, 9, 23, 20, 10, 55)
offsetstring = ' -0700'
utcoffset = datetime.timedelta(hours=-7)
t... |
18padx08/PPTex | refs/heads/master | PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/printing/python.py | 118 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import keyword as kw
import sympy
from .repr import ReprPrinter
from .str import StrPrinter
# A list of classes that should be printed using StrPrinter
STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity",
"Pow", "Zero... |
shastikk/youtube-dl | refs/heads/master | youtube_dl/extractor/googlesearch.py | 168 | from __future__ import unicode_literals
import itertools
import re
from .common import SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
)
class GoogleSearchIE(SearchInfoExtractor):
IE_DESC = 'Google Video search'
_MAX_RESULTS = 1000
IE_NAME = 'video.google:search'
_SEARCH_KEY = 'g... |
ssteo/scrapy | refs/heads/master | tests/mocks/dummydbm.py | 179 | """DBM-like dummy module"""
import collections
class DummyDB(dict):
"""Provide dummy DBM-like interface."""
def close(self):
pass
error = KeyError
_DATABASES = collections.defaultdict(DummyDB)
def open(file, flag='r', mode=0o666):
"""Open or create a dummy database compatible.
Arguments ... |
crazypoo/find-unused-images | refs/heads/master | find_unused_images.py | 1 | #######################################################
# This script is for reduce pakage size of ipa file
# copyright reserved xiabin
# trimpackage.py
#######################################################
import sys
import os
import re
import types
xcext = "xcodeproj"
pbxname = "project.pbxproj"
# Help
def help(... |
SkippsDev/Py-Agar.io | refs/heads/master | src/protocol/UpdatePing.py | 1 | from src.packet.ArrayBuffer import ArrayBuffer
from src.packet.NetPacker import NetPacker
class UpdatePing:
def __init__(self):
self.buffer = ArrayBuffer()
self.packer = NetPacker(self.buffer)
def build(self, handler, payload, isBinary):
self.handler = handler
self.payload = payload
self.isBinary = isBin... |
hugs/selenium | refs/heads/master | selenium/src/py/lib/docutils/writers/s5_html/__init__.py | 5 | # Author: Chris Liechti
# Contact: cliechti@gmx.net
# Author: David Goodger
# Contact: goodger@python.org
# Revision: $Revision: 4461 $
# Date: $Date: 2006-04-01 02:25:45 +0200 (Sat, 01 Apr 2006) $
# Copyright: This module has been placed in the public domain.
"""
S5/HTML Slideshow Writer.
"""
__docformat... |
kouk/boto | refs/heads/develop | boto/cacerts/__init__.py | 260 | # Copyright 2010 Google Inc.
# All rights reserved.
#
# 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 rights to use, copy, modify, merg... |
mpetyx/energagement | refs/heads/master | energagement/energagement/wsgi.py | 1 | """
WSGI config for energagement project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "energagement.settings")
from dja... |
emilio/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/__init__.py | 38 | # flake8: noqa (not ideal, but nicer than adding noqa: F401 to every line!)
from .serializer import serialize
from .parser import parse
from .backends.static import compile as compile_static
from .backends.conditional import compile as compile_condition
|
Maccimo/intellij-community | refs/heads/master | python/helpers/third_party/thriftpy/_shaded_thriftpy/tornado.py | 5 | # -*- coding: utf-8 -*-
"""
>>> pingpong = _shaded_thriftpy.load("pingpong.thrift")
>>>
>>> class Dispatcher(object):
>>> def ping(self):
>>> return "pong"
>>> server = make_server(pingpong.PingPong, Dispatcher())
>>> server.listen(6000)
>>> client = ioloop.IOLoop.current().run_sync(
lambda: make_clie... |
AndreasMadsen/tensorflow | refs/heads/master | tensorflow/python/ops/sets.py | 3 | # 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... |
edx/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/db/backends/oracle/creation.py | 43 | import sys, time
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated Oracle column
# types, as strings. Column-type strings can contain fo... |
sylarcp/anita | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/orm/__init__.py | 70 | # orm/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Functional constructs for ORM configuration.
See the SQLAlchemy object relation... |
arth-co/saleor | refs/heads/master | saleor/userprofile/migrations/0014_user_email.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0013_remove_user_email'),
]
operations = [
migrations.AddField(
model_name='user',
na... |
openstack/networking-bagpipe-l2 | refs/heads/master | networking_bagpipe/bagpipe_bgp/common/__init__.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... |
cristian69/KernotekV3 | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 116 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys
import os
import marshal
import textwrap
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, g... |
SWiT/ARTT | refs/heads/master | utils.py | 1 | import cv2, math
def dist(p0, p1):
return math.sqrt((p0[0] - p1[0])**2 + (p0[1] - p1[1])**2)
def findCenter(pts):
x = 0
y = 0
l = len(pts)
for i in range(0,l):
x += pts[i][0]
y += pts[i][1]
return (int(x/l), int(y/l))
def findDiffs(pt0, pt1):
x = pt1[0]-pt0[0]
y = pt1[... |
crisisking/udbraaains | refs/heads/master | brains/mapping/migrations/0001_initial.py | 1 | # encoding: 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 'Location'
db.create_table('mapping_location', (
('id', self.gf('django.db.mode... |
cwoebker/relo | refs/heads/master | relo/local/util.py | 1 | #!/usr/bin/env python
# encoding: utf-8
import os
from collections import defaultdict
from relo.core import doctype
from relo.core.log import logger
FILE_Marker = '<files>'
##### Format #####
def paths2tree(paths):
"a list of paths to a list of tree elements"
def attach(branch, trunk):
"""
I... |
arschles/kubernetes-service-catalog | refs/heads/downstream | vendor/k8s.io/kubernetes/examples/cluster-dns/images/backend/server.py | 504 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... |
hachreak/invenio-ext | refs/heads/master | invenio_ext/principal/__init__.py | 7 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 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... |
EUNIX-TRIX/al-go-rithms | refs/heads/master | deep_learning/python/neuralnetwork.py | 5 | import numpy as np
import dill
class neural_network:
def __init__(self, num_layers, num_nodes, activation_function, cost_function):
self.num_layers = num_layers
self.num_nodes = num_nodes
self.layers = []
self.cost_function = cost_function
for i in range(num_layers):
... |
jpshort/odoo | refs/heads/8.0 | openerp/report/print_fnc.py | 458 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
morpheby/levelup-by | refs/heads/master | cms/djangoapps/contentstore/features/problem-editor.py | 2 | # disable missing docstring
#pylint: disable=C0111
from lettuce import world, step
from nose.tools import assert_equal, assert_true # pylint: disable=E0611
from common import type_in_codemirror
DISPLAY_NAME = "Display Name"
MAXIMUM_ATTEMPTS = "Maximum Attempts"
PROBLEM_WEIGHT = "Problem Weight"
RANDOMIZATION = 'Rand... |
andfoy/margffoy-tuay-server | refs/heads/master | env/lib/python2.7/site-packages/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/lib/enums.py | 35 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/enums.py
__version__=''' $Id$ '''
__doc__="""
Container for constants. Hardly used!
"""
TA_LEFT = 0
TA_CENTER = 1
TA_RIGHT = 2
TA_JUSTIFY = 4 |
luvit/gyp | refs/heads/luvit-dev | test/additional-targets/src/dir1/emit.py | 337 | #!/usr/bin/env python
# Copyright (c) 2009 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.
import sys
f = open(sys.argv[1], 'wb')
f.write('Hello from emit.py\n')
f.close()
|
jlspyaozhongkai/Uter | refs/heads/master | third_party_build/Python-2.7.9/lib/python2.7/xml/dom/pulldom.py | 322 | import xml.sax
import xml.sax.handler
import types
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringTypes = [types.StringType]
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
... |
NeCTAR-RC/neutron | refs/heads/master | neutron/plugins/vmware/dbexts/nsx_models.py | 26 | # Copyright 2015 VMware, 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 agree... |
alexmandujano/django | refs/heads/master | tests/utils_tests/test_archive.py | 102 | import os
import shutil
import tempfile
from django.utils import unittest
from django.utils.archive import Archive, extract
from django.utils._os import upath
TEST_DIR = os.path.join(os.path.dirname(upath(__file__)), 'archives')
class ArchiveTester(object):
archive = None
def setUp(self):
"""
... |
ramondelafuente/ansible | refs/heads/devel | test/units/template/test_templar.py | 59 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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... |
macedir/Software-Development | refs/heads/master | Python/shortest dec to hex.py | 1 | while True:
try:
print(hex(int(input('What do you want to convert into hexadecimal? '))))
print('')
except (ValueError, TypeError):
print('Invalid input')
print('')
|
olegpshenichniy/Booktype | refs/heads/master | lib/booktype/apps/reader/views.py | 6 | # This file is part of Booktype.
# Copyright (c) 2014 Helmy Giacoman <helmy.giacoman@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
kneeks/is210-week-03-warmup | refs/heads/master | task_05.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Splinter would be proud."""
TEENAGE_MUTANT_NINJAS = ('Michaelangelo. Leonardo. Rafael. Donatello. Heroes '
'in a half shell.')
TURTLE_POWER = TEENAGE_MUTANT_NINJAS.split('. ')
|
bjodah/mpmath | refs/heads/master | mpmath/tests/test_summation.py | 15 | from mpmath import *
def test_sumem():
mp.dps = 15
assert sumem(lambda k: 1/k**2.5, [50, 100]).ae(0.0012524505324784962)
assert sumem(lambda k: k**4 + 3*k + 1, [10, 100]).ae(2050333103)
def test_nsum():
mp.dps = 15
assert nsum(lambda x: x**2, [1, 3]) == 14
assert nsum(lambda k: 1/factorial(k),... |
tuxos/Django-facebook | refs/heads/master | docs/docs_env/Lib/encodings/bz2_codec.py | 501 | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import ... |
taiyuanfang/gyp | refs/heads/master | test/win/gyptest-link-base-address.py | 137 | #!/usr/bin/env python
# Copyright 2013 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 the base address setting is extracted properly.
"""
import TestGyp
import re
import sys
if sys.platform == 'win32':
test = Te... |
jiangzhuo/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_file_eintr.py | 122 | # Written to test interrupted system calls interfering with our many buffered
# IO implementations. http://bugs.python.org/issue12268
#
# It was suggested that this code could be merged into test_io and the tests
# made to work using the same method as the existing signal tests in test_io.
# I was unable to get single... |
leiferikb/bitpop | refs/heads/master | src/third_party/mesa/src/scons/gallium.py | 12 | """gallium
Frontend-tool for Gallium3D architecture.
"""
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# All Rights Reserved.
#
# 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 Soft... |
ramaganapathy1/AMuDA-Ir-back-end | refs/heads/master | vEnv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py | 515 | 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... |
pothosware/gnuradio | refs/heads/master | gr-digital/python/digital/cpm.py | 41 | #
# CPM modulation and demodulation.
#
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 ve... |
holmes/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/Yield33.after.py | 79 | def f(xs):
found = False
found = yield from bar(found, xs)
print(found)
def bar(found_new, xs_new):
for x in xs_new:
yield x
found_new = True
return found_new |
rzambre/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/py/_code/_assertionold.py | 218 | import py
import sys, inspect
from compiler import parse, ast, pycodegen
from py._code.assertion import BuiltinAssertionError, _format_explanation
passthroughex = py.builtin._sysex
class Failure:
def __init__(self, node):
self.exc, self.value, self.tb = sys.exc_info()
self.node = node
class View(... |
Metronus/metronus | refs/heads/master | Metronus-Project/metronus_app/apps.py | 1 | from django.apps import AppConfig
class MetronusAppConfig(AppConfig):
""" La documentasió """
name = 'metronus_app'
|
zhaoxianpeng/s3c2440 | refs/heads/master | linux-3.10.71/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
osvalr/odoo | refs/heads/8.0 | addons/account_bank_statement_extensions/res_partner_bank.py | 381 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
stonegithubs/micropython | refs/heads/master | tests/basics/for2.py | 118 | i = 'init'
for i in range(0):
pass
print(i) # should not have been modified
for i in range(10):
pass
print(i) # should be last successful value of loop
|
randynobx/ansible | refs/heads/devel | test/units/module_utils/test_postgresql.py | 63 | import json
import sys
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, MagicMock
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six.moves import builtins
from ansible.module_utils._text import to_native
from units.mock.procenv import swap_stdin_an... |
ahmedRguei/job | refs/heads/master | typo3conf/ext/extension_builder/Resources/Public/jsDomainModeling/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... |
joopert/home-assistant | refs/heads/dev | homeassistant/components/blackbird/__init__.py | 36 | """The blackbird component."""
|
Maccimo/intellij-community | refs/heads/master | python/testData/completion/initParams.after.py | 83 | class C:
def __init__(self, auno=True): pass
c = C(auno=)
|
soonhokong/dReal-osx | refs/heads/master | benchmarks/network/battery/battery-double-p.py | 11 |
from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[tau] 1)))
"""
state_dec[0] = """
(declare-fun time_{0} () Real)
(declare-fun tau_{0}_0 () Real)
(declare-fun tau_{0}_t () Real)
"""
state_val[0] = """
(assert (<= 0 ... |
ivanbaldo/yowsup | refs/heads/master | yowsup/layers/axolotl/protocolentities/receipt_outgoing_retry.py | 35 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from yowsup.layers.protocol_receipts.protocolentities import OutgoingReceiptProtocolEntity
from yowsup.layers.axolotl.protocolentities.iq_keys_get_result import ResultGetKeysIqProtocolEntity
class RetryOutgoingReceiptProtocolEntity(OutgoingReceiptProtocolEntit... |
erikr/django | refs/heads/master | tests/i18n/urls.py | 128 | from __future__ import unicode_literals
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from django.http import HttpResponse, StreamingHttpResponse
from django.utils.translation import ugettext_lazy as _
urlpatterns = i18n_patterns(
url(r'^simple/$', lambda r: HttpResponse()),
... |
open-synergy/stock-logistics-workflow | refs/heads/8.0 | product_serial/company.py | 27 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Product serial module for OpenERP
# Copyright (C) 2010-2011 Anevia. All Rights Reserved
# Copyright (C) 2013 Akretion
# @author: Sebastien Beau <sebastien.beau@akretion.com>
# @author: Alexis de L... |
henrytao-me/openerp.positionq | refs/heads/master | openerp/addons/mail/mail_vote.py | 439 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
odooindia/odoo | refs/heads/master | addons/l10n_si/__openerp__.py | 430 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GLES2/QCOM/extended_get.py | 8 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import... |
maocubillos/pnt2015 | refs/heads/master | src/bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 566 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
... |
mudithkr/zamboni | refs/heads/master | mkt/inapp/models.py | 20 | import json
from django.conf import settings
from django.db import models
from mkt.prices.models import Price
from mkt.site.models import ModelBase
from mkt.translations.fields import save_signal, TranslatedField
from mkt.webapps.models import UUIDModelMixin
class InAppProduct(UUIDModelMixin, ModelBase):
"""
... |
GinnyN/Team-Fortress-RPG-Generators | refs/heads/master | tests/regressiontests/views/models.py | 144 | """
Regression tests for Django built-in views.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
def get_absolute_url(self):
return '/views/authors/%s/' % self.id
class BaseArticle(models.Model):... |
lachesis/shed | refs/heads/master | helpers.py | 1 | import math
import gdal
import numpy as np
from tornado.httpclient import AsyncHTTPClient
from skimage.draw import line
from tornado.gen import Return
from tornado import gen
ZOOM=12
class CoordSystem(object):
@classmethod
def lnglat_to_pixel(cls, lnglat, zoom=ZOOM):
lng, lat = lnglat
lat *= ... |
willcode/gnuradio | refs/heads/master | grc/tests/test_block_templates.py | 15 | import pytest
from grc.core.blocks._templates import MakoTemplates
from grc.core.errors import TemplateError
class Block(object):
namespace_templates = {}
templates = MakoTemplates(None)
def __init__(self, **kwargs):
self.namespace_templates.update(kwargs)
def test_simple():
t = MakoTempl... |
nthien/pulp | refs/heads/master | server/pulp/server/webservices/views/roles.py | 7 | from django.core.urlresolvers import reverse
from django.views.generic import View
from pulp.server import exceptions as pulp_exceptions
from pulp.server.auth import authorization
from pulp.server.managers import factory
from pulp.server.webservices.views.decorators import auth_required
from pulp.server.webservices.vi... |
quanvm009/codev7 | refs/heads/master | openerp/addons/crm_helpdesk/crm_helpdesk.py | 38 | # -*- 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... |
albireox/marvin | refs/heads/master | python/marvin/tests/tools/test_modelcube.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews
# @Date: 2017-08-15
# @Filename: test_modelcube.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu)
# @Last modified ... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/integration/cloudformation/test_connection.py | 31 | #!/usr/bin/env python
import time
import json
from tests.unit import unittest
from boto.cloudformation.connection import CloudFormationConnection
BASIC_EC2_TEMPLATE = {
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template EC2InstanceSample",
"Parameters": {
},... |
xbs13/influxdb-python | refs/heads/master | influxdb/resultset.py | 5 | # -*- coding: utf-8 -*-
import warnings
from influxdb.exceptions import InfluxDBClientError
_sentinel = object()
class ResultSet(object):
"""A wrapper around a single InfluxDB query result"""
def __init__(self, series, raise_errors=True):
self._raw = series
self._error = self.raw.get('erro... |
infoxchange/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/localflavor/sk/sk_regions.py | 543 | """
Slovak regions according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('BB', _('Banska Bystrica region')),
('BA', _('Bratislava region')),
('KE', _('Kosice region')),
('NR', _('Nitra regi... |
o3project/ryu-oe | refs/heads/master | ryu/tests/unit/packet/test_vlan.py | 18 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... |
konieboy/Seng_403 | refs/heads/master | Gender Computer/unidecode/x1d7.py | 248 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... |
dayatz/taiga-back | refs/heads/stable | taiga/export_import/serializers/__init__.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... |
bsipocz/astroML | refs/heads/fetch_cnn_images | astroML/clustering/mst_clustering.py | 2 | """
Minimum Spanning Tree Clustering
"""
import numpy as np
from scipy import sparse
from sklearn.base import BaseEstimator
from sklearn.neighbors import kneighbors_graph
try:
from scipy.sparse.csgraph import (
minimum_spanning_tree, connected_components)
except ImportError:
raise ValueError("scipy v0... |
pauljohnleonard/MusicBox | refs/heads/master | attic/thirdparty/srcMMA/MMA/tweaks.py | 1 |
# tweaks.py
"""
This module is an integeral part of the program
MMA - Musical Midi Accompaniment.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option... |
rleadbetter/Sick-Beard | refs/heads/anime | lib/hachoir_parser/game/spider_man_video.py | 90 | """
Parser for an obscure FMV file format: bin files from the game
"The Amazing Spider-Man vs. The Kingpin" (Sega CD)
Author: Mike Melanson
Creation date: 2006-09-30
File samples: http://samples.mplayerhq.hu/game-formats/spiderman-segacd-bin/
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field impor... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/ship/components/reactor/shared_rct_freitek_powerhouse_mk2.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 = Tangible()
result.template = "object/tangible/ship/components/reactor/shared_rct_freitek_powerhouse_mk2.iff"
resu... |
kwhinnery/node-workshop | refs/heads/master | challenge6/finished/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/esprima-six/tools/generate-unicode-regex.py | 341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# By Yusuke Suzuki <utatane.tea@gmail.com>
# Modified by Mathias Bynens <http://mathiasbynens.be/>
# http://code.google.com/p/esprima/issues/detail?id=110
import sys
import string
import re
class RegExpGenerator(object):
def __init__(self, detector):
self.de... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/formtools/tests/wizard/namedwizardtests/urls.py | 320 | from django.conf.urls import patterns, url
from django.contrib.formtools.tests.wizard.namedwizardtests.forms import (
SessionContactWizard, CookieContactWizard, Page1, Page2, Page3, Page4)
def get_named_session_wizard():
return SessionContactWizard.as_view(
[('form1', Page1), ('form2', Page2), ('form3'... |
whaleygeek/pc_parser | refs/heads/master | build/yply/yply.py | 1 | #!/usr/local/bin/python
# yply.py
#
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
#
# Converts a UNIX-yacc specification file into a PLY-compatible
# specification. To use, simply do this:
#
# % python yply.py [-nocode] inputfile.y >myparser.py
#
# The output of this program is Python code. In... |
ivan-fedorov/intellij-community | refs/heads/master | python/lib/Lib/encodings/mac_greek.py | 593 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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,err... |
wevoteeducation/WeVoteBase | refs/heads/master | import_export_maplight/admin.py | 1 | # import_export_maplight/admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.contrib import admin
# Register your models here.
|
Marilynmontu/final-competiton | refs/heads/master | Tools/LogAnalyzer/VehicleType.py | 187 | class VehicleType():
Plane = 17
Copter = 23
Rover = 37
# these should really be "Plane", "Copter" and "Rover", but many
# things use these values as triggers in their code:
VehicleTypeString = {
17: "ArduPlane",
23: "ArduCopter",
37: "ArduRover"
}
|
petrutlucian94/nova | refs/heads/master | nova/vnc/__init__.py | 19 | #!/usr/bin/env python
# Copyright (c) 2010 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/LICEN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.