repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
dbaxa/django
refs/heads/master
tests/select_for_update/tests.py
123
from __future__ import unicode_literals import threading import time from multiple_database.routers import TestRouter from django.db import DatabaseError, connection, router, transaction from django.test import ( TransactionTestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature, ) from .models im...
withorwithoutgod/tacozmq
refs/heads/master
cherrypy/test/test_encoding.py
12
import gzip import sys import cherrypy from cherrypy._cpcompat import BytesIO, IncompleteRead, ntob, ntou europoundUnicode = ntou('\x80\xa3') sing = ntou("\u6bdb\u6cfd\u4e1c: Sing, Little Birdie?", 'escape') sing8 = sing.encode('utf-8') sing16 = sing.encode('utf-16') from cherrypy.test import helper class Encodi...
marctc/wagtail
refs/heads/master
wagtail/wagtailsites/urls.py
10
from django.conf.urls import url from wagtail.wagtailsites import views urlpatterns = [ url(r'^$', views.index, name='wagtailsites_index'), url(r'^new/$', views.create, name='wagtailsites_create'), url(r'^(\d+)/$', views.edit, name='wagtailsites_edit'), url(r'^(\d+)/delete/$', views.delete, name='wagt...
AlphaSmartDog/DeepLearningNotes
refs/heads/master
Note-6 A3CNet/Note-6.4 HS300指数增强/sonnet/python/modules/rnn_core_test.py
9
# Copyright 2017 The Sonnet 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 applicable l...
daoluan/decode-Django
refs/heads/master
Django-1.5.1/django/utils/translation/__init__.py
110
""" Internationalization support. """ from __future__ import unicode_literals from django.utils.encoding import force_text from django.utils.functional import lazy from django.utils import six __all__ = [ 'activate', 'deactivate', 'override', 'deactivate_all', 'get_language', 'get_language_from_request', ...
rubencabrera/odoo
refs/heads/8.0
addons/l10n_be_hr_payroll_account/__init__.py
430
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
maxwell-demon/grpc
refs/heads/master
src/python/grpcio/grpc/_adapter/_types.py
4
# Copyright 2015, 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...
wzbozon/statsmodels
refs/heads/master
statsmodels/graphics/plottools.py
42
import numpy as np def rainbow(n): """ Returns a list of colors sampled at equal intervals over the spectrum. Parameters ---------- n : int The number of colors to return Returns ------- R : (n,3) array An of rows of RGB color values Notes ----- Converts f...
GenericStudent/home-assistant
refs/heads/dev
homeassistant/components/upcloud/const.py
14
"""UpCloud constants.""" from datetime import timedelta DOMAIN = "upcloud" DEFAULT_SCAN_INTERVAL = timedelta(seconds=60) CONFIG_ENTRY_UPDATE_SIGNAL_TEMPLATE = f"{DOMAIN}_config_entry_update:" "{}"
gsmartway/odoo
refs/heads/8.0
addons/web_tests_demo/__openerp__.py
384
{ 'name': "Demonstration of web/javascript tests", 'category': 'Hidden', 'description': """ OpenERP Web demo of a test suite ================================ Test suite example, same code as that used in the testing documentation. """, 'depends': ['web'], 'data' : [ 'views/web_tests_dem...
dilawar/moogli
refs/heads/geometry
main.py
2
import _moogli """ class Visualizer(MorphologyViewer): def __init__(parent = None, callback = None): self.callback = callback self.morphology = moogli.Morphology("morph", 1) desktop = QtGui.QApplication.desktop() self.visualizer = MorphologyEditor( self.morphology ...
plotly/plotly.py
refs/heads/master
packages/python/plotly/plotly/validators/icicle/marker/_colorscale.py
1
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__(self, plotly_name="colorscale", parent_name="icicle.marker", **kwargs): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
ccpgames/eve-metrics
refs/heads/master
web2py/applications/welcome/languages/fr-ca.py
1
# coding: utf8 { '!langcode!': 'fr-ca', '!langname!': 'Français (Canadien)', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les r...
jhauberg/cards.py
refs/heads/master
test/test_markdown.py
1
# coding=utf-8 import unittest from cards.markdown import markdown class MarkdownTest(unittest.TestCase): def test_markdown(self): # strong self.assertEqual(markdown('**strong**'), '<strong>strong</strong>') self.assertEqual(markdown('**strong word**'), '<strong>strong word</strong>') ...
bansallab/asnr
refs/heads/master
Python_files/community.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module implements community detection. """ __all__ = ["partition_at_level", "modularity", "best_partition", "generate_dendogram", "induced_graph"] __author__ = """Thomas Aynaud (thomas.aynaud@lip6.fr)""" # Copyright (C) 2009 by # Thomas Aynaud <thomas.aynaud@lip6...
DocuSignDev/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/pylib/gyp/SCons.py
137
#!/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. """ SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types ...
Martiusweb/asyncio
refs/heads/master
asyncio/events.py
2
"""Event loop and event loop policy.""" __all__ = ['AbstractEventLoopPolicy', 'AbstractEventLoop', 'AbstractServer', 'Handle', 'TimerHandle', 'get_event_loop_policy', 'set_event_loop_policy', 'get_event_loop', 'set_event_loop', 'new_event_loop', 'get_child_watcher...
kashif/chainer
refs/heads/master
chainer/functions/normalization/local_response_normalization.py
9
import numpy import six from chainer import cuda from chainer import function from chainer.utils import type_check def _cu_conv_sum(y, x, n): # Convolutional sum # TODO(beam2d): Use scan computation rdim = x.size // (x.shape[0] * x.shape[1]) cuda.elementwise( 'raw T x, int32 rdim, int32 N, in...
GarrettArm/TheDjangoBook
refs/heads/master
mysite_project/site_core/views.py
1
import datetime from django.views.generic import TemplateView from django.contrib.auth.views import LoginView, LogoutView from django.views import generic from django.urls import reverse_lazy from .forms import CustomUserCreationForm class FrontView(TemplateView): template_name = "site_core/frontpage.html" ...
USGSDenverPychron/pychron
refs/heads/develop
pychron/dashboard/__init__.py
186
__author__ = 'ross'
geekosphere/zgeist
refs/heads/master
zg/task/helpers.py
1
""" Helpers used for celery tasks. """ from __future__ import division, print_function, absolute_import, unicode_literals from zg.util import config, to_bytes, format_bytes, mktemp from urlparse import urlparse from zg.app import celery from mock import Mock import re import os import os.path import logging logger = ...
darkleons/BE
refs/heads/master
addons/base_report_designer/wizard/base_report_designer_modify.py
314
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
androidbftab1/bf-kernel
refs/heads/master
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...
glorizen/nupic
refs/heads/master
nupic/frameworks/opf/previousvaluemodel.py
39
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gsnbng/erpnext
refs/heads/develop
erpnext/accounts/doctype/cash_flow_mapping/test_cash_flow_mapping.py
19
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestCashFlowMapping(unittest.TestCase): def setUp(self): if frappe.db.exists("Cash Flow Mapping", "Test Mapping"): frappe.de...
liyy7/scrapy
refs/heads/master
scrapy/utils/ossignal.py
204
from __future__ import absolute_import from twisted.internet import reactor import signal signal_names = {} for signame in dir(signal): if signame.startswith("SIG"): signum = getattr(signal, signame) if isinstance(signum, int): signal_names[signum] = signame def install_shutdown_han...
peterbraden/tensorflow
refs/heads/master
tensorflow/python/tools/freeze_graph_test.py
14
# 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 a...
eepalms/gem5-newcache
refs/heads/master
src/arch/sparc/SparcInterrupts.py
69
# Copyright (c) 2008 The Regents of The University of Michigan # 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 ...
mcdonc/buildit
refs/heads/master
__init__.py
35
# this is a package
angrylogic/posixqueue
refs/heads/master
setup.py
1
#!/usr/bin/python from distutils.core import setup setup(name="posixqueue", version="1.0", description="Python wrapper for POSIX message queue interface", author="Greg Harris", author_email="gharris@angrylogic.net", packages=["posixqueue"])
ddboline/pylearn2
refs/heads/master
pylearn2/testing/skip.py
49
""" Helper functions for determining which tests to skip. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from nose.plugins.skip import SkipT...
xiaq/jadepy
refs/heads/master
jade/runtime.py
1
def _jade_class(classes): if isinstance(classes, list): return u' '.join(classes) return classes
micronicstraining/python
refs/heads/master
module_2/overview.py
1
#! /usr/bin/env python3 # nonetype none_object = None # bools bool_object_true = True bool_object_false = False # if False: # print('This is a basic if branch') # elif True: # print('This is a basic else if branch') # else: # print('this is a basic else branch') bool_not_example = not True print(bool_no...
tommo/gii
refs/heads/master
support/waf/waflib/extras/package.py
2
#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011 """ Obtain packages, unpack them in a location, and add associated uselib variables (CFLAGS_pkgname, LIBPATH_pkgname, etc). The default is use a Dependencies.txt file in the source directory. This is a work in progress. Usage: def options(opt): opt.load...
kevalds51/sympy
refs/heads/master
sympy/unify/tests/test_rewrite.py
59
from sympy.unify.rewrite import rewriterule from sympy import sin, Basic, Symbol, S from sympy.abc import x, y from sympy.strategies.rl import rebuild from sympy.assumptions import Q p, q = Symbol('p'), Symbol('q') def test_simple(): rl = rewriterule(Basic(p, 1), Basic(p, 2), variables=(p,)) assert list(rl(Ba...
bradparks/csvkit__query_join_filter_CSV_cli
refs/heads/master
csvkit/headers.py
21
#!/usr/bin/env python def make_default_headers(n): """ Make a set of simple, default headers for files that are missing them. """ return ['column%i' % (i + 1) for i in range(n)]
alexmorozov/django
refs/heads/master
django/conf/urls/static.py
336
import re from django.conf import settings from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from django.views.static import serve def static(prefix, view=serve, **kwargs): """ Helper function to return a URL pattern for serving files in debug mode. from django.con...
sckott/pyobis
refs/heads/master
pyobis/obisissues.py
1
import re def occ_issues_lookup(issue=None, code=None): ''' Lookup occurrence issue definitions and short codes :param issue: Full name of issue, e.g, CONTINENT_COUNTRY_MISMATCH :param code: an issue short code, e.g. ccm Usage pygbif.occ_issues_lookup(issue = 'CONTINENT_COUNTRY_MISMATCH') ...
yantrabuddhi/blocos
refs/heads/master
tabs/ConsoleTab.py
1
# -*- coding: utf-8 -*- # Este arquivo é parte do programa Monitor # Monitor é um software livre; você pode redistribui-lo e/ou # modifica-lo dentro dos termos da Licença Pública Geral GNU como # publicada pela Fundação do Software Livre (FSF); na versão 3 da # Licença, ou (na sua opinião) qualquer versão. #...
llvm-mirror/lldb
refs/heads/master
packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
5
""" Tests that TSan and LLDB have correct thread numbers. """ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil import json class TsanThreadNumbersTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailure...
furrtek/portapack-havoc
refs/heads/master
firmware/tools/extract_cpld_data.py
2
#!/usr/bin/env python # # Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. # # This file is part of PortaPack. # # 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, o...
PetePriority/home-assistant
refs/heads/dev
homeassistant/components/homeworks/__init__.py
2
"""Component for interfacing to Lutron Homeworks Series 4 and 8 systems. For more details about this component, please refer to the documentation at https://home-assistant.io/components/homeworks/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ( ...
jonroberts/nasaMining
refs/heads/master
states_data.py
1
from __future__ import unicode_literals import requests import json states = [ 'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'M...
nino-c/plerp.org
refs/heads/master
src/mainsite/wsgi.py
1
""" WSGI config for mainsite project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", " mainsite.settings.production") from...
imrandomizer/Algorithm-Implementations
refs/heads/master
Bloom_Filter/Python/argvk/BloomFilter.py
20
""" Bloomfilters are a memory efficient way of checking if an element is part of a set or not here is a pretty decent tutorial http://billmill.org/bloomfilter-tutorial/ """ from bitarray import bitarray import mmh3 class BloomFilter: def __init__(self): self.HASH_SIZE = 1000 self.bits = bitarra...
tellesnobrega/sahara
refs/heads/master
sahara/service/coordinator.py
2
# Copyright (c) 2015 Mirantis 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 agreed to in writ...
Darknet-Crypto/Darknet
refs/heads/master
test/functional/wallet_hd.py
1
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" import os import shutil from test_framework.test_...
Jannes123/inasafe
refs/heads/develop
safe/impact_functions/generic/classified_polygon_population/parameter_definitions.py
6
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Parameter definition for Volcano Polygon on Population Impact Function. Contact : ole.moller.nielsen@gmail.com .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
fingeronthebutton/robotframework
refs/heads/master
atest/testdata/test_libraries/MyLibDir/SubPackage/ClassLib.py
37
class ClassLib(object): def keyword_in_mylibdir_subpackage_classlib(self): pass
NBor/SkyPython
refs/heads/master
src/touch/MapMover.py
1
''' // Copyright 2010 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 or agre...
CARocha/ciat_plataforma
refs/heads/master
analisis/analisis/utils.py
3
# -*- coding: UTF-8 -*- from django.shortcuts import render_to_response from django.template.context import RequestContext from django.http import HttpResponse import json as simplejson import os import re p = re.compile(r'[^0-9a-zA-Z\._]+') #metodo para reemplazar los caracteres especiales en una cadena def repl(ma...
ovresko/erpnext
refs/heads/master
erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py
12
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("assets", "doctype", "Location") for dt in ("Account", "Cost Center", "File", "Employee", "Location", ...
Hearen/OnceServer
refs/heads/master
pool_management/bn-xend-core/util/xsm/__init__.py
45382
JamesTFarrington/flask
refs/heads/master
scripts/test_import_migration.py
141
# Tester for the flaskext_migrate.py module located in flask/scripts/ # # Author: Keyan Pishdadian import pytest from redbaron import RedBaron import flaskext_migrate as migrate def test_simple_from_import(): red = RedBaron("from flask.ext import foo") output = migrate.fix_tester(red) assert output == "im...
xpac1985/ansible
refs/heads/devel
test/units/errors/__init__.py
267
# (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...
chanceraine/nupic
refs/heads/master
examples/opf/experiments/anomaly/spatial/10field_many_balanced/description.py
96
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
yeewang/pjsip-2.4
refs/heads/master
pjsip-apps/src/pygui/endpoint.py
28
# $Id: endpoint.py 4704 2014-01-16 05:30:46Z ming $ # # pjsua Python GUI Demo # # Copyright (C)2013 Teluu Inc. (http://www.teluu.com) # # 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 ver...
rshk/pygpgme
refs/heads/master
tests/test_genkey.py
2
# pygpgme - a Python wrapper for the gpgme library # Copyright (C) 2006 James Henstridge # # This library 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 2.1 of the License, or (at you...
imsparsh/python-for-android
refs/heads/master
python3-alpha/python3-src/Tools/msi/sequence.py
291
AdminExecuteSequence = [ (u'InstallInitialize', None, 1500), (u'InstallFinalize', None, 6600), (u'InstallFiles', None, 4000), (u'InstallAdminPackage', None, 3900), (u'FileCost', None, 900), (u'CostInitialize', None, 800), (u'CostFinalize', None, 1000), (u'InstallValidate', None, 1400), ] AdminUISequence = [ (u'FileCos...
JackKelly/neuralnilm_prototype
refs/heads/master
scripts/disag_545d.py
2
from __future__ import print_function, division #import matplotlib import logging from sys import stdout # matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt from neuralnilm import (Net, RealApplianceSource) from neuralnilm.source import (standardise, discretize...
chaen/Phronesis
refs/heads/master
src/analyzerCompiler/profile.py
1
#!/usr/bin/python import sys import pstats import os if len(sys.argv) > 1: arg = sys.argv[1] else: arg = "" os.system("python -m cProfile -o profile.stat phronesisCompiler.py %s"%arg) p = pstats.Stats('profile.stat') p.strip_dirs().sort_stats(-1).print_stats()
shybovycha/buck
refs/heads/master
third-party/py/unittest2/unittest2/__init__.py
155
""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 P...
PriviPK/privipk-sync-engine
refs/heads/privipk
kls/dht_node.py
1
from twisted.internet import reactor import twisted.internet.threads from entangled.node import EntangledNode from entangled.kademlia.datastore import DictDataStore #from entangled.kademlia.datastore import SQLiteDataStore import sys import hashlib import threading class DhtNode: # entry_nodes: array of tuples ...
zanderle/django
refs/heads/master
django/db/backends/base/schema.py
339
import hashlib import logging from django.db.backends.utils import truncate_name from django.db.transaction import atomic from django.utils import six from django.utils.encoding import force_bytes logger = logging.getLogger('django.db.backends.schema') def _related_non_m2m_objects(old_field, new_field): # Filte...
createwindow/pjsip-blf
refs/heads/master
tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py
59
# $Id: 200_codec_l16_16000_stereo.py 2075 2008-06-27 16:18:13Z nanang $ # from inc_cfg import * ADD_PARAM = "" if (HAS_SND_DEV == 0): ADD_PARAM += "--null-audio" # Call with L16/16000/2 codec test_param = TestParam( "PESQ defaults pjsua settings", [ InstanceParam("UA1", ADD_PARAM + " --stereo --max-calls=1 -...
illume/numpy3k
refs/heads/master
numpy/distutils/mingw32ccompiler.py
4
""" Support code for building Python extensions on Windows. # NT stuff # 1. Make sure libpython<version>.a exists for gcc. If not, build it. # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) # 3. Force windows to use g77 """ import os import subprocess import sys import log ...
ning-yang/compute-image-windows
refs/heads/master
examples/windows_auth_python_sample.py
4
#!/usr/bin/env python # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
psi4/psi4
refs/heads/master
tests/pytests/test_zeta.py
7
import pytest from .utils import * import psi4 import numpy as np pytestmark = pytest.mark.skip ref = { "conv": { "ene": { "d": -100.01941126909895, "t": -100.05801143109962, "q": -100.06768524807164, "5": -100.0704303543983, "6": -100.07073832...
SofiaReis/django-cms
refs/heads/develop
cms/test_utils/project/second_cms_urls_for_apphook_tests.py
54
from cms.utils.compat.dj import is_installed from django.conf.urls import include, url from cms.apphook_pool import apphook_pool from cms.views import details from django.conf import settings if settings.APPEND_SLASH: reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)/$', details, name='pages-details-by-slug') else: reg...
DavidPurcell/murano_temp
refs/heads/master
murano/db/migration/alembic_migrations/versions/015_adding_text_description.py
1
# Copyright 2016 OpenStack Foundation. # # 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 ...
jazzmes/ryu
refs/heads/master
ryu/tests/unit/ofproto/test_ofproto_parser.py
22
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
jas02/easybuild-easyblocks
refs/heads/master
easybuild/easyblocks/m/metis.py
10
## # Copyright 2009-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
terrycojones/dark-matter
refs/heads/master
dark/filter.py
1
import re from math import ceil from collections import OrderedDict from dark.simplify import simplifyTitle from dark.utils import parseRangeString class TitleFilter(object): """ Provide an acceptance test for sequence titles. @param whitelist: If not C{None}, a C{set} of exact titles that are always ...
agry/NGECore2
refs/heads/master
scripts/object/tangible/ship/attachment/weapon/kse_firespray_weapon1_s04.py
85615
import sys def setup(core, object): return
jcoady9/youtube-dl
refs/heads/master
youtube_dl/extractor/ruleporn.py
76
from __future__ import unicode_literals from .nuevo import NuevoBaseIE class RulePornIE(NuevoBaseIE): _VALID_URL = r'https?://(?:www\.)?ruleporn\.com/(?:[^/?#&]+/)*(?P<id>[^/?#&]+)' _TEST = { 'url': 'http://ruleporn.com/brunette-nympho-chick-takes-her-boyfriend-in-every-angle/', 'md5': '86861...
Eddy0402/Environment
refs/heads/master
vim/ycmd/cpp/ycm/tests/gmock/scripts/upload.py
2511
#!/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...
s40523125/2016fallcp_hw
refs/heads/gh-pages
plugin/render_math/__init__.py
371
from .math import *
alexhenrie/poedit
refs/heads/master
deps/boost/tools/build/test/explicit.py
7
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) import BoostBuild t = BoostBuild.Tester(use_test_config=False) t.write("jamroot.jam", """\ exe hello : hello.cpp ; exe hello...
pannkotsky/groupmate
refs/heads/master
backend/apps/forum/models.py
1
from django.db import models from model_utils.models import TimeStampedModel from users.models import EmailUser class Topic(TimeStampedModel): name = models.CharField(max_length=100) author = models.ForeignKey( EmailUser, related_name='created_topics', null=True, on_delete=mo...
haad/ansible
refs/heads/devel
lib/ansible/plugins/action/debug.py
17
# Copyright 2012, Dag Wieers <dag@wieers.com> # Copyright 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, either versi...
veger/ansible
refs/heads/devel
lib/ansible/modules/cloud/docker/docker_prune.py
7
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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_version': '1.1', 'status': ['prev...
ppries/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/ops/distribution.py
1
# 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...
lightbulb-framework/lightbulb-framework
refs/heads/master
lightbulb/data/regex/PHPIDS040/52.py
544
META = { 'author': 'George Argyros, Ioannis Stais', 'description': 'Automatic transformed ruleset', 'type':'Regex', 'comments': [] }
ahb0327/intellij-community
refs/heads/master
python/lib/Lib/encodings/cp855.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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_map) def decode(self,input,errors='strict'): ...
jigarkb/Twitter-Sentiment-Analysis
refs/heads/master
twitterstream.py
1
import oauth2 as oauth import urllib2 as urllib access_token_key = "105782391-kfbeApbulMptbrV9w6Bfh5MHrAiUUqqmd1xmD2az" access_token_secret = "fuIwYDPiqTFvfI4jPJVbCWxZBZaL0ESiq4IMD30c1o" consumer_key = "1ANfOmOIRa4iaJideGYAg" consumer_secret = "MmrodYL5xcpjFrFcG8Y4CAR5PTYbRXkKWuQgA1bU" _debug = 0 oauth_token = o...
jazztpt/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/social_facebook/courses/models.py
1644
""" A models.py is required to make this an app (until we move to Django 1.7) """
gdimitris/ChessPuzzlerBackend
refs/heads/master
Virtual_Environment/lib/python2.7/site-packages/setuptools/command/saveopts.py
1052
from setuptools.command.setopt import edit_config, option_base class saveopts(option_base): """Save command-line options to a file""" description = "save supplied options to setup.cfg or other config file" def run(self): dist = self.distribution settings = {} for cmd in dist.com...
ValkyrieSystems/six-library
refs/heads/master
externals/coda-oss/modules/python/math.poly/tests/test_math_poly.py
4
#!/usr/bin/env python """ * ========================================================================= * This file is part of math.poly-c++ * ========================================================================= * * (C) Copyright 2004 - 2014, MDA Information Systems LLC * * math.linear-c++ is free software...
lochiiconnectivity/libcloud
refs/heads/trunk
libcloud/compute/deployment.py
25
# 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 use ...
CentroGeo/geonode
refs/heads/master
geonode/geoserver/__init__.py
4
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
shakamunyi/tensorflow
refs/heads/master
tensorflow/python/training/summary_io.py
165
# 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...
mdilai/jweegad
refs/heads/master
external/gtest/test/gtest_break_on_failure_unittest.py
2140
#!/usr/bin/env python # # Copyright 2006, 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...
seagullbird/BLEXT
refs/heads/master
tests/test_basics.py
1
# -*- coding: utf-8 -*- import unittest from flask import current_app from app import create_app, db # 使用 unittest 编写的测试 # setUp() 和 tearDown() 分别在各测试前后运行 # 名字以 test_开头的函数都作为测试执行 # setUp()方法尝试创建一个测试环境,类似于运行中的程序。 # 首先,使用测试配置创建程序,然后激活上下文。 # 这一步的作用是确保能在测试中使用current_app,像普通请求一样。 # 然后创建一个全新的数据库,以备不时之需。 # 数据库和程序上下文在tearDown...
kostyll/micropython
refs/heads/master
tests/bytecode/mp-tests/string2.py
22
'abc' class f: u"123" pass x = 'abc' x = u"abc" x = u"ab\\c" x = r"ab\\c" x = b"abc" x = rb"abc" x = b"ab\\c" x = rb"ab\\c" x = """abc""" x = b"""abc"""
maisim/django-localflavor
refs/heads/master
localflavor/cl/forms.py
4
""" Chile specific form helpers. """ from __future__ import unicode_literals from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ ...
qeedquan/misc_utilities
refs/heads/master
snippets/python/sympy/calculus.py
1
from sympy import * x, y = symbols('x y') print(Derivative(x*x, x).doit()) print(Derivative(sin(x), x).doit()) print(Derivative(exp(x), x).doit()) print(Derivative(x*x - exp(x) + sin(x)*cos(x)/exp(2*x*x*x), x).doit()) print(Integral(x*3, x).doit()) print(Integral(exp(x), x).doit()) print(Integral(sin(x), x).doit()) p...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/zope.interface-4.1.2/src/zope/interface/tests/odd.py
79
############################################################################## # # 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...
pkbullock/RaspberryPi
refs/heads/master
Projects/cam-pir/ncampir-v2.py
2
import RPi.GPIO as GPIO import picamera import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) #GPIO.setup(18, GPIO.OUT) camera = picamera.PiCamera() camera.resolution = (1024, 768) try: while True: #GPIO.output(18, True) input_state = GPIO.input(17) if input_state == True: print('Motion Detected') ...
yungsters/rain-workload-toolkit
refs/heads/master
utils/fixedurl.py
10
import sys import subprocess import time import re import os import simplejson as json import getopt from run_manager import RunManager, RainOutputParser '''Example config { "profilesCreatorClass": "radlab.rain.workload.httptest.FixedUrlProfileCreator", "profilesCreatorClassParams": { "hostListFile" :...
p4datasystems/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/encodings/iso2022_jp_3.py
816
# # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_3') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...