repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Tong-Chen/scikit-learn | refs/heads/master | sklearn/cluster/k_means_.py | 1 | """K-means clustering"""
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Thomas Rueckstiess <ruecksti@in.tum.de>
# James Bergstra <james.bergstra@umontreal.ca>
# Jan Schlueter <scikit-learn@jan-schlueter.de>
# Nelle Varoquaux
# Peter Prettenhofer <peter.prettenh... |
CyanogenMod/android_external_chromium_org | refs/heads/cm-12.0 | third_party/tlslite/tlslite/utils/rc4.py | 149 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Abstract class for RC4."""
class RC4(object):
def __init__(self, keyBytes, implementation):
if len(keyBytes) < 16 or len(keyBytes) > 256:
raise ValueError()
self.isBlockCipher = False
... |
akosyakov/intellij-community | refs/heads/master | python/testData/highlighting/escapedBackslash.py | 83 | str = 'a a \\' |
benjsto/ronquixote | refs/heads/master | djangoappengine/tests/test_not_return_sets.py | 28 | import datetime
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.test import TestCase
from .models import FieldsWithOptionsModel, OrderedModel, \
SelfReferenceModel
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['app-engine@scho... |
plivo/sharq | refs/heads/master | sharq/utils.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Plivo Team. See LICENSE.txt for details.
import time
import msgpack
VALID_IDENTIFIER_SET = set(list('abcdefghijklmnopqrstuvwxyz0123456789_-'))
def is_valid_identifier(identifier):
"""Checks if the given identifier is valid or not. A valid
identifier may consists o... |
jamesmishra/nlp-playground | refs/heads/master | nlp_playground/path.py | 1 | """
Find where this package is running on the system.
This module is a singleton to compute the BASE_DIR.
You can change this value if we're executing outside
the typical directory structure.
"""
import os
CUSTOM_PATH = None
def base_path():
"""
Return the base location of the project.
This is suppose... |
knneth/teacup | refs/heads/master | example_configs/config-scenario5.py | 1 | # Three tcp flows between 3 pairs of hosts with staggered start, tcp congestion
# algorithms are varied
#
# $Id: $
import sys
import datetime
from fabric.api import env
#
# Fabric config
#
# User and password
env.user = 'root'
env.password = 'rootpw'
# Set shell used to execute commands
env.shell = '/bin/sh -c'
... |
sutartmelson/girder | refs/heads/master | plugins/thumbnails/plugin_tests/__init__.py | 12133432 | |
GinnyN/towerofdimensions-django | refs/heads/master | django-allauth/build/lib/allauth/socialaccount/providers/oauth2/__init__.py | 12133432 | |
vicky2135/lucious | refs/heads/master | tests/functional/basket/__init__.py | 12133432 | |
iamutkarshtiwari/sympy | refs/heads/master | sympy/physics/tests/test_qho_1d.py | 88 | from sympy import exp, integrate, oo, Rational, pi, S, simplify, sqrt, Symbol
from sympy.core.compatibility import range
from sympy.abc import omega, m, x
from sympy.physics.qho_1d import psi_n, E_n, coherent_state
from sympy.physics.quantum.constants import hbar
nu = m * omega / hbar
def test_wavefunction():
Ps... |
Azure/azure-storage-python | refs/heads/master | azure-storage-blob/azure/storage/blob/baseblobservice.py | 1 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys... |
OnroerendErfgoed/VioeConvertor | refs/heads/master | config/__init__.py | 12133432 | |
williamn/notejam | refs/heads/master | django/notejam/users/__init__.py | 12133432 | |
MentorEmbedded/qmtest | refs/heads/master | qm/dist/__init__.py | 12133432 | |
MartinPetkov/django-security | refs/heads/master | security/migrations/__init__.py | 12133432 | |
Opentaste/bombolone | refs/heads/master | bombolone/tests/python/__init__.py | 12133432 | |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/PyAMF/doc/tutorials/examples/actionscript/bytearray/python/client.py | 8 | # Copyright (c) The PyAMF Project.
# See LICENSE for details.
"""
Python ByteArray example.
@since: 0.5
"""
import os
from optparse import OptionParser
from gateway import images_root
from pyamf.amf3 import ByteArray
from pyamf.remoting.client import RemotingService
# parse commandline options
parser = OptionPa... |
anryko/ansible | refs/heads/devel | lib/ansible/module_utils/network/junos/config/l2_interfaces/__init__.py | 12133432 | |
leonardowolf/bookfree | refs/heads/master | app/controllers/__init__.py | 12133432 | |
lliss/model-my-watershed | refs/heads/develop | src/mmw/apps/core/migrations/__init__.py | 12133432 | |
NixOS/nixops | refs/heads/master | nixops/ssh_util.py | 1 | # -*- coding: utf-8 -*-
import atexit
import os
import shlex
import subprocess
import sys
import time
import weakref
from tempfile import mkdtemp
from typing import Dict, Any, Optional, Callable, List, Union, Iterable, Tuple, cast
import nixops.util
from nixops.logger import MachineLogger
__all__ = ["SSHConnectionFai... |
TimBizeps/BachelorAP | refs/heads/master | V303_LockInVerstärker/auswertung.py | 1 | import matplotlib as mpl
mpl.use('pgf')
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from uncertainties import ufloat
import uncertainties.unumpy as unp
mpl.rcParams.update({
'font.family': 'serif',
'text.usetex': True,
'pgf.rcfonts': False,
'pgf.texsystem': 'l... |
kaarl/pyload | refs/heads/stable | module/plugins/crypter/BigfileToFolder.py | 2 | # -*- coding: utf-8 -*-
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class BigfileToFolder(SimpleCrypter):
__name__ = "BigfileToFolder"
__type__ = "crypter"
__version__ = "0.09"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:uploadable\.ch|bigfile\.to)/lis... |
sirex/atviriduomenys.lt | refs/heads/master | adlt/frontpage/api.py | 1 | from django.http import Http404
from django.contrib.auth.decorators import login_required
from django.db.models import F
from adlt.common.helpers import ajax
import adlt.core.models as core_models
@ajax.request('GET')
def agent_list(request): # pylint: disable=unused-argument
return [
{
'pk'... |
shoheietzel/proj5-maps | refs/heads/master | env/lib/python3.6/site-packages/nose/commands.py | 11 | """
nosetests setuptools command
----------------------------
The easiest way to run tests with nose is to use the `nosetests` setuptools
command::
python setup.py nosetests
This command has one *major* benefit over the standard `test` command: *all
nose plugins are supported*.
To configure the `nosetests` comman... |
tlksio/tlksio | refs/heads/develop | env/lib/python3.4/site-packages/logilab/common/logging_ext.py | 93 | # -*- coding: utf-8 -*-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... |
google-code-export/django-profile | refs/heads/master | userprofile/templatetags/avatars.py | 8 | # coding=UTF-8
from django.template import Library, Node, Template, TemplateSyntaxError, \
Variable
from django.utils.translation import ugettext as _
from userprofile.models import Avatar, AVATAR_SIZES, S3BackendNotFound, \
DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR, DEFAULT_AVATAR_FOR_INA... |
SergeySatskiy/cdm-flowparser | refs/heads/master | tests/empty_brackets.py | 3 | a = ()
b = []
c = {}
def f():
return ()
def g():
return []
def h():
return {}
|
daoluan/decode-Django | refs/heads/master | Django-1.5.1/django/contrib/gis/gdal/__init__.py | 104 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-su... |
janocat/odoo | refs/heads/8.0 | openerp/addons/test_exceptions/models.py | 336 | # -*- coding: utf-8 -*-
import openerp.exceptions
import openerp.osv.orm
import openerp.osv.osv
import openerp.tools.safe_eval
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will raise the different
exceptions that must be handled by the server (and its RPC layer)
and the... |
bnq4ever/gypgoogle | refs/heads/master | test/mac/gyptest-postbuild-multiple-configurations.py | 349 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a postbuild work in projects with multiple configurations.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
... |
noiselabs/box-linux-sync | refs/heads/master | src/noiselabs/box/main.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of box-linux-sync.
#
# Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org>
#
# box-linux-sync 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... |
aviarypl/mozilla-l10n-addons-server | refs/heads/master | src/olympia/tags/__init__.py | 12133432 | |
bhoberman/HackerRank | refs/heads/master | Algorithm/Strings/pangrams.py | 1 | s = input().strip().lower()
letters = 'abcdefghijklmnopqrstuvwxyz'
pangram = True
for letter in letters:
if letter not in s:
print('not pangram')
pangram = False
break
if pangram:
print('pangram')
|
yosukesuzuki/let-me-notify | refs/heads/master | project/kay/tests/ereporter_testapp/__init__.py | 16 | # -*- coding: utf-8 -*-
# Kay application: server_error_testapp
|
faust64/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/openbsd_pkg.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrik Lundin <patrik@sigterm.se>
#
# 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 Lic... |
ryfeus/lambda-packs | refs/heads/master | Rasterio_osgeo_shapely_PIL_pyproj_numpy/source/shapely/coords.py | 7 | """Coordinate sequence utilities
"""
import sys
from array import array
from ctypes import byref, c_double, c_uint
from shapely.geos import lgeos
from shapely.topology import Validating
if sys.version_info[0] < 3:
range = xrange
class CoordinateSequence(object):
"""
Iterative access to coordinate tuple... |
CyanogenMod/android_kernel_samsung_msm8660-q1 | refs/heads/ics | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
camny125/grit-i18n | refs/heads/master | grit/pseudo_unittest.py | 61 | #!/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.
'''Unit tests for grit.pseudo'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__... |
elky/django | refs/heads/master | django/conf/locale/eo/__init__.py | 12133432 | |
chepazzo/ansible-modules-extras | refs/heads/devel | cloud/misc/__init__.py | 12133432 | |
ujenmr/ansible | refs/heads/devel | lib/ansible/module_utils/network/dellos10/__init__.py | 12133432 | |
kustodian/ansible | refs/heads/devel | test/integration/targets/module_utils/other_mu_dir/a/b/c/d/e/__init__.py | 12133432 | |
rahul67/hue | refs/heads/master | desktop/core/ext-py/ndg_httpsclient-0.4.0/ndg/httpsclient/ssl_context_util.py | 75 | """ndg_httpsclient SSL Context utilities module containing convenience routines
for setting SSL context configuration.
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "09/12/11"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact... |
smeissner/eden | refs/heads/master | controllers/msg.py | 6 | # -*- coding: utf-8 -*-
"""
Messaging Module - Controllers
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
... |
casadi/casadi | refs/heads/master | test/python/ocp.py | 3 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... |
ropik/chromium | refs/heads/master | third_party/protobuf/python/google/protobuf/internal/type_checkers.py | 527 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
DPaaS-Raksha/horizon | refs/heads/master | horizon/test/test_dashboards/dogs/puppies/views.py | 38 | from horizon import views
class IndexView(views.APIView):
# A very simple class-based view...
template_name = 'dogs/puppies/index.html'
def get_data(self, request, context, *args, **kwargs):
# Add data to the context here...
return context
|
peterfpeterson/mantid | refs/heads/master | Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py | 1 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... |
m4734/mysql_pio | refs/heads/5.7 | boost_1_59_0/tools/build/test/scanner_causing_rebuilds.py | 38 | #!/usr/bin/python
# Copyright 2012 Jurko Gospodnetic
# 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)
# Tests for a bug causing Boost Build's scanner targets to be rebuilt.
# unnecessarily in the following scenario:
# * W... |
skatecoin/p2pool-sk8 | refs/heads/master | wstools/MIMEAttachment.py | 294 | #TODO add the license
#I had to rewrite this class because the python MIME email.mime (version 2.5)
#are buggy, they use \n instead \r\n for new line which is not compliant
#to standard!
# http://bugs.python.org/issue5525
#TODO do not load all the message in memory stream it from the disk
import re
import random
impo... |
shareefalis/ace-iphone | refs/heads/master | prepare.py | 7 | #!/usr/bin/env python
############################################################################
# prepare.py
# Copyright (C) 2015 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/... |
pedrobaeza/odoo | refs/heads/master | addons/mrp/wizard/mrp_price.py | 381 | # -*- 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... |
nojhan/weboob-devel | refs/heads/master | modules/societegenerale/pages/login.py | 6 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Jocelyn Jaubert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
kingvuplus/EGAMI-dvbapp | refs/heads/master | tools/create_picon_sats.py | 193 | #
# create symlinks for picons
# usage: create_picon_sats lamedb
# run in picon directory.
# It will read the servicenames from the lamedb and create symlinks
# for the servicereference names.
#
# by pieterg, 2008
import os, sys
f = open(sys.argv[1]).readlines()
f = f[f.index("services\n")+1:-3]
while len(f) > 2:... |
dreamhost/ceilometer | refs/heads/master | ceilometer/storage/impl_mongodb.py | 1 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright © 2013 eNovance
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in com... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/twisted/test/proto_helpers.py | 11 | # -*- test-case-name: twisted.test.test_stringtransport -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Assorted functionality which is commonly useful when writing unit tests.
"""
from __future__ import division, absolute_import
from socket import AF_INET, AF_INET6
from io import Byt... |
abdoosh00/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/textannotation_module.py | 15 | ''' Text annotation module '''
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
from xmodule.annotator_mixin import get_instructions
from xmodule.annotator_token import retrieve_toke... |
vipulroxx/sympy | refs/heads/master | sympy/printing/ccode.py | 44 | """
C code printer
The CCodePrinter converts single sympy expressions into single C expressions,
using the functions defined in math.h where possible.
A complete code generator, which uses ccode extensively, can be found in
sympy.utilities.codegen. The codegen module can be used to generate complete
source code files... |
msmolens/VTK | refs/heads/slicer-v6.3.0-2015-07-21-426987d | ThirdParty/AutobahnPython/autobahn/wamp1/protocol.py | 13 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... |
bradrf/garbagetruck | refs/heads/master | tests/test_garbagetruck.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_garbagetruck
----------------------------------
Tests for `garbagetruck` module.
"""
import pytest
from contextlib import contextmanager
from click.testing import CliRunner
from garbagetruck import garbagetruck
from garbagetruck import cli
class TestGarbaget... |
thiagomg/experiments | refs/heads/master | math/thinaso.py | 4 | def get_single_number(nums, pos):
if pos >= 0 and pos < len(nums):
return nums[pos]
return 0
def get_number(nums, pos):
pr = pos+1
pl = pos-1
while get_single_number(nums, pos) == 0:
pos = pr
pr += 1
if get_single_number(nums, pos) == 0:
pos = pl
... |
ptphp/PtServer | refs/heads/master | library/core/ptnetworkaccessmanager.py | 1 | from PySide.QtNetwork import QNetworkAccessManager
from PySide.QtNetwork import QNetworkProxy
from PySide.QtCore import SIGNAL, QUrl
import urlparse
class PtNetworkAccessManager(QNetworkAccessManager):
_url_filter = []
def __init__(self, parent):
QNetworkAccessManager.__init__(self, parent)
sel... |
liggitt/openshift-ansible | refs/heads/master | roles/lib_openshift/library/oc_serviceaccount.py | 18 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
dwagon/pymoo | refs/heads/master | moo/building/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
ClearCorp/server-tools | refs/heads/9.0 | password_security/exceptions.py | 11 | # -*- coding: utf-8 -*-
# Copyright 2015 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from openerp.exceptions import Warning as UserError
class PassError(UserError):
""" Example: When you try to create an insecure password."""
def __init__(self, msg):
self.message... |
gautam1858/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/distributions/bijector_test.py | 13 | # 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... |
bufferapp/buffer-django-nonrel | refs/heads/master | tests/regressiontests/generic_views/views.py | 49 | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views import generic
from regressiontests.generic_views.models import Artist, Author, Book, Page
from regre... |
photoninger/ansible | refs/heads/devel | test/runner/lib/cloud/azure.py | 18 | """Azure plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from lib.util import (
ApplicationError,
display,
is_shippable,
)
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.http import (
HttpClient,
urlparse,
urlunpa... |
openmb/openblackhole-enigma2 | refs/heads/master | lib/python/Components/Converter/RdsInfo.py | 163 | from enigma import iRdsDecoder, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
class RdsInfo(Converter, object):
RASS_INTERACTIVE_AVAILABLE = 0
RTP_TEXT_CHANGED = 1
RADIO_TEXT_CHANGED = 2
def __init__(self, type):
Converter.__init__(self, type)
self... |
joshdavies89/e-commerce | refs/heads/master | src/products/admin.py | 1 | from django.contrib import admin
from .models import Product
admin.site.register(Product)
|
boundarydevices/android_external_chromium_org | refs/heads/cm-12.0 | tools/telemetry/telemetry/timeline/async_slice.py | 10 | # 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 telemetry.timeline.event as event
class AsyncSlice(event.TimelineEvent):
''' A AsyncSlice represents an interval of time during which an
asynchro... |
HopeFOAM/HopeFOAM | refs/heads/master | ThirdParty-0.1/ParaView-5.0.1/Examples/Catalyst/PythonFullExample/coprocessor.py | 1 | coProcessor = None
usecp = True
def initialize():
global coProcessor, usecp
if usecp:
import paraview
import vtkParallelCorePython
import vtk
from mpi4py import MPI
import os, sys
paraview.options.batch = True
paraview.options.symmetric = True
im... |
fiji-flo/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/py/testing/code/test_excinfo.py | 55 | # -*- coding: utf-8 -*-
import py
import pytest
import sys
from test_source import astonly
from py._code.code import FormattedExcinfo, ReprExceptionInfo
queue = py.builtin._tryimport('queue', 'Queue')
failsonjython = py.test.mark.xfail("sys.platform.startswith('java')")
try:
import importlib
except ImportError:... |
mSenyor/sl4a | refs/heads/master | python/src/Lib/plat-irix5/panel.py | 132 | # Module 'panel'
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
from warnin... |
urbn/kombu | refs/heads/master | t/integration/tests/test_qpid.py | 5 | from __future__ import absolute_import, unicode_literals
from funtests import transport
from kombu.tests.case import skip
@skip.unless_module('qpid.messaging')
class test_qpid(transport.TransportCase):
transport = 'qpid'
prefix = 'qpid'
|
ninuxorg/nodeshot | refs/heads/master | nodeshot/community/notifications/admin.py | 5 | from django.contrib import admin
from nodeshot.core.base.admin import BaseAdmin
from .models import * # noqa
from .settings import settings
class NotificationAdmin(BaseAdmin):
list_display = ('to_user', 'type', 'text', 'is_read', 'added', 'updated')
list_filter = ('type', 'is_read', 'added')
raw_id_fie... |
wd5/jangr | refs/heads/master | documents/admin.py | 1 | from util import admin
from documents.models import *
class DocumentInCollectionInline(admin.TabularInline):
model = DocumentInCollection
ordering = ('order',)
class DocumentAdmin(admin.ModelAdmin):
list_display = ('title','type')
pass
class DocumentCollectionAdmin(admin.ModelAdmin):
list_display = ('title',)... |
ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu | refs/heads/master | qa/rpc-tests/wallet.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import Bitc... |
0jpq0/kbengine | refs/heads/master | kbe/src/lib/python/PCbuild/field3.py | 233 | # An absurd workaround for the lack of arithmetic in MS's resource compiler.
# After building Python, run this, then paste the output into the appropriate
# part of PC\python_nt.rc.
# Example output:
#
# * For 2.3a0,
# * PY_MICRO_VERSION = 0
# * PY_RELEASE_LEVEL = 'alpha' = 0xA
# * PY_RELEASE_SERIAL = 1
# *
# * and 0*1... |
robhudson/kuma | refs/heads/master | vendor/packages/pygments/lexers/business.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.business
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for "business-oriented" languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words, ... |
joshowen/django-allauth | refs/heads/master | allauth/socialaccount/providers/google/__init__.py | 12133432 | |
sodafree/backend | refs/heads/master | build/lib.linux-i686-2.7/django/db/backends/postgresql_psycopg2/__init__.py | 12133432 | |
initNirvana/Easyphotos | refs/heads/master | env/lib/python3.4/site-packages/flask/testsuite/test_apps/blueprintapp/__init__.py | 629 | from flask import Flask
app = Flask(__name__)
from blueprintapp.apps.admin import admin
from blueprintapp.apps.frontend import frontend
app.register_blueprint(admin)
app.register_blueprint(frontend)
|
nanolearningllc/edx-platform-cypress | refs/heads/master | common/test/acceptance/accessibility/test_studio_library_axs.py | 71 | """
Accessibility tests for Studio Library pages.
Run just this test with:
SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_studio_library_axs.py
"""
from ..tests.studio.base_studio_test import StudioLibraryTest
from ..pages.studio.library import LibraryEditPage
class StudioLibraryAxsTest(Studi... |
Danielhiversen/home-assistant | refs/heads/master | homeassistant/components/device_tracker/__init__.py | 2 | """
Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
import asyncio
from datetime import timedelta
import logging
from typing import Any, List, Sequence, Callable
import voluptuous as vo... |
ribag/ganeti-experiments | refs/heads/topic-cli-quote | test/py/ganeti.opcodes_unittest.py | 3 | #!/usr/bin/python
#
# Copyright (C) 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ... |
simonwydooghe/ansible | refs/heads/devel | test/units/plugins/connection/test_connection.py | 45 | # (c) 2015, 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 version 3 of the License, or
# (at your option) any later... |
seeminglee/pyglet64 | refs/heads/master | tools/epydoc/epydoc/log.py | 99 | # epydoc -- Logging
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: log.py 1488 2007-02-14 00:34:27Z edloper $
"""
Functions used to report messages and progress updates to the user.
These functions are delegated to zero or more registered L{Logger}... |
inclement/kivy | refs/heads/master | kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py | 30 | from kivy.tools.packaging.pyinstaller_hooks import (
add_dep_paths, excludedimports, datas, get_deps_all,
get_factory_modules, kivy_modules)
add_dep_paths()
hiddenimports = [] # get_deps_all()['hiddenimports']
hiddenimports = list(set(
get_factory_modules() + kivy_modules + hiddenimports))
|
Yen-Chung-En/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/urllib/__init__.py | 12133432 | |
xrmx/django | refs/heads/master | django/conf/locale/pt/__init__.py | 12133432 | |
brownman/selenium-webdriver | refs/heads/master | selenium/src/py/lib/docutils/parsers/rst/directives/tables.py | 5 | # Authors: David Goodger, David Priest
# Contact: goodger@python.org
# Revision: $Revision: 3900 $
# Date: $Date: 2005-09-24 17:11:20 +0200 (Sat, 24 Sep 2005) $
# Copyright: This module has been placed in the public domain.
"""
Directives for table elements.
"""
__docformat__ = 'reStructuredText'
impor... |
diegobanol/VentasPc | refs/heads/master | requests/auth.py | 25 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
import warnings
from base64 import b64encode
from .compat import urlparse, str, basestring
from .cookies import extract_cookies_... |
PredictiveScienceLab/GPy | refs/heads/master | GPy/models/__init__.py | 8 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .gp_regression import GPRegression
from .gp_classification import GPClassification
from .sparse_gp_regression import SparseGPRegression, SparseGPRegressionUncertainInput
from .sparse_gp_classification ... |
horance-liu/tensorflow | refs/heads/master | tensorflow/contrib/nccl/__init__.py | 56 | # 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... |
dkulikovsky/ceres | refs/heads/master | tests/test_ceres.py | 1 | from unittest import TestCase
from mock import ANY, Mock, call, mock_open, patch
from ceres import *
def fetch_mock_open_writes(open_mock):
handle = open_mock()
return ''.join([ c[0][0] for c in handle.write.call_args_list])
class ModuleFunctionsTest(TestCase):
@patch('ceres.isdir', new=Mock(return_value=Fals... |
endlessm/chromium-browser | refs/heads/master | third_party/catapult/third_party/gae_ts_mon/gae_ts_mon/protobuf/google/protobuf/unittest_import_pb2.py | 35 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest_import.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.proto... |
yograterol/django | refs/heads/master | tests/test_client_regress/session.py | 373 | from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
"""
A simple cookie-based session storage implementation.
The session key is actually the session data, pickled and encoded.
This means that saving the session will change the session key.
"""
def _... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.