repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
capitalk/treelearn | refs/heads/master | distribute_setup.py | 46 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... |
lucidfrontier45/scikit-learn | refs/heads/master | sklearn/datasets/tests/test_lfw.py | 2 | """This test for the LFW require medium-size data dowloading and processing
If the data has not been already downloaded by runnning the examples,
the tests won't run (skipped).
If the test are run, the first execution will be long (typically a bit
more than a couple of minutes) but as the dataset loader is leveraging... |
MicroPyramid/django-simple-pagination | refs/heads/master | sandbox/sample/tests.py | 873 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here.
|
seba-1511/randopt | refs/heads/master | bin/roviz.py | 1 | #!/usr/bin/env python3
import webbrowser
import os
import sys
import json
if __name__ == '__main__':
roviz_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
if len(sys.argv) < 2 or len(sys.argv) > 2:
print('The new usage of roviz is: roviz.py path/to/experiment')
sys.exit(-1... |
asajeffrey/servo | refs/heads/master | python/servo/gstreamer.py | 3 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... |
se4u/pylearn2 | refs/heads/master | pylearn2/utils/track_version.py | 33 | #!/usr/bin/env python
"""
Script to obtain version of Python modules and basic information on the
experiment setup (e.g. cpu, os), e.g.
* numpy: 1.6.1 | pylearn: a6e634b83d | pylearn2: 57a156beb0
* CPU: x86_64
* OS: Linux-2.6.35.14-106.fc14.x86_64-x86_64-with-fedora-14-Laughlin
You can also define the modules to be t... |
mandeepdhami/neutron | refs/heads/master | neutron/tests/api/test_routers_negative.py | 47 | # Copyright 2013 OpenStack Foundation
# 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 requ... |
laikuaut/nlp100 | refs/heads/master | nlp100/chapter2/Q010.py | 1 | # coding: utf-8
from util import util
def Q_010_1():
""" 10. 行数のカウント
行数をカウントせよ.
"""
num_lines = 0
with open('data/hightemp.txt', 'r') as f:
num_lines = sum(1 for line in f)
return num_lines
def Q_010_2():
""" 10. 行数のカウント
確認にはwcコマンドを用いよ.
"""
ite = util.exe_cmd('cat d... |
agincel/AdamTestBot | refs/heads/master | future/moves/http/server.py | 2 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from http.server import *
else:
__future_module__ = True
from BaseHTTPServer import *
from CGIHTTPServer import *
from SimpleHTTPServer import *
try:
from CGIHTTPServer import _url_collapse_path #... |
urda/nistbeacon | refs/heads/master | tests/integration/__init__.py | 7 | """
Copyright 2015-2016 Peter Urda
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, softwar... |
OpenNetworkingFoundation/Snowmass-ONFOpenTransport | refs/heads/develop | RI/flask_server/tapi_server/models/tapi_oam_updateoamserviceendpoint_output.py | 4 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_oam_oam_service_end_point import TapiOamOamServiceEndPoint # noqa: F401,E501
from tapi_se... |
zdary/intellij-community | refs/heads/master | python/testData/refactoring/move/moveNamespacePackage3/after/src/b.py | 79 | import nspkg.a
print(nspkg.a.VAR) |
gustavoam/django-subscribe | refs/heads/master | subscribe/admin.py | 1 | """Admin classes for the ``subscribe`` app."""
from django.contrib import admin
from .models import Subscription
admin.site.register(Subscription)
|
Wafflespeanut/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/request.py | 87 | import base64
import cgi
import Cookie
import StringIO
import tempfile
import urlparse
from . import stash
from .utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about t... |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | refs/heads/master | python-packages/mne-python-0.10/mne/io/fiff/tests/test_raw.py | 1 | from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os
import os.path as op
import glob
from copy import deepcopy
import warnings
import itertools as itt
import numpy as np
... |
hvy/chainer | refs/heads/master | tests/chainer_tests/training_tests/extensions_tests/test_print_report.py | 11 | import tempfile
import unittest
import mock
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def _setup(self, stream=None, delete_flush=False):
self.logreport = mock.MagicMock(spec=extensions.LogReport(
['epoch'], trigger=(1, 'iter... |
kntem/webdeposit | refs/heads/webdeposit-final | modules/miscutil/lib/hashutils.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... |
jobscore/sync-engine | refs/heads/master | inbox/test/auth/test_gmail_auth_credentials.py | 5 | # -*- coding: UTF-8 -*-
import pytest
from sqlalchemy.orm import joinedload, object_session
from inbox.auth.gmail import GmailAuthHandler
from inbox.models.session import session_scope
from inbox.models.account import Account
from inbox.models.backends.gmail import (GOOGLE_CALENDAR_SCOPE,
... |
ChinaMassClouds/copenstack-server | refs/heads/master | openstack/src/ceilometer-2014.2.2/ceilometer/tests/network/statistics/opencontrail/test_driver.py | 6 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Author: Sylvain Afchain <sylvain.afchain@enovance.com>
#
# 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.apach... |
pranto157/django-pipeline | refs/heads/master | pipeline/compressors/yui.py | 47 | from __future__ import unicode_literals
from pipeline.conf import settings
from pipeline.compressors import SubProcessCompressor
class YUICompressor(SubProcessCompressor):
def compress_common(self, content, compress_type, arguments):
command = '%s --type=%s %s' % (settings.PIPELINE_YUI_BINARY, compress_t... |
ujjwalwahi/odoo | refs/heads/8.0 | addons/auth_signup/__openerp__.py | 313 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
allyjweir/lackawanna | refs/heads/master | lackawanna/transcript/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
lihan/SAE-ChannelChat | refs/heads/master | channelchat/1/channelchat/chat/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
wisechengyi/pants | refs/heads/master | tests/python/pants_test/process/test_lock.py | 2 | # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import shutil
import tempfile
import unittest
from multiprocessing import Manager, Process
from threading import Thread
from pants.process.lock import OwnerPrintingInterProcessF... |
earthreader/web | refs/heads/master | setup.py | 3 | import os.path
import sys
try:
from setuptools import find_packages, setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import find_packages, setup
from setuptools.command.test import test
def readme():
try:
with open(os.path.join(os.path.dirname... |
Kingdread/qutebrowser | refs/heads/master | qutebrowser/browser/network/networkreply.py | 4 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# Based on the Eric5 helpviewer,
# Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redist... |
hand-iemura/lightpng | refs/heads/master | boost_1_53_0/libs/python/test/return_arg.py | 46 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from return_arg_ext import *
>>> l1=Label()
>>> assert l1 is l1.label("bar")
>>> assert l1 is l1.label("bar").sensitive(0)
>>> a... |
bukalov/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/main_unittest.py | 124 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... |
playingaround2017/test123 | refs/heads/master | gamera/paths.py | 2 | # -*- mode: python; indent-tabs-mode: nil; tab-width: 3 -*-
# vim: set tabstop=3 shiftwidth=3 expandtab:
#
# Copyright (C) 2001-2005 Ichiro Fujinaga, Michael Droettboom,
# and Karl MacMillan
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU... |
Intel-Corporation/tensorflow | refs/heads/master | tensorflow/contrib/distribute/python/collective_all_reduce_strategy.py | 4 | # 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... |
iamutkarshtiwari/sympy | refs/heads/master | sympy/concrete/__init__.py | 123 | from .products import product, Product
from .summations import summation, Sum
|
westinedu/similarinterest | refs/heads/master | django/db/models/sql/where.py | 10 | """
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from __future__ import absolute_import
import datetime
from itertools import repeat
from django.utils import tree
from django.db.models.fields import Field
from django.db.models.sql.datastructures import EmptyResultSet, FullResultSet
from ... |
conejoninja/plugin.video.pelisalacarta | refs/heads/master | lib/gdata/tlslite/utils/compat.py | 361 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... |
mprego/NBA | refs/heads/master | Regression/tests/Reg_Model_tests.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Sun May 29 14:15:09 2016
@author: Matt
"""
import pandas as pd
from unittest import TestCase
from Regression.Reg_Model import Reg_Model
class TestModel(TestCase):
def test_ridge(self):
model=Reg_Model()
x = pd.DataFrame({'x1': [1,2,3,4]})
y= [1, 2, 3... |
hedaoyuan/Paddle | refs/heads/master | python/paddle/trainer_config_helpers/tests/layers_test_config.py | 16 | # Copyright (c) 2016 PaddlePaddle 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 applic... |
all3fox/algos-py | refs/heads/main | src/graph/concomp.py | 1 | from collections import deque
def concomp0(graph):
"""
Performs depth-first search to find connected components of a given graph
Args:
graph: an undirected graph (a forest of connected components).
Returns:
a dictionary {node: integer} where the integer is the same for
those ... |
ArnoldJunior/simuladorA | refs/heads/master | graphics.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PySide import QtCore, QtGui
import math
import sys
# Importa os módulos necessários para implementação do diagrama gráfico
from elementos import Religador, BusBarSection, Substation, Condutor
from elementos import EnergyConsumer
from DialogRecloser import RecloserDialo... |
tensorflow/tensorflow | refs/heads/master | tensorflow/python/keras/feature_column/sequence_feature_column_integration_test.py | 5 | # 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... |
gangadharkadam/shfr | refs/heads/master | frappe/core/doctype/notification_count/notification_count.py | 23 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import MySQLdb
from frappe.model.document import Document
logger = frappe.get_logger()
class NotificationCoun... |
adamrp/qiime | refs/heads/master | qiime/parallel/multiple_rarefactions.py | 15 | #!/usr/bin/env python
# File created on 14 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
from ... |
projectatomic/anaconda | refs/heads/rhel7-atomic | pyanaconda/ui/gui/spokes/datetime_spoke.py | 1 | # Datetime configuration spoke class
#
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program i... |
liorvh/pythonpentest | refs/heads/master | multi_process.py | 2 | #!/usr/bin/env python
'''
Author: Christopher Duffy
Date: July 2015
Name: multi_process.py
Purpose: To identify live web applications with a list of IP addresses, using parallel processes
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modi... |
jesparza/peepdf | refs/heads/master | jsbeautifier/unpackers/packer.py | 76 | #
# Unpacker for Dean Edward's p.a.c.k.e.r, a part of javascript beautifier
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
"""Unpacker for Dean Edward's p.a.c.k.e.r"""
import r... |
sgammon/libcloud | refs/heads/trunk | docs/examples/compute/openstack_floating_ips.py | 63 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security
# This assumes you don't have SSL set up.
# Note: Code like this poses a security risk (MITM attack) and
# that's the reason why you should never use it for anything else
# besides testing. You have ... |
hanw/p4-hlir | refs/heads/master | p4_hlir/graphs/__init__.py | 6 | # Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
whs/django | refs/heads/master | django/contrib/postgres/aggregates/statistics.py | 17 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... |
luzfcb/django-autocomplete-light | refs/heads/master | test_project/tests/models.py | 5 | from django.contrib.auth.models import User
from django.db.models.signals import post_migrate
def test_user(sender, *args, **kwargs):
if sender.name != 'django.contrib.auth':
return
user, c = User.objects.get_or_create(username='test')
user.is_staff = True
user.is_superuser = True
user.se... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/sphinx/writers/websupport.py | 3 | # -*- coding: utf-8 -*-
"""
sphinx.writers.websupport
~~~~~~~~~~~~~~~~~~~~~~~~~
sphinx.websupport writer that adds comment-related annotations.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.writers.html import HTMLTranslat... |
kdrone/crazyflie-python-client | refs/heads/master | build/lib.linux-i686-2.7/cflib/bootloader/__init__.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
1ns/project-r2 | refs/heads/master | web/themes/contrib/bootstrap_sass_starterkit/node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | #!/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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... |
chenruixuan/PopClip-Extensions | refs/heads/master | source/Trello/requests/packages/urllib3/util/response.py | 928 | def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check via the official file-like-object way.
return obj.closed
except AttributeError:
pass
try:
# Check if the object... |
elkingtoncode/Pysense | refs/heads/master | setup.py | 19 | import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
|
cs-au-dk/Artemis | refs/heads/master | contrib/Z3/python/mk_z3tactics.py | 1 | ############################################
# Copyright (c) 2012 Microsoft Corporation
#
# Extract tactics and probes from install_tactics.cpp
#
# Author: Leonardo de Moura (leonardo)
############################################
import re
import os
tactic_pat = re.compile("^[ \t]*ADD_TACTIC_CMD")
probe_p... |
nett55/scrapy | refs/heads/0.20 | scrapy/tests/test_link.py | 27 | import unittest
import warnings
from scrapy.link import Link
class LinkTest(unittest.TestCase):
def _assert_same_links(self, link1, link2):
self.assertEqual(link1, link2)
self.assertEqual(hash(link1), hash(link2))
def _assert_different_links(self, link1, link2):
self.assertNotEqual(l... |
JohnGriffiths/nipype | refs/heads/master | nipype/workflows/graph/setup.py | 14 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('graph', parent_package, top_path)
return config
if __name__ == ... |
mfwarren/FreeCoding | refs/heads/master | 2015/02/fc_2015_02_27.py | 1 | #!/usr/bin/env python3
# imports go here
import inspect
#
# Free Coding session for 2015-02-27
# Written by Matt Warren
#
def f(arg):
print(arg)
class Foo:
"""
sample comment
"""
def method(self, arg):
print(arg)
if __name__ == '__main__':
print("f is method? %s" % inspect.ismetho... |
maxvogel/NetworKit-mirror2 | refs/heads/master | networkit/auxiliary.py | 1 | """
General Python helpers.
""" |
A-t48/-tg-station | refs/heads/master | tools/travis/template_dm_generator.py | 132 | #!/usr/bin/env python
import os
import os.path
import sys
folders = ["_maps/RandomRuins", "_maps/RandomZLevels", "_maps/shuttles",
"_maps/templates"]
generated = "_maps/templates.dm"
template_filenames = []
def find_dm(path):
L = []
for dirpath, dirnames, filenames in os.walk(path):
for ... |
jean/sentry | refs/heads/master | tests/sentry/similarity/test_encoder.py | 4 | from __future__ import absolute_import
import pytest
import six
from sentry.similarity.encoder import Encoder
def test_builtin_types():
encoder = Encoder()
values = [
1,
1.1,
b'\x00\x01\x02',
u'\N{SNOWMAN}',
('a', 'b', 'c'),
['a', 'b', 'c'],
{
... |
jkstrick/samba | refs/heads/master | buildtools/wafsamba/samba_perl.py | 27 | import Build
from samba_utils import *
from Configure import conf
done = {}
@conf
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
#
# TODO: use the @runonce mechanism for this.
# The problem is that @runonce currently does
# not seem to work together with @conf...
# So @runonce (and/o... |
breznak/nupic | refs/heads/master | examples/opf/experiments/missing_record/base/description.py | 31 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
wikimedia/labs-tools-ptable | refs/heads/master | data.py | 1 | # -*- coding: utf-8 -*-
"""
Copyright © 2012-2015 Ricordisamoa
This file is part of the Wikidata periodic table.
The Wikidata periodic table 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 th... |
jonathanmz34/ztransfert | refs/heads/master | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... |
ashang/calibre | refs/heads/master | src/calibre/db/__init__.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
SPOOL_SIZE = ... |
espenhgn/nest-simulator | refs/heads/master | pynest/examples/arbor_cosim_example/arbor_proxy.py | 17 | #!/usr/bin/env python3
# arbor_proxy.py simulates an Arbor run with MPI spike exchange to external
# NEST. Reimplementation of the C++ version of Peyser implemented in pure
# Python to allow easy testing by external developers without building Arbor.
from mpi4py import MPI
import sys
import numpy as np
import math
##... |
signed/intellij-community | refs/heads/master | python/testData/resolve/ImplicitDunderSizeOfWithInheritedClassAttr.py | 35 | class A(object):
__sizeof__ = 4
class B(A):
def foo(self):
return __sizeof__
# <ref> |
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_asyncio/test_locks.py | 80 | """Tests for lock.py"""
import unittest
from unittest import mock
import re
import asyncio
from asyncio import test_utils
STR_RGX_REPR = (
r'^<(?P<class>.*?) object at (?P<address>.*?)'
r'\[(?P<extras>'
r'(set|unset|locked|unlocked)(,value:\d)?(,waiters:\d+)?'
r')\]>\Z'
)
RGX_REPR = re.compile(STR_R... |
alexmandujano/django | refs/heads/master | django/conf/locale/bs/formats.py | 118 | # -*- 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.'
TIME_FORMAT = 'G:i'
DATE... |
raycarnes/hr | refs/heads/8.0 | __unported__/hr_payroll_register/wizard/__init__.py | 28 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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 the Free Software Foundation... |
THURachel/GenSegNet | refs/heads/master | matconvnet-1.0-beta16/doc/matdoc.py | 7 | # file: matdoc.py
# author: Andrea Vedaldi
# brief: Extact comments from a MATLAB mfile and generate a Markdown file
import sys, os, re, shutil
import subprocess, signal
import string, fnmatch
from matdocparser import *
from optparse import OptionParser
usage = """usage: %prog [options] <mfile>
Extracts the comment... |
padraic-padraic/StabilizerSearch | refs/heads/master | stabilizer_search/__init__.py | 1 | from .core import *
from .stabilizers import *
# from .search import * |
fitermay/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/sk/sk_districts.py | 543 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... |
uclouvain/osis_louvain | refs/heads/master | base/models/mandate.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
Git-Host/jaikuengine | refs/heads/master | common/patterns.py | 33 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
jsirois/pex | refs/heads/master | pex/vendor/_vendored/pip/pip/_vendor/msgpack/_version.py | 21 | version = (1, 0, 0)
|
FePhyFoFum/PyPHLAWD | refs/heads/master | src/get_internal_seqs_unrepresented_in_tips.py | 1 | import sys
import os
import seq
if __name__ == "__main__":
if len(sys.argv) != 3:
print("python "+sys.argv[0]+" curdir logfile")
sys.exit(0)
curd = sys.argv[1]
LOGFILE = sys.argv[2]
ff = None
dirs = []
for i in os.listdir(curd):
if ".fas" == i[-4:]:
ff = i
... |
MartinEnder/erpnext-de | refs/heads/develop | erpnext/selling/report/customer_credit_balance/customer_credit_balance.py | 96 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from erpnext.selling.doctype.customer.customer import get_customer_outstanding,... |
edx-solutions/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_tabs.py | 4 | """ Tests for tab functions (just primitive). """
import json
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url
from contentstore.views import tabs
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTest... |
rahenry/nonHexact | refs/heads/master | test3.py | 1 | import numpy, scipy, math, cmath, random, scipy.sparse, scipy.sparse.linalg, scipy.special, sys, struct, os, operator
import matplotlib.pyplot as plt
import solver, data_processing, writer, measure
N = 3
L = 200
R = range(0,L)
g = 1.
def omega(j):
return numpy.exp(math.pi*1.J*j/L)
def eps_per(k, L, N):
z = o... |
rkashapov/buildbot | refs/heads/master | pkg/test_buildbot_pkg.py | 10 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
IMCG/iMapReduce | refs/heads/master | src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftMetaStore.py | 15 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
import fb303.FacebookService
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.pr... |
ric03uec/boto | refs/heads/develop | boto/ec2/autoscale/limits.py | 18 | # Copyright (c) 2013 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 ... |
contactr2m/remote_repo | refs/heads/master | src/song/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
jeffzheng1/tensorflow | refs/heads/master | tensorflow/python/training/monitored_session.py | 3 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
OSSESAC/odoopubarquiluz | refs/heads/7.0 | addons/account_analytic_plans/wizard/account_crossovered_analytic.py | 52 | # -*- 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... |
PaulAYoung/f2014_iolab | refs/heads/master | pymongoProject/venv/lib/python2.7/site-packages/passlib/handlers/scram.py | 19 | """passlib.handlers.scram - hash for SCRAM credential storage"""
#=============================================================================
# imports
#=============================================================================
# core
from binascii import hexlify, unhexlify
from base64 import b64encode, b64decode
... |
gdm/aws-cfn-resource-bridge | refs/heads/master | aws/cfn/__init__.py | 8 | #==============================================================================
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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 ... |
abhilashnta/edx-platform | refs/heads/master | cms/envs/test.py | 31 | # -*- coding: utf-8 -*-
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We ... |
MostlyOpen/odoo_addons_jcafb | refs/heads/master | myo_employee_cst/models/hr_employee_seq.py | 1 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/celery/docs/slidesource/slide-example1.py | 23 | from celery.task import Task
class MyTask(Task):
def run(self, x, y):
return x * y
|
d-led/influxdb-cpp-rest | refs/heads/master | deps/fmt/support/appveyor-build.py | 10 | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIGURATION']
platform = os.environ['PLATFORM']
path = os.environ['PATH']
image = os.environ['APPVEYOR_BUILD_WORKER_IMAGE']
jobid = os.environ['APPVEYOR_JOB_ID']
cmake_... |
tonypujals/POSTMan-Chrome-Extension | refs/heads/master | tests/selenium/pmtests/postman_tests_requests.py | 104 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import tracebac... |
TimYi/django | refs/heads/master | tests/schema/fields.py | 203 | from django.db import models
from django.db.models.fields.related import (
RECURSIVE_RELATIONSHIP_CONSTANT, ManyRelatedObjectsDescriptor,
ManyToManyField, ManyToManyRel, RelatedField,
create_many_to_many_intermediary_model,
)
from django.utils.functional import curry
class CustomManyToManyField(RelatedFie... |
lucienfostier/gaffer | refs/heads/master | doc/source/WorkingWithThePythonScriptingAPI/TutorialStartupConfig2/screengrab.py | 3 | # BuildTarget: images/tutorialBookmarks.png
# BuildTarget: images/tutorialDefaultBookmark.png
# BuildTarget: images/tutorialDefaultImageNodeBookmark.png
# BuildTarget: images/tutorialDefaultImageNodePath.png
import os
import subprocess32 as subprocess
import tempfile
import time
import Gaffer
import GafferUI
import G... |
dagnello/ansible-modules-core | refs/heads/devel | packaging/os/apt_rpm.py | 192 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2013, Evgenii Terechkov
# Written by Evgenii Terechkov <evg@altlinux.org>
# Based on urpmi module written by Philippe Makowski <philippem@mageia.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/migration/utils.py | 129 | import sys
from collections import deque
from django.utils.datastructures import SortedDict
from django.db import models
from south import exceptions
class SortedSet(SortedDict):
def __init__(self, data=tuple()):
self.extend(data)
def __str__(self):
return "SortedSet(%s)" % list(self)
... |
tqchen/tvm | refs/heads/master | tests/python/unittest/test_te_schedule_postproc_rewrite_for_tensor_core.py | 4 | # 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... |
ministryofjustice/cla_public | refs/heads/master | cla_public/apps/base/forms.py | 1 | # coding: utf-8
"Base forms"
from flask import render_template, current_app, request
from flask_wtf import Form
from flask.ext.babel import lazy_gettext as _, get_translations
from wtforms import TextAreaField, RadioField, SelectMultipleField, StringField, widgets
from wtforms.validators import InputRequired, Length
... |
jonparrott/billing-export-python | refs/heads/master | test/test.py | 2 | from datetime import date
import json
import logging
import os
import unittest
import cloudstorage as gcs
import main
import webapp2
import webtest
from google.appengine.ext import testbed
class TestParseData(unittest.TestCase):
"""Tests parsing billing export data into a datatable."""
def LoadTestData(self):
... |
carnotweat/cpupimp | refs/heads/master | libs/bs4/__init__.py | 417 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.