repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/chromium_org/chrome/test/functional/webrtc_apprtc_call.py | 30 | #!/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.
import random
import time
# Note: pyauto_functional must come before pyauto.
import pyauto_functional
import pyauto
import webrtc_... |
ilexius/odoo | refs/heads/master | addons/hr_expense/__init__.py | 337 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import models
import wizard
|
sahiljain/catapult | refs/heads/master | dashboard/dashboard/memory_report.py | 3 | # Copyright 2016 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.
"""Provides the web interface for the memory infra graph picker."""
from dashboard import chart_handler
class MemoryReportHandler(chart_handler.ChartHandle... |
barbuza/django | refs/heads/master | tests/admin_scripts/management/commands/app_command.py | 531 | from django.core.management.base import AppCommand
class Command(AppCommand):
help = 'Test Application-based commands'
requires_system_checks = False
def handle_app_config(self, app_config, **options):
print('EXECUTE:AppCommand name=%s, options=%s' % (app_config.name, sorted(options.items())))
|
AngelkPetkov/titanium_mobile | refs/heads/master | support/common/simplejson/tests/test_encode_basestring_ascii.py | 135 | from unittest import TestCase
import simplejson.encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0... |
maohongyuan/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_json/test_pass1.py | 132 | from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
... |
KokareIITP/django | refs/heads/master | tests/view_tests/tests/test_i18n.py | 188 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import gettext
import json
import os
import unittest
from os import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import (
LiveServerTestCase, SimpleTestCase, TestCase, modify_settings,
overrid... |
joshalbrecht/memdam | refs/heads/master | tests/unit/common/test_log.py | 1 |
import logging
import sys
import time
import nose.tools
import memdam
import memdam.common.parallel
def test_multithreaded_logging():
"""Check that logging works when using threads instead of processes"""
with DebugProcessesAsThreads():
_check_logging()
def test_multiprocess_logging():
"""Check... |
fhaoquan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/macurl2path.py | 110 | """Macintosh-specific module for conversion between pathnames and URLs.
Do not import directly; use urllib instead."""
import urllib.parse
import os
__all__ = ["url2pathname","pathname2url"]
def url2pathname(pathname):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path;... |
zenywallet/bitzeny | refs/heads/z1.2.x | contrib/qt_translations.py | 4110 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary bitcoin distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg... |
drips/seedbit | refs/heads/master | contrib/qt_translations.py | 4110 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary bitcoin distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg... |
nityas/6869-finalproject | refs/heads/master | src/lenet2/logistic_sgd.py | 9 | """
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic, linear classifier. It is parametrized
by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is
done by projecting data points onto a set of hyperplanes, the distance... |
brchiu/tensorflow | refs/heads/master | tensorflow/python/keras/applications/vgg19.py | 12 | # 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... |
Shao-Feng/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_base-uri_asterisk-manual.py | 25 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "base-uri * 'unsafe-in... |
BruceDai/web-testing-service | refs/heads/master | tools/wptserve/wptserve/request.py | 3 | import base64
import cgi
import Cookie
import os
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about... |
jbants/TileStache | refs/heads/master | TileStache/Goodies/Proj4Projection.py | 12 | """ Projection that supports any projection that can be expressed in Proj.4 format.
The projection is configured by a projection definition in the Proj.4
format, the resolution of the zoom levels that the projection should
support, the tile size, and a transformation that defines how to tile
coordinate... |
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/virt_plus/volume/test_del_sharable_vol.py | 2 | '''
@author: SyZhao
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.operations.resource_operations as res_ops
import os
test_stub = test_lib.lib_get_t... |
hurricup/intellij-community | refs/heads/master | python/testData/completion/completeBeforeSyntaxError.after.py | 83 | def foo():
if xyzzy()
def xyzzy():
pass |
burzillibus/RobHome | refs/heads/master | venv/lib/python2.7/site-packages/chardet/big5freq.py | 3132 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
rghe/ansible | refs/heads/devel | lib/ansible/modules/network/radware/vdirect_runnable.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Radware LTD.
#
# 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... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/iap/v1/iap-v1-py/noxfile.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... |
metacoin/florincoin | refs/heads/master | qa/rpc-tests/multi_rpc.py | 8 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test mulitple rpc user config option rpcauth
#
from test_framework.test_framework import BitcoinTest... |
rohanpurohit/android_kernel_sony_msm8930 | refs/heads/cm-12.0 | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
TeachAtTUM/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/library_content_module.py | 1 | # -*- coding: utf-8 -*-
"""
LibraryContent: The XBlock used to include blocks from a library in a course.
"""
import json
import logging
import random
from copy import copy
from gettext import ngettext
from lazy import lazy
from lxml import etree
from opaque_keys.edx.locator import LibraryLocator
from pkg_resources im... |
jian-li/rpg_svo | refs/heads/master | svo_analysis/src/svo_analysis/hand_eye_calib.py | 17 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 4 15:47:55 2013
@author: cforster
"""
import os
import yaml
import numpy as np
import svo_analysis.tum_benchmark_tools.associate as associate
import vikit_py.align_trajectory as align_trajectory
import vikit_py.transformations as transformations
import matplotlib.pyplot ... |
TadeoArmenta/pupy | refs/heads/master | pupy/packages/windows/amd64/psutil/__init__.py | 66 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a cross-platform library for retrieving information on
running processes and system utilization... |
hehongliang/tensorflow | refs/heads/master | tensorflow/python/data/experimental/kernel_tests/parallel_interleave_test.py | 8 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
yawnosnorous/python-for-android | refs/heads/master | python-modules/twisted/twisted/plugins/twisted_mail.py | 54 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.application.service import ServiceMaker
TwistedMail = ServiceMaker(
"Twisted Mail",
"twisted.mail.tap",
"An email service",
"mail")
|
nirs/vdsm | refs/heads/master | tests/network/integration/sourceroute_test.py | 1 | #
# Copyright 2014-2020 Red Hat, 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.
#
# This program is distributed ... |
splav/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/py/py/_code/_assertionold.py | 60 | import py
import sys, inspect
from compiler import parse, ast, pycodegen
from py._code.assertion import BuiltinAssertionError, _format_explanation
import types
passthroughex = py.builtin._sysex
class Failure:
def __init__(self, node):
self.exc, self.value, self.tb = sys.exc_info()
self.node = node... |
ThinkOpen-Solutions/odoo | refs/heads/stable | addons/survey/controllers/__init__.py | 770 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
Shade5/coala-bears | refs/heads/master | bears/js/JSONFormatBear.py | 19 | import json
from collections import OrderedDict
from re import match
from coala_utils.param_conversion import negate
from coalib.bearlib import deprecate_settings
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.LocalBear import LocalBear
from coalib.misc.Compatibility import JSONDecode... |
hunter007/django-rest-framework | refs/heads/master | rest_framework/validators.py | 15 | """
We perform uniqueness checks explicitly on the serializer class, rather
the using Django's `.full_clean()`.
This gives us better separation of concerns, allows us to use single-step
object creation, and makes it possible to switch between using the implicit
`ModelSerializer` class and an equivalent explicit `Seria... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_importlib/test_api.py | 8 | from . import util as test_util
init = test_util.import_importlib('importlib')
util = test_util.import_importlib('importlib.util')
machinery = test_util.import_importlib('importlib.machinery')
import os.path
import sys
from test import support
import types
import unittest
import warnings
class ImportModuleTests:
... |
gibxxi/nzbToMedia | refs/heads/master | libs/chardet/sjisprober.py | 1182 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
bolkedebruin/airflow | refs/heads/master | airflow/providers/redis/operators/__init__.py | 1213 | # -*- coding: 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 License, Version 2.0 (the
#... |
anitailieva/fullstack-javascript | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | #!/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.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... |
code4futuredotorg/reeborg_tw | refs/heads/master | src/libraries/Brython3.2.3/Lib/encodings/cp855.py | 272 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
marcydoty/geraldo | refs/heads/master | site/newsite/site-geraldo/django/contrib/formtools/utils.py | 11 | try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.utils.hashcompat import md5_constructor
from django.forms import BooleanField
def security_hash(request, form, *args):
"""
Calculates a security hash for the given Form instance.
... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/resolve/multiFile/relativeImport/RelativeImport.py | 79 | import x
print(x.z)
# <ref>
|
LasLabs/python-helpscout | refs/heads/master | helpscout/models/person.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2017-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import properties
from .. import BaseModel
class Person(BaseModel):
"""This is a subset of the data representing a Customer, User or Team.
The ``type`` property will specify if this person is re... |
ChrisHirsch/robotframework | refs/heads/master | utest/result/test_resultmodel.py | 18 | import unittest
from robot.utils.asserts import assert_equal, assert_raises, assert_true, assert_false
from robot.result.testsuite import TestSuite
from robot.result.testcase import TestCase
from robot.result.keyword import Keyword
from robot.result.message import Message
class TestSuiteStats(unittest.TestCase):
... |
kms123/PyKata | refs/heads/master | roman_calc/roman_test.py | 1 | import unittest
from roman import parse_numeral, add, reconstruct_numeral
class RomanNumeralParserTest(unittest.TestCase):
def test_I_parses_as_one(self):
self.assertEqual(1, parse_numeral('I'))
def test_V_parses_as_five(self):
self.assertEqual(5, parse_numeral('V'))
def test_X_parses_... |
tommo/gii | refs/heads/master | packages/RemoteInput/WebHTTPServer.py | 1 | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import time
import threading
import logging
_HTTP_PORT = 8030
def _getModulePath( path ):
import os.path
return os.path.dirname( __file__ ) + '/' + path
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
... |
fossoult/odoo | refs/heads/8.0 | addons/note/__openerp__.py | 260 | # -*- 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... |
pcolmant/repanier | refs/heads/master | repanier/fields/RepanierMoneyField.py | 1 | from decimal import Decimal, ROUND_HALF_UP
import repanier.apps
from django.conf import settings
from django.db import models
from django.db.models.expressions import BaseExpression, Expression
from django.forms import DecimalField
from repanier.widget.money import RepanierMoneyWidget
DECIMAL_ZERO = Decimal("0")
cl... |
craigderington/studentloan5 | refs/heads/master | studentloan5/Lib/site-packages/django/contrib/gis/geos/prototypes/errcheck.py | 103 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the `free` routine used to free the memory allocated for
# string pointers ... |
ogrisel/scipy | refs/heads/master | scipy/stats/tests/test_tukeylambda_stats.py | 126 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal, run_module_suite
from scipy.stats._tukeylambda_stats import tukeylambda_variance, \
tukeylambda_kurtosis
def test_tukeylambda_stats... |
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2761 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
spark-test/spark | refs/heads/master | python/pyspark/tests/test_conf.py | 21 | #
# 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 us... |
play113/swer | refs/heads/master | opencamlib-read-only/scripts/drop-cutter/drop_cutter_tst_1.py | 8 | import ocl
import camvtk
import time
if __name__ == "__main__":
cutter = ocl.CylCutter(.1, 5)
print cutter
a = ocl.Point(1,0,0)
b = ocl.Point(0,1,0)
c = ocl.Point(0,0,1)
t = ocl.Triangle(a,b,c)
print "triangle created t=", t
cl = ocl.CLPoint(0.2,0.2,-5)
print "CL= ", cl
cutte... |
shootstar/ctest | refs/heads/test | tools/notificationclient.py | 2 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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 o... |
pjdelport/pip | refs/heads/develop | tests/unit/test_compat.py | 37 | import os
from pip.compat import get_path_uid, native_str
import pytest
def test_get_path_uid():
path = os.getcwd()
assert get_path_uid(path) == os.stat(path).st_uid
@pytest.mark.skipif("not hasattr(os, 'O_NOFOLLOW')")
def test_get_path_uid_without_NOFOLLOW(monkeypatch):
monkeypatch.delattr("os.O_NOFOLL... |
tdsimao/tt | refs/heads/master | django/contrib/comments/views/comments.py | 5 | from django import http
from django.conf import settings
from utils import next_redirect, confirmation_view
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.... |
keithroe/vtkoptix | refs/heads/master | Imaging/Core/Testing/Python/ReslicePermutations.py | 20 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with various axes permutations,
# in order to cover a nasty set of "if" statements that check
# the intersections of the raster lines with the inpu... |
xianggong/m2c_unit_test | refs/heads/master | test/operator/unary_minus_uint2/compile.py | 1861 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... |
naojsoft/ginga | refs/heads/master | ginga/imap.py | 3 | #
# imap.py -- intensity maps for fits viewing
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
#import numpy as np
# Some built in intensity maps
imap_equa = (
0.06275, # noqa
0.13725,
0.22353,
... |
Jeremmm/multizab | refs/heads/1.0 | manage.py | 1 | from flask_script import Manager, Server
from multizab import app
manager = Manager(app)
manager.add_command('runserver', Server(
use_debugger=True,
use_reloader=True,
host='0.0.0.0',
port='8000'))
if __name__ == '__main__':
manager.run()
|
superhuahua/xunfengES | refs/heads/master | server/vulscan/vuldb/pyasn1/type/tag.py | 162 | # ASN.1 types tags
from operator import getitem
from pyasn1 import error
tagClassUniversal = 0x00
tagClassApplication = 0x40
tagClassContext = 0x80
tagClassPrivate = 0xC0
tagFormatSimple = 0x00
tagFormatConstructed = 0x20
tagCategoryImplicit = 0x01
tagCategoryExplicit = 0x02
tagCategoryUntagged = 0x04
class Tag:
... |
frattallone/python-oauth2 | refs/heads/master | oauth2/clients/smtp.py | 884 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... |
richbs/colourlens | refs/heads/master | colourlens/venv/lib/python2.7/site-packages/setuptools/lib2to3_ex.py | 907 | """
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactorin... |
noughts/NNDraggableScrollBarController | refs/heads/master | update.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pod を更新してpushするスクリプトです。
1. コードを変更
2. podspecのバージョン番号を更新
3. commit
4. python update.py
"""
import commands;
import os;
def runCommand( command ):
print "$ "+ command;
os.system( command );
pass
def getVersion():
import json;
projectName = os.getcwd().split("/... |
OskarBreach/hit-hit-crit | refs/heads/master | hithitcrit/xwingdata/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
40223246/0622W17test2 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/connection.py | 707 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... |
amisrs/one-eighty | refs/heads/master | angular_flask/lib/python2.7/site-packages/sqlalchemy/testing/pickleable.py | 22 | """Classes used in pickling tests, need to be at the module level for
unpickling.
"""
from . import fixtures
class User(fixtures.ComparableEntity):
pass
class Order(fixtures.ComparableEntity):
pass
class Dingaling(fixtures.ComparableEntity):
pass
class EmailUser(User):
pass
class Address(fixt... |
pavel-odintsov/ru_open_statistics | refs/heads/master | classes/downloader.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = 'alexeyymanikin'
import datetime
from classes.command.wget import Wget
from helpers.helpers import *
import shutil
from helpers.helpersCollor import BColor
class Downloader(object):
@staticmethod
def create_data_dir():
"""... |
fcahoon/soundcloud-smit | refs/heads/master | scapp/smit/views.py | 1 | from django.http import HttpResponseRedirect
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import render
import soundcloud
from smit.models import User
def home(request):
if 'sc_access_token' in request.session:
sc_client = soundcloud.Client(
... |
mcella/django | refs/heads/master | tests/from_db_value/tests.py | 399 | from django.db import connection
from django.db.models import Max
from django.test import TestCase
from .models import Cash, CashModel
class FromDBValueTest(TestCase):
def setUp(self):
CashModel.objects.create(cash='12.50')
def test_simple_load(self):
instance = CashModel.objects.get()
... |
nanditav/15712-TensorFlow | refs/heads/master | tensorflow/contrib/rnn/python/ops/rnn.py | 15 | # 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... |
urisimchoni/samba | refs/heads/master | third_party/waf/wafadmin/Logs.py | 32 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005 (ita)
import ansiterm
import os, re, logging, traceback, sys
from Constants import *
zones = ''
verbose = 0
colors_lst = {
'USE' : True,
'BOLD' :'\x1b[01;1m',
'RED' :'\x1b[01;31m',
'GREEN' :'\x1b[32m',
'YELLOW':'\x1b[33m',
'PINK' :'\x1b[35m',
'BLUE' :'... |
slisson/intellij-community | refs/heads/master | python/testData/findUsages/LambdaParameter.py | 83 | parm = 1
x = lambda <caret>parm: parm+1
|
centrofermi/e3monitor | refs/heads/master | obsolete/make_xlsx_file.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 5 17:19:41 2015
@author: Fabrizio Coccetti (fabrizio.coccetti@centrofermi.it) [www.fc8.net]
OLD code. Used before the Database was in place
"""
import xlsxwriter
from datetime import datetime
import logging
from e3monitor.config.__files_server__ import (lastDataFile,
... |
srgblnch/Lima | refs/heads/master | common/python/__init__.py | 4 | ############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under ... |
tlatzko/spmcluster | refs/heads/master | .tox/2.6-nocov/lib/python2.6/site-packages/_markerlib/markers.py | 1769 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... |
Learningtribes/edx-platform | refs/heads/master | common/djangoapps/terrain/stubs/lti.py | 44 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
from oauthlib.oauth1.rfc5849 ... |
dorotan/pythontraining | refs/heads/master | env/Lib/site-packages/selenium/__init__.py | 1 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
antgonza/qiita | refs/heads/master | qiita_db/test/test_portal.py | 3 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
depet/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_least_angle.py | 1 | import warnings
from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.te... |
yqm/sl4a | refs/heads/master | python/xmpppy/setup.py | 87 | #!/usr/bin/python
# -*- coding: koi8-r -*-
from distutils.core import setup,sys
from setuptools import setup
import os
if sys.version < '2.2.3':
from distutils.dist import DistributionMetadata
DistributionMetadata.classifiers = None
DistributionMetadata.download_url = None
# Set proper release version in ... |
benni0815/root | refs/heads/master | tutorials/pyroot/fildir.py | 18 | #
# This macro displays the ROOT Directory data structure
#
from ROOT import TCanvas, TPaveLabel, TPaveText, TText, TArrow, TLine
from ROOT import gROOT
gROOT.Reset()
c1 = TCanvas( 'c1', 'ROOT FilDir description', 700, 900 )
c1.Range( 1, 1, 19, 24.5 )
title = TPaveLabel( 4, 23, 16, 24.2, 'ROOT File/Directory/Key d... |
danieljaouen/ansible | refs/heads/devel | test/units/modules/network/nxos/nxos_module.py | 27 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
reiverjohn/biobench2 | refs/heads/master | velvet/contrib/MetaVelvet-v0.3.1/shuffleAndConvertSequences_fastq2fasta.py | 8 | #!/usr/bin/env python2.5
# -*- coding: utf-8 -*-
import sys
import re
listLine = ["", ""]
fin_fw = open(sys.argv[1], "r")
fin_bw = open(sys.argv[2], "r")
fout = open(sys.argv[3], "w")
while True:
for i in range(2):
for j in range(4):
if i == 0:
line = fin_fw.readline()
... |
davidjrichardson/uwcs-zarya | refs/heads/master | blog/migrations/0029_auto_20160922_1928.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-22 19:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0028_auto_20160919_1643'),
]
operations = [
... |
kou/zulip | refs/heads/master | zerver/migrations/0188_userprofile_enable_login_emails.py | 7 | # Generated by Django 1.11.14 on 2018-08-22 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0187_userprofile_is_billing_admin'),
]
operations = [
migrations.AddField(
model_name='userprofile',
nam... |
laiqiqi886/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_json/test_pass1.py | 132 | from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
... |
OCA/account-financial-tools | refs/heads/13.0 | product_category_tax/tests/__init__.py | 1 | from . import test_product_category_tax
|
wsharif/thesis | refs/heads/master | openFlow/ofptGetConfigReq.py | 1 | from ofptHeader import ofptHeader
def ofptGetConfigReq():
header = ofptHeader(7)
return header |
shaunokeefe/hoponit | refs/heads/master | hoponit/harvest/tasks.py | 1 | import logging
from pymongo import MongoClient
from django.conf import settings
from .untappd import UntappdApi
logger = logging.getLogger(__name__)
def fetch(suburb='Northcote'):
untappd = UntappdApi(
settings.HARVEST_UNTAPPD_CLIENT_ENDPOINT,
client_id = settings.HARVEST_UNTAPPD_CLIENT_ID,
... |
nsauder/treeano | refs/heads/master | examples/prelu/mnist_cnn.py | 3 | from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import itertools
import numpy as np
import sklearn.datasets
import sklearn.cross_validation
import sklearn.metrics
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import canopy
fro... |
exildev/Piscix | refs/heads/master | inventario/migrations/0021_auto_20170823_2310.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-08-23 23:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventario', '0020_movimientos'),
]
operations = [
migrations.RemoveField(
... |
tesujimath/filebutler | refs/heads/master | filebutler/util.py | 1 | # Copyright 2017-2018 Simon Guest
#
# This file is part of filebutler.
#
# Filebutler 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.
#... |
nickzuber/ClusterRunner | refs/heads/master | app/master/subjob.py | 1 | import os
from typing import List
from app.common.build_artifact import BuildArtifact
from app.master.atom import AtomState
from app.util.conf.configuration import Configuration
from app.util.log import get_logger
from app.util.pagination import get_paginated_indices
class Subjob(object):
def __init__(self, buil... |
thewtex/tomviz | refs/heads/master | tomviz/python/LabelObjectDistanceFromPrincipalAxis.py | 4 | import tomviz.operators
class LabelObjectDistanceFromPrincipalAxis(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset, label_value=1, principal_axis=0):
"""Computes the distance from the centroid of each connected component
in the label object with the given label_value to ... |
CiscoSystems/jujucharm-n1k | refs/heads/master | charms/precise/glance/unit_tests/test_glance_relations.py | 1 | from mock import call, patch, MagicMock
from test_utils import CharmTestCase
import glance_utils as utils
_reg = utils.register_configs
_map = utils.restart_map
utils.register_configs = MagicMock()
utils.restart_map = MagicMock()
import glance_relations as relations
utils.register_configs = _reg
utils.restart_map... |
IwraStudios/NoSSL | refs/heads/master | sslstrip2-master/build/lib.linux-x86_64-2.7/sslstrip/ClientRequest.py | 19 | # Copyright (c) 2004-2009 Moxie Marlinspike
#
# 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 version.
#
# This program is distri... |
ximion/dak | refs/heads/master | dak/dakdb/update86.py | 7 | #!/usr/bin/env python
# coding=utf8
"""
Unprivileged group into the database config table
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2012 Joerg Jaspert <joerg@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or mo... |
crcresearch/osf.io | refs/heads/develop | addons/twofactor/migrations/0002_usersettings_owner.py | 28 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-23 20:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.... |
aroberts/flanker | refs/heads/master | flanker/addresslib/__init__.py | 7 | '''
The flanker.addresslib package exposes a simple address parsing library that
can handle email addresses and urls.
See the address.py module for the public interfaces to the library and the
parser.py module for the implementation of the recursive descent parser
used to parse email addresses and urls.
To override t... |
TobbeTripitaka/src | refs/heads/master | book/Recipes/lines.py | 5 | from rsf.proj import *
import math
def vlines(out,inp,max=1.,axes='',plot=''):
''' Plot with vertical lines on specific positions'''
max = abs(max);
Plot(out,inp,
'''spray axis=2 n=2 o=%g d=%g | rtoc | math output="input+I*x2" | transp |
graph %s wanttitle=n wantaxis=n %s''' %(-max,2*m... |
githubutilities/LeetCode | refs/heads/master | Python/find-leaves-of-binary-tree.py | 5 | # Time: O(n)
# Space: O(h)
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findLeaves(self, root):
"""
:type root: TreeNode
:rtype: List[Li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.