repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
MoritzS/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/__init__.py
12133432
davemerwin/blue-channel
refs/heads/master
external_apps/voting/tests/__init__.py
12133432
damngamerz/coala-bears
refs/heads/master
tests/c_languages/CPPLintBearTest.py
21
from bears.c_languages.CPPLintBear import CPPLintBear from coalib.testing.LocalBearTestHelper import verify_local_bear test_file = """ int main() { return 0; } """ CPPLintBearTest = verify_local_bear(CPPLintBear, valid_files=(), invalid_files...
rahul67/hue
refs/heads/master
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/jobs/weekly/__init__.py
12133432
sedden/django-basic-apps
refs/heads/fixing_event_detail
basic/movies/__init__.py
12133432
hellsgate1001/bookit
refs/heads/master
docs/env/Lib/site-packages/django/conf/locale/en/__init__.py
12133432
Learningtribes/edx-platform
refs/heads/master
openedx/core/djangoapps/user_api/course_tag/tests/__init__.py
12133432
ytjiang/django
refs/heads/master
tests/empty/__init__.py
12133432
mitya57/django
refs/heads/master
tests/admin_registration/__init__.py
12133432
neutrons/FastGR
refs/heads/master
addie/databases/oncat/__init__.py
12133432
pferreir/indico
refs/heads/master
indico/modules/events/sessions/controllers/__init__.py
12133432
varunarya10/jenkins-job-builder
refs/heads/master
tests/scm/__init__.py
12133432
itbabu/saleor
refs/heads/master
saleor/product/templatetags/product_images.py
6
import logging import re import warnings from django import template from django.conf import settings from django.contrib.staticfiles.templatetags.staticfiles import static logger = logging.getLogger(__name__) register = template.Library() # cache available sizes at module level def get_available_sizes(): all_s...
edmundgentle/schoolscript
refs/heads/master
SchoolScript/bin/Debug/pythonlib/Lib/test/json_tests/test_pass2.py
3
from test.json_tests import PyTest, CTest # from http://json.org/JSON_checker/test/pass2.json JSON = r''' [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] ''' class TestPass2: def test_parse(self): # test in/out equivalence and parsing res = self.loads(JSON) out = self.dum...
aptana/Pydev
refs/heads/development
bundles/org.python.pydev.jython/Lib/posixfile.py
12
"""Extended file operations available in POSIX. f = posixfile.open(filename, [mode, [bufsize]]) will create a new posixfile object f = posixfile.fileopen(fileobject) will create a posixfile object from a builtin file object f.file() will return the original builtin file object f.dup() will r...
glwu/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/hashlib.py
46
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, data=b'') - returns a new hash object implementing the given hash function; initializing the hash...
shubhamchaudhary/pulla
refs/heads/develop
tests/test_pulla.py
1
#!/usr/bin/env python from __future__ import print_function import os from itertools import chain try: import unittest import unittest.mock from unittest.mock import patch from unittest.mock import call except ImportError as e: import unittest2 as unittest import mock from mock import patc...
vmamidi/trafficserver
refs/heads/master
tests/gold_tests/pluginTest/compress/compress.test.py
5
''' ''' # 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");...
page-io/Cactus
refs/heads/master
cactus/tests/test_ignore.py
14
#coding:utf-8 import os from cactus.tests import SiteTestCase class TestIgnore(SiteTestCase): def test_ignore_static(self): with open(os.path.join(self.site.static_path, "koen.psd"), "w") as f: f.write("Not really a psd") with open(os.path.join(self.site.static_path, "koen.gif"), "w")...
aliaksandrb/anydo_api
refs/heads/master
tests/test_constants.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_constants ---------------------------------- Tests for `Constants` module. Checks if all the required constants are set in one place """ import unittest import anydo_api.constants as constants class TestConstants(unittest.TestCase): def setUp(self): ...
froch/kubernetes-py
refs/heads/master
kubernetes_py/models/v1beta1/CronJob.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.models.unversioned.BaseModel import BaseModel from kubernetes_py.models.v1beta1.CronJobSpec import CronJobSpec from kuberne...
dims/test-infra
refs/heads/master
gubernator/__init__.py
12133432
adoosii/edx-platform
refs/heads/master
lms/djangoapps/dashboard/tests/__init__.py
12133432
harisibrahimkv/django
refs/heads/master
django/core/handlers/__init__.py
12133432
Gr1ph00n/staticwebanalyzer
refs/heads/master
SDK/mechanize-0.2.5/test-tools/twisted-ftpserver.py
22
import optparse import sys import twisted.cred.checkers import twisted.cred.credentials import twisted.cred.portal import twisted.internet import twisted.protocols.ftp from twisted.python import filepath, log from zope.interface import implements def make_ftp_shell(avatar_id, root_path): if avatar_id is twisted...
veegee/amqpy
refs/heads/master
amqpy/__init__.py
1
from __future__ import absolute_import, division, print_function __metaclass__ = type VERSION = (0, 13, 1) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'veegee' __maintainer__ = 'veegee' __contact__ = 'veegee@veegee.org' __homepage__ = 'http://github.com/veegee/amqpy' __docformat...
kun--hust/libcloud_with_cn
refs/heads/development
libcloud/test/loadbalancer/__init__.py
2443
# 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 ...
navcat/wechatpy
refs/heads/master
wechatpy/client/api/material.py
4
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from wechatpy._compat import json from wechatpy.client.api.base import BaseWeChatAPI class WeChatMaterial(BaseWeChatAPI): def add_articles(self, articles): """ 新增永久图文素材 详情请参考 http://mp.weixin.qq.com/w...
ennoborg/gramps
refs/heads/master
gramps/plugins/view/fanchartdescview.py
3
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch # Copyright (C) 2009 Douglas S. Blank # # 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 Foun...
BuildingLink/sentry
refs/heads/master
src/sentry/api/endpoints/project_stats.py
6
from __future__ import absolute_import from rest_framework.response import Response from sentry.app import tsdb from sentry.api.base import DocSection, StatsMixin from sentry.api.bases.project import ProjectEndpoint from sentry.utils.apidocs import scenario, attach_scenarios @scenario('RetrieveEventCountsProjcet') ...
ollie314/browserscope
refs/heads/master
bin/reflow/__init__.py
12133432
RRCKI/panda-jedi
refs/heads/master
pandajedi/jedisetup/__init__.py
12133432
DukeOfHazard/crits
refs/heads/master
crits/backdoors/backdoor.py
11
from mongoengine import Document, StringField, ListField from django.conf import settings from crits.core.crits_mongoengine import CritsBaseAttributes, CritsSourceDocument class Backdoor(CritsBaseAttributes, CritsSourceDocument, Document): """ Backdoor class. """ meta = { "collection": settin...
dkdewitt/werkzeug
refs/heads/master
examples/shorty/application.py
44
from sqlalchemy import create_engine from werkzeug.wrappers import Request from werkzeug.wsgi import ClosingIterator, SharedDataMiddleware from werkzeug.exceptions import HTTPException, NotFound from shorty.utils import STATIC_PATH, session, local, local_manager, \ metadata, url_map import shorty.models from shor...
pjdelport/django
refs/heads/master
django/contrib/messages/utils.py
1333
from django.conf import settings from django.contrib.messages import constants def get_level_tags(): """ Returns the message level tags. """ level_tags = constants.DEFAULT_TAGS.copy() level_tags.update(getattr(settings, 'MESSAGE_TAGS', {})) return level_tags
kswiat/django
refs/heads/master
tests/test_runner/__init__.py
12133432
EvaErzin/DragonHack
refs/heads/master
DragonHack/__init__.py
12133432
ahmed-mahran/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/m2m_multiple/__init__.py
12133432
arodic/three.js
refs/heads/master
utils/exporters/max/annotate/annotate.py
160
#!/usr/bin/env python __author__ = 'Andrew Dunai <andrew@dun.ai>' import sys import json import argparse import re from collections import namedtuple try: from PyQt4 import QtGui import argparseui except ImportError: CAN_GUI = False else: CAN_GUI = True range_regexp = re.compile(r'^([\w\d]+)\=([\d]+)...
YuxuanLing/trunk
refs/heads/master
trunk/code/study/python/core_python_appilication/ch11/myproject/poster/__init__.py
12133432
yamila-moreno/django
refs/heads/master
tests/gis_tests/layermap/__init__.py
12133432
kalxas/geonode
refs/heads/master
geonode/base/management/commands/load_thesaurus.py
2
# -*- 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 ...
marusak/C2ARTMC
refs/heads/master
tests/test_dirs/dll_concat/expected_program.py
1
# pointer variables are : v0=5, v1=6, x=1, y=2, yLast=4, z=3 # next pointers are : next=0, prev=1 # data values are : def get_program(): program=[ ("x=null","00000000",1,1,"NOABSTR"), ("x=null","00000001",2,2,"NOABSTR"), ("new","00000010",1,3,"NOABSTR"), ("x.next=null","00000011",1,...
aayushKumarJarvis/Algorithm-Implementations
refs/heads/master
Gnome_sort/Python/jcla1/gnome_sort.py
25
# Gnome sort runs in O(n^2), but if the array # is nearly sorted already it runs in about O(n) # http://en.wikipedia.org/wiki/Gnome_sort def gnome_sort(arr): pos = 1 while pos < len(arr): if arr[pos] >= arr[pos-1]: pos += 1 else: arr[pos], arr[pos-1] = arr[pos-1], arr[pos...
denniszollo/MAVProxy
refs/heads/master
MAVProxy/modules/mavproxy_link.py
2
#!/usr/bin/env python '''enable run-time addition and removal of master link, just like --master on the cnd line''' ''' TO USE: link add 10.11.12.13:14550 link list link remove 3 # to remove 3rd output ''' from pymavlink import mavutil import time, struct, math, sys, fnmatch, traceback from MAVP...
JackDanger/sentry
refs/heads/master
src/sentry/south_migrations/0288_set_release_project_new_groups_to_zero.py
3
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." db.commit_transaction() modified =...
sergio-incaser/odoo
refs/heads/8.0
addons/web/__init__.py
435
import sys # Mock deprecated openerp.addons.web.http module import openerp.http sys.modules['openerp.addons.web.http'] = openerp.http http = openerp.http import controllers
bhargav/scikit-learn
refs/heads/master
examples/ensemble/plot_adaboost_regression.py
311
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
alshedivat/tensorflow
refs/heads/master
tensorflow/contrib/image/python/kernel_tests/dense_image_warp_test.py
9
# 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...
devendermishrajio/nova
refs/heads/master
nova/tests/unit/keymgr/test_key.py
93
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
ojii/sandlib
refs/heads/master
lib/lib-python/2.7/_abcoll.py
218
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gabrielfalcao/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/mysql/base.py
308
from django.db.backends.mysql.base import * from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper from django.contrib.gis.db.backends.mysql.creation import MySQLCreation from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection from django.contrib.gis.db.backends.mysq...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/installation/base/shared_construction_installation_base.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Installation() result.template = "object/installation/base/shared_construction_installation_base.iff" result.attr...
idovear/odoo
refs/heads/master
openerp/addons/test_convert/__openerp__.py
437
{ 'name': 'test_convert', 'description': "Data for xml conversion tests", 'version': '0.0.1', }
mhoffma/micropython
refs/heads/master
tests/misc/print_exception.py
18
try: import uio as io except ImportError: import io import sys if hasattr(sys, 'print_exception'): print_exception = sys.print_exception else: import traceback print_exception = lambda e, f: traceback.print_exception(None, e, sys.exc_info()[2], file=f) def print_exc(e): buf = io.StringIO() ...
jonashaag/django-floppyforms
refs/heads/master
floppyforms/test_settings.py
1
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'floppyforms.sqlite', }, } INSTALLED_APPS = [ 'django.contrib.gis', 'floppyforms', 'floppyforms.tests', ] STATIC_URL = '/static/' TEST_RUNNER = 'discover_runner.DiscoverRunner' SECRET_KEY = '0'
gangadharkadam/vlinkerp
refs/heads/master
erpnext/hr/doctype/salary_manager/__init__.py
16
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Frappe Technologies Pvt Ltd # # 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 ...
flwh/KK_mt6589_iq451
refs/heads/master
prebuilts/python/linux-x86/2.7.5/lib/python2.7/json/encoder.py
105
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x...
DrDub/pilas
refs/heads/master
pilas/tutoriales.py
5
# -*- coding: utf-8 -*- import os import sys try: from PyQt4 import QtCore, QtGui from .tutoriales_base import Ui_TutorialesWindow except: print("ERROR: No se encuentra pyqt") Ui_TutorialesWindow = object pass import os import pilas class VentanaTutoriales(Ui_TutorialesWindow): def setupUi(s...
ros2/ci
refs/heads/master
ros2_batch_job/vendor/osrf_pycommon/tests/unit/test_process_utils/impl_aep_asyncio.py
2
from osrf_pycommon.process_utils import asyncio from osrf_pycommon.process_utils.async_execute_process import async_execute_process from osrf_pycommon.process_utils import get_loop from .impl_aep_protocol import create_protocol loop = get_loop() @asyncio.coroutine def run(cmd, **kwargs): transport, protocol = y...
somehume/namebench
refs/heads/master
libnamebench/data_sources.py
173
#!/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...
bangoocms/bangoo
refs/heads/master
bangoo/navigation/models.py
3
from django.db import models from hvad.models import TranslatableModel, TranslatedFields, TranslationManager from jsonfield import JSONField from .debug import WrongMenuFormatException from django.conf import settings from django.template.defaultfilters import slugify from mptt.models import MPTTModel, TreeForeignKey f...
holygits/incubator-airflow
refs/heads/master
tests/contrib/operators/test_dataflow_operator.py
23
# -*- 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 ...
jaggu303619/asylum-v2.0
refs/heads/master
openerp/addons/analytic/__openerp__.py
112
# -*- 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...
pchmieli/h2o-3
refs/heads/master
h2o-py/tests/testdir_jira/pyunit_hexdev_29_parse_false.py
1
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils ################################################################################ ## ## Verifying that Python can support importing without parsing. ## ################################################################################ de...
brev/nupic
refs/heads/master
tests/unit/nupic/regions/pyregion_test.py
25
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
Adai0808/scikit-learn
refs/heads/master
sklearn/linear_model/omp.py
127
"""Orthogonal matching pursuit algorithms """ # Author: Vlad Niculae # # License: BSD 3 clause import warnings from distutils.version import LooseVersion import numpy as np from scipy import linalg from scipy.linalg.lapack import get_lapack_funcs from .base import LinearModel, _pre_fit from ..base import RegressorM...
DiptoDas8/Biponi
refs/heads/master
lib/python2.7/site-packages/setuptools/launch.py
59
""" Launch the Python script on the command line after setuptools is bootstrapped via import. """ # Note that setuptools gets imported implicitly by the # invocation of this script using python -m setuptools.launch import tokenize import sys def run(): """ Run the script in sys.argv[1] as if it had been...
Anwesh43/numpy
refs/heads/master
numpy/core/_internal.py
23
""" A place for code to be called from core C-code. Some things are more easily handled Python. """ from __future__ import division, absolute_import, print_function import re import sys from numpy.compat import asbytes, basestring from .multiarray import dtype, array, ndarray import ctypes from .numerictypes import...
cshallue/models
refs/heads/master
research/attention_ocr/python/datasets/unittest_utils_test.py
15
# Copyright 2017 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 applicab...
richardcs/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_software_update.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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', ...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source - Copy/Lib/site-packages/urllib3/util/__init__.py
204
from __future__ import absolute_import # For backwards compatibility, provide imports that used to be here. from .connection import is_connection_dropped from .request import make_headers from .response import is_fp_closed from .ssl_ import ( SSLContext, HAS_SNI, IS_PYOPENSSL, IS_SECURETRANSPORT, as...
jwren/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/BuiltinInputPy2.py
62
class A: pass input(A()) input(b"b") input(u"u")
GheRivero/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_disk_facts.py
63
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 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 #...
brittanystoroz/kitsune
refs/heads/master
kitsune/search/tests/test_search_utils.py
8
from nose.tools import ok_ from kitsune.search.forms import SimpleSearchForm from kitsune.search.search_utils import generate_simple_search from kitsune.sumo.tests import TestCase class SimpleSearchTests(TestCase): def test_language_en_us(self): form = SimpleSearchForm({'q': 'foo'}) ok_(form.is_v...
zetaops/zengine
refs/heads/develop
zengine/views/task_manager_actions.py
1
# Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from zengine.views.base import BaseView from zengine import forms from zengine.forms import fields from zengine.models import TaskInvitation from pyoko.lib.utils import get_objec...
google/capirca
refs/heads/master
tests/lib/pcap_test.py
1
# Copyright 2016 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...
JetBrains/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/FunctionInIgnoredIdentifiers/mock/__init__.py
72
from mock.mock import *
yohanko88/gem5-DC
refs/heads/master
src/arch/x86/isa/insts/simd128/integer/save_and_restore_state/save_and_restore_state.py
31
# Copyright (c) 2013 Andreas Sandberg # 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 fol...
Horace1117/MKTCloud
refs/heads/master
openstack_dashboard/api/quantum.py
5
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Cisco Systems, Inc. # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Vers...
LinkHS/incubator-mxnet
refs/heads/master
example/reinforcement-learning/ddpg/ddpg.py
42
# 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...
zengluyang/ns3-d2d
refs/heads/master
examples/udp/examples-to-run.py
199
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
ppy/angle
refs/heads/master
src/tests/gles_conformance_tests/generate_gles_conformance_tests.py
9
import os import re import sys def ReadFileAsLines(filename): """Reads a file, removing blank lines and lines that start with #""" file = open(filename, "r") raw_lines = file.readlines() file.close() lines = [] for line in raw_lines: line = line.strip() if len(line) > 0 and not...
highb/deep-learning
refs/heads/master
face_generation/problem_unittests.py
159
from copy import deepcopy from unittest import mock import tensorflow as tf def test_safe(func): """ Isolate tests """ def func_wrapper(*args): with tf.Graph().as_default(): result = func(*args) print('Tests Passed') return result return func_wrapper def _ass...
stephane-martin/salt-debian-packaging
refs/heads/master
salt-2016.3.2/salt/runners/asam.py
2
# -*- coding: utf-8 -*- ''' Novell ASAM Runner ================== .. versionadded:: Beryllium Runner to interact with Novell ASAM Fan-Out Driver :codeauthor: Nitin Madhok <nmadhok@clemson.edu> To use this runner, set up the Novell Fan-Out Driver URL, username and password in the master configuration at ``/etc/salt/...
ddrmanxbxfr/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream.py
496
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
epall/selenium
refs/heads/master
selenium/src/py/mypydoc.py
5
import pydoc if __name__ == "__main__": pydoc.cli()
pratikmallya/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/conf/locale/id/formats.py
117
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j N Y' DATETIME_FORMAT = "j N Y, ...
erwilan/ansible
refs/heads/devel
test/units/modules/network/eos/test_eos_command.py
41
# (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...
rajul/mne-python
refs/heads/master
examples/preprocessing/plot_define_target_events.py
19
""" ============================================================ Define target events based on time lag, plot evoked response ============================================================ This script shows how to define higher order events based on time lag between reference and target events. For illustration, we will...
agimofcarmen/xen-api
refs/heads/master
scripts/examples/python/mini-xenrt.py
25
#!/usr/bin/env python # Receive multiple VMs # Issue parallel loops of: reboot, suspend/resume, migrate import xmlrpclib from threading import Thread import time, sys iso8601 = "%Y%m%dT%H:%M:%SZ" stop_on_first_failure = True stop = False class Operation: def __init__(self): raise "this is supposed to b...
sergshabal/p2pool
refs/heads/master
SOAPpy/Types.py
289
from __future__ import nested_scopes """ ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
tcwicklund/django
refs/heads/master
tests/transactions/models.py
411
""" Transactions Django handles transactions in three different ways. The default is to commit each transaction upon a write, but you can decorate a function to get commit-on-success behavior. Alternatively, you can manage the transaction manually. """ from __future__ import unicode_literals from django.db import mod...
GeoNode/geonode
refs/heads/master
geonode/tests/bdd/__init__.py
102
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2018 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 ...
happycube/ld-decode
refs/heads/master
lddecode/fft8.py
1
#! /usr/bin/python import math import matplotlib.pyplot as plt import numpy as np import scipy as sp import sys SAMPLE_RATE = 8 * 315 / 88.0 MAX_SAMPLES = int(1e6) filename = "" def load(filename): if filename.endswith(".ld"): ttype = np.uint16 max_samples = MAX_SAMPLES * 2 print("Assumi...
stanlyxiang/incubator-hawq
refs/heads/master
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/File.py
11
from pychecker2.util import parents from compiler import ast class File: def __init__(self, name): self.name = name self.parseTree = None self.scopes = {} self.root_scope = None self.warnings = [] def __cmp__(self, other): return cmp(self.name, other.name) ...
SerCeMan/intellij-community
refs/heads/master
python/lib/Lib/distutils/command/bdist_dumb.py
81
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: bdist_dumb.py 38697 2005-03-23 18:54:36Z loewis $"...
varunnaganathan/django
refs/heads/master
django/contrib/admin/helpers.py
21
from __future__ import unicode_literals import json import warnings from django import forms from django.conf import settings from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, ) from django.core.exceptions import ObjectDoesNotExi...
alephu5/Soundbyte
refs/heads/master
environment/lib/python3.3/site-packages/numpy/random/__init__.py
16
""" ======================== Random Number Generation ======================== ==================== ========================================================= Utility functions ============================================================================== random Uniformly distributed values of a given sha...
alxgu/ansible
refs/heads/devel
contrib/inventory/stacki.py
52
#!/usr/bin/env python # Copyright (c) 2016, Hugh Ma <hugh.ma@flextronics.com> # # 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 v...