repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
poryfly/scikit-learn | refs/heads/master | sklearn/externals/joblib/memory.py | 194 | """
A context object for caching a function's return value each time it
is called with the same input arguments.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import with_statement
import os
import shutil
... |
rajsadho/django | refs/heads/master | tests/postgres_tests/__init__.py | 315 | import unittest
from django.db import connection
from django.test import TestCase
@unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests")
class PostgreSQLTestCase(TestCase):
pass
|
LSSTDESC/LSSTDarkMatter | refs/heads/master | streamsim/instcat.py | 1 | #!/usr/bin/env python
"""
Convert a simulated set of stars into an instcat file for imsim.
"""
__author__ = "Alex Drlica-Wagner"
import os
import copy
from collections import OrderedDict as odict
import numpy as np
FILTER = 'g'
MAG = 'MAG_%s'%FILTER.upper()
MAGLIMS =odict([('u',23),('g',25),('r',25),('i',24.5),('z',... |
uwosh/UWOshSuccess | refs/heads/master | __init__.py | 1 | # There are three ways to inject custom code here:
#
# - To set global configuration variables, create a file AppConfig.py.
# This will be imported in config.py, which in turn is imported in
# each generated class and in this file.
# - To perform custom initialisation after types have been registered,
#... |
cdubz/babybuddy | refs/heads/master | api/permissions.py | 1 | # -*- coding: utf-8 -*-
from rest_framework.permissions import DjangoModelPermissions
class BabyBuddyDjangoModelPermissions(DjangoModelPermissions):
perms_map = {
'GET': ['%(app_label)s.view_%(model_name)s'],
'OPTIONS': ['%(app_label)s.add_%(model_name)s'],
'HEAD': [],
'POST': ['%(... |
promptworks/keystone | refs/heads/master | keystone/common/wsgi.py | 2 | # Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... |
Dricus/dwarf-fortress-launcher | refs/heads/master | src/launcher.py | 1 | from app.api import set_qt_api_version # @UnusedImport
if __name__ == '__main__':
'''
Starts the Qt application.
'''
import sys
from app.app import App
from ui.mainwindow import MainWindow
from PyQt4 import QtGui
qt_app = QtGui.QApplication(sys.argv)
app = App()
window = Mai... |
matthiasdiener/spack | refs/heads/develop | lib/spack/spack/util/compression.py | 4 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
carljm/django | refs/heads/master | tests/admin_custom_urls/urls.py | 405 | from django.conf.urls import url
from .models import site
urlpatterns = [
url(r'^admin/', site.urls),
]
|
miguelparaiso/OdooAccessible | refs/heads/master | addons/website_mail_group/controllers/main.py | 306 | # -*- coding: utf-8 -*-
import datetime
from dateutil import relativedelta
from openerp import tools, SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import slug
from openerp.addons.web.http import request
class MailGroup(http.Controller):
_thread_per_page = 20
_r... |
apporc/nova | refs/heads/master | nova/objects/pci_device.py | 2 | # Copyright 2013 Intel Corporation
# 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 require... |
ciex/motor | refs/heads/master | lib/werkzeug/contrib/atom.py | 90 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... |
JioCloud/neutron | refs/heads/master | neutron/plugins/metaplugin/meta_neutron_plugin.py | 21 | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... |
JshWright/home-assistant | refs/heads/dev | homeassistant/components/sensor/verisure.py | 2 | """
Interfaces with Verisure sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.verisure/
"""
import logging
from homeassistant.components.verisure import HUB as hub
from homeassistant.components.verisure import (
CONF_THERMOMETERS, CONF... |
th0mmeke/toyworld | refs/heads/master | runner.py | 1 | """
Created on 1/03/2013
@author: thom
"""
from experiment import Experiment
from parameters import Parameters
from rdkit.rdBase import DisableLog, EnableLog
import logging
import collections
import importlib
class Runner(object):
"""
Run a series of experiments.
"""
def __init__(self, parameter... |
Wafflespeanut/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/py/_process/killproc.py | 278 | import py
import os, sys
if sys.platform == "win32" or getattr(os, '_name', '') == 'nt':
try:
import ctypes
except ImportError:
def dokill(pid):
py.process.cmdexec("taskkill /F /PID %d" %(pid,))
else:
def dokill(pid):
PROCESS_TERMINATE = 1
handle ... |
LohithBlaze/scikit-learn | refs/heads/master | sklearn/qda.py | 140 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
from .utils.validation import ... |
earthreader/libearth | refs/heads/master | tests/session_test.py | 2 | from __future__ import print_function
import collections
import datetime
import operator
import sys
import time
from pytest import fixture, mark, raises
from libearth.codecs import Integer
from libearth.compat import binary
from libearth.schema import Attribute, Child, Content, Text, Element
from libearth.session im... |
datenbetrieb/odoo | refs/heads/8.0 | addons/website_sale_delivery/models/sale_order.py | 176 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
from openerp import SUPERUSER_ID
from openerp.addons import decimal_precision
from openerp.tools.translate import _
class delivery_carrier(orm.Model):
_inherit = 'delivery.carrier'
_columns = {
'website_published': fields.boolean('Available ... |
snazy2000/netbox | refs/heads/develop | netbox/dcim/migrations/0021_add_ff_flexstack.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-10-31 18:47
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0020_rack_desc_units'),
]
operations = [
... |
google-code-export/evennia | refs/heads/master | src/server/portal/msdp.py | 2 | """
MSDP (Mud Server Data Protocol)
This implements the MSDP protocol as per
http://tintin.sourceforge.net/msdp/. MSDP manages out-of-band
communication between the client and server, for updating health bars
etc.
"""
import re
from src.utils.utils import to_str
# MSDP-relevant telnet cmd/opt-codes
MSDP = chr(69)
... |
alvarofe/cassle | refs/heads/master | tls/tls_stream.py | 1 |
# Copyright (C) 2014 Alvaro Felipe Melchor (alvaro.felipe91@gmail.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 version 3 of the License, or
# (at your option) any later ... |
AnselCmy/ARPS | refs/heads/master | report_spider/report_spider/spiders/USTC002.py | 3 | # -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import time
import scrapy
from Global_function import get_localtime, print_new_number, save_messages
now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime()))
# now_time = 20170410
class USTC002_Spider(scrapy.Spider):
name = ... |
thehajime/ns-3-dev | refs/heads/master | src/core/bindings/modulegen__gcc_ILP32.py | 5 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
dankolbman/NumericalAnalysis | refs/heads/master | Homeworks/HW1/Problem5.py | 1 | import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
def g1(x):
#return x + 0.1*(1/(2*x**2-6))
return (1/(2*x**2-6))
def g2(x):
return 3/x+1/(2*x**2)
def g3(x):
return (3*x+1/2)**(1/3.0)
def g4(x):
return x - 1/(6... |
ynikulin/tapp | refs/heads/master | tapp/fixtures/app/settings/__init__.py | 1 | # Define global APP settings
#
# local APP settings
try:
from .local import *
except ImportError, e:
pass
|
valkjsaaa/sl4a | refs/heads/master | python/src/Lib/test/pystone.py | 189 | #! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/bsddb/__init__.py | 39 | #----------------------------------------------------------------------
# Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
# and Andrew Kuchling. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... |
KrzysiekJ/django-terminator | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup
VERSION = '0.1.1'
def read(file_name):
with open(file_name, 'r') as f:
return f.read()
setup(
name='django-terminator',
description='''One time method executor for Django models''',
long_description=read('README.rst'),
version=str(VERSI... |
zanderle/django | refs/heads/master | tests/admin_changelist/urls.py | 810 | from django.conf.urls import url
from . import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
|
Greennut/ostproject | refs/heads/master | django/contrib/localflavor/de/de_states.py | 544 | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('BW', _('Baden-Wuerttemberg')),
('BY', _('Bavaria')),
('BE', _('Berlin')),
('BB', _('Brandenburg')),
('HB', _('Bremen')),
('HH', _('Hamburg')),
('HE', _('Hessen')),
('MV', _('Mecklenburg-We... |
sergiorua/libcloud | refs/heads/trunk | docs/examples/compute/cloudsigma/list_sizes_images_drives.py | 63 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls('username', 'password', region='zrh', api_version='2.0')
sizes = driver.list_sizes()
print(sizes)
images = driver.list_images()
print(images)
drives = driver.ex_list_libra... |
zzzeek/sqlalchemy | refs/heads/master | lib/sqlalchemy/orm/collections.py | 3 | # orm/collections.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for collections of mapped entities.
The collections package supplies ... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/oldnumeric/functions.py | 88 | # Functions that should behave the same as Numeric and need changing
import numpy as np
import numpy.core.multiarray as mu
import numpy.core.numeric as nn
from typeconv import convtypecode, convtypecode2
__all__ = ['take', 'repeat', 'sum', 'product', 'sometrue', 'alltrue',
'cumsum', 'cumproduct', 'compress... |
shinate/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/__init__.py | 6014 | # Required for Python to search this directory for module files
|
saumishr/django | refs/heads/master | tests/regressiontests/string_lookup/tests.py | 34 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test import TestCase
from .models import Foo, Whiz, Bar, Article, Base, Child
class StringLookupTests(TestCase):
def test_string_form_referencing(self):
"""
Regression test for #1661 and #1662
Check that string f... |
yordan-desta/QgisIns | refs/heads/master | python/plugins/processing/algs/lidar/lastools/shp2las.py | 2 | # -*- coding: utf-8 -*-
"""
***************************************************************************
las2txt.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
*****************... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/nose-1.3.7/functional_tests/support/todo/todoplug.py | 10 | from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin
class Todo(Exception):
pass
class TodoPlugin(ErrorClassPlugin):
todo = ErrorClass(Todo, label='TODO', isfailure=True)
|
luzheqi1987/nova-annotation | refs/heads/master | nova/tests/unit/virt/xenapi/test_volumeops.py | 65 | # Copyright (c) 2012 Citrix Systems, 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 ... |
ghber/My-Django-Nonrel | refs/heads/master | django/test/utils.py | 185 | import sys
import time
import os
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
__all__ = ('Approximate', 'ContextList', 'setu... |
iwitaly/psycopg2-for-aws-lambda | refs/heads/master | psycopg2/_json.py | 15 | """Implementation of the JSON adaptation objects
This module exists to avoid a circular import problem: pyscopg2.extras depends
on psycopg2.extension, so I can't create the default JSON typecasters in
extensions importing register_json from extras.
"""
# psycopg/_json.py - Implementation of the JSON adaptation object... |
RandallDW/Aruba_plugin | refs/heads/Aruba_plugin | plugins/org.python.pydev.jython/Lib/distutils/command/install_egg_info.py | 438 | """distutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""
from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re
class install_egg_info(Command):
"""Install an .egg-info file for the package"""
... |
dtaht/ns-3-codel | refs/heads/master | src/tools/bindings/modulegen__gcc_ILP32.py | 32 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
ucsc-mus-strain-cactus/Comparative-Annotation-Toolkit | refs/heads/master | cat/consensus.py | 1 | """
Generates consensus gene set.
This module takes as input the genePreds produced by transMap, AugustusTM(R) and AugustusCGP and generates a consensus
of these, producing a filtered gene set.
This process relies on a combination of metrics and evaluations loaded to a sqlite database by the classify module.
GFF3 t... |
octoblu/alljoyn | refs/heads/master | alljoyn/services/controlpanel/cpp/tools/CPSAppGenerator/GeneratorUtils/actionWidget.py | 3 | # Copyright AllSeen Alliance. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AN... |
riadnassiffe/Simulator | refs/heads/master | src/tools/ecos/cvxpy/cvxpy/interface/numpy_interface/sparse_matrix_interface.py | 1 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... |
friendsoftheweb/woff-rb | refs/heads/master | woffTools/Lib/woffTools/__init__.py | 1 | """
This implements the WOFF specification dated September 16, 2009.
The main object is the WOFFFont. It is a subclass for the FontTools
TTFont object, so it has very similar functionality. The WOFFReader
and WOFFWriter are also available for use outside of this module.
Those objects are much faster than WOFFFont, but... |
darmaa/odoo | refs/heads/master | addons/crm_partner_assign/crm_lead.py | 44 | # -*- 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... |
googleapis/python-compute | refs/heads/master | google/cloud/compute_v1/services/node_groups/__init__.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
huijunwu/heron | refs/heads/master | heron/shell/src/python/handlers/pmaphandler.py | 5 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... |
Phuehvk/gyp | refs/heads/master | test/defines/gyptest-defines-env.py | 501 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable with C++ define specified by a gyp define.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
# Wi... |
Azulinho/ansible | refs/heads/devel | lib/ansible/modules/system/facter.py | 125 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_v... |
SydOps/awscli.sh | refs/heads/master | python.boto/spl46/highlow.py | 1 | #!/usr/bin/env python
import random, time, os, sys
import boto.ec2.cloudwatch
# Connect to CloudWatch
ec2_region = os.environ.get('EC2_REGION')
connection = boto.ec2.cloudwatch.connect_to_region(ec2_region)
# Let them guess
count = 0
while True:
# Start of game?
if count == 0:
start_time = time.time()
n... |
thumbimigwe/echorizr | refs/heads/master | lib/python2.7/site-packages/django/contrib/postgres/signals.py | 548 | from psycopg2 import ProgrammingError
from psycopg2.extras import register_hstore
from django.utils import six
def register_hstore_handler(connection, **kwargs):
if connection.vendor != 'postgresql':
return
try:
if six.PY2:
register_hstore(connection.connection, globally=True, un... |
xiaoyaozi5566/DynamicCache | refs/heads/master | src/python/m5/objects/__init__.py | 87 | # Copyright (c) 2010 The Hewlett-Packard Development Company
# 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... |
photoninger/ansible | refs/heads/devel | lib/ansible/modules/windows/win_reboot.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = r'''
---
module: win_reb... |
tiagovaz/qlive | refs/heads/master | Resources/AudioServer.py | 1 | import time
from pyo64 import *
from constants import *
from fxbox_def import *
import QLiveLib
class SoundFilePlayer:
def __init__(self, id, filename):
self.id = id
self.filename = filename
sndfolder = os.path.join(QLiveLib.getVar("projectFolder"), "sounds")
path = os.path.... |
mahabs/nitro | refs/heads/master | nssrc/com/citrix/netscaler/nitro/resource/config/cs/csvserver_spilloverpolicy_binding.py | 1 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit/scons.py | 62 | #!/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.
'''SCons integration for GRIT.
'''
# NOTE: DO NOT IMPORT ANY GRIT STUFF HERE - we import lazily so that
# grit and its dependencie... |
kalxas/geonode | refs/heads/master | geonode/documents/api/__init__.py | 42 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2020 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 ... |
hfeeki/cmdln | refs/heads/master | test/cmdln_helloworld.py | 1 | #!/usr/bin/env python
"""
$ python cmdln_helloworld.py #expecttest: INTERACTIVE, PROMPT="hi> "
hi> hi
Hi, stranger!
hi> hi Trent
Hi, Trent!
hi> ^D
$ python cmdln_helloworld.py hi Guido
Hi, Guido!
"""
import sys
import cmdln
class HelloWorld(cmdln.RawCmdln):
prompt = "hi> "
de... |
janebeckman/gpdb | refs/heads/master | gpMgmt/bin/gppylib/test/unit/test_unit_compare_segment_guc.py | 16 | from mock import *
from gp_unittest import *
from gpconfig_modules.compare_segment_guc import MultiValueGuc
from gpconfig_modules.database_segment_guc import DatabaseSegmentGuc
from gpconfig_modules.file_segment_guc import FileSegmentGuc
class CompareSegmentGucTest(GpTestCase):
def setUp(self):
row = ['co... |
imsparsh/pyo | refs/heads/master | doc-sphinx/source/api/classes/get_templates.py | 11 | from pyo import *
cats = OBJECTS_TREE['PyoObjectBase']['PyoTableObject']
cats.sort()
module = """%s
===================================
.. module:: pyo
"""
template = """*%s*
-----------------------------------
.. autoclass:: %s
:members:
"""
with open("tables.rst", "w") as f:
f.write(module % "Tables"... |
CMPUT404Proj/CMPUT404-project-socialdistribution | refs/heads/master | social_dist/api/models.py | 10644 | from django.db import models
# Create your models here.
|
hustlzp/eve | refs/heads/develop | eve/tests/io/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
neoareslinux/neutron | refs/heads/master | neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py | 11 | # Copyright (c) 2015 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 ... |
henriknelson/micropython | refs/heads/master | tools/tinytest-codegen.py | 7 | #!/usr/bin/env python3
import os, sys
from glob import glob
from re import sub
import argparse
def escape(s):
s = s.decode()
lookup = {
'\0': '\\0',
'\t': '\\t',
'\n': '\\n\"\n\"',
'\r': '\\r',
'\\': '\\\\',
'\"': '\\\"',
}
return "\"\"\n\"{}\"".format(... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.6.0/Lib/test/test_importlib/extension/test_case_sensitivity.py | 8 | from importlib import _bootstrap_external
from test import support
import unittest
from .. import util
importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
@unittest.skipIf(util.EXTENSIONS.filename is None, '_testcapi not available')
@util.case_insensitive_tests
cl... |
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/snowballstemmer/basestemmer.py | 18 | class BaseStemmer(object):
def __init__(self):
self.set_current("")
self.maxCacheSize = 10000
self._cache = {}
self._counter = 0
def set_current(self, value):
'''
Set the self.current string.
'''
self.current = value
self.cursor = 0
... |
gtaylor/ansible | refs/heads/devel | v2/ansible/plugins/lookup/redis_kv.py | 69 | # (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver... |
Accelerite/cinder | refs/heads/master | cinder/tests/api/contrib/test_quotas_classes.py | 14 | # Copyright 2013 Huawei Technologies Co., Ltd
# 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
#
# Unl... |
anadigi/paramiko | refs/heads/master | tests/test_sftp_big.py | 25 | # Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 (a... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/django-nose-1.4.5/docs/conf.py | 6 | # -*- coding: utf-8 -*-
"""django-nose build configuration file.
Created by sphinx-quickstart on Mon Jul 21 13:24:51 2014.
This file is execfile()d with the current directory set to its
containing dir.
Note that not all possible configuration values are present in this
autogenerated file.
All configuration values h... |
caronc/nzb-subliminal | refs/heads/master | Subliminal/dogpile/core/__init__.py | 60 | from .dogpile import NeedRegenerationException, Lock
from .nameregistry import NameRegistry
from .readwrite_lock import ReadWriteMutex
from .legacy import Dogpile, SyncReaderDogpile
__all__ = [
'Dogpile', 'SyncReaderDogpile', 'NeedRegenerationException',
'NameRegistry', 'ReadWriteMutex', 'Lock']
__ver... |
waldenner/robotframework | refs/heads/master | atest/testdata/test_libraries/ThreadLoggingLib.py | 38 | import threading
import logging
import time
from robot.api import logger
def log_using_robot_api_in_thread():
threading.Timer(0.1, log_using_robot_api).start()
def log_using_robot_api():
for i in range(100):
logger.info(str(i))
time.sleep(0.01)
def log_using_logging_module_in_thread():
... |
yajnab/android_kernel_htc_magnids | refs/heads/ics | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
lthurlow/scaling-computing-machine | refs/heads/master | netaddr/strategy/ipv4.py | 9 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""IPv4 address logic.... |
spring-week-topos/nova-week | refs/heads/spring-week | nova/virt/netutils.py | 16 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... |
sanyaade-teachings/gyp | refs/heads/master | test/rules-rebuild/src/make-sources.py | 337 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
assert len(sys.argv) == 4, sys.argv
(in_file, c_file, h_file) = sys.argv[1:]
def write_file(filename, contents):
open(filenam... |
ramadhane/odoo | refs/heads/8.0 | addons/hr_expense/tests/test_journal_entries.py | 251 | from openerp.tests.common import TransactionCase
from openerp import netsvc, workflow
class TestCheckJournalEntry(TransactionCase):
"""
Check journal entries when the expense product is having tax which is tax included.
"""
def setUp(self):
super(TestCheckJournalEntry, self).setUp()
... |
crichardson17/starburst_atlas | refs/heads/master | Low_resolution_sims/Dusty_LowRes/Geneva_inst_NoRot/Geneva_inst_NoRot_2/fullgrid/UV2.py | 31 | import csv
import matplotlib.pyplot as plt
from numpy import *
import scipy.interpolate
import math
from pylab import *
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib.patches as patches
from matplotlib.path import Path
import os
# --------------------------------------------------... |
klmitch/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/268_add_host_in_compute_node.py | 81 | # Copyright (c) 2014 Red Hat, 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 require... |
lehmannro/translate | refs/heads/master | storage/properties.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
atacai/server-tools | refs/heads/8.0 | __unported__/configuration_helper/__init__.py | 65 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: David BEAL
# Copyright 2014 Akretion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by ... |
micha-shepher/oervoer-wizard | refs/heads/master | oervoer-django/oervoer/src/wizard/tests.py | 3 | '''
Created on Apr 14, 2015
@author: mshepher
'''
from django.test import TestCase
from wizard.brains.oervoer.oervoer import Oervoer
class OervoerTest(TestCase):
def testLoad(self):
oer = Oervoer(None,None,None)
oer.parse_products()
assert(len(oer.prodlists)>0)
assert(len(oer.ord... |
jumpstarter-io/neutron | refs/heads/master | neutron/plugins/nec/router_drivers.py | 8 | # Copyright 2013 NEC Corporation. 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 ... |
notnola/pyalienfx | refs/heads/master | usb/_debug.py | 10 | # Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... |
mosterta/xbmc | refs/heads/master | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsoleMulticast.py | 202 | #!/usr/bin/env python
from struct import *
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_MULTICAST_ADDR = "239.255.255.100"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ... |
jhartford/DeepIV | refs/heads/master | deepiv/models.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
import deepiv.samplers as samplers
import deepiv.densities as densities
from deepiv.custom_gradients import replace_gradients_mse
from keras.models import Model
from keras import backend as K
f... |
jluissandovalm/smd_lammps | refs/heads/luis | tools/amber2lmp/dump2trj.py | 52 | #! /usr/freeware/bin/python
#
# This is dump2trj, a program written by Keir E. Novik to convert
# Lammps position dump files to Amber trajectory files.
#
# Copyright 2000, 2001 Keir E. Novik; all rights reserved.
#
# Modified by Vikas Varshney, U Akron, 5 July 2005, as described in README
#
#========================... |
liorvh/infernal-twin | refs/heads/master | build/reportlab/build/lib.linux-i686-2.7/reportlab/lib/geomutils.py | 35 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__=''' $Id$ '''
__doc__='''Utility functions for geometrical operations.'''
def normalizeTRBL(p):
'''
Useful for interpreting short descriptions of paddings, borders, margin, etc.
Expects a single value or a tuple of l... |
Alerion/fantasy_map | refs/heads/master | fantasy_map/wsgi.py | 1 | """
WSGI config for fantasy_map 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/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... |
pfhayes/boto | refs/heads/develop | tests/integration/cloudhsm/__init__.py | 586 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... |
weimingtom/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/xml/sax/xmlreader.py | 53 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... |
mrfuxi/django | refs/heads/master | tests/migrations/migrations_test_apps/alter_fk/author_app/migrations/0002_alter_id.py | 379 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('author_app', '0001_initial'),
('book_app', '0001_initial'), # Forces the book table to alter the FK
]
operations = [
... |
bowang/tensorflow | refs/heads/master | tensorflow/python/training/ftrl.py | 47 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
victormlourenco/kernel_msm | refs/heads/android-msm-mako-3.4-lollipop-mr1 | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
brianmay/python-tldap | refs/heads/master | tldap/ldap_passwd.py | 1 | # Copyright 2012-2018 Brian May
#
# This file is part of python-tldap.
#
# python-tldap 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.... |
fitermay/intellij-community | refs/heads/master | python/helpers/py3only/docutils/transforms/peps.py | 44 | # $Id: peps.py 6433 2010-09-28 08:21:25Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms for PEP processing.
- `Headers`: Used to transform a PEP's initial RFC-2822 header. It remains a
field list, but some entries get processed.
- ... |
ericsnowcurrently/micropython | refs/heads/master | tests/import/pkg3/subpkg1/__init__.py | 118 | print("subpkg1 __name__:", __name__)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.