repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
citrix-openstack-build/nova | refs/heads/master | nova/virt/disk/mount/api.py | 9 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Red Hat, 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 ... |
acenario/Payable | refs/heads/master | lib/python2.7/site-packages/django/contrib/flatpages/models.py | 136 | from __future__ import unicode_literals
from django.contrib.sites.models import Site
from django.core.urlresolvers import get_script_prefix
from django.db import models
from django.utils.encoding import iri_to_uri, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_... |
hanicker/odoo | refs/heads/8.0 | addons/hr_timesheet_invoice/__init__.py | 442 | # -*- 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... |
rohitwaghchaure/frappe_smart | refs/heads/develop | frappe/core/doctype/file_data/__init__.py | 2292 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
jasimpson/gnuradio-jasimpson | refs/heads/master | grc/gui/StateCache.py | 34 | """
Copyright 2007 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4.3/Lib/idlelib/TreeWidget.py | 15 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - key bindings (instead of quick-n-dirty bindings on Canvas):
# - up/down arrow keys to move focus around
# - ditto for page up/down, home/end
# - left/right arrows to expand/collapse & move out/in
# - more doc strings
# - add icons for "file", ... |
miguelgrinberg/python-engineio | refs/heads/main | examples/server/sanic/latency.py | 1 | from sanic import Sanic
from sanic.response import html
import engineio
eio = engineio.AsyncServer(async_mode='sanic')
app = Sanic(name='latency')
eio.attach(app)
@app.route('/')
async def index(request):
with open('latency.html') as f:
return html(f.read())
@eio.on('message')
async def message(sid, d... |
chuan9/chromium-crosswalk | refs/heads/master | third_party/mojo/src/mojo/public/third_party/jinja2/parser.py | 637 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer impo... |
jh23453/privacyidea | refs/heads/master | privacyidea/lib/tokens/radiustoken.py | 2 | # -*- coding: utf-8 -*-
#
# 2016-02-22 Cornelius Kölbel <cornelius@privacyidea.org>
# Add the RADIUS identifier, which points to the system wide list
# of RADIUS servers.
# 2015-10-09 Cornelius Kölbel <cornelius@privacyidea.org>
# Add the RADIUS-System-Config, so that not each
# ... |
aduffy70/diversitydb | refs/heads/master | main.py | 1 | from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.api import users
from time import time
from google.appengine.ext.webapp import template
class DiversityRecord(db.Model):
"""
Record of a single diversity m... |
gregoryjscott/please | refs/heads/master | app/Tests/Scripts/files/py/2_error.py | 3 | raise Exception("Error!")
|
taleinat/taltools | refs/heads/master | src/taltools/combinatorics.py | 1 | import functools
import operator
def n_choose_k(n, k):
result = 1
for i in range(k):
result *= n - i
result //= i + 1
return result
def n_next_to_k(n, k):
return functools.reduce(operator.mul, range(n, k, -1))
|
mindnervestech/mnrp | refs/heads/master | addons/website_google_map/__openerp__.py | 354 | {
'name': 'Website Google Map',
'category': 'Hidden',
'summary': '',
'version': '1.0',
'description': """
OpenERP Website Google Map
==========================
""",
'author': 'OpenERP SA',
'depends': ['base_geolocalize', 'website_partner', 'crm_partner_assign'],
'data': [
... |
PagerDuty/dd-agent | refs/heads/master | tests/checks/mock/test_network.py | 6 | # 3p
import mock
# project
from tests.checks.common import AgentCheckTest, Fixtures
def ss_subprocess_mock(*args, **kwargs):
if args[0][-1] == '-4':
return Fixtures.read_file('ss_ipv4')
elif args[0][-1] == '-6':
return Fixtures.read_file('ss_ipv6')
def netstat_subprocess_mock(*args, **kwarg... |
titasakgm/brc-stock | refs/heads/master | openerp/addons/account/wizard/account_move_line_unreconcile_select.py | 56 | # -*- 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... |
mt2d2/servo | refs/heads/master | tests/wpt/harness/wptrunner/update/base.py | 196 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
exit_unclean = object()
exit_clean = object()
class Step(object):
provides = []
def __init__(self, logger):
... |
Bogh/django-oscar | refs/heads/master | src/oscar/apps/catalogue/migrations/0004_auto_20150217_1710.py | 67 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0003_data_migration_slugs'),
]
operations = [
migrations.AlterField(
model_name='category',
... |
dezynetechnologies/odoo | refs/heads/8.0 | openerp/addons/base/res/res_config.py | 243 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... |
consulo/consulo-python | refs/heads/master | plugin/src/main/dist/helpers/python-skeletons/numpy/__init__.py | 80 | """Skeleton for 'numpy' module.
Project: NumPy 1.8.0 <http://www.numpy.org//>
"""
from . import core
from .core import *
__all__ = []
__all__.extend(core.__all__) |
rgeleta/odoo | refs/heads/8.0 | openerp/report/render/__init__.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... |
kawamon/hue | refs/heads/master | desktop/core/src/desktop/lib/connectors/api_tests.py | 2 | #!/usr/bin/env python
## -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 ... |
girving/tensorflow | refs/heads/master | tensorflow/python/estimator/inputs/queues/feeding_functions.py | 20 | # 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... |
rajat1994/scikit-learn | refs/heads/master | examples/decomposition/plot_sparse_coding.py | 247 | """
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... |
sandeepkbhat/pylearn2 | refs/heads/master | pylearn2/scripts/__init__.py | 49 | """
Some scripts define objects that we want to import via yaml files
that we pass to the script, so this directory must be a python
module, rather than just a directory full of scripts.
"""
|
br0ziliy/oh-my-vagrant | refs/heads/master | extras/centos-ci.py | 1 | #!/usr/bin/python
# modified from:
# https://github.com/kbsingh/centos-ci-scripts/blob/master/build_python_script.py
# usage: centos-ci.py giturl [branch [commands]]
import os
import sys
import json
import urllib
import subprocess
url_base = 'http://admin.ci.centos.org:8080'
apikey = os.environ.get('DUFFY_API_KEY')
... |
RagBillySandstone/google-python-exercises | refs/heads/master | basic/solution/mimic.py | 208 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... |
Nyancoins/NyanFaucet | refs/heads/master | nyanfaucet/cryptocoin/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
altairpearl/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_gradient_boosting.py | 43 | """
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import warnings
import numpy as np
from itertools import product
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import coo_matrix
from sklearn import datasets
from sklearn.base import clo... |
ckohl/illumos-kvm-cmd | refs/heads/master | scripts/tracetool/backend/ust.py | 114 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LTTng User Space Tracing backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajno... |
googlearchive/cloud-playground | refs/heads/master | __pg/secret.py | 2 | """Class to maintain application secrets in the datastore."""
from webapp2_extras import security
from . import settings
from google.appengine.ext import ndb
class Secret(ndb.Model):
"""A model which stores secret keys."""
secret_key = ndb.StringProperty(indexed=False)
created = ndb.DateTimeProperty(auto_now... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/weapon_capacitor/cap_sorosuub_dynamo_mk2.py | 85615 | import sys
def setup(core, object):
return |
VasuAgrawal/tartanHacks2015 | refs/heads/master | site/flask/lib/python2.7/site-packages/werkzeug/routing.py | 27 | # -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
When it comes to combining multiple controller or view functions (however
you want to call them) you need a dispatcher. A simple way would be
applying regular expression tests on the ``PATH_INFO`` and calling
registered callback fun... |
vathpela/blivet | refs/heads/master | blivet/formats/multipath.py | 5 | # multipath.py
# multipath device formats
#
# Copyright (C) 2009 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... |
prarthitm/edxplatform | refs/heads/master | common/djangoapps/microsite_configuration/tests/test_admin.py | 46 | """
Tests for microsite admin
"""
from django.contrib.admin.sites import AdminSite
from django.http import HttpRequest
from microsite_configuration.admin import MicrositeAdmin
from microsite_configuration.models import Microsite
from microsite_configuration.tests.tests import DatabaseMicrositeTestCase
class Microsit... |
ADemonisis/mitmproxy | refs/heads/master | libmproxy/contrib/jsbeautifier/unpackers/urlencode.py | 221 | #
# Trivial bookmarklet/escaped script detector for the javascript beautifier
# written by Einar Lielmanis <einar@jsbeautifier.org>
# rewritten in Python by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# Will always return valid javascript: if `detect()` is false, `code` is
# returned, unmodified.
#
# usage:... |
brianwoo/django-tutorial | refs/heads/master | ENV/lib/python2.7/site-packages/django/utils/decorators.py | 118 | "Functions that help with dynamically creating decorators for views."
try:
from contextlib import ContextDecorator
except ImportError:
ContextDecorator = None
from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps
from django.utils import six
class classonlymethod(classmethod):
def __get__(se... |
townbull/keystone-dtrust | refs/heads/dev/domain-trusts | keystone/tests/test_sql_upgrade.py | 2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
clokep/pelican-plugins | refs/heads/master | extract_toc/__init__.py | 84 | from .extract_toc import *
|
heeraj123/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/plugins/twisted_portforward.py | 83 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.application.service import ServiceMaker
TwistedPortForward = ServiceMaker(
"Twisted Port-Forwarding",
"twisted.tap.portforward",
"A simple port-forwarder.",
"portforward")
|
mugurrus/superdesk-core | refs/heads/master | apps/publish/odbc_test.py | 7 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import... |
asartori/mopidy-cd | refs/heads/master | mopidy_cd/__init__.py | 1 | from __future__ import unicode_literals
import os
from mopidy import config, ext
__version__ = '0.5'
class Extension(ext.Extension):
dist_name = 'Mopidy-Cd'
ext_name = 'cd'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')... |
aavanian/bokeh | refs/heads/master | bokeh/protocol/messages/__init__.py | 8 | '''
'''
from __future__ import absolute_import
from ..exceptions import ProtocolError
index = {}
def register(cls):
''' Decorator to add a Message (and its revision) to the Protocol index.
Example:
.. code-block:: python
@register
class some_msg_1(Message):
... |
banga/powerline-shell | refs/heads/master | test/segments_test/git_stash_test.py | 3 | import unittest
import mock
import tempfile
import shutil
import sh
import powerline_shell.segments.git_stash as git_stash
from powerline_shell.utils import RepoStats
class GitStashTest(unittest.TestCase):
def setUp(self):
self.powerline = mock.MagicMock()
self.dirname = tempfile.mkdtemp()
... |
amjadm61/bedrock | refs/heads/master | vendor-local/lib/python/south/management/commands/graphmigrations.py | 129 | """
Outputs a graphviz dot file of the dependencies.
"""
from __future__ import print_function
from optparse import make_option
import re
import textwrap
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from south.migration import Migrations, all_migrations
clas... |
DelazJ/QGIS | refs/heads/master | tests/src/python/test_qgsfiledownloader.py | 16 | # -*- coding: utf-8 -*-
"""
Test the QgsFileDownloader class
Run test with:
LC_ALL=en_US.UTF-8 ctest -V -R PyQgsFileDownloader
.. note:: 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 versio... |
CPedrini/TateTRES | refs/heads/master | handler.py | 1 | #-*- encoding: utf-8 -*-
import random, time, sys
# Librerias de mi autoria, permiten respectivamente: Scrapear eRepublik, scrapear datos de RW's, scrapear eventos de eRepublik de forma automatica
from erapi import ErAPI
from watcher import Watcher
from events import Events
from serversocket import ServerSocket
clas... |
rowhit/h2o-2 | refs/heads/master | py/testdir_multi_jvm/test_rf_float_rand_fvec.py | 9 | import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_rf
# fyi max FP single precision (hex rep. 7f7f ffff) approx. 3.4028234 * 10**38"
def write_syn_dataset(csvPathname, rowCount, colCount, headerData):
dsf = open(csvPathname, "... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/evaluate/compiled/mixed.py | 1 | """
Used only for REPL Completion.
"""
import inspect
from jedi import common
from jedi.parser.fast import FastParser
from jedi.evaluate import compiled
from jedi.cache import underscore_memoization
class MixedObject(object):
"""
A ``MixedObject`` is used in two ways:
1. It uses the default logic of ``... |
tommybobbins/ChristmasUnicornHat | refs/heads/master | christmas.py | 1 | #!/usr/bin/env python
import unicornhat as unicorn
import time, colorsys
def christmas_tree():
unicorn.brightness(0.4)
r = int(0)
g = int(255)
b = int(0)
rt = int(102)
gt = int(51)
bt = int(0)
unicorn.set_pixel(0,5,255,0,0)
unicorn.set_pixel(1,5,r,g,b)
unicorn.set_pixel... |
gooofy/voxforge | refs/heads/master | zamiaai/ai_context.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015, 2016, 2017, 2018 Guenter Bartsch
#
# 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/LIC... |
kevinmel2000/sl4a | refs/heads/master | python/src/Lib/encodings/bz2_codec.py | 501 | """ Python 'bz2_codec' Codec - bz2 compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import ... |
jmesteve/saas3 | refs/heads/master | openerp/addons/base/tests/test_res_lang.py | 384 | import unittest2
import openerp.tests.common as common
class test_res_lang(common.TransactionCase):
def test_00_intersperse(self):
from openerp.addons.base.res.res_lang import intersperse
assert intersperse("", []) == ("", 0)
assert intersperse("0", []) == ("0", 0)
assert intersp... |
fillycheezstake/MissionPlanner | refs/heads/master | Lib/lib2to3/fixes/fix_getcwdu.py | 61 | """
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixGetcwdu(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< 'os' trailer< dot='.' name='getcwdu' > any* >
... |
mglukhikh/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_0/_pkg1_0_0_1/_pkg1_0_0_1_0/_mod1_0_0_1_0_2.py | 30 | name1_0_0_1_0_2_0 = None
name1_0_0_1_0_2_1 = None
name1_0_0_1_0_2_2 = None
name1_0_0_1_0_2_3 = None
name1_0_0_1_0_2_4 = None |
bitmazk/django-document-library | refs/heads/master | document_library/cms_app.py | 1 | """CMS apphook for the ``document_library`` app."""
from django.utils.translation import ugettext_lazy as _
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
class DocumentLibraryApphook(CMSApp):
name = _("Document Library Apphook")
urls = ["document_library.urls"]
apphook_pool.regi... |
sabi0/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/IndentOnTopLevel.dst.py | 83 | class C:
def foo(self):
x = 1
y = 2
<caret>
def foo():
pass |
delhivery/django | refs/heads/master | tests/forms_tests/views.py | 452 | from django import forms
from django.views.generic.edit import UpdateView
from .models import Article
class ArticleForm(forms.ModelForm):
content = forms.CharField(strip=False, widget=forms.Textarea)
class Meta:
model = Article
fields = '__all__'
class ArticleFormView(UpdateView):
mode... |
paveldedik/blog | refs/heads/master | paveldedik/utils.py | 1 | # -*- coding: utf-8 -*-
import re
from unicodedata import normalize
from flask.views import MethodView
from . import app
_slug_regex = re.compile(r'[\t !"#$%&\'()*\-/<=>?@\[\\\]^_`{|},.]+')
def slugify(text, delim=u'-', length=60):
"""Generates an ASCII-only slug. A slug is the part of a URL which
ident... |
cpcloud/dynd-python | refs/heads/master | dynd/tests/test_nd_groupby.py | 3 | import sys
import unittest
from dynd import nd, ndt
"""
Todo: Fix this
class TestGroupBy(unittest.TestCase):
def test_immutable(self):
a = nd.array([
('x', 0),
('y', 1),
('x', 2),
('x', 3),
('y', 4)],
dtype='{A:... |
dezede/dezede | refs/heads/master | static_grouper/templatetags/static_grouper.py | 1 | from collections import defaultdict
from compressor.templatetags.compress import CompressorNode
from django.template import (
Library, Node, Template, TemplateSyntaxError, Context)
register = Library()
CONTEXT_VARIABLE_NAME = 'static_grouper_dict'
class AddStaticNode(Node):
def __init__(self, parser, toke... |
dhcmrlchtdj/toolkit | refs/heads/master | python/database.py | 1 | #!/usr/bin/env python3.4
# python 3.4.0
# mysql-connector 1.1.6
# mariadb 5.5.37
__version__ = "0.2.0"
import logging
import mysql.connector
logger = logging.getLogger(__name__)
class Connection:
""" Usage:
>>> import database
>>> db = database.Connection("user", "password", "database")
"""
... |
2ndQuadrant/ansible | refs/heads/master | lib/ansible/modules/cloud/docker/docker_image.py | 2 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# 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.1',
'status': ['prev... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/south/south/management/commands/test.py | 4 | from django.core.management.commands import test
import south.management.commands.syncdb
class Command(test.Command):
def handle(self, *args, **kwargs):
south.management.commands.syncdb.patch_for_test_db_setup()
super(Command, self).handle(*args, **kwargs)
|
peterwilletts24/Python-Scripts | refs/heads/master | plot_scripts/Rain/Diurnal/Diurnal_Surface_Flux_Embrace.py | 2 | """
Load npy xy, plot and save
"""
import os, sys
import matplotlib
#matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
from matplotlib import rc
from matplotlib.font_manager import FontProperties
from matplotlib import rc... |
chandolia/python-social-auth | refs/heads/master | social/backends/yahoo.py | 70 | """
Yahoo OpenId, OAuth1 and OAuth2 backends, docs at:
http://psa.matiasaguirre.net/docs/backends/yahoo.html
"""
from requests.auth import HTTPBasicAuth
from social.utils import handle_http_errors
from social.backends.open_id import OpenIdAuth
from social.backends.oauth import BaseOAuth2, BaseOAuth1
class YahooO... |
cogeorg/black_rhino | refs/heads/master | examples/firesales_simple/networkx/algorithms/link_analysis/tests/test_pagerank.py | 22 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import random
import networkx
# Example from
# A. Langville and C. Meyer, "A survey of eigenvector methods of web
# information retrieval." http://citeseer.ist.psu.edu/713792.html
class TestPageRank:
d... |
yeming233/rally | refs/heads/master | tests/unit/plugins/openstack/scenarios/zaqar/test_utils.py | 10 | # Copyright (c) 2014 Red Hat, 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 writ... |
mfherbst/spack | refs/heads/develop | lib/spack/spack/test/cmd/spec.py | 2 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
alirizakeles/zato | refs/heads/dsuch-f-gh723-add-exe-agent | code/alembic/versions/0028_ae3419a9_gh323_http_soap_migration.py | 7 | """gh323 http_soap migration
Revision ID: 0028_ae3419a9
Revises: 0027_e139a019
Create Date: 2014-11-03 19:31:51
"""
# revision identifiers, used by Alembic.
revision = '0028_ae3419a9'
down_revision = '0027_e139a019'
def upgrade():
pass
def downgrade():
pass
|
AudreyFrancisco/AliPhysics | refs/heads/master | PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/TriggerPatchTHnSparse.py | 41 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... |
akretion/hr | refs/heads/8.0 | __unported__/hr_policy_absence/__init__.py | 3 | #-*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, eith... |
krez13/scikit-learn | refs/heads/master | sklearn/ensemble/partial_dependence.py | 251 | """Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... |
mehdidc/scikit-learn | refs/heads/master | examples/cluster/plot_birch_vs_minibatchkmeans.py | 333 | """
=================================
Compare BIRCH and MiniBatchKMeans
=================================
This example compares the timing of Birch (with and without the global
clustering step) and MiniBatchKMeans on a synthetic dataset having
100,000 samples and 2 features generated using make_blobs.
If ``n_clusters... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/hair/rodian/hair_rodian_female_s45.py | 85615 | import sys
def setup(core, object):
return |
danielquinn/paperless | refs/heads/master | src/documents/views.py | 1 | from django.http import HttpResponse, HttpResponseBadRequest
from django.views.generic import DetailView, FormView, TemplateView
from django_filters.rest_framework import DjangoFilterBackend
from django.conf import settings
from django.utils import cache
from paperless.db import GnuPG
from paperless.mixins import Sess... |
glu10/trough | refs/heads/master | newsStore.py | 1 | """
Trough - a GTK+ RSS news reader
Copyright (C) 2017 Andrew Asp
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 late... |
portableant/open-context-py | refs/heads/master | opencontext_py/apps/contexts/tests.py | 9 | from django.test import TestCase
from opencontext_py.apps.ocitems.ocitem.models import OCitem
#from opencontext_py.apps.ldata.linkannotations.recursion import LinkRecursion
class TestPredicateValues(TestCase):
def setUp(self):
self.oc_item = OCitem(
).get_item('9E474B89-E36B-4B9D-2D38-7C7CCBD... |
alexgorban/models | refs/heads/master | research/syntaxnet/examples/dragnn/tutorial_2.py | 18 | """Second example: separate tagger and parser."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import tensorflow as tf
from google.protobuf import text_format
from dragnn.protos import spec_pb2
from dragnn.python import graph_builder
from ... |
totalgood/nlpia | refs/heads/master | src/nlpia/book/examples/ch06_word2vec_embedding_viz.py | 1 | # script adopted from https://gist.github.com/lampts/026a4d6400b1efac9a13a3296f16e655
import gensim
import numpy as np
import tensorflow as tf
from nlpia.loaders import get_data
from tensorflow.contrib.tensorboard.plugins import projector
words = ('Sacramento', 'California', 'Oregon', 'Salem', 'Washington', 'Olympia'... |
gcode-mirror/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg03-metro.lv2/waflib/Tools/c_config.py | 69 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,shlex,sys
from waflib import Build,Utils,Task,Options,Logs,Errors,ConfigSet,Runner
from waflib.TaskGen import after_method,feature
from waflib.Configure import co... |
larsmans/scipy | refs/heads/master | scipy/sparse/csgraph/tests/test_reordering.py | 93 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal
from scipy.sparse.csgraph import reverse_cuthill_mckee,\
maximum_bipartite_matching
from scipy.sparse import diags, csr_matrix, coo_matrix
def test_graph_reverse_cuthill_mckee():
A = ... |
torchbox/wagtail | refs/heads/master | wagtail/documents/migrations/0005_document_collection.py | 24 | # -*- coding: utf-8 -*-
from django.db import migrations, models
import wagtail.core.models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0025_collection_initial_data'),
('wagtaildocs', '0004_capitalizeverbose'),
]
operations = [
migrations.AddField(
... |
msadat/python-scripts | refs/heads/master | delete_atoms_GB_point.py | 1 | #Author: Mohammad R. Sadat
#PhD candidate
#Dept of CEEM, U of A
#this script randomly deletes atoms from a grain boundary while maintaining stoichiometry and writes data in 'full' style format after deletion
def delAtoms(x,t):
"""x = array of xyz data file with the atom types,
t = list of atoms to be delet... |
krishauser/Klampt | refs/heads/master | Python/klampt/io/open3d_convert.py | 1 | """Conversions to and from the Open3D library.
Open3D is useful for doing various point cloud processing routines.
It can be installed using pip as follows::
pip install open3d-python
"""
import open3d
from klampt import PointCloud,TriangleMesh,VolumeGrid,Geometry3D
from ..model import geometry
def to_open3d(o... |
timm/timmnix | refs/heads/master | pypy3-v5.5.0-linux64/lib-python/3/test/test_cmd_line_script.py | 1 | # tests command line execution of scripts
import importlib
import importlib.machinery
import zipimport
import unittest
import sys
import os
import os.path
import py_compile
import textwrap
from test import support
from test.script_helper import (
make_pkg, make_script, make_zip_pkg, make_zip_script,
assert_py... |
NMGRL/pychron | refs/heads/develop | pychron/entry/export/xml_irradiation_exporter.py | 2 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... |
AkA84/edx-platform | refs/heads/master | lms/djangoapps/survey/tests/test_utils.py | 62 | """
Python tests for the Survey models
"""
from collections import OrderedDict
from django.test.client import Client
from django.contrib.auth.models import User
from survey.models import SurveyForm
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import Modul... |
mmbtba/odoo | refs/heads/8.0 | addons/l10n_be_intrastat/__init__.py | 258 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
digideskio/st2contrib | refs/heads/master | packs/github/actions/add_status.py | 15 | from github import GithubObject
from lib.base import BaseGithubAction
__all__ = [
'AddCommitStatusAction'
]
class AddCommitStatusAction(BaseGithubAction):
def run(self, user, repo, sha, state, target_url=None, description=None):
target_url = target_url or GithubObject.NotSet
description = de... |
mhollick/strider | refs/heads/master | lib/strider/utils/__init__.py | 4 | # Copyright 2015 Michael DeHaan <michael.dehaan/gmail>
#
# 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... |
Maccimo/intellij-community | refs/heads/master | python/testData/stubs/variableAnnotationsInExternalFiles/main.py | 34 | from .lib import attr
x = attr
|
scottpurdy/nupic | refs/heads/master | tests/integration/nupic/algorithms/tm_test.py | 10 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
HewlettPackard/oneview-ansible | refs/heads/master | library/oneview_certificates_server.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
darina/omim | refs/heads/master | tools/python/InstrumentsTraceParser.py | 24 | #!/usr/bin/env python2.7
from __future__ import print_function
import struct
import sys
import numpy
class Analyzer:
"""
The binary format is
time since the beginning of the measurement : double
unknown and irrelevant field : double
momentary consumption calculated for the current tim... |
faust93/franco_geehrc_f93 | refs/heads/nightlies-4.4 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
lenw/ansible-modules-core | refs/heads/devel | cloud/amazon/ec2_lc.py | 47 | #!/usr/bin/python
# 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 distributed... |
guewen/odoo | refs/heads/master | addons/base_setup/res_config.py | 38 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
nevir/plexability | refs/heads/master | extern/depot_tools/git_try.py | 18 | #!/usr/bin/python
# Copyright (c) 2011 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.
"""Wrapper for trychange.py for git checkout."""
import logging
import sys
import breakpad # pylint: disable=W0611
from scm import G... |
eddyb/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/pipes.py | 38 | from cgi import escape
import gzip as gzip_module
import re
import time
import types
import uuid
from cStringIO import StringIO
def resolve_content(response):
return b"".join(item for item in response.iter_content(read_file=True))
class Pipeline(object):
pipes = {}
def __init__(self, pipe_string):
... |
faywong/FFPlayer | refs/heads/trunk | project/jni/python/src/Demo/threads/Coroutine.py | 42 | # Coroutine implementation using Python threads.
#
# Combines ideas from Guido's Generator module, and from the coroutine
# features of Icon and Simula 67.
#
# To run a collection of functions as coroutines, you need to create
# a Coroutine object to control them:
# co = Coroutine()
# and then 'create' a subsidiary ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.