repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
chrisfranzen/django | refs/heads/master | django/contrib/auth/models.py | 3 | from __future__ import unicode_literals
import re
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_s... |
vaygr/ansible | refs/heads/devel | lib/ansible/modules/network/bigswitch/bigmon_policy.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metacl... |
RebeccaWPerry/vispy | refs/heads/master | vispy/app/backends/tests/test_ipynb_util.py | 18 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from vispy.app.backends._ipynb_util import (_extract_buffers,
_serialize_command,
... |
jspargo/AneMo | refs/heads/master | django/lib/python2.7/site-packages/django/template/loaders/cached.py | 95 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_orig... |
xmw/hsh-link | refs/heads/master | hsh-link.py | 1 | # vim: tabstop=4
# vim: set fileencoding=utf-8
# copyright Michael Weber (michael at xmw dot de) 2014
from config import STORAGE_DIR, LINK_DIR, FILE_SIZE_MAX, MIME_ALLOWED, BASE_PROTO, BASE_PATH, COOKIE_SECRET, THEMES
OUTPUT = 'raw', 'html', 'long', 'short', 'qr', 'qr_png', 'qr_utf8', 'qr_ascii'
import base64, hashli... |
SergiySW/RaiWalletBot | refs/heads/master | transaction_booster.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Nano Telegram bot
# @NanoWalletBot https://t.me/NanoWalletBot
#
# Source code:
# https://github.com/SergiySW/NanoWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron sometimes during distribution period
# or manually in case of unsynchronization
#... |
fotinakis/sentry | refs/heads/master | src/sentry/api/endpoints/organization_member_details.py | 5 | from __future__ import absolute_import
from django.db import transaction
from django.db.models import Q
from rest_framework import serializers
from rest_framework.response import Response
from sentry import roles
from sentry.api.bases.organization import (
OrganizationEndpoint, OrganizationPermission
)
from sentr... |
cybaek/twisted-network-programming-essentials-2nd-edition-python3 | refs/heads/master | ch3/adderrback.py | 1 | from twisted.internet.defer import Deferred
def myErrback(failure):
print(failure)
d = Deferred()
d.addErrback(myErrback)
d.errback(Exception("Triggering callback."))
|
j-fuentes/werkzeug | refs/heads/master | examples/simplewiki/database.py | 45 | # -*- coding: utf-8 -*-
"""
simplewiki.database
~~~~~~~~~~~~~~~~~~~
The database.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
from datetime import datetime
from sqlalchemy import Table, Column, Integer, String, DateTime, \
ForeignKey, MetaData, ... |
cosmoharrigan/pylearn2 | refs/heads/master | pylearn2/devtools/__init__.py | 147 | __authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
|
PhiInnovations/mdp28-linux-bsp | refs/heads/master | scripts/pybootchartgui/pybootchartgui/__init__.py | 12133432 | |
kylef/lithium | refs/heads/master | lithium/blog/templatetags/__init__.py | 12133432 | |
Suninus/erpnext | refs/heads/develop | erpnext/accounts/report/item_wise_purchase_register/__init__.py | 12133432 | |
helenst/django | refs/heads/master | tests/one_to_one/__init__.py | 12133432 | |
gradel/mezzanine | refs/heads/master | mezzanine/galleries/migrations/__init__.py | 12133432 | |
pkolios/qlutter-todo | refs/heads/master | qlutter_todo/tests/__init__.py | 12133432 | |
embedded1/django-oscar-paypal | refs/heads/master | paypal/payflow/admin.py | 14 | from django.contrib import admin
from paypal.payflow import models
class TxnAdmin(admin.ModelAdmin):
list_display = ['pnref', 'comment1', 'amount', 'get_trxtype_display',
'get_tender_display', 'result', 'respmsg', 'date_created']
readonly_fields = [
'trxtype',
'tender',
... |
simonflueckiger/tesserocr-windows_build | refs/heads/master | res/tesserocr/__init__.py | 2 | from ._tesserocr import *
|
igsr/igsr_analysis | refs/heads/master | Utils/RunProgram.py | 1 | '''
Created on 03 May 2018
@author: ernesto
'''
import subprocess
import re
import os
class RunProgram(object):
"""
SuperClass used to run an external program within a Python script
"""
def __init__(self, program=None, path=None, args=None, arg_sep=None, parameters=None,
cmd_line=N... |
halfak/Wiki-Class | refs/heads/master | articlequality/utilities/fetch_text.py | 3 | """
``$ articlequality fetch_text -h``
::
Fetches text & metadata for labelings using a MediaWiki API.
Usage:
fetch_text --api-host=<url> [--labelings=<path>] [--output=<path>]
[--verbose]
Options:
-h --help Show this documentation.
--... |
ThinkOpen-Solutions/odoo | refs/heads/stable | addons/account_test/account_test.py | 342 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $
#
# WARNING: This program as such is intended to be used by professional
# prog... |
40223102/w17b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/browser/timer.py | 610 | from browser import window
def wrap(func):
# Transforms a function f into another function that prints a
# traceback in case of exception
def f(*args, **kw):
try:
return func(*args, **kw)
except Exception as exc:
sys.stderr.write(exc)
return f
clear_interval = w... |
RyanBeatty/Steer-Clear-Backend | refs/heads/master | steerclear/utils/cas.py | 3 | """
cas.py
By: Ryan Beatty
Enable automatic login to W&M CAS server by emulating
a browser to perform login
"""
import mechanize
from urllib2 import HTTPError
# url of the login route for the W&M CAS server
WM_CAS_SERVER_URL = 'https://cas.wm.edu/cas/login?service=http%3A//localhost%3A8080/login/'
"""
validate_user
... |
arante/pyloc | refs/heads/master | py3/cs-circle/pendulum.py | 2 | #! /usr/bin/env python
# Billy Wilson Arante
# 12/21/2015
"""
In physics, for a pendulum with length L and initial angle A, its horizontal
displacement X(T) at time T is given by the formula:
X(T) = L × cos(A × cos(T × √9.8/L)) - L × cos(A)
"""
import math
L = float(input())
A = float(input())
T = 0
X = 0.0
wh... |
programadorjc/django | refs/heads/master | django/utils/checksums.py | 310 | """
Common checksum routines.
"""
__all__ = ['luhn']
import warnings
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
warnings.warn(
"django.utils.checksums will be removed in Django 1.10. The "
"luhn() function is now included in django-localflavor 1.1+.",
Rem... |
pierg75/pier-sosreport | refs/heads/master | sos/plugins/nis.py | 1 | # 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 in the hope that it will be useful,
# but... |
suiyuan2009/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/nets/resnet_is_training_test.py | 50 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
elcodigok/mtff | refs/heads/master | lib/iplib/setup.py | 1 | #!/usr/bin/env python
import sys
from distutils.core import setup
long_desc = """You can use this Python module to convert amongst many
different notations and to manage couples of address/netmask
in the CIDR notation.
"""
classifiers = """\
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable... |
Webcampak/v1.0 | refs/heads/master | src/bin/wpakPhidget.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010-2012 Infracom & Eurotechnia (support@webcampak.com)
# This file is part of the Webcampak project.
# Webcampak 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 Fo... |
dushu1203/chromium.src | refs/heads/nw12 | components/policy/resources/PRESUBMIT.py | 51 | # 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.
# If this presubmit check fails or misbehaves, please complain to
# mnissler@chromium.org, bartfab@chromium.org or atwilson@chromium.org.
import itertoo... |
aaronelliotross/django-tastypie | refs/heads/master | tests/core/forms.py | 18 | from django import forms
from core.models import Note
class NoteForm(forms.ModelForm):
foobaz = forms.CharField()
class Meta:
model = Note
class VeryCustomNoteForm(NoteForm):
class Meta:
model = Note
fields = ['title', 'content', 'created', 'is_active', 'foobaz']
# Notes:
# * ... |
irwinlove/django | refs/heads/master | django/utils/jslex.py | 251 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... |
Danisan/odoo-1 | refs/heads/8.0 | addons/hw_escpos/controllers/main.py | 26 | # -*- coding: utf-8 -*-
import commands
import logging
import simplejson
import os
import os.path
import io
import base64
import openerp
import time
import random
import math
import md5
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import pickle
import re
import subprocess
import traceback
try:
from... |
mtrbean/scipy | refs/heads/master | scipy/io/harwell_boeing/_fortran_format_parser.py | 127 | """
Preliminary module to handle fortran formats for IO. Does not use this outside
scipy.sparse io for now, until the API is deemed reasonable.
The *Format classes handle conversion between fortran and python format, and
FortranFormatParser can create *Format instances from raw fortran format
strings (e.g. '(3I4)', '(... |
wylliam-silva/leiteilustrador | refs/heads/master | 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... |
0branch/punkmoney | refs/heads/master | tracker/utils/parser.py | 1 | # -*- coding: utf-8 -*-
"""
PunkMoney 0.2 :: parser.py
Main class for interpreting #PunkMoney statements.
"""
from mysql import Connection
from harvester import Harvester
from config import HASHTAG, ALT_HASHTAG, SETTINGS
from objects import Event
import re
from datetime import datetime
from dateutil.relativedelta... |
TechEmpower/FrameworkBenchmarks | refs/heads/master | frameworks/Python/pyramid/gunicorn_conf.py | 24 | import multiprocessing
import os
import sys
_is_pypy = hasattr(sys, 'pypy_version_info')
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count() * 3
if _is_travis:
workers = 2
bind = "0.0.0.0:8080"
keepalive = 120
errorlog = '-'
pidfile = '/tmp/gunicorn.pid'
if _is_pypy:
worker... |
maheshakya/scikit-learn | refs/heads/master | sklearn/utils/tests/test_testing.py | 33 | import warnings
import unittest
import sys
from nose.tools import assert_raises
from sklearn.utils.testing import (
_assert_less,
_assert_greater,
assert_less_equal,
assert_greater_equal,
assert_warns,
assert_no_warnings,
assert_equal,
set_random_state,
assert_raise_message)
from ... |
JamesTFarrington/hendrix | refs/heads/WSGI | hendrix/contrib/cache/resource.py | 5 | import cStringIO
import urlparse
from . import decompressBuffer, compressBuffer
from .backends.memory_cache import MemoryCacheBackend
from hendrix.utils import responseInColor
from twisted.internet import reactor
from twisted.web import proxy, client
from twisted.web.server import NOT_DONE_YET
from urllib import quo... |
zaffra/Donate | refs/heads/master | django/template/loaders/cached.py | 79 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_str... |
erikge/watch_gyp | refs/heads/master | test/win/gyptest-link-subsystem.py | 239 | #!/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.
"""
Make sure subsystem setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp... |
enitihas/SAC-Website | refs/heads/master | venv/bin/venv/lib/python2.7/site-packages/flask/testsuite/test_apps/flask_broken/__init__.py | 629 | import flask.ext.broken.b
import missing_module
|
mhugent/Quantum-GIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/HtmlReportPostProcessor.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
HtmlReportPostProcessor.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************... |
tongpo/Holle-World | refs/heads/master | py/python3-cookbook/basic/mydesign/d06_proxy.py | 1 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 代理模式
Desc : 代理模式,也叫委托模式 是一个使用率非常高的模式,
非常典型的场景就是游戏代练,代练者就是一个代理者或者委托者。
"""
class RealSubject:
def request(self):
print('核心业务逻辑')
class Proxy(RealSubject):
def __init__(self):
self.real_subject = RealSubject()
def request(se... |
kartikshah1/Test | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2800 | ######################## 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... |
miho030/FoxVc | refs/heads/master | TestCode/Fox2Av/FoxEngine/FoxCore/FoxConst.py | 2 | # _*_coding:utf-8 _*_
"""
Made by Nicht = tayaka = Lee joon sung
South Korea. Seoul. Gangnam. gaepodong.
contact admin = miho0_0@naver.com OR anonymous0korea0@gmail.com(youtube) OR miho03092@gmail.com(gmail)
This is Opensource Computer Anti-Virus program.
anyone can modificate this script. n you can edit this p... |
ucsb-seclab/ictf-framework | refs/heads/master | gamebot/gamebot.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The gamebot is an internal component of the database backend and is
responsible for progressing the game (each "round" of the game is known as a
tick). Each tick the gamebot decides which scripts to run against which team
and randomizes the order. This information is pe... |
laszlocsomor/tensorflow | refs/heads/master | tensorflow/python/__init__.py | 7 | # 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... |
sunjeammy/tornado | refs/heads/master | tornado/util.py | 102 | """Miscellaneous utility functions and classes.
This module is used internally by Tornado. It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.
The one public-facing part of this module is the `Configurable` cl... |
jimmy-ren/RPN2T | refs/heads/master | external/_caffe/python/caffe/test/test_solver.py | 33 | import unittest
import tempfile
import os
import numpy as np
import six
import caffe
from test_net import simple_net_file
class TestSolver(unittest.TestCase):
def setUp(self):
self.num_output = 13
net_f = simple_net_file(self.num_output)
f = tempfile.NamedTemporaryFile(mode='w+', delete=F... |
Weil0ng/gem5 | refs/heads/master | src/sim/probe/Probe.py | 62 | # -*- mode:python -*-
# Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementatio... |
ppmt/Crust | refs/heads/master | flask/lib/python2.7/site-packages/flask/app.py | 427 | # -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... |
hoangt/tpzsimul.gem5 | refs/heads/master | src/arch/x86/isa/insts/simd128/floating_point/logical/andp.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
opendaylight/netvirt | refs/heads/master | resources/tools/odltools/odltools/mdsal/tests/test_cmd.py | 1 | import logging
import os
import shutil
import unittest
from odltools import logg
from odltools.mdsal import cmd
from odltools.mdsal.tests import Args
@unittest.skip("skipping")
class TestCmd(unittest.TestCase):
def setUp(self):
logg.Logger(logging.INFO, logging.INFO)
self.args = Args(path="/tmp/t... |
philsch/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... |
msebire/intellij-community | refs/heads/master | python/lib/Lib/nturl2path.py | 155 | """Convert a NT pathname to a file URL and vice versa."""
def url2pathname(url):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
# e.g.
# ///C|/foo/bar/spam.foo
# becomes
# C:\foo\bar\spam.foo
import string, urlli... |
timmahoney/ansible-modules-core | refs/heads/devel | system/ping.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
SaikWolf/gnuradio | refs/heads/master | gr-fec/python/fec/qa_ber_bf.py | 33 | #!/usr/bin/env python
#
# Copyright 2014 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)
# ... |
domeger/SplunkTAforPuppetEnterprise | refs/heads/master | bin/splunktaforpuppetenterprise/mako/runtime.py | 22 | # mako/runtime.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides runtime services for templates, including Context,
Namespace, and various helper funct... |
oliverhr/odoo | refs/heads/8.0-pos-pademobile-payment | addons/mail/tests/test_mail_features.py | 172 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
wraiden/spacewalk | refs/heads/master | backend/server/importlib/test/test_ks_tree.py | 14 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
partofthething/home-assistant | refs/heads/dev | homeassistant/components/mullvad/__init__.py | 1 | """The Mullvad VPN integration."""
import asyncio
from datetime import timedelta
import logging
import async_timeout
from mullvad_api import MullvadAPI
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeas... |
pfnet/chainercv | refs/heads/master | chainercv/evaluations/eval_detection_voc.py | 3 | from __future__ import division
from collections import defaultdict
import itertools
import numpy as np
import six
from chainercv.utils.bbox.bbox_iou import bbox_iou
def eval_detection_voc(
pred_bboxes, pred_labels, pred_scores, gt_bboxes, gt_labels,
gt_difficults=None,
iou_thresh=0.5, use_0... |
Teamxrtc/webrtc-streaming-node | refs/heads/master | third_party/depot_tools/third_party/pylint/lint.py | 46 | # Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... |
bigswitch/tempest | refs/heads/master | tempest/api/compute/servers/test_list_server_filters.py | 5 | # Copyright 2012 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... |
nimbusproject/kazoo | refs/heads/master | kazoo/__init__.py | 1 | import os
from kazoo.zkclient import ZooKeeperClient
from kazoo.client import KazooClient
__all__ = ['ZooKeeperClient', 'KazooClient']
# ZK C client likes to spew log info to STDERR. disable that unless an
# env is present.
def disable_zookeeper_log():
import zookeeper
zookeeper.set_log_stream(open('/dev/n... |
rvalyi/OpenUpgrade | refs/heads/master | addons/account_anglo_saxon/product.py | 384 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... |
johankaito/fufuka | refs/heads/master | microblog/flask/venv/lib/python2.7/site-packages/celery/tests/backends/test_cache.py | 6 | from __future__ import absolute_import
import sys
import types
from contextlib import contextmanager
from kombu.utils.encoding import str_to_bytes
from celery import signature
from celery import states
from celery import group
from celery.backends.cache import CacheBackend, DummyClient
from celery.exceptions import... |
Domatix/account-financial-tools | refs/heads/8.0 | account_asset_management/__init__.py | 35 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
# Copyright (c) 2014 Noviat nv/sa (ww... |
wmvanvliet/mne-python | refs/heads/master | mne/tests/test_ola.py | 14 | import numpy as np
from numpy.testing import assert_allclose
import pytest
from mne._ola import _COLA, _Interp2, _Storer
def test_interp_2pt():
"""Test our two-point interpolator."""
n_pts = 200
assert n_pts % 50 == 0
feeds = [ # test a bunch of feeds to make sure they don't break things
[n_... |
VioletRed/script.module.urlresolver | refs/heads/master | lib/urlresolver/plugins/donevideo.py | 1 | '''
Donevideo urlresolver plugin
Copyright (C) 2013 Vinnydude
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 ... |
chouseknecht/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_ips_global.py | 14 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... |
SummerLW/Perf-Insight-Report | refs/heads/test | telemetry/third_party/modulegraph/modulegraph_tests/testdata/syspath/mymodule3.py | 26 | """ fake module """
|
sachinkum/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/views/debug.py | 17 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
from django.urls impor... |
isyippee/ceilometer | refs/heads/master | ceilometer/storage/sqlalchemy/migrate_repo/versions/006_counter_volume_is_float.py | 9 | # -*- coding: utf-8 -*-
#
# Copyright 2013 eNovance SAS <licensing@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.apache.org/licenses/LICENSE-2.0
#
# Unless... |
vitaly4uk/django | refs/heads/master | tests/forms_tests/tests/test_fields.py | 134 | # -*- coding: utf-8 -*-
"""
##########
# Fields #
##########
Each Field class does some sort of validation. Each Field has a clean() method,
which either raises django.forms.ValidationError or returns the "clean"
data -- usually a Unicode object, but, in some rare cases, a list.
Each Field's __init__() takes at least... |
JPWKU/unix-agent | refs/heads/master | src/dcm/agent/tests/unit/messaging/__init__.py | 51 | #
# Copyright (C) 2014 Dell, 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 wri... |
plum-umd/java-sketch | refs/heads/master | java_sk/glob2/fnmatch.py | 13 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
flashycud/timestack | refs/heads/master | django/http/multipartparser.py | 87 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import cgi
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.datastructures import MultiValueDict
fro... |
seberg/numpy | refs/heads/ufunc-refactor-2021-normal | numpy/f2py/tests/test_module_doc.py | 10 | import os
import sys
import pytest
import textwrap
from . import util
from numpy.testing import assert_equal, IS_PYPY
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestModuleDocString(util.F2PyTest):
sources = [_path('src', 'module_data', 'module_data_docstring.f90')]
@... |
richtier/alexa-browser-client | refs/heads/master | alexa_browser_client/config/routing.py | 1 | from channels.routing import ProtocolTypeRouter
from channels.sessions import SessionMiddlewareStack
from alexa_browser_client import consumers
application = ProtocolTypeRouter({
'websocket': SessionMiddlewareStack(consumers.AlexaConsumer)
})
|
olasitarska/django | refs/heads/master | django/conf/locale/hi/formats.py | 619 | # -*- 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 F Y'
TIME_FORMAT = 'g:i A'
# DA... |
wfxiang08/django190 | refs/heads/master | tests/null_queries/tests.py | 290 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... |
mfwarren/FreeCoding | refs/heads/master | 2014/10/fc_2014_10_14.py | 1 | #!/usr/bin/env python
#imports go here
import datetime
import smtplib
from email.mime.text import MIMEText
from github import Github
#
# Free Coding session for 2014-10-14
# Written by Matt Warren
#
EMAIL = 'me@example.com'
hub = Github()
hub_user = hub.get_user('mfwarren')
event = hub_user.get_public_events()[0] ... |
savoirfairelinux/shinken | refs/heads/master | shinken/easter.py | 17 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ca... |
yannrouillard/weboob | refs/heads/master | modules/apivie/pages.py | 2 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
dios-game/dios | refs/heads/master | src/oslibs/google_breakpad/google-breakpad-read-only/src/tools/gyp/test/exclusion/gyptest-exclusion.py | 363 | #!/usr/bin/env python
# Copyright (c) 2010 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that exclusions (e.g. sources!) are respected. Excluded sources
that do not exist should not prevent the build from succeeding... |
Zex0n/django-simple-cms | refs/heads/master | shop/migrations/0030_item_variation_in_stock.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-09-11 09:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0029_category_code1c'),
]
operations = [
migrations.AddField(
... |
eoogbe/api-client-staging | refs/heads/master | generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/text_annotation_pb2.py | 8 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/proto/vision/v1/text_annotation.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google... |
c-rhodes/hack2014 | refs/heads/master | hack2014/category/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
drawcode/deployee-flask | refs/heads/master | app/main/views.py | 2 | from flask import Blueprint, request, render_template, flash, g, session, redirect, url_for
from werkzeug import check_password_hash, generate_password_hash
from app import db
main = Blueprint('main', __name__)
@main.route('/')
def main_root():
return render_template("main.html")
@main.route('/home')
def main_h... |
mavlab2015/paparazzi | refs/heads/indoor | sw/lib/python/pprz_math/__init__.py | 79 | __all__ = ["geodetic", "algebra"]
|
toshywoshy/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_firewall_DoS_policy.py | 21 | # Copyright 2019 Fortinet, 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
tedder/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_profile_persistence_src_addr.py | 21 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
yakovenkodenis/rethinkdb | refs/heads/next | external/v8_3.30.33.16/tools/testrunner/local/progress.py | 41 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
pcchenxi/baseline | refs/heads/master | baselines/common/math_util.py | 11 | import numpy as np
import scipy.signal
def discount(x, gamma):
"""
computes discounted sums along 0th dimension of x.
inputs
------
x: ndarray
gamma: float
outputs
-------
y: ndarray with same shape as x, satisfying
y[t] = x[t] + gamma*x[t+1] + gamma^2*x[t+2] + ... + gam... |
shirayu/slex | refs/heads/master | slex/tool/singleton.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://python.g.hatena.ne.jp/nelnal_programing/20080225/1203927879
"""
__author__ = ''
__version__ = ""
__copyright__ = ""
__license__ = ""
class Singleton( type ):
def __init__( self, *args, **kwargs ):
type.__init__( self, *args, **kwargs )
se... |
patrickhartling/maestro | refs/heads/master | maestro/gui/environment.py | 2 | # Maestro is Copyright (C) 2006-2008 by Infiscape Corporation
#
# 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... |
elkingtonmcb/django | refs/heads/master | docs/_ext/djangodocs.py | 321 | """
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import __version__ as sphinx_ver, addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util... |
dysya92/monkeys | refs/heads/master | flask/lib/python2.7/site-packages/pbr/tests/testpackage/setup.py | 139 | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.