repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
hirokiky/gargant.dispatch
refs/heads/master
gargant/dispatch/__init__.py
1
""" t = lambda condition: True f = lambda condition: False tree = Node((t,), children=[ Node((t,), case='posts', name='posts', children=[ Node((f,), case='post_detail', ...
resmo/ansible
refs/heads/devel
test/units/modules/cloud/linode/test_linode.py
77
from __future__ import (absolute_import, division, print_function) import pytest from ansible.modules.cloud.linode import linode from units.modules.utils import set_module_args if not linode.HAS_LINODE: pytestmark = pytest.mark.skip('test_linode.py requires the `linode-python` module') def test_name_is_a_requi...
elbow-jason/learning-goat-django
refs/heads/master
lists/views.py
1
from django.shortcuts import render, redirect from lists.models import Item, List def home_page(request): if request.method == 'POST': list_ = List.objects.create() Item.objects.create( text=request.POST['item_text'], list=list_ ) return redirect('/lists/th...
farseerfc/pacman-fc
refs/heads/master
test/pacman/tests/upgrade057.py
28
self.description = "Upgrade a package that both provides and is a dependency" lp1 = pmpkg("pkg1") lp1.depends = ["pkg2", "imag3"] self.addpkg2db("local", lp1) lp2 = pmpkg("pkg2") lp2.provides = ["imag3"] self.addpkg2db("local", lp2) p = pmpkg("pkg2", "1.0-2") p.provides = ["imag3"] self.addpkg(p) self.args = "-U %s...
petertodd/bitcoin
refs/heads/master
qa/rpc-tests/listtransactions.py
145
#!/usr/bin/env python # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API # Add python-bitcoinrpc to module search path: import os import sys sy...
ferranti/watchdog
refs/heads/master
import/parse/earmarks.py
3
#!/usr/bin/env python """ A parser for the 2008 earmarks data (XLS format) from http://taxpayer.net/ This script depends on xls2list which will convert the excel file to a 2d array. It then does some trivial parsing of each field and outputs the data in a few ways. """ __author__ = ['Alex Gourley <acgourley@gmail.com...
shikil/sympy
refs/heads/master
sympy/physics/optics/tests/test_medium.py
70
from __future__ import division from sympy import sqrt, simplify from sympy.physics.optics import Medium from sympy.abc import epsilon, mu from sympy.physics.units import c, u0, e0, m, kg, s, A def test_medium(): m1 = Medium('m1') assert m1.intrinsic_impedance == sqrt(u0/e0) assert m1.speed == 1/sqrt(e0*u...
rednach/krill
refs/heads/master
test/test_business_rules_with_bad_realm_conf.py
18
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
rayluo/boto
refs/heads/develop
boto/support/layer1.py
151
# Copyright (c) 2014 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 restriction, including # without limitation the rights ...
amanikamail/flexx
refs/heads/master
make/__main__.py
21
# License: consider this public domain from __future__ import absolute_import, division, print_function import sys import os import os.path as op THIS_DIR = op.dirname(op.abspath(__file__)) ROOT_DIR = op.dirname(THIS_DIR) # Setup paths os.chdir(ROOT_DIR) sys.path.insert(0, ROOT_DIR) if 'make' in sys.path: sys....
wangscript/libjingle-1
refs/heads/master
trunk/tools/clang/scripts/test_tool.py
5
#!/usr/bin/env python # Copyright (c) 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. """Test harness for chromium clang tools.""" import difflib import glob import json import os import os.path import subprocess imp...
victorywang80/Maintenance
refs/heads/master
saltstack/src/tests/integration/modules/decorators.py
1
# Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration class DecoratorTest(integration.ModuleCase): def test_module(self): self.assertTrue( self.run_function( 'runtests_decorators.w...
jflamant/sphericalEMC
refs/heads/master
dataGeneration/generateSamplesShell.py
1
# file: generatSamplesShell.py # # This code generates a given number of patterns, on a specified shell. The # samples are obtained by Poisson realizations of the underlying intensity. # The theoretical intensity on the shell (continuous) is to be calculated # using 'compute3Dintensityshell.py'. # # Copyrig...
lmprice/ansible
refs/heads/devel
lib/ansible/modules/remote_management/manageiq/manageiq_provider.py
53
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Daniel Korn <korndaniel1@gmail.com> # (c) 2017, Yaacov Zamir <yzamir@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANS...
eduardolujan/django_project_template
refs/heads/master
django_project_template/django_project_template/urls.py
1
from django.conf.urls.static import static from django.conf.urls import patterns, url, include from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'', include('django_project_template.apps.app.urls')), (r'^admin/doc/', include('django.contrib.ad...
indictranstech/phr-frappe
refs/heads/develop
frappe/core/doctype/property_setter/__init__.py
2292
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
dendisuhubdy/tensorflow
refs/heads/master
tensorflow/contrib/crf/python/kernel_tests/crf_test.py
10
# 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...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_binhex.py
193
#! /usr/bin/env python """Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. """ import binhex import os import unittest from test import test_support class BinHexTestCase(unittest.TestCase): def setUp(self): self.fname1 ...
c86j224s/snippet
refs/heads/master
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pkg_resources/__init__.py
20
# coding: utf-8 """ Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path opera...
athompso/ansible
refs/heads/devel
contrib/inventory/proxmox.py
43
#!/usr/bin/env python # Copyright (C) 2014 Mathieu GAUTHIER-LAFAYE <gauthierl@lapth.cnrs.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
richardnpaul/FWL-Website
refs/heads/master
lib/python2.7/site-packages/setuptools/tests/test_sandbox.py
204
"""develop tests """ import sys import os import shutil import unittest import tempfile from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): """ Run this to determine if the local machine has win32com, and if it does, include additional tests. """ if not sys.platfo...
pilou-/ansible
refs/heads/devel
lib/ansible/modules/system/hostname.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Hiroaki Nakamura <hnakamur@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_versi...
gtest-org/test10
refs/heads/master
jenkins_jobs/modules/parameters.py
8
# Copyright 2012 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 applicable law...
mt2d2/servo
refs/heads/master
tests/wpt/css-tests/tools/html5lib/html5lib/tokenizer.py
1710
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
crossbario/crossbar-examples
refs/heads/master
demos/votes/kivy/kivy/main.py
3
""" A Kivy front end component for the WAMP Votes demo application. The Votes application collects votes for our favourite flavours of ice cream. It is powered by a back end WAMP component that runs on the address as defined in the start_wamp_component() function. See https://github.com/crossbario/crossbarexamples/tre...
qedi-r/home-assistant
refs/heads/dev
tests/components/homematicip_cloud/conftest.py
1
"""Initializer helpers for HomematicIP fake server.""" from asynctest import MagicMock, Mock, patch from homematicip.aio.auth import AsyncAuth from homematicip.aio.connection import AsyncConnection from homematicip.aio.home import AsyncHome import pytest from homeassistant import config_entries from homeassistant.comp...
KimNorgaard/ansible-modules-extras
refs/heads/devel
network/a10/a10_service_group.py
117
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage A10 Networks slb service-group objects (c) 2014, Mischa Peters <mpeters@a10networks.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 publishe...
fitermay/intellij-community
refs/heads/master
python/testData/formatter/forceSpacesAroundEqualSignInAnnotatedParameter.py
70
def test(x = 1, y: int = 2, z: int=3): pass
hkchenhongyi/django
refs/heads/master
tests/model_validation/models.py
260
from django.db import models class ThingItem(object): def __init__(self, value, display): self.value = value self.display = display def __iter__(self): return (x for x in [self.value, self.display]) def __len__(self): return 2 class Things(object): def __iter__(se...
TeamWin/android_kernel_samsung_zerolteeu
refs/heads/android-5.1
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
nikesh-mahalka/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/227_fix_project_user_quotas_resource_length.py
81
# Copyright 2013 NEC 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 applicable law or ag...
asedunov/intellij-community
refs/heads/master
python/testData/refactoring/makeFunctionTopLevel/methodImportUpdates/before/other.py
44
from main import C inst = C() inst.method(42)
dennisobrien/bokeh
refs/heads/master
examples/embed/embed_responsive_width_height.py
19
""" This example shows how a Bokeh plot can be embedded in an HTML document, in a way that the plot resizes to make use of the available width and height (while keeping the aspect ratio fixed). To make this work well, the plot should be placed in a container that *has* a certain width and height (i.e. non-scrollable),...
jkramarz/zuombot
refs/heads/zuombot
plugins/books.py
31
import requests from cloudbot import hook from cloudbot.util import formatting, web base_url = 'https://www.googleapis.com/books/v1/' book_search_api = base_url + 'volumes?' @hook.on_start() def load_key(bot): global dev_key dev_key = bot.config.get("api_keys", {}).get("google_dev_key", None) @hook.comman...
shinate/three.js
refs/heads/master
utils/exporters/blender/addons/io_three/logger.py
121
import os import logging import tempfile from . import constants LOG_FILE = None LOGGER = None LEVELS = { constants.DEBUG: logging.DEBUG, constants.INFO: logging.INFO, constants.WARNING: logging.WARNING, constants.ERROR: logging.ERROR, constants.CRITICAL: logging.CRITICAL } def init(filename, l...
google-research/falken
refs/heads/main
service/generated_flatbuffers/tflite/DimensionMetadata.py
1
# Copyright 2021 Google LLC # # 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, ...
MarcJoan/django
refs/heads/master
tests/field_subclassing/tests.py
129
from __future__ import unicode_literals from django.db import connection from django.test import SimpleTestCase from .fields import CustomTypedField class TestDbType(SimpleTestCase): def test_db_parameters_respects_db_type(self): f = CustomTypedField() self.assertEqual(f.db_parameters(connectio...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/mobiles/tatooine/pirate_leader.py
2
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
joansmith/openmicroscopy
refs/heads/develop
components/tools/OmeroPy/src/omero/plugins/import.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2009-2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # 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...
pombredanne/pytest_django
refs/heads/master
pytest_django_test/settings_sqlite.py
13
from .settings_base import * # noqa DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' }, }
hiteshagrawal/python
refs/heads/master
mbox-short-spam.py
1
#!/usr/bin/python my_list = [] with open('mbox-short.txt') as fh: for line in fh: if line.startswith('X-DSPAM-Confidence:'): line = line.strip() #print line stpos = line.find(' ') number = line[stpos+1:len(line)] my_list += [float(number)] print my_list #print sum(my_list) avg = sum(my_list)/len(my_l...
Big-B702/python-for-android
refs/heads/master
python-modules/twisted/twisted/internet/test/reactormixins.py
49
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorTime}. """ __metaclass__ = type import signal from twisted.internet.defer import TimeoutError from twisted.trial.unittest import TestCase, SkipTest from twisted.python.runtime import platform...
atalax/libsigrokdecode
refs/heads/qi
decoders/pan1321/pd.py
13
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 t...
leighpauls/k2cro4
refs/heads/master
chrome/test/functional/infobars.py
4
#!/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 re import pyauto_functional # Must be imported before pyauto import pyauto import test_utils cl...
jmerkow/VTK
refs/heads/master
Common/DataModel/Testing/Python/ImplicitSum.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This example demonstrates adding two implicit models # to produce an (unexpected!) result # first we load in the standard vtk packages into tcl geomObject1 = vtk.vtkCone() geomObjec...
VladimirVystupkin/AMRParsing1.x
refs/heads/master
stanfordnlp/unidecode/x061.py
252
data = ( 'Qiao ', # 0x00 'Chou ', # 0x01 'Bei ', # 0x02 'Xuan ', # 0x03 'Wei ', # 0x04 'Ge ', # 0x05 'Qian ', # 0x06 'Wei ', # 0x07 'Yu ', # 0x08 'Yu ', # 0x09 'Bi ', # 0x0a 'Xuan ', # 0x0b 'Huan ', # 0x0c 'Min ', # 0x0d 'Bi ', # 0x0e 'Yi ', # 0x0f 'Mian ', # 0x10 'Yon...
sleshepic/l900_MC2_Kernel
refs/heads/master
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,...
frankvdp/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex/6_auto.py
266
from django.db import migrations class Migration(migrations.Migration): dependencies = [("migrations", "5_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
jaruba/chromium.src
refs/heads/nw12
chrome/test/telemetry/telemetry_lib.py
133
# 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 __future__ import absolute_import import os import sys path = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'tools'...
cogeorg/black_rhino
refs/heads/master
examples/degroot/networkx/utils/random_sequence.py
20
""" Utilities for generating random numbers, random sequences, and random selections. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import random import sys import networkx a...
liunian/closure-linter
refs/heads/master
closure_linter/runner.py
102
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
aldefalco/flasky
refs/heads/master
migrations/versions/190163627111_account_confirmation.py
144
"""account confirmation Revision ID: 190163627111 Revises: 456a945560f6 Create Date: 2013-12-29 02:58:45.577428 """ # revision identifiers, used by Alembic. revision = '190163627111' down_revision = '456a945560f6' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Ale...
faust64/ansible
refs/heads/devel
test/units/modules/network/ios/ios_module.py
59
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
cluck/mt940
refs/heads/develop
mt940/processors.py
1
import calendar import re def add_currency_pre_processor(currency, overwrite=True): def _add_currency_pre_processor(transactions, tag, tag_dict, *args): if 'currency' not in tag_dict or overwrite: # pragma: no branch tag_dict['currency'] = currency return tag_dict return _add_cu...
BozhkoAlexander/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/msvs/external_builder/external_builder.py
260
# 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. import sys with open('external_builder.out', 'w') as f: f.write(' '.join(sys.argv))
thomasrotter/sublimetext-cfml
refs/heads/master
src/component_index/documentation.py
2
import sublime from functools import partial from .. import utils, minihtml, documentation_helpers SIDE_COLOR = "color(var(--bluish) blend(var(--background) 60%))" def get_documentation(view, extended_metadata, file_path, class_name): model_doc = build_documentation(extended_metadata, file_path, class_name) ...
jcai19/smm_gem5
refs/heads/master
src/arch/x86/isa/insts/simd128/integer/shift/__init__.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
prodigeni/unbound-dns64
refs/heads/master
libunbound/python/doc/conf.py
26
# -*- coding: utf-8 -*- # # Unbound documentation build configuration file # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically)....
willhardy/django
refs/heads/master
tests/empty/models.py
542
""" Empty model tests These test that things behave sensibly for the rare corner-case of a model with no fields. """ from django.db import models class Empty(models.Model): pass
openstack/senlin-dashboard
refs/heads/master
senlin_dashboard/cluster/receivers/tests.py
2
# 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 # distributed under t...
1065865483/0python_script
refs/heads/master
four/Webdriver/scroll_window.py
1
from selenium import webdriver from time import sleep driver=webdriver.Firefox() driver.get('http://www.51zxw.net/') sleep(2) #webdriver不能操作的方法可通过js实现 #将滚动条拖到底部- js="var action=document.documentElement.scrollTop=10000" driver.execute_script(js) sleep(2) #将滚动条拖到顶部 js="var action=document.documentElement.scrollTop=0" d...
songfj/calibre
refs/heads/master
src/calibre/gui2/preferences/saving.py
14
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2.preferences import ConfigWidgetBase, test_widget, \ AbortCommit from calibre.gui2.preferences.s...
cvalenzu/acalib
refs/heads/master
acalib/algorithms/stacking.py
1
import acalib from .algorithm import Algorithm from numpy import mean from scipy.stats import signaltonoise import scipy.ndimage as scnd from astropy.nddata import NDData,NDDataRef class Stacking(Algorithm): """ Create a stacked image using a template image and a set of different images from same object. ...
alebcay/android_kernel_oneplus_msm8974
refs/heads/m-caf
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...
EarthTeam/earthteam.net
refs/heads/master
sites/all/libraries/geos-3.4.2/swig/python/tests/example.py
29
import os import sys import distutils.util import math # Put local build directory on head of python path platformdir = '-'.join((distutils.util.get_platform(), '.'.join(map(str, sys.version_info[0:2])))) sys.path.insert(0, os.path.join('build', 'lib.' + platformdir)) # import geos from the lo...
hardboiled65/Seshat
refs/heads/master
configure.py
1
#!/usr/bin/env python3 # Seshat config tool. # This is not a part of autotools. import sys import os import platform import shutil import xml.etree.ElementTree import subprocess ICU_MIN_VERSION = "59.1" UNICODE_VERSION = "10.0" SESHAT_VERSION_MAJOR = 0 SESHAT_VERSION_MINOR = 1 SESHAT_VERSION_PATCH = 0 SESHAT_VERSION =...
habeanf/Open-Knesset
refs/heads/upmaster
apis/urls.py
11
from django.conf.urls import url, patterns, include from resources import v2_api urlpatterns = patterns( '', (r'^', include(v2_api.urls)), url( r'^v2/doc/', include('tastypie_swagger.urls', namespace='tastypie_swagger'), kwargs={ "tastypie_api_module": "apis.resources.v...
finger563/learningTF
refs/heads/master
src/intro/mnist_softmax.py
30
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
hottwaj/django
refs/heads/master
django/contrib/admin/models.py
184
from __future__ import unicode_literals from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import NoReverseMatch, reverse from django.db import models from django.utils import timezone from django.utils....
kaustubhhiware/hiPy
refs/heads/master
think_python/birthdays.py
1
import random def length(listed): """ return length of list """ count = 0 for item in listed: count += 1 return count def has_duplicates(listed): """ check for duplicates Birthday paradox! """ for index in range(length(listed)): j =...
jlongstaf/f5-openstack-lbaasv2-driver
refs/heads/master
test/dev/testgetservice.py
5
import os import sys import time from neutron.common import rpc as q_rpc from neutron import context from neutronclient.v2_0 import client as q_client from oslo_config import cfg import oslo_messaging as messaging from f5lbaasdriver.v2.bigip import constants_v2 lb_dict = { 'loadbalancer': { 'vip_subnet_...
yt752/theano_exercises
refs/heads/master
02_advanced/01_symbolic/04_two_step_backprop_soln.py
13
import numpy as np from theano import config from theano import function from theano import shared from theano import tensor as T from theano.compat.python2x import OrderedDict num_vis = 2 class SimpleMLP(object): """ An MLP with one sigmoid hidden layer and one linear output layer (for solving regressi...
wartman4404/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py
276
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface OneNullableInUnion { void foo((object? or DOMString?) arg); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Two ...
manishpatell/erpcustomizationssaiimpex123qwe
refs/heads/master
addons/payment_paypal/controllers/main.py
260
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import urllib2 import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controller): _noti...
miing/mci_migo
refs/heads/master
identityprovider/backend/base.py
1
# Copyright 2010, 2012 Canonical Ltd. This software is licensed under # the GNU Affero General Public License version 3 (see the file # LICENSE). __all__ = [ 'DatabaseWrapper', 'DatabaseError', 'IntegrityError', ] import re from hashlib import sha1 from django.conf import settings from django.core.cache import ...
halberom/ansible
refs/heads/devel
lib/ansible/modules/cloud/rackspace/rax_files.py
50
#!/usr/bin/python # (c) 2013, Paul Durivage <paul.durivage@rackspace.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 # (a...
fgaudin/aemanager
refs/heads/master
faq/models.py
1
from django.db import models from django.utils.translation import ugettext_lazy as _ class Category(models.Model): label = models.CharField(max_length=255, verbose_name=_('Label')) order = models.IntegerField(default=0, verbose_name=_('Order')) class Meta: ordering = ['order'] def __unicode__...
zakuro9715/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/tests/modeltests/files/tests.py
38
import shutil from django.core.cache import cache from django.core.files.base import ContentFile from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase from models import Storage, temp_storage, temp_storage_location class FileTests(TestCase): def tearDown(self): s...
bdh1011/wau
refs/heads/master
venv/lib/python2.7/site-packages/twisted/web/sux.py
11
# -*- test-case-name: twisted.web.test.test_xml -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ *S*mall, *U*ncomplicated *X*ML. This is a very simple implementation of XML/HTML as a network protocol. It is not at all clever. Its main features are that it does not: - support nam...
lite3/adbtool
refs/heads/master
adbtool/apkinstall.py
1
import argparse import os import os.path import sys from cmd import call, getAdb import adbdevice import apkinfo # BASE_DIR="F:/release" BASE_DIR = "" def getApks(path, filters): apks = os.listdir(path) apks = filter(lambda filename: filename.endswith(".apk"), apks) if filters is not None: def ...
iamjy/beaglebone-kernel
refs/heads/master
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...
medspx/QGIS
refs/heads/master
tests/src/python/test_versioncompare.py
74
# -*- coding: utf-8 -*- ''' test_versioncompare.py -------------------------------------- Date : September 2016 Copyright : (C) 2016 Alexander Bruy email : alexander dot bruy at gmail dot com *******************...
pavlova-marina/QGIS
refs/heads/master
python/plugins/processing/algs/lidar/lastools/lascontrol.py
9
# -*- coding: utf-8 -*- """ *************************************************************************** lascontrol.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com **************...
gahoo/PiBox
refs/heads/master
PiBox/PiHome/PiApp/models.py
4
#coding=utf-8 ''' # The modules contains PiApp's models # Any issues or improvements please contact jacob-chen@iotwrt.com ''' from django.db import models from django.contrib.auth.models import AbstractUser from PiHome import settings import os UPLOAD_ROOT = 'pibox_upload' UPLOAD_ROOT_HOUSR_PLAN='pibox_upload/hous...
hypnotika/namebench
refs/heads/master
tools/convert_servers_to_csv.py
174
#!/usr/bin/env python # Copyright 2009 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...
ddv2005/intercom
refs/heads/master
3rdparty/pjproject/tests/pjsua/scripts-recvfrom/202_reg_good_ok_wildcard.py
59
# $Id: 202_reg_good_ok_wildcard.py 2392 2008-12-22 18:54:58Z bennylp $ import inc_sip as sip import inc_sdp as sdp pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \ "--username user --realm \"*\" --password passwd --auto-update-nat=0" req1 = sip.RecvfromTransaction("Initial registration", 4...
grischa/django-tastypie
refs/heads/master
tastypie/contrib/contenttypes/fields.py
16
from functools import partial from tastypie import fields from tastypie.resources import Resource from tastypie.exceptions import ApiFieldError from django.db import models from django.core.exceptions import ObjectDoesNotExist from .resources import GenericResource class GenericForeignKeyField(fields.ToOneField): ...
tdomhan/thrax
refs/heads/master
scripts/berant_to_reference.py
3
#!/usr/bin/env python import os, sys, codecs def main(): # <eat::animal_1::animal_2> <kill::animal_1::animal_2> # <be affected than::animal_2::animal_1> <be susceptible than::animal_2::animal_1> for line in sys.stdin: (source, target) = line.lstrip().rstrip().split("\t") (s_phr, s1, s2) = source[1:-1].s...
indexofire/django-cms-content
refs/heads/master
cms_content/menu.py
2
# -*- coding: utf-8 -*- from django.core.cache import cache from django.utils.translation import ugettext_lazy as _ from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool from cms_content.settings import ROOT_URL from cms_content.models import CMSMenuID, ...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/graph_objs/table/_hoverlabel.py
2
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "table" _path_str = "table.hoverlabel" _valid_props = { "align", "alignsr...
AshishNamdev/linux
refs/heads/master
Documentation/sphinx/cdomain.py
146
# -*- coding: utf-8; mode: python -*- # pylint: disable=W0141,C0113,C0103,C0325 u""" cdomain ~~~~~~~ Replacement for the sphinx c-domain. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see Linux/COPYING for details. List of customizations: * Moved th...
angelapper/odoo
refs/heads/9.0
openerp/report/render/rml2pdf/__init__.py
49
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from trml2pdf import parseString, parseNode
jpt4/urbit
refs/heads/master
outside/commonmark/test/spec_tests.py
23
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from difflib import unified_diff import argparse import re import json from cmark import CMark from normalize import normalize_html if __name__ == "__main__": parser = argparse.ArgumentParser(description='Run cmark tests.') parser.add_argument('--progra...
rynomster/django
refs/heads/master
tests/test_discovery_sample/tests_sample.py
98
import doctest from unittest import TestCase from django.test import SimpleTestCase, TestCase as DjangoTestCase, tag from . import doctests class TestVanillaUnittest(TestCase): def test_sample(self): self.assertEqual(1, 1) class TestDjangoTestCase(DjangoTestCase): def test_sample(self): ...
lihui7115/ChromiumGStreamerBackend
refs/heads/master
tools/json_comment_eater/json_comment_eater.py
42
#!/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. '''Utility to remove comments from JSON files so that they can be parsed by json.loads. ''' import sys def _Rcount(string, chars...
mkheirkhah/ns-3.23
refs/heads/development
src/visualizer/visualizer/hud.py
189
import goocanvas import core import math import pango import gtk class Axes(object): def __init__(self, viz): self.viz = viz self.color = 0x8080C0FF self.hlines = goocanvas.Path(parent=viz.canvas.get_root_item(), stroke_color_rgba=self.color) self.hlines.lower(None) self.vl...
mrquim/repository.mrquim
refs/heads/master
repo/plugin.video.castaway/resources/lib/resolvers/livestreamer.py
4
from resources.lib.modules import control,client from resources.lib.modules.log_utils import log import xbmc,os,re,urllib,base64 def resolve(url): initial = url libPath = os.path.join(control.addonPath, 'resources/lib/modules') serverPath = os.path.join(libPath, 'livestreamerXBMCLocalProxy.py') try: import reque...
takeshineshiro/django-cms
refs/heads/develop
cms/utils/i18n.py
55
# -*- coding: utf-8 -*- from contextlib import contextmanager from django.core.urlresolvers import get_resolver, LocaleRegexURLResolver from django.conf import settings from django.utils import translation from django.utils.translation import ugettext_lazy as _ from cms.exceptions import LanguageError from cms.utils....
byt3bl33d3r/sslstrip2
refs/heads/master
sslstrip/CookieCleaner.py
107
# Copyright (c) 2004-2011 Moxie Marlinspike # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distri...
woobe/h2o
refs/heads/master
py/testdir_rpy2/test_GLM_both.py
2
import unittest, time, sys sys.path.extend(['.','..','py']) import copy print "Needs numpy, rpy2, and R installed. Run on 192.168.171-175" # FIX! maybe should update to build_cloud_with_hosts to run on 171-175? import h2o, h2o_cmd, h2o_glm, h2o_util, h2o_import as h2i import numpy as np from rpy2 import robjects as r...