repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
dawangjiaowolaixunshan/runtime | refs/heads/master | deps/v8/tools/trace-maps-processor.py | 56 | #!/usr/bin/env python
# Copyright 2014 the V8 project 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 sys
action = sys.argv[1]
if action in ["help", "-h", "--help"] or len(sys.argv) != 3:
print("Usage: %s <action> <inputfil... |
wbyne/QGIS | refs/heads/master | scripts/qgis_fixes/fix_apply.py | 77 | from lib2to3.fixes.fix_apply import FixApply
|
l-meng/mobly | refs/heads/master | mobly/controllers/android_device_lib/adb.py | 1 | # Copyright 2016 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, ... |
DanteOnline/free-art | refs/heads/master | venv/lib/python3.4/site-packages/pip/commands/__init__.py | 143 | """
Package containing all pip commands
"""
from __future__ import absolute_import
from pip.commands.completion import CompletionCommand
from pip.commands.download import DownloadCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.hash import HashCommand
from pip.commands.help import HelpCommand
fr... |
leTel/django-urlmiddleware | refs/heads/master | urlmiddleware/conf.py | 2 | from django.core.exceptions import ImproperlyConfigured
from urlmiddleware.urlresolvers import MiddlewareRegexURLResolver, MiddlewareRegexURLPattern
__all__ = ['mpatterns', 'middleware', ]
def mpatterns(prefix, *args):
pattern_list = []
for t in args:
if isinstance(t, (list, tuple)):
t =... |
zmanji/ecryptfs | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
vrtadmin/clamav-bytecode-compiler | refs/heads/master | llvm/utils/lit/lit.py | 119 | #!/usr/bin/env python
if __name__=='__main__':
import lit
lit.main()
|
jianhuiz/kubernetes | refs/heads/master | hack/boilerplate/boilerplate.py | 300 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... |
UnataInc/apns-client | refs/heads/master | apnsclient/test.py | 2 | if __name__ == '__main__':
import os.path, sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import unittest, struct, pickle, json
import time
import datetime
from mock import patch
from OpenSSL.SSL import ZeroReturnError
from apnsclient import *
class APNsTest(unittest.TestCase):
""" Tes... |
ddico/odoo | refs/heads/master | addons/stock_account/models/account_chart_template.py | 5 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
import logging
_logger = logging.getLogger(__name__)
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
@api.model
def generate_journals(self, ac... |
zachjanicki/osf.io | refs/heads/develop | scripts/register_oauth_scopes.py | 33 | """
Register the list of OAuth2 scopes that can be requested by third parties. This populates the Mongo collection
referenced by CAS when responding to authorization grant requests.
The database class is minimal; the exact specification for what a scope contains lives in the
python module from which this colle... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.3/doc/_ext/youtube.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Taken from sphinx-contrib
# https://bitbucket.org/birkenfeld/sphinx-contrib/src/a3d904f8ab24/youtube
# If not otherwise noted, the extensions in this package are licensed
# under the following license.
#
# Copyright (c) 2009 by the contributors (see AUTHORS file).
# All... |
bigdatauniversity/edx-platform | refs/heads/master | common/djangoapps/course_modes/views.py | 12 | """
Views for the course_mode module
"""
import decimal
from ipware.ip import get_ip
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.views.generic.base import View
from django.... |
umayr/notary | refs/heads/master | buildscripts/covertest.py | 10 | #!/usr/bin/env python
"""
This module is used to run tests with full coverage-reports.
It's a way to provide accurate -coverpkg arguments to `go test`.
To run over all packages:
buildscripts/covertest.py --tags "tag1 tag2" --testopts="-v -race"
To run over some packages:
buildscripts/covertest.py --pkgs "X"
"""
fr... |
thewtex/ITK | refs/heads/master | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/declaration.py | 13 | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
Defines :class:`pygccxml.declarations.declaration_t` class - all declarations
base class.
"""
import warnings
from . i... |
weblyzard/weblyzard_api | refs/heads/master | src/python/weblyzard_api/client/videolyzard.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on 16.04.2014
.. seealso::
`API Documentation <https://gitlab.semanticlab.net/matthiasb/weblyzard-youtube-tab/wikis/api-documentation>`_
:mod::`wl_data_scripts.projects.videolyzard.import_data`
@author: heinz-peterlang
'''
from __future__ import division
f... |
skuater/radare2-bindings | refs/heads/master | python/test-r2rc.py | 11 | #!/usr/bin/python
# -- pancake
import sys
from r_asm import *
from r_util import *
from r_bin import *
try:
program = sys.argv[1]
except:
print "Usage: test-r2rc [path-to-program]"
sys.exit (1)
a = RAsm ()
a.use ("x86.nasm")
b = RBin ()
off_printf = 0
b.load (program, None)
baddr = b.get_baddr ()
for i in b.get_... |
larrybradley/astropy | refs/heads/remote-tests | astropy/timeseries/tests/__init__.py | 185 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
|
kytvi2p/Sigil | refs/heads/master | 3rdparty/python/Lib/enum.py | 10 | import sys
from collections import OrderedDict
from types import MappingProxyType, DynamicClassAttribute
__all__ = ['Enum', 'IntEnum', 'unique']
def _is_descriptor(obj):
"""Returns True if obj is a descriptor, False otherwise."""
return (
hasattr(obj, '__get__') or
hasattr(obj, '__set... |
PeterPetrik/QGIS | refs/heads/master | python/plugins/db_manager/db_plugins/gpkg/data_model.py | 30 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
rismalrv/edx-platform | refs/heads/master | lms/djangoapps/lti_provider/tests/test_users.py | 85 | """
Tests for the LTI user management functionality
"""
import string
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.test import TestCase
from django.test.client import RequestFactory
from mock import patch, MagicMock
from lti_provider.models import LtiCons... |
ad-m/pru | refs/heads/master | pru/registers/urls.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(
regex=r'^miejscowosc-(?P<teryt_pk>\d+)/$',
view=views.RegisterListView.as_view(),
name='list'
),
url(
regex=r'^$',
view=views.RegisterListView.as... |
2015fallproject/2015fallcase2 | refs/heads/master | static/Brython3.2.2-20150927-180218/Lib/struct.py | 15 | __all__ = [
# Functions
'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from',
# Classes
'Struct',
# Exceptions
'error'
]
from _struct import *
from _struct import _clearcache
from _struct import __doc__
|
flip111/portia | refs/heads/master | slybot/slybot/linkextractor/__init__.py | 23 | """
Link extraction for auto scraping
"""
from scrapy.utils.misc import load_object
from .base import BaseLinkExtractor, ALLOWED_SCHEMES
from .html import HtmlLinkExtractor
from .xml import XmlLinkExtractor, RssLinkExtractor, SitemapLinkExtractor, AtomLinkExtractor
from .regex import RegexLinkExtractor
from .ecsv impo... |
Mariatta/pythondotorg | refs/heads/master | users/migrations/0002_auto_20150416_1853.py | 12 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='bio_markup... |
pothosware/gnuradio | refs/heads/master | gr-wxgui/python/wxgui/scope_window.py | 45 | #
# Copyright 2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... |
sbarman/webscript_db | refs/heads/master | api/handlers.py | 1 | from piston.handler import BaseHandler
from piston.utils import rc, throttle
from piston.utils import validate
from django.contrib.auth.models import User
import HTMLParser
from webscript_backend import models
class UserHandler(BaseHandler):
allowed_methods = ('GET',)
fields = ('username', 'first_name', 'last... |
barentsen/dave | refs/heads/master | pipeline/test_clipboard.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 14:24:06 2015
@author: fergal
$Id$
$URL$
"""
__version__ = "$Id$"
__URL__ = "$URL$"
from clipboard import Clipboard, loadClipboard
import unittest
import numpy as np
class TestClipboard(unittest.TestCase):
def setUp(self):
c2 = Clipboard(a=1, b=2)
... |
petteyg/intellij-community | refs/heads/master | python/testData/inspections/AugmentAssignmentSubscription.py | 83 | current_sum = 1
numbers = [1, 2, 3]
<weak_warning descr="Assignment can be replaced with augmented assignment">current_sum = current_sum + numbers[0]</weak_warning> |
inovtec-solutions/OpenERP | refs/heads/branch_openerp | openerp/addons/mx/TextTools/Examples/Python.py | 1 | #!/usr/local/bin/python
""" Python - tag table for Python (Version 0.6)
* 0.5->0.6: changed the names of the tags !
fixed bug in match_str()
XXX can't handle (lambda ...) and misses not in 'if x is not'
Copyright (c) 2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
Copyright (c) 2000... |
RPGOne/scikit-learn | refs/heads/master | examples/decomposition/plot_pca_iris.py | 65 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
PCA example with Iris Data-set
=========================================================
Principal Component Analysis applied to the Iris dataset.
See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f... |
danielmartin/swift | refs/heads/master | utils/swift_build_support/tests/test_shell.py | 39 | # tests/test_shell.py -------------------------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... |
wnduan/IntroToComSci | refs/heads/master | myCombination.py | 2 | # -*- coding: utf-8 -*-
__author__ = 'wnduan'
# 数学中的排列组合问题在Python中有内置的运算模块itertools,可以import itertools,
# 然后其中的itertools.combinations(),itertools.combinations_with_replacement
# 还有itertools.permutations()三个函数可以用于计算组合,有重复的组合,以及排列问题。
# 但是作为学习,还是很希望能理解这些问题的算法。所以这里,以组合问题为例,来进行一个
# 讨论。
# 组合问题也就是从m个元素中,取出n个元素的问题表示为C(m,n)。首... |
zachatrocity/mapnik-fork | refs/heads/master | point.py | 1 | import mapnik
merc = mapnik.Projection('+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over')
longlat = mapnik.Projection('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
mapfile = "osm.xml"
m = mapnik.Map(600,300)
mapnik.load_map(m,mapfile)
m.srs... |
donkirkby/django | refs/heads/master | django/utils/numberformat.py | 431 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.utils import six
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (... |
hatwar/buyback-frappe | refs/heads/master | frappe/workflow/doctype/workflow/__init__.py | 1020 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
|
keedio/hue | refs/heads/master | desktop/core/ext-py/cx_Oracle-5.1.2/samples/DatabaseShutdown.py | 37 | #------------------------------------------------------------------------------
# DatabaseShutdown.py
# This script demonstrates shutting down a database using Python. It is only
# possible in Oracle 10g Release 2 and higher. The connection used assumes that
# the environment variable ORACLE_SID has been set.
#------... |
adieu/django-nonrel | refs/heads/master | tests/regressiontests/comment_tests/tests/templatetag_tests.py | 49 | from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context
from regressiontests.comment_tests.models import Article, Author
from regressiontests.comment_tests.tests impo... |
sdphome/UHF_Reader | refs/heads/master | rfs/rootfs/usr/lib/python2.7/copy_reg.py | 442 | """Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extens... |
Designist/audacity | refs/heads/master | lib-src/lv2/serd/waflib/Tools/xlcxx.py | 330 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... |
mountain213/neo4jworkshop | refs/heads/master | REST_clients/Python_client/requests/packages/urllib3/connectionpool.py | 66 | import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
try: # Python 3
from queue import LifoQueue, Empty, Full
except ImportError:
from Queue import LifoQueue, Empty, Full
import Queue as _ # Platform-specific: Windows
fr... |
hsu1994/Terminator | refs/heads/master | Server/RelyON/boost_1_61_0/libs/python/test/exception_translator.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 exception_translator_ext import *
>>> try:
... throw_error();
... except RuntimeError, x:
... print x
... else:
...... |
allevato/swift | refs/heads/master | utils/build_swift/tests/build_swift/argparse/__init__.py | 108 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... |
jtorrents/networkx | refs/heads/master | examples/graph/unix_email.py | 62 | #!/usr/bin/env python
"""
Create a directed graph, allowing multiple edges and self loops, from
a unix mailbox. The nodes are email addresses with links
that point from the sender to the recievers. The edge data
is a Python email.Message object which contains all of
the email message data.
This example shows the po... |
MattPerron/esper | refs/heads/master | esper/query/urls.py | 1 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^api/search2', views.search2, name='search2'),
url(r'^api/schema', views.schema, name='schema'),
url(r'^api/build_index', views.build_index, name='build_index'),
url(r'^fallback', views.fallback, name='fallback'),
url(r'^bat... |
peterjanes/dosage | refs/heads/master | dosagelib/updater.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import os
from distutils.version import LooseVersion
import dosagelib
fr... |
pcu4dros/pandora-core | refs/heads/master | workspace/lib/python3.5/site-packages/pip/_vendor/requests/__init__.py | 327 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... |
avanheuvelen/python-telegram-bot | refs/heads/master | telegram/groupchat.py | 4 | #!/usr/bin/env python
# pylint: disable=C0103,W0622
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public ... |
schettino72/nikola | refs/heads/master | tests/test_compile_markdown.py | 12 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import io
import shutil
import tempfile
import unittest
from os import path
from nikola.plugins.compile.markdown import CompileMarkdown
from .base import BaseTestCase, FakeSite
class CompileMarkdownTests(BaseTestCase):
def se... |
spartonia/django-oscar | refs/heads/master | src/oscar/apps/address/models.py | 30 | from oscar.apps.address.abstract_models import (
AbstractCountry, AbstractUserAddress)
from oscar.core.loading import is_model_registered
__all__ = []
if not is_model_registered('address', 'UserAddress'):
class UserAddress(AbstractUserAddress):
pass
__all__.append('UserAddress')
if not is_mode... |
garbled1/ansible | refs/heads/devel | lib/ansible/modules/commands/telnet.py | 24 | # this is a virtual module that is entirely implemented server side
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1... |
mhaller/pyffmpeg | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import os
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from os.path import join as path_join
print "Remember: Edit at first ffmpegpath within setup.py"
##############################################################... |
wetek-enigma/enigma2 | refs/heads/wetek | lib/python/Components/Renderer/Picon.py | 18 | import os, re, unicodedata
from Renderer import Renderer
from enigma import ePixmap, ePicLoad
from Tools.Alternatives import GetWithAlternative
from Tools.Directories import pathExists, SCOPE_SKIN_IMAGE, SCOPE_ACTIVE_SKIN, resolveFilename
from Components.Harddisk import harddiskmanager
from ServiceReference import Serv... |
tropp/acq4 | refs/heads/develop | acq4/devices/OptomechDevice.py | 1 | from PyQt4 import QtCore, QtGui
from Device import Device
from acq4.util.Mutex import Mutex
import acq4.pyqtgraph as pg
import collections
import numpy as np
class OptomechDevice(object):
"""
OptomechDevice is an extenstion to the Device class which manages coordinate system mapping between
rigid... |
jeromatron/cassandra | refs/heads/trunk | pylib/cqlshlib/test/winpty.py | 28 | # 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... |
openstack/blazar | refs/heads/master | blazar/api/v1/oshosts/v1_0.py | 2 | # Copyright (c) 2013 Bull.
#
# 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, sof... |
benschmaus/catapult | refs/heads/master | third_party/gsutil/third_party/crcmod_osx/crcmod/predefined.py | 72 | #-----------------------------------------------------------------------------
# Copyright (c) 2010 Craig McQueen
#
# 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, includ... |
be-cloud-be/horizon-addons | refs/heads/9.0 | server/addons/account_bank_statement_import/wizard/journal_creation.py | 45 | # -*- coding: utf-8 -*-
from openerp import api, fields, models
class account_bank_statement_import_journal_creation(models.TransientModel):
_name = 'account.bank.statement.import.journal.creation'
_description = 'Import Bank Statement Journal Creation Wizard'
journal_id = fields.Many2one('account.journa... |
myvoice-nigeria/myvoice | refs/heads/develop | myvoice/clinics/migrations/0028_auto__del_clinicstatistic__del_unique_clinicstatistic_clinic_statistic.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ClinicStatistic', fields ['clinic', 'statistic',... |
bendykst/deluge | refs/heads/develop | deluge/ui/web/json_api.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2010 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
im... |
ndzou/httpie-negotiate | refs/heads/master | httpie_negotiate.py | 1 | """
SPNEGO (GSS Negotiate) auth plugin for HTTPie.
"""
import os
from httpie.plugins import AuthPlugin
__version__ = '1.0.1'
__author__ = 'Nan Zou'
__licence__ = 'BSD'
class NegotiateAuthPlugin(AuthPlugin):
name = 'SPNEGO auth'
auth_type = 'negotiate'
description = ''
def get_auth(self, username... |
ColdrickSotK/storyboard | refs/heads/master | storyboard/api/v1/task_statuses.py | 1 | # Copyright (c) 2013 Mirantis 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... |
ecino/compassion-modules | refs/heads/10.0-emanuel | mobile_app_connector/tests/__init__.py | 4 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Bornand
#
# The licence is in the file __manifest__.py
#
################... |
Jozain/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/__init__.py | 2 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DISABLED)
version = options.get('a... |
euclio/eclim | refs/heads/master | doc/extension/eclim/sphinx/rss.py | 3 | import cgi
import os
from docutils import nodes, utils
from docutils.frontend import OptionParser
from docutils.parsers.rst import Directive, directives, Parser
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.writers.html import HTMLTranslator, HTMLWriter
from sphinx.util.osutil import os_path
cla... |
elviswf/yapf | refs/heads/master | yapftests/file_resources_test.py | 9 | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
40223119/w17test | refs/heads/master | ref/gear.py | 68 |
import cherrypy
import os
import sys
# 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite
# 導入 pybean 模組與所要使用的 Store 及 SQLiteWriter 方法
from pybean import Store, SQLiteWriter
import math
# 確定程式檔案所在目錄, 在 Windows 有最後的反斜線
_curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
# 將所在目錄設為系統搜尋目錄
sys.path.append(_curdir)
if 'O... |
niftynei/zulip | refs/heads/master | zerver/management/commands/create_realm.py | 5 | from __future__ import absolute_import
from __future__ import print_function
from optparse import make_option
from typing import Any, Text
from django.conf import settings
from django.core.management.base import BaseCommand, CommandParser
from zerver.lib.actions import Realm, do_create_realm, set_default_streams
from... |
eharney/nova | refs/heads/master | nova/tests/api/openstack/compute/plugins/v3/test_shelve.py | 8 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
sparcs-kaist/sparcssso | refs/heads/master | apps/core/backends/__init__.py | 1 | from apps.core.backends.auth import * # noqa: F401, F403
from apps.core.backends.decorator import * # noqa: F401, F403
from apps.core.backends.service import * # noqa: F401, F403
from apps.core.backends.signup import * # noqa: F401, F403
from apps.core.backends.token import * # noqa: F401, F403
from ... |
sahmed95/sympy | refs/heads/master | sympy/core/benchmarks/bench_numbers.py | 121 | from __future__ import print_function, division
from sympy.core.numbers import Integer, Rational, integer_nthroot, igcd
from sympy import S, pi, oo
i3 = Integer(3)
i4 = Integer(4)
r34 = Rational(3, 4)
q45 = Rational(4, 5)
def timeit_Integer_create():
Integer(2)
def timeit_Integer_int():
int(i3)
def time... |
linsicai/or-tools | refs/heads/master | examples/data/nonogram_regular/nonogram_n4.py | 74 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/django/dispatch/__init__.py | 758 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver # NOQA
|
briantwatson/developer-support | refs/heads/master | python/arcpy-python/find-and-replace-data-sources-in-mxd/find_and_replace_data_sources.py | 9 | #-------------------------------------------------------------------------------
# Name: Find and Replace Data Sources in MXD
# Purpose: Takes an input workspace to recursively walk through a directory
# and replace a specified path. A common use case is when the name
# of a server ... |
jjneely/ansible | refs/heads/devel | lib/ansible/runner/lookup_plugins/sequence.py | 85 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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 v... |
fabianmurariu/FrameworkBenchmarks | refs/heads/master | frameworks/Python/flask/app.py | 19 | #!/usr/bin/env python
from functools import partial
import json
from operator import attrgetter
import os
from random import randint
import sys
import flask
from flask import Flask, request, render_template, make_response, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from sq... |
mdanielwork/intellij-community | refs/heads/master | python/testData/quickdoc/NumPyOnesDoc/numpy/core/multiarray.py | 103 | class ndarray(object):
"""
ndarray(shape, dtype=float, buffer=None, offset=0,
strides=None, order=None)
An array object represents a multidimensional, homogeneous array
of fixed-size items. An associated data-type object describes the
format of each element in the array... |
arvedviehweger/swift | refs/heads/master | utils/resolve-crashes.py | 19 | #!/usr/bin/env python
# A small utility to take the output of a Swift validation test run
# where some compiler crashers have been fixed, and move them into the
# "fixed" testsuite, removing the "--crash" in the process.
from __future__ import print_function
import os
import re
import sys
def execute_cmd(cmd):
... |
runt18/mojo | refs/heads/master | tools/run_hooks.py | 1 | #!/usr/bin/env python
# Copyright 2015 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.
# This script runs all of the hooks specified in DEPS in order.
import os
import subprocess
import sys
scope = {}
def Var(key):
re... |
NickolausDS/oauthenticator | refs/heads/master | oauthenticator/tests/conftest.py | 4 | """Py.Test fixtures"""
import inspect
from tornado.httpclient import AsyncHTTPClient
from tornado import ioloop
from tornado.platform.asyncio import AsyncIOMainLoop
from pytest import fixture
from .mocks import MockAsyncHTTPClient
def pytest_collection_modifyitems(items):
"""add asyncio marker to all async tes... |
CameronLonsdale/lantern | refs/heads/master | lantern/structures/decryption.py | 1 | """Class to group information about a decryption.
Todo:
Possibly add more functionality to this class
* Equality checking
* Formatted plaintext (added spaces)
Once there is evidence these things are needed, I will implement them
"""
class Decryption:
"""A decryption object, composed of plaintext,... |
OpenCobolIDE/OpenCobolIDE | refs/heads/master | open_cobol_ide/extlibs/future/backports/xmlrpc/server.py | 82 | r"""
Ported using Python-Future from the Python 3.3 standard library.
XML-RPC Servers.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.
It can also be used to handle XML-RPC requests in a CGI... |
OpringaoDoTurno/airflow | refs/heads/master | tests/dags/no_dags.py | 197 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
jamison904/android_kernel_samsung_hlte | refs/heads/cm-11.0 | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
iwanders/catkin_tools | refs/heads/master | catkin_tools/jobs/commands/cmake.py | 1 | # Copyright 2014 Open Source Robotics Foundation, 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... |
looker/sentry | refs/heads/master | tests/sentry/models/test_releaseprojectenvironment.py | 2 | from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import Environment, Release, ReleaseProjectEnvironment
from sentry.testutils import TestCase
class GetOrCreateTest(TestCase):
def setUp(self):
self.project = self.create_project(nam... |
inveniosoftware/invenio-formatter | refs/heads/master | invenio_formatter/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Jinja utilities for Invenio applications.
Quick start
-----------
This section pr... |
fabricehong/zim-desktop | refs/heads/master | tools/data_uri.py | 5 | #!/usr/bin/python
import base64
from zim.fs import File
def data_uri(file):
if file.basename.endswith('.png'):
mime = 'image/png'
else:
mime = file.get_mimetype()
data64 = u''.join(base64.encodestring(file.raw()).splitlines())
return u'data:%s;base64,%s' % (mime, data64)
if __name__ == '__main__':
import ... |
benfinke/ns_python | refs/heads/master | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_tmtrafficpolicy_binding.py | 3 | #
# 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... |
room77/py77 | refs/heads/master | pylib/zeus/exporter.py | 1 | #!/usr/bin/env python
"""Handles export."""
__author__ = 'pramodg@room77.com (Pramod Gupta)'
__copyright__ = 'Copyright 2012 Room77, Inc.'
import itertools
import os
import sys
import time
from pylib.base.flags import Flags
from pylib.base.exec_utils import ExecUtils
from pylib.base.term_color import TermColor
from... |
Refefer/pylearn2 | refs/heads/master | pylearn2/packaged_dependencies/theano_linear/unshared_conv/gpu_unshared_conv.py | 44 | """
WRITEME
"""
from __future__ import print_function
import inspect
import os
import StringIO
import theano
from theano.sandbox.cuda import CudaNdarrayType
from theano.gof import local_optimizer
from theano.sandbox.cuda.opt import register_opt
from theano.sandbox.cuda import gpu_from_host, host_from_gpu
from theano.... |
stinos/micropython | refs/heads/master | tests/unicode/unicode.py | 15 | # Test a UTF-8 encoded literal
s = "asdf©qwer"
for i in range(len(s)):
print("s[%d]: %s %X" % (i, s[i], ord(s[i])))
# Test all three forms of Unicode escape, and
# all blocks of UTF-8 byte patterns
s = "a\xA9\xFF\u0123\u0800\uFFEE\U0001F44C"
for i in range(-len(s), len(s)):
print("s[%d]: %s %X" % (i, s[i],... |
gauribhoite/personfinder | refs/heads/master | env/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... |
2014cdag10/2014cdag10 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/browser/__init__.py | 111 | from _browser import *
|
lighht/pyonenote-old | refs/heads/master | pyonenote/api/client.py | 1 | import json
import time
from urllib.parse import urlencode, parse_qs
import requests
from pyonenote import SESSION_FILE
class Client:
DEFAULT_CLIENT_SCOPE = ['wl.signin', 'office.onenote_create', 'wl.offline_access', 'Office.onenote']
DEFAULT_REDIRECT_URI = 'https://login.live.com/oauth20_desktop.srf'
O... |
jsenko/repour | refs/heads/master | repour/exception.py | 1 | import asyncio
import json
class DescribedError(Exception):
def __init__(self, desc):
super().__init__(desc)
self.desc = desc
class CommandError(DescribedError):
def __init__(self, desc, cmd, exit_code, stdout=None, stderr=None):
super().__init__(desc)
self.cmd = cmd
se... |
ucrawler/cp-uc | refs/heads/master | libs/pyutil/iputil.py | 92 | # from the Python Standard Library
import os, re, socket, sys, subprocess
# from Twisted
from twisted.internet import defer, threads, reactor
from twisted.internet.protocol import DatagramProtocol
from twisted.python.procutils import which
from twisted.python import log
try:
import resource
def increase_rlimi... |
pombredanne/invenio | refs/heads/master | modules/bibformat/lib/elements/bfe_plots.py | 1 | # -*- coding: utf-8 -*-
##
## $Id: bfe_CERN_plots.py,v 1.3 2009/03/17 10:55:15 jerome Exp $
##
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Publi... |
ncbray/pystream | refs/heads/master | bin/language/python/program.py | 1 | # Copyright 2011 Nicholas Bray
#
# 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... |
twitchyliquid64/misc-scripts | refs/heads/master | s3tool/boto-develop/boto/emr/emrobject.py | 136 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com>
# Copyright (c) 2010-2011 Yelp
#
# 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 restricti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.