repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
ubic135/odoo-design
refs/heads/master
addons/purchase/tests/test_purchase_to_invoice.py
10
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
aringh/odl
refs/heads/master
odl/contrib/mrc/mrc.py
1
# Copyright 2014-2017 The ODL contributors # # This file is part of ODL. # # 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 https://mozilla.org/MPL/2.0/. """Specification and reader for the MRC2014 ...
gf712/AbPyTools
refs/heads/master
tests/features_tests_composition.py
1
import unittest from abpytools import ChainCollection from abpytools.features.composition import * class SequenceCompositionTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.chain = ChainCollection.load_from_file(path='./tests/Data/chain_collection_1_light.json') cls.chain.load()...
jcoady9/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/ctypes/test/test_slicing.py
65
import unittest from ctypes import * import _ctypes_test class SlicesTestCase(unittest.TestCase): def test_getslice_cint(self): a = (c_int * 100)(*range(1100, 1200)) b = list(range(1100, 1200)) self.assertEqual(a[0:2], b[0:2]) self.assertEqual(a[0:2:], b[0:2:]) self.assertE...
Eureka22/ASM_xf
refs/heads/master
PythonD/lib/python2.4/test/test_exceptions.py
8
# Python test set -- part 5, built-in exceptions from test.test_support import TestFailed, TESTFN, unlink from types import ClassType import warnings import sys, traceback, os print '5. Built-in exceptions' # XXX This is not really enough, each *operation* should be tested! # Reloading the built-in exceptions module...
ruzhytskyi/Koans
refs/heads/master
python3/koans/about_extra_credit.py
130
#!/usr/bin/env python # -*- coding: utf-8 -*- # EXTRA CREDIT: # # Create a program that will play the Greed Game. # Rules for the game are in GREED_RULES.TXT. # # You already have a DiceSet class and score function you can use. # Write a player class and a Game class to complete the project. This # is a free form ass...
javrasya/python-indent-parser
refs/heads/master
setup.py
1
__author__ = 'ahmetdal' from setuptools import setup try: long_description = open('README.md').read() except IOError: long_description = '' setup( name='python-indent-parser', version='1.0.0', description='Python Indent Parser', author='Ahmet DAL', author_email='ceahmetdal@gmail.com', ...
akimboio/sleepy
refs/heads/master
sleepy/base.py
1
""" Sleepy A RESTful api framework built on top of Django that simplifies common RESTful idioms. Originally created at akimbo. :author: Adam Haney :contact: adam.haney@akimbo.io :license: (c) 2013 Akimbo """ __author__ = "Adam Haney" __license__ = "Copyright (c) 2013 Akimbo" HTTP_READ_ONLY_METHODS = ['GET', 'HEAD'...
anomen-s/programming-challenges
refs/heads/master
gopas.cz/python_adv/1_3_variables.py
1
print('-------- variable scope') a = 10 def func1(): print(a) # cannot switch to other variable from other scope # FAILS: a = 100 b = 100 def func2(): global a print(a) a = 100 print(a) func1() print(a) func2() print(a) print('-------- default parameters') def funkce2(a, b=10, c=[]...
paleolimbot/qosm
refs/heads/master
qosmpy/qosmlogging.py
1
''' Created on Jan 5, 2016 @author: dewey ''' import os import time FILE = os.path.join(os.path.dirname(__file__), "../qosm.log.txt") PREVIOUS_FILE = os.path.join(os.path.dirname(__file__), "../qosm.previous.log.txt") _yesdoitlogme = False def initialize_logging(): global _yesdoitlogme _yesdoitlogme = True ...
codecollision/DropboxToFlickr
refs/heads/master
django/views/decorators/vary.py
307
try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified heade...
hsorby/neon
refs/heads/develop
src/opencmiss/neon/ui/zincwidgets/fieldconditions.py
3
''' Copyright 2016 University of Auckland 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 agre...
arnehilmann/yumrepos
refs/heads/master
setup.py
6
#!/usr/bin/env python # # -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2015 PyBuilder Team # # 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 # # ...
AlexTMjugador/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/subdirectory/gyptest-subdir2-deep.py
501
#!/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. """ Verifies building a project rooted several layers under src_dir works. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('prog...
prakashmishra1598/gdeploy
refs/heads/3.0
gdeployfeatures/peer/peer.py
1
""" Add functions corresponding to each of the actions in the json file. The function should be named as follows <feature name>_<action_name> """ from gdeploylib import defaults, Global def peer_probe(section_dict): if not check_for_host_names(): return False, False Global.ignore_errors = section_dict....
cloud9UG/odoo
refs/heads/8.0
addons/warning/__init__.py
446
# -*- 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...
jadonk/debexpo
refs/heads/master
debexpo/controllers/my.py
2
# -*- coding: utf-8 -*- # # my.py — My Controller # # This file is part of debexpo - https://alioth.debian.org/projects/debexpo/ # # Copyright © 2008 Jonny Lamb <jonny@debian.org> # Copyright © 2010 Jan Dittberner <jandd@debian.org> # # Permission is hereby granted, free of charge, to any person # obtaining...
cloudera/hue
refs/heads/master
desktop/libs/kafka/src/kafka/settings.py
2
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
appleseedhq/gaffer
refs/heads/master
python/GafferSceneTest/CopyPrimitiveVariablesTest.py
1
########################################################################## # # Copyright (c) 2019, Image Engine Design 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: # # * Redistrib...
dvliman/jaikuengine
refs/heads/master
.google_appengine/google/appengine/api/dosinfo.py
7
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
nishad-jobsglobal/odoo-marriot
refs/heads/master
addons/report/tests/test_reports.py
385
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
vribeiro1/plainsboro_221
refs/heads/master
plainsboro/doctor_subscriptions/tests/test_view_doctor_profile.py
1
from django.contrib.auth.models import User from django.test import TestCase from plainsboro.doctor_subscriptions.forms import EditProfileForm from plainsboro.doctor_subscriptions.models import Doctor class DoctorSignIn(TestCase): def setUp(self): self.user = User.objects.create( username='hao...
pabloborrego93/edx-platform
refs/heads/master
common/djangoapps/student/management/commands/assigngroups.py
170
from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import UserTestGroup import random import sys import datetime from textwrap import dedent import json from pytz import UTC def group_from_value(groups, v): ''' Given group: (('a',0.3),('b',0.4),(...
luisgg/iteexe
refs/heads/master
twisted/spread/ui/gtkutil.py
21
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import gtk import string from twisted.spread import pb from twisted import copyright from twisted.python import reflect from twisted.cred.credentials import UsernamePassword normalFont = gtk.load_font("-adobe-courier-medium-r-normal-...
Gamebasis/3DGamebasisServer
refs/heads/master
GameData/blender-2.71-windows64/2.71/python/lib/email/errors.py
120
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """email package exception classes.""" class MessageError(Exception): """Base class for errors in the email package.""" class MessageParseError(MessageError): """Base class for message parsing errors...
ahmadiga/min_edx
refs/heads/master
common/djangoapps/service_status/test.py
132
"""Test for async task service status""" from django.utils import unittest from django.test.client import Client from django.core.urlresolvers import reverse import json class CeleryConfigTest(unittest.TestCase): """ Test that we can get a response from Celery """ def setUp(self): """ ...
orekyuu/intellij-community
refs/heads/master
python/lib/Lib/xml/sax/saxlib.py
130
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id: saxlib.py,v 1...
UAVenture/mavlink
refs/heads/master
pymavlink/generator/mavgen_python.py
20
#!/usr/bin/env python ''' parse a MAVLink protocol XML file and generate a python implementation Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import sys, textwrap, os from . import mavparse, mavtemplate t = mavtemplate.MAVTemplate() def generate_preamble(outf, msgs, basename, args, x...
heurezjusz/Athena
refs/heads/master
athenet/algorithm/random.py
2
import numpy def get_random_indicators(layers): return [numpy.random.rand(layer.W.size).reshape(layer.W.shape) for layer in layers]
CVL-GitHub/karaage
refs/heads/master
karaage/tests/test_people.py
2
# Copyright 2009-2010, 2013-2015 VPAC # Copyright 2010-2011, 2014 The University of Melbourne # # This file is part of Karaage. # # Karaage 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 t...
freundTech/deepl-cli
refs/heads/master
deepl/__init__.py
1
from .translator import translate __all__ = ['translate']
gilneidp/FinalProject
refs/heads/master
ALL_FILES/pox/misc/gephi_topo.py
40
# Copyright 2013 James McCauley # # 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 writi...
ChinaMassClouds/copenstack-server
refs/heads/master
openstack/src/horizon-2014.2/openstack_dashboard/dashboards/project/volumes/snapshots/urls.py
7
# 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 # d...
newerthcom/savagerebirth
refs/heads/master
libs/python-2.72/Lib/plat-mac/Carbon/CoreGraphics.py
81
# Generated from 'CGContext.h' def FOUR_CHAR_CODE(x): return x kCGLineJoinMiter = 0 kCGLineJoinRound = 1 kCGLineJoinBevel = 2 kCGLineCapButt = 0 kCGLineCapRound = 1 kCGLineCapSquare = 2 kCGPathFill = 0 kCGPathEOFill = 1 kCGPathStroke = 2 kCGPathFillStroke = 3 kCGPathEOFillStroke = 4 kCGTextFill = 0 kCGTextStroke = 1 k...
ayys/alms
refs/heads/master
settings/views.py
2
# -*- coding: utf-8 -*- from settings.models import Globals, addGlobalContext from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import render def home(request): config = Globals() context = {'config': config} if request.method == "POST": ...
CamelBackNotation/CarnotKE
refs/heads/master
jyhton/bugtests/test387.py
13
import support import test387p.test387m import sys if not 'test387p.difflib' in sys.modules: raise support.TestError, 'Cached module for sibling module import miss should exist in sys.modules' if not sys.modules['test387p.difflib'] is None: raise support.TestError, 'Cached module for sibling module import miss...
septag/termite
refs/heads/master
deps/bgfx/3rdparty/scintilla/qt/ScintillaEditPy/sepbuild.py
65
import distutils.sysconfig import getopt import glob import os import platform import shutil import subprocess import stat import sys sys.path.append(os.path.join("..", "ScintillaEdit")) import WidgetGen scintillaDirectory = "../.." scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts") sys.path.appe...
michaelgallacher/intellij-community
refs/heads/master
python/testData/quickFixes/PyRemoveParameterQuickFixTest/docstring.py
80
def foo(r<caret>): """ :param r: some parameter :type r: int :return: """ def a(): pass x = 1 x = 2
jchen7960/python_framework
refs/heads/master
pages/TestAuthenticateMerchantPage.py
1
__author__ = 'Yunxi Lin' from selenium.webdriver.support.wait import WebDriverWait from selenium.common.exceptions import NoSuchElementException #from pages.BasePage import BasePage from locators.TestAuthenticateMerchantPageLocators import TestAuthenticateMerchantPageLocators from common.CommonMethods import CommonMe...
oliverhr/odoo
refs/heads/8.0-pos-pademobile-payment
addons/stock/stock.py
3
# -*- 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...
rhertzog/django
refs/heads/master
tests/get_object_or_404/tests.py
44
from __future__ import unicode_literals from django.http import Http404 from django.shortcuts import get_list_or_404, get_object_or_404 from django.test import TestCase from .models import Article, Author class GetObjectOr404Tests(TestCase): def test_get_object_or_404(self): a1 = Author.objects.create(n...
dkubiak789/OpenUpgrade
refs/heads/8.0
addons/mail/wizard/__init__.py
438
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
CharlesMcKinnis/ecommStackStatus
refs/heads/master
stack-recon/mysql/connector/dbapi.py
35
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
proxysh/Safejumper-for-Mac
refs/heads/master
buildmac/Resources/env/lib/python2.7/site-packages/zope/interface/ro.py
33
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
simone-campagna/invoice
refs/heads/master
invoice/database/upgrade/upgrader_v2_1_x__v2_2_0.py
1
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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...
tomasreimers/tensorflow-emscripten
refs/heads/master
tensorflow/g3doc/how_tos/adding_an_op/cuda_op_test.py
56
# 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...
reinout/django
refs/heads/master
tests/utils_tests/test_module/bad_module.py
581
import a_package_name_that_does_not_exist # NOQA content = 'Bad Module'
mosaic-cloud/mosaic-distribution-dependencies
refs/heads/development
dependencies/nodejs/0.8.22/deps/npm/node_modules/node-gyp/gyp/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()
stuart-knock/bokeh
refs/heads/master
examples/charts/file/blaze_input.py
37
from os.path import dirname, join from blaze import Data from bokeh.sampledata import iris from bokeh.charts import Line, show, output_file bbvalues = Data(join(dirname(iris.__file__), 'iris.csv')) columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width'] result = bbvalues[columns] output_file("blaze_in...
ladybug-analysis-tools/butterfly
refs/heads/master
butterfly/p.py
2
# coding=utf-8 """p class.""" from foamfile import FoamFileZeroFolder, foam_file_from_file from collections import OrderedDict class P(FoamFileZeroFolder): """P (pressure) class.""" # set default valus for this class __default_values = OrderedDict() __default_values['dimensions'] = '[0 2 -2 0 0 0 0]'...
openstates/openstates
refs/heads/master
openstates/pr/bills.py
1
# -*- coding: utf-8 -*- import re import lxml.html import datetime import math import requests import pytz from pupa.scrape import Scraper, Bill, VoteEvent as Vote class NoSuchBill(Exception): pass _classifiers = ( ("Radicado", "", "introduction"), (u"Aprobado por Cámara en Votación Final", "lower", "pa...
sroze/kubernetes
refs/heads/master
cluster/saltbase/salt/_states/container_bridge.py
32
#!/usr/bin/env python # Copyright 2014 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/jinja2-2.6/jinja2/testsuite/ext.py
90
# -*- coding: utf-8 -*- """ jinja2.testsuite.ext ~~~~~~~~~~~~~~~~~~~~ Tests for the extensions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, DictLoader...
gisce/OCB
refs/heads/7.0
addons/pad_project/project_task.py
433
# -*- coding: utf-8 -*- from openerp.tools.translate import _ from openerp.osv import fields, osv class task(osv.osv): _name = "project.task" _inherit = ["project.task",'pad.common'] _columns = { 'description_pad': fields.char('Description PAD', pad_content_field='description') }
QianBIG/odoo
refs/heads/8.0
addons/website_forum/__init__.py
363
# -*- coding: utf-8 -*- import controllers import models import tests
mixturemodel-flow/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/ops/logistic.py
46
# 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...
boundarydevices/android_external_chromium_org
refs/heads/cm-12.0
chrome/common/extensions/docs/server2/github_file_system.py
94
# 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 json import logging from StringIO import StringIO import posixpath from appengine_blobstore import AppEngineBlobstore, BLOBSTORE_GITHUB from appe...
837468220/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/idlelib/configHandler.py
48
"""Provides access to stored IDLE configuration information. Refer to the comments at the beginning of config-main.def for a description of the available configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will...
fullfanta/mxnet
refs/heads/master
example/module/python_loss.py
26
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
likit/medtech-ieqa
refs/heads/master
scripts/insert_customer_data.py
1
# -*- coding: utf-8 -*- import sys import json from sqlalchemy import create_engine, MetaData, Table db = create_engine('sqlite:///'+sys.argv[1]) connect = db.connect() meta = MetaData() def add_data(table, attrs): ins = table.insert().values(**attrs) result = connect.execute(ins) return result.inserted_...
manashmndl/scikit-learn
refs/heads/master
examples/neighbors/plot_classification.py
287
""" ================================ Nearest Neighbors Classification ================================ Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each class. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColorm...
supersven/intellij-community
refs/heads/master
python/testData/completion/alias.after.py
83
import datetime as timedate timedate
SlimRoms/android_external_chromium_org
refs/heads/lp5.0
content/test/gpu/page_sets/page_set_unittest.py
51
# 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. import os from telemetry.unittest import page_set_smoke_test class PageSetUnitTest(page_set_smoke_test.PageSetSmokeTest): def testSmoke(self): page...
zozo123/buildbot
refs/heads/master
master/buildbot/test/unit/test_data_buildrequests.py
1
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
ardydedase/amadeus-python
refs/heads/master
runtests.py
2
import unittest testmodules = [ 'tests.test_amadeus' ] suite = unittest.TestSuite() for t in testmodules: try: # If the module defines a suite() function, call it to get the suite. mod = __import__(t, globals(), locals(), ['suite']) suitefn = getattr(mod, 'suite') suite.addTes...
evandrix/zxing
refs/heads/master
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/filesystem.py
34
"""SCons.Tool.filesystem Tool-specific initialization for the filesystem tools. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The...
hoh/pytest-django
refs/heads/master
tests/test_django_settings_module.py
8
"""Tests which check the various ways you can set DJANGO_SETTINGS_MODULE If these tests fail you probably forgot to run "python setup.py develop". """ import django import pytest BARE_SETTINGS = ''' # At least one database must be configured DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlit...
yanheven/nova
refs/heads/master
nova/openstack/common/report/views/xml/__init__.py
82
# Copyright 2013 Red Hat, 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 agre...
kishori82/MetaPathways_Python.3.0
refs/heads/master
libs/python_modules/parsers/interpro.py
3
"""This module defines classes for working with InterProScan output.""" import datetime import re class InterProScanParser(object): """Parses InterProScan output.""" GO_TERM_REGEXP = re.compile(r'^(.*?): (.*?) \((GO:\d{7})\)$') def __init__(self, contents): self.contents = contents def __get...
fgaudin/aemanager
refs/heads/master
core/decorators.py
1
from django.contrib.auth import REDIRECT_FIELD_NAME from django.http import HttpResponseRedirect, HttpResponseNotAllowed, \ HttpResponseForbidden from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext_lazy as _, ugettext from django.contrib.aut...
jalexvig/tensorflow
refs/heads/master
tensorflow/contrib/eager/python/examples/l2hmc/neural_nets.py
30
# Copyright 2018 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...
joelarmstrong/treeBuildingEvaluation
refs/heads/master
znfTruth/getBestScoringChains.py
1
#!/usr/bin/env python import sys f = open(sys.argv[1]) s = f.read() a = map(lambda x: x.split(), s.split("\n")) bestScoring = {} for line in a: if len(line) < 10: continue query = line[1] score = int(line[9]) if query in bestScoring: if int(bestScoring[query][9]) < score: b...
Axure/shadowsocks
refs/heads/master
tests/test.py
1016
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
wfxiang08/thrift
refs/heads/wf/20171009
lib/py/src/transport/TTransport.py
9
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
hanzz/qsimkit
refs/heads/master
3rdparty/pythonqt21-qt48/examples/PyGettingStarted/GettingStarted.py
3
from PythonQt import * # set the title of the group box, accessing the title property box.title = 'PythonQt Example' # set the html content of the QTextBrowser box.browser.html = 'Hello <b>Qt</b>!' # set the title of the button box.button1.text = 'Append Text' # set the text of the line edit box.edit.t...
Nattefrost/Biblio-shelf
refs/heads/master
main.py
2
__author__ = 'Nattefrost' import tkinter as tk import db_access from tkinter import ttk from tkinter import simpledialog from tkinter import messagebox import find_book_ISBN as isbn import add_dialog import plot import stats import math class Biblio(tk.Frame): def __init__(self, root ): t...
MichaelNedzelsky/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/languages/zh_tw.py
57
# -*- coding: utf-8 -*- # $Id: zh_tw.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two...
mosquito/TelePY
refs/heads/master
telephony/models.py
1
#-*- coding: utf-8 -*- from django.db.models import * from datetime import time, datetime from timezones import TIME_ZONES from random import randint, choice import string class Cdr(Model): DISPOSITIONS=( ('ANSWERED','Отвечен'), ('FAILED', 'Ошибка'), ('NO ANSWER','Нет ответа'), ('B...
Acehaidrey/incubator-airflow
refs/heads/master
airflow/utils/log/es_task_handler.py
7
# # 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...
kennethgillen/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_flavor_facts.py
27
#!/usr/bin/python # Copyright (c) 2015 IBM # # This module 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 software is distri...
quinot/ansible
refs/heads/devel
test/units/modules/remote_management/oneview/test_oneview_datacenter_facts.py
102
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import pytest from oneview_module_loader import OneViewModuleBase from ansible.modules.remote_management.oneview.oneview_datacenter_facts import DatacenterFa...
mrfuxi/django
refs/heads/master
tests/test_runner_deprecation_app/tests.py
377
import warnings from django.test import TestCase from django.utils.deprecation import RemovedInNextVersionWarning warnings.warn("module-level warning from deprecation_app", RemovedInNextVersionWarning) class DummyTest(TestCase): def test_warn(self): warnings.warn("warning from test", RemovedInNextVersio...
tomasreimers/tensorflow-emscripten
refs/heads/master
tensorflow/contrib/learn/python/learn/utils/gc.py
66
# 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...
chalkchisel/sorl-url
refs/heads/master
sorl_url/utils.py
2
import hashlib import json import zlib from django.core import signing from django.core.urlresolvers import reverse from django.db.models import get_model, Model from django.utils.encoding import smart_str from django.utils.functional import SimpleLazyObject, empty from django.utils.importlib import import_module from ...
intestinalbrain/noema
refs/heads/master
noema_project/noema_site/action/__init__.py
9
__author__ = 'master'
pythonvietnam/pbc082015
refs/heads/master
nguyenduyhai/bai4/timkiem_demo.py
1
ds = list() while 1: c = raw_input("Ban muon nhap thong tin hs? ") if c == 'q': # print ds break elif c == '1': print "Tao thong tin hoc sinh" hs = dict() ht = raw_input("Ho va ten: ") ns = raw_input("Ngay sinh: ") hs['hoten'] = ht hs['ngaysinh'] = ns #Them hs vao ds ds.append(hs) elif c...
CamelBackNotation/CarnotKE
refs/heads/master
jyhton/bugtests/test362.py
13
""" [ 545235 ] unexpected match with re """ import support import re rt = re.compile(r'c[^a]*t', re.IGNORECASE) if rt.match("cat") is not None: raise support.TestError('Should not match #1') rs = re.compile(r'c[^a]t', re.IGNORECASE) if rs.match('cat') is not None: raise support.TestError('Should not match #2...
rezoo/chainer
refs/heads/master
examples/sentiment/download.py
14
#!/usr/bin/env python import os import os.path from six.moves.urllib import request import zipfile request.urlretrieve( 'https://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip', 'trainDevTestTrees_PTB.zip') zf = zipfile.ZipFile('trainDevTestTrees_PTB.zip') for name in zf.namelist(): (dirname, filena...
xinwu/horizon
refs/heads/master
openstack_dashboard/dashboards/project/firewalls/tabs.py
48
# Copyright 2013, Big Switch Networks, 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 applic...
NielsZeilemaker/incubator-airflow
refs/heads/master
airflow/example_dags/example_latest_only_with_trigger.py
44
# -*- 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 ...
vadimtk/chrome4sdp
refs/heads/master
native_client_sdk/src/build_tools/tests/sdktools_test.py
76
#!/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 os import re import subprocess import sys import tarfile import tempfile import test_server import unittest import zipfile ...
tareqalayan/ansible
refs/heads/devel
test/units/modules/cloud/google/test_gcp_forwarding_rule.py
158
import unittest from ansible.modules.cloud.google.gcp_forwarding_rule import _build_global_forwarding_rule_dict class TestGCPFowardingRule(unittest.TestCase): """Unit tests for gcp_fowarding_rule module.""" params_dict = { 'forwarding_rule_name': 'foo_fowarding_rule_name', 'address': 'foo_ext...
1013553207/django
refs/heads/master
django/core/serializers/xml_serializer.py
184
""" XML serializer. """ from __future__ import unicode_literals from collections import OrderedDict from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import bas...
jerabekjak/smoderp
refs/heads/master
main_src/processes/surface.py
1
import math def shallowSurfaceKinematic(sur): a = sur.a b = sur.b h = sur.h return math.pow(h,b) * a
Kray/qmdc
refs/heads/master
src/connection.py
1
def parseDict(line): result = {} key = "" tmp = "" for c in line: if c == '=' and len(key) == 0: key = tmp tmp = "" elif c == ' ': if len(key) == 0: key = "id" result[key] = tmp key = "" ...
AmrThabet/CouchPotatoServer
refs/heads/master
couchpotato/core/media/_base/providers/torrent/passthepopcorn.py
7
import htmlentitydefs import json import re import time import traceback from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.variable import getTitle, tryInt, mergeDicts, getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.bas...
gertingold/scipy
refs/heads/master
scipy/linalg/decomp_schur.py
15
"""Schur decomposition functions.""" from __future__ import division, print_function, absolute_import import numpy from numpy import asarray_chkfinite, single, asarray, array from numpy.linalg import norm from scipy._lib.six import callable # Local imports. from .misc import LinAlgError, _datacopied from .lapack imp...
rockyzhang/zhangyanhit-python-for-android-mips
refs/heads/master
python3-alpha/python3-src/Lib/nturl2path.py
56
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # becomes # C:\foo\bar\spam.foo import string, urlli...
siosio/intellij-community
refs/heads/master
python/testData/codeInsight/smartEnter/func.py
83
def <caret>foo(*a) if a pass
drhoet/avr-remote
refs/heads/master
main.py
1
import sys if sys.version_info < (3,6): print("This script requires Python version >= 3.6") sys.exit(1) import os import json import argparse from avrremote.default_config import default_config as config from avrremote.server import Server def _load_config(config_file=None): if config_file is None: ...