repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
h2oai/h2o-3
refs/heads/master
h2o-py/tests/testdir_misc/pyunit_job_progress_custom_widget.py
1
from __future__ import print_function from builtins import range import sys sys.path.insert(1,"../../") import h2o from h2o.job import H2OJob from h2o.utils.progressbar import ProgressBar, ProgressBarWidget, PBWBar, PBWString, RenderResult from tests import pyunit_utils as pu job_request_counter = 0 class MyWidget...
jcornford/pyecog
refs/heads/master
start.py
1
import pyecog if __name__ == '__main__': pyecog.pyecog_main_gui.main()
borysiasty/QGIS
refs/heads/master
scripts/process_function_template.py
27
# -*- coding: utf-8 -*- import sys import os import json import glob sys.path.append( os.path.join( os.path.dirname(os.path.realpath(__file__)), '../python/ext-libs')) cpp = open(sys.argv[1], "w", encoding="utf-8") cpp.write( "#include \"qgsexpression.h\"\n" "#include \"qgsexpression_p.h\...
ruo91/bazel
refs/heads/master
tools/build_defs/docker/sha256.py
20
# 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 by applicable law or ag...
isandlaTech/cohorte-3rdparty
refs/heads/master
sleekxmpp/src/main/python/sleekxmpp/plugins/xep_0060/stanza/base.py
16
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2011 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.xmlstream import ET class OptionalSetting(object): interfaces = set(('required',)) def set_required(self, value): ...
navycrow/Sick-Beard
refs/heads/development
lib/hachoir_parser/common/win32_lang_id.py
186
""" Windows 2000 - List of Locale IDs and Language Groups Original data table: http://www.microsoft.com/globaldev/reference/win2k/setup/lcid.mspx """ LANGUAGE_ID = { 0x0436: u"Afrikaans", 0x041c: u"Albanian", 0x0401: u"Arabic Saudi Arabia", 0x0801: u"Arabic Iraq", 0x0c01: u"Arabic Egypt", 0x10...
ashishnitinpatil/vnitstudnotifs
refs/heads/master
django/contrib/auth/tests/test_management.py
89
from __future__ import unicode_literals from datetime import date from django.contrib.auth import models, management from django.contrib.auth.management import create_permissions from django.contrib.auth.management.commands import changepassword from django.contrib.auth.models import User from django.contrib.auth.test...
glwu/python-for-android
refs/heads/master
python-modules/twisted/twisted/tap/socks.py
61
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ I am a support module for making SOCKSv4 servers with twistd. """ from twisted.protocols import socks from twisted.python import usage from twisted.application import internet import sys class Options(usage.Options): synopsis...
siliconsmiley/QGIS
refs/heads/master
python/plugins/processing/algs/taudem/dinfdistdown.py
1
# -*- coding: utf-8 -*- """ *************************************************************************** dinfdistdown.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ************...
40023154/final0627
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/this.py
948
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpg...
agry/NGECore2
refs/heads/master
scripts/object/tangible/crafting/station/inivisible_crafting_station.py
85615
import sys def setup(core, object): return
shawnwanderson/466T7Music
refs/heads/master
Abrams_code/sextract.py
1
''' Copyright (c) 2013-2015, Gregory Burlet, Abram Hindle This program 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 (at your option) any later v...
phamngtuananh/Singaboat_RobotX2016
refs/heads/master
robotx_vision/src/robotx_vision/mser.py
2
#!/usr/bin/env python ''' MSER detector demo ================== Usage: ------ mser.py [<video source>] Keys: ----- ESC - exit ''' import numpy as np import cv2 # import video if __name__ == '__main__': cam = cv2.VideoCapture(0) mser = cv2.MSER_create() while True: ret, img = cam.read...
noblepepper/openwrt
refs/heads/master
scripts/json_add_image_info.py
14
#!/usr/bin/env python3 from os import getenv from pathlib import Path from sys import argv import hashlib import json if len(argv) != 2: print("ERROR: JSON info script requires output arg") exit(1) json_path = Path(argv[1]) bin_dir = Path(getenv("BIN_DIR")) image_file = bin_dir / getenv("DEVICE_IMG_NAME") i...
singingwolfboy/flask-dance
refs/heads/main
tests/contrib/test_linkedin.py
1
import pytest import responses from urlobject import URLObject from flask import Flask from flask_dance.contrib.linkedin import make_linkedin_blueprint, linkedin from flask_dance.consumer import OAuth2ConsumerBlueprint from flask_dance.consumer.storage import MemoryStorage @pytest.fixture def make_app(): "A calla...
ahockersten/lierogbg
refs/heads/master
accounts/__init__.py
7
""" Unused """
thonkify/thonkify
refs/heads/master
src/lib/setuptools/command/alias.py
467
from distutils.errors import DistutilsOptionError from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in '"', "'", "\\", "#": if c in arg: return repr(arg) if arg.split() != [arg...
chromium/chromium
refs/heads/master
build/android/pylib/dex/dex_parser.py
3
#!/usr/bin/env python # Copyright 2019 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. """Utilities for optimistically parsing dex files. This file is not meant to provide a generic tool for analyzing dex files. A DexFile...
ddico/odoo
refs/heads/master
odoo/addons/test_access_rights/__manifest__.py
5
{ 'name': 'test of access rights and rules', 'description': "Testing of access restrictions", 'version': '0.0.1', 'category': 'Hidden/Tests', 'data': [ 'ir.model.access.csv', 'security.xml', 'data.xml', ], }
endlessm/chromium-browser
refs/heads/master
testing/libfuzzer/tests/check_fuzzer_config.py
24
#!/usr/bin/python2 # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Script that prints out "option=value" from the config file. Used for testing. import ConfigParser import os import sys OPTIONS_SECTION...
fnouama/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/objectNewAttributes.py
166
class C(object): def __new__(cls): self = object.__new__(cls) self.foo = 1 return self x = C() print(x.foo) print(x.<warning descr="Unresolved attribute reference 'bar' for class 'C'">bar</warning>)
direvus/ansible
refs/heads/devel
lib/ansible/playbook/loop_control.py
38
# (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...
Arno-Nymous/pyload
refs/heads/stable
module/plugins/crypter/CryptItCom.py
7
# -*- coding: utf-8 -*- from ..internal.DeadCrypter import DeadCrypter class CryptItCom(DeadCrypter): __name__ = "CryptItCom" __type__ = "crypter" __version__ = "0.16" __status__ = "stable" __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/\w+' __config__ = [("activated", "bool", "Act...
koushikcgit/xen
refs/heads/master
tools/python/logging/logging-0.4.9.2/test/logrecv.py
42
#! /usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright ...
sachintyagi22/spark
refs/heads/master
python/test_support/SimpleHTTPServer.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...
HyperloopTeam/FullOpenMDAO
refs/heads/master
lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/__init__.py
4
# $Id: __init__.py 7503 2012-08-26 15:42:37Z grubert $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This package contains Docutils parser modules. """ __docformat__ = 'reStructuredText' import sys from docutils import Component if sys.version_info < ...
hogarthj/ansible
refs/heads/devel
lib/ansible/cli/__init__.py
20
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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, eithe...
jeasoft/odoo
refs/heads/marcos-8.0
addons/analytic/__openerp__.py
302
# -*- 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...
agentxan/nzbToMedia
refs/heads/master
libs/jaraco/windows/error.py
4
#!/usr/bin/env python import sys import ctypes import ctypes.wintypes import six builtins = six.moves.builtins def format_system_message(errno): """ Call FormatMessage with a system error number to retrieve the descriptive error message. """ # first some flags used by FormatMessageW ALLOCATE_BUFFER = 0x100 ...
codexgigassys/codex-backend
refs/heads/master
src/Query/apifuzz.py
1
# Copyright (C) 2016 Deloitte Argentina. # This file is part of CodexGigas - https://github.com/codexgigassys/ # See the file 'LICENSE' for copying permission. import pathmagic from pymongo import MongoClient import ssdeep from env import envget def searchFuzzy(fuzz, limit, thresh): client = MongoClient(envget('m...
veger/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_compute_vpn_tunnel.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
halex2005/pjproject
refs/heads/master
tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_1.py
59
# $Id: 120_sdp_with_video_dynamic_1.py 2081 2008-06-27 21:59:15Z bennylp $ import inc_sip as sip import inc_sdp as sdp # Video uses dynamic payload type sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=- c=IN IP4 127.0.0.1 t=0 0 m=audio 5000 RTP/AVP 0 m=video 4000 RTP/AVP 100 a=rtpmap:100 myvideo/80000 """ pjsua_args = "--...
jaywreddy/django
refs/heads/master
django/forms/extras/__init__.py
464
import warnings from django.forms.widgets import SelectDateWidget from django.utils.deprecation import RemovedInDjango20Warning __all__ = ['SelectDateWidget'] warnings.warn( "django.forms.extras is deprecated. You can find " "SelectDateWidget in django.forms.widgets instead.", RemovedInDjango20Warning, ...
woodpecker1/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment_unittest.py
124
# Copyright (C) 2011 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...
0jpq0/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/encodings/iso8859_5.py
272
""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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,errors='...
davidvon/pipa-pay-server
refs/heads/master
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...
bruderstein/PythonScript
refs/heads/master
PythonLib/min/socket.py
14
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
RicardoJohann/um
refs/heads/master
erpnext/controllers/trends.py
20
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import getdate from frappe import _ def get_columns(filters, trans): validate_filters(filters) # get conditions f...
neotext/neotext-django-server
refs/heads/master
lib/neotext_quote_context/url.py
1
# -*- coding: utf-8 -*- # Copyright (C) 2015-2016 Tim Langeman and contributors # <see AUTHORS.txt file> # # This library is part of the Neotext project: # http://www.neotext.net/ # The code for this server library is released under the MIT License: # http://www.opensource.org/licenses/mit-license from neotext.model...
andreif/blues
refs/heads/master
blues/wkhtmltopdf.py
5
""" wkhtmltopdf Blueprint .. code-block:: yaml blueprints: - blues.wkhtmltopdf settings: wkhtmltopdf: # wkhtmltopdf_version: 0.12.2.1 """ from fabric.decorators import task from refabric.context_managers import sudo, settings from refabric.contrib import blueprints from refabric...
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/components/kulersky/const.py
5
"""Constants for the Kuler Sky integration.""" DOMAIN = "kulersky" DATA_ADDRESSES = "addresses" DATA_DISCOVERY_SUBSCRIPTION = "discovery_subscription"
bit-bots/imagetagger
refs/heads/master
imagetagger/imagetagger/images/migrations/0009_auto_20171122_1504.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-22 14:04 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('images', '0008_auto_20171120_1056'), ] operations ...
dol-sen/portage
refs/heads/master
pym/portage/tests/dbapi/__init__.py
62
# Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2
marcelocure/django
refs/heads/master
tests/runtests.py
105
#!/usr/bin/env python import logging import os import shutil import subprocess import sys import tempfile import warnings from argparse import ArgumentParser import django from django.apps import apps from django.conf import settings from django.db import connection from django.test import TestCase, TransactionTestCas...
krieger-od/nwjs_chromium.src
refs/heads/master
chrome/common/extensions/docs/server2/manifest_data_source_test.py
87
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from copy import deepcopy import json import unittest from future import Future import manifest_data_source from object_store_creator ...
tumf/xen-3.3.1
refs/heads/master
tools/xm-test/tests/network-attach/03_network_attach_detach_multiple_pos.py
42
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Murillo F. Bernardes <mfb@br.ibm.com> import sys import re import time from XmTestLib import * from XmTestLib.network_utils import * if ENABLE_HVM_SUPPORT: SKIP("Network-attach not supported for HVM domains") # Create a dom...
ntuecon/server
refs/heads/master
pyenv/Lib/site-packages/twisted/trial/test/test_log.py
24
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test the interaction between trial and errors logged during test run. """ from __future__ import division, absolute_import import time from twisted.internet import reactor, task from twisted.python import failure, log from twisted.trial impo...
joelelmercarlson/color
refs/heads/master
discovery.py
1
#!/usr/bin/env python # # discovery.py # # Usage: discovery.py marathon # Output: /appId hostname:port # import urllib2 import json import sys def marathon(url): try: mesos = urllib2.urlopen(url) data = json.loads(mesos.read()) except: data = {} return data def user(item): t = "" try: a = it...
android-ia/platform_external_chromium_org
refs/heads/master
tools/perf/page_sets/typical_25.py
34
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class Typical25Page(page_module.Page): def __init__...
PCManticore/argus-ci
refs/heads/master
argus/backends/tempest/cloud.py
2
# Copyright 2015 Cloudbase Solutions Srl # 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 # # ...
c11/earthengine-api
refs/heads/master
python/ee/tests/dictionary_test.py
5
#!/usr/bin/env python """Test for the ee.dictionary module.""" import unittest import ee from ee import apitestcase class DictionaryTest(apitestcase.ApiTestCase): def testDictionary(self): """Verifies basic behavior of ee.Dictionary.""" src = {'a': 1, 'b': 2, 'c': 'three'} dictionary = ee.Dictionar...
madscatt/zazmol
refs/heads/dev
src/python/test_sasmol/utilities/generate_huge_dcd_onthefly.py
2
import os import numpy as np import sasmol.system as system import sasmol.dcdio as dcdio def generate(fin='rna.pdb', fout='rna.dcd', frames=1000): path = os.path.dirname(os.path.realpath(__file__)) fin = os.path.join(path,'../','data','pdb_common',fin) if not os.path.exists(fin): raise Exception,fin+' does ...
jeffthemaximum/crispy-hippopotamus
refs/heads/master
migrations/versions/5651968fb60c_added_game_pid.py
1
"""added game pid Revision ID: 5651968fb60c Revises: 4ee7c51f1bbd Create Date: 2015-08-05 17:14:01.211795 """ # revision identifiers, used by Alembic. revision = '5651968fb60c' down_revision = '4ee7c51f1bbd' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic -...
2014c2g18/c2g18
refs/heads/master
w2/static/Brython2.0.0-20140209-164925/Lib/test/test_re.py
718
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
jesseh/dothis
refs/heads/master
volunteering/migrations/0025_campaign_message_trigger.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('volunteering', '0024_dutyeditable'), ] operations = [ migrat...
fernandog/Medusa
refs/heads/optimized
ext/boto/dynamodb/schema.py
185
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Amazon.com, Inc. or its affiliates. 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 ...
chris-griffin/django-auditlog
refs/heads/master
src/auditlog/migrations/0001_initial.py
6
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contentt...
dylan-reeves/home_backup
refs/heads/master
backupclient-env/Lib/encodings/cp1251.py
272
""" Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.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,in...
krunal3103/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/filters/inject_meta_charset.py
1730
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
clab/lstm-parser
refs/heads/master
cnn/pyexamples/cpu_vs_gpu.py
3
import gpycnn as G print import pycnn as C cm = C.Model() gm = G.Model() cpW = cm.add_parameters("W",(1000,1000)) gpW = gm.add_parameters("W",(1000,1000)) def do_cpu(): C.renew_cg() W = C.parameter(cpW) W = W*W*W*W*W*W*W z = C.squared_distance(W,W) z.value() z.backward() def do_gpu(): G.renew_cg() W = G.pa...
StelixROM/android_external_skia
refs/heads/kk4.4
bench/gen_bench_ranges.py
29
#!/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. """ Analyze recent SkPicture or Microbench data, and output suggested ranges. The outputs can be edited and pasted to bench_expect...
blademainer/intellij-community
refs/heads/master
python/testData/override/simple.py
83
class A: def doStuff(self, foo=True): pass class B(A): def otherMethod(self, foo, bar): print foo, bar
mttr/django
refs/heads/master
django/contrib/gis/geoip/prototypes.py
535
from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at from django.contrib.gis.geoip.libgeoip import free, lgeoip # #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('cou...
yaybu/touchdown
refs/heads/master
touchdown/tests/test_aws_vpc_vpn_gateway.py
1
# Copyright 2015 Isotoma 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 writing...
Dandandan/wikiprogramming
refs/heads/master
jsrepl/build/extern/python/unclosured/lib/python2.7/Bastion.py
298
"""Bastionification utility. A bastion (for another object -- the 'original') is an object that has the same methods as the original but does not give access to its instance variables. Bastions have a number of uses, but the most obvious one is to provide code executing in restricted mode with a safe interface to an ...
adamweiner/gunicorn
refs/heads/master
gunicorn/workers/gaiohttp.py
101
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import sys if sys.version_info >= (3, 3): try: import aiohttp # NOQA except ImportError: raise RuntimeError("You need aiohttp installed to use this worker.") else...
KokareIITP/django
refs/heads/master
tests/invalid_models_tests/test_custom_fields.py
348
from django.db import models from .base import IsolatedModelsTestCase class CustomFieldTest(IsolatedModelsTestCase): def test_none_column(self): class NoColumnField(models.AutoField): def db_type(self, connection): # None indicates not to create a column in the database. ...
technologiescollege/Blockly-rduino-communication
refs/heads/master
scripts_XP/Lib/test/test_sax.py
4
# regression test for SAX 2.0 # $Id$ from xml.sax import make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException import unittest try: make_parser() except SAXReaderNotAvailable: # don't try to test this module if we cannot create a parser raise unittest.Ski...
mewbak/idc
refs/heads/master
machine/pentium/simplify.py
1
'''Simplification.''' from transf import parse from machine.pentium.common import * parse.Transfs(''' simplifyExpr = Not(Int(1,_)) -> Not(Bool) | Or(Int(1,_)) -> Or(Bool) | And(Int(1,_)) -> And(Bool) simplifyStmt = Assign(type, dst, Cond(cond, src, dst)) -> If(cond, Assign(type, dst, src), NoStmt) | Assign...
dgellis90/nipype
refs/heads/master
nipype/algorithms/tests/test_overlap.py
14
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os from shutil import rmtree from tempfile import mkdtemp from nipype.testing import (example_data) import numpy as np def test_overlap(): from ...
alcobar/asuswrt-merlin
refs/heads/master
release/src/router/samba36/lib/dnspython/dns/rcode.py
248
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
xq262144/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/aggregation/tests.py
59
from __future__ import absolute_import import datetime from decimal import Decimal from django.db.models import Avg, Sum, Count, Max, Min from django.test import TestCase, Approximate from .models import Author, Publisher, Book, Store class BaseAggregateTestCase(TestCase): fixtures = ["aggregation.json"] ...
GeorgiaTechDHLab/TOME
refs/heads/master
topics/migrations/0025_auto_20180515_1323.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2018-05-15 13:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0024_auto_20180515_1259'), ] operations = [ migrations.AddIndex( ...
willhardy/django
refs/heads/master
tests/app_loading/tests.py
54
from __future__ import unicode_literals import os from django.apps import apps from django.test import SimpleTestCase from django.test.utils import extend_sys_path from django.utils._os import upath class EggLoadingTest(SimpleTestCase): def setUp(self): self.egg_dir = '%s/eggs' % os.path.dirname(upath(...
zombi-x/android_kernel_htc_m7
refs/heads/lp5.1
tools/perf/python/twatch.py
7370
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
jindongh/boto
refs/heads/develop
tests/unit/ec2/test_instance.py
114
#!/usr/bin/env python import base64 from tests.compat import unittest, mock from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection DESCRIBE_INSTANCE_VPC = br"""<?xml version="1.0" encoding="UTF-8"?> <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2012-10-01/"> ...
remi128/vertx-apex_old
refs/heads/master
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/sbcharsetprober.py
2926
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
circleQu/greenPlant
refs/heads/master
helloworld/public/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
1467
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys BUILDBOT_DIR = os....
spatialmonk/qgsMapzenIsochrones
refs/heads/master
test/test_translations.py
116
# coding=utf-8 """Safe Translations Test. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ from ut...
mglukhikh/intellij-community
refs/heads/master
python/testData/mover/innerIf_afterDown.py
83
if value is not None: if not False or value <= 2: pass print "here"
scollis/iris
refs/heads/master
docs/iris/example_tests/test_global_map.py
3
# (C) British Crown Copyright 2010 - 2013, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
PeterPetrik/QGIS
refs/heads/master
tests/src/python/test_qgsinterval.py
22
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsInterval. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __aut...
sergecodd/FireFox-OS
refs/heads/master
B2G/gecko/dom/bindings/BindingGen.py
2
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import os import cPickle import WebIDL from Configuration import * from Codegen import CGBindingRoot, replaceFileIfChang...
jrrembert/django
refs/heads/master
tests/custom_pk/fields.py
379
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
JeanKossaifi/scikit-learn
refs/heads/master
sklearn/externals/joblib/parallel.py
79
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
ChromiumWebApps/chromium
refs/heads/master
components/test/data/autofill/merge/tools/serialize_profiles.py
137
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os.path import sqlite3 import sys from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType def main(): ""...
gFelicio/agenda
refs/heads/dev
public/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
896
# 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
illicitonion/givabit
refs/heads/master
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/tests/modeltests/test_client/models.py
38
# coding: utf-8 """ 39. Testing using the Test Client The test client is a class that can act like a simple browser for testing purposes. It allows the user to compose GET and POST requests, and obtain the response that the server gave to those requests. The server Response objects are annotated with the details of t...
sahana/Turkey
refs/heads/master
modules/templates/default/layouts.py
19
# -*- coding: utf-8 -*- from gluon import * from gluon.storage import Storage from s3 import * #from s3theme import NAV, SECTION # Below is an example which you can base your own template's layout.py on # - there are also other examples in the other templates folders # - you will need to restart web2py after making c...
vivaxy/algorithms
refs/heads/master
python/problems/two_sum_ii_input_array_is_sorted.py
1
""" https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ https://leetcode.com/submissions/detail/107710289/ """ class Solution(object): def twoSum(self, numbers, target): """ :type numbers: List[int] :type target: int :rtype: List[int] """ index1 = 0 ...
tbinjiayou/Odoo
refs/heads/master
addons/account_budget/tests/test_theoreticalamount.py
229
# -*- coding: utf-8 -*- from datetime import datetime from mock import patch from openerp.tests.common import TransactionCase from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT # --------------------------------------------------------- # Tests # --------------------------------------------------------- class ...
openstack/glance
refs/heads/master
glance/api/v2/model/metadef_property_type.py
20
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
libcrosswind/libcrosswind
refs/heads/master
platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/unittest/result.py
223
"""Test result object""" import os import sys import traceback from StringIO import StringIO from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() retur...
Shedino/SherpaHighLevel
refs/heads/master
catkin_ws/src/px-ros-pkg/mavlink/share/pyshared/pymavlink/examples/mavtester.py
30
#!/usr/bin/env python ''' test mavlink messages ''' import sys, struct, time, os from curses import ascii # allow import from the parent directory, where mavlink.py is sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) import mavlink, mavtest, mavutil from optparse import OptionPar...
IlDucci/RetroArch
refs/heads/master
deps/SPIRV-Cross/test_shaders.py
13
#!/usr/bin/env python3 import sys import os import os.path import subprocess import tempfile import re import itertools import hashlib import shutil import argparse import codecs import json import multiprocessing import errno from functools import partial class Paths(): def __init__(self, spirv_cross, glslang, s...
Geeglee/scrapy
refs/heads/master
scrapy/xlib/tx/__init__.py
161
from scrapy import twisted_version if twisted_version > (13, 0, 0): from twisted.web import client from twisted.internet import endpoints if twisted_version >= (11, 1, 0): from . import client, endpoints else: from scrapy.exceptions import NotSupported class _Mocked(object): def __init__(sel...
BogusCurry/BlocksCAD
refs/heads/master
blockly/appengine/index_redirect.py
179
print("Status: 302") print("Location: /static/demos/index.html")
Richard2ndQuadrant/ansible
refs/heads/devel
lib/ansible/new_inventory/group.py
7690
# (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...
ernstbaslerpartner/send2geoadmin
refs/heads/master
env/Lib/encodings/cp932.py
817
# # cp932.py: Python Unicode Codec for CP932 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('cp932') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrement...
hackerkid/zulip
refs/heads/master
zerver/webhooks/hellosign/view.py
5
from typing import Any, Dict, List import orjson from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zer...