repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
convexopt/gpkit | refs/heads/master | gpkit/interactive/ractor.py | 1 | "Implements Ractor-based interactive CADtoons"
from string import Template
import itertools
import numpy as np
try:
from IPython.display import display, HTML
except ImportError:
pass
from ..solution_array import SolutionArray
def showcadtoon(title, css=""):
"Displays cadtoon as iPython HTML"
with op... |
nathanaevitas/odoo | refs/heads/master | openerp/addons/procurement_jit_stock/procurement_jit_stock.py | 64 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
sicknemesis/AK-OnePone | refs/heads/sicki-11.0 | tools/perf/scripts/python/net_dropmonitor.py | 1258 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
xuxiaoxin/micropython | refs/heads/master | tests/misc/features.py | 87 | # mad.py
# Alf Clement 27-Mar-2014
#
zero=0
three=3
print("1")
print("2")
print(three)
print("{}".format(4))
five=25//5
print(int(five))
j=0
for i in range(4):
j += i
print(j)
print(3+4)
try:
a=4//zero
except:
print(8)
print("xxxxxxxxx".count("x"))
def ten():
return 10
print(ten())
a=[]
for i in range(13):
a.appen... |
dzheng256/PittAPI | refs/heads/master | PittAPI/lab.py | 2 | '''
The Pitt API, to access workable data of the University of Pittsburgh
Copyright (C) 2015 Ritwik Gupta
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 ... |
CristianBB/SickRage | refs/heads/develop | lib/sqlalchemy/ext/automap.py | 75 | # ext/automap.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system
which automatica... |
chronicwaffle/PokemonGo-DesktopMap | refs/heads/master | app/pywin/Lib/idlelib/idle_test/test_searchengine.py | 21 | '''Test functions and SearchEngine class in SearchEngine.py.'''
# With mock replacements, the module does not use any gui widgets.
# The use of tk.Text is avoided (for now, until mock Text is improved)
# by patching instances with an index function returning what is needed.
# This works because mock Text.get does not ... |
pselle/calibre | refs/heads/master | src/calibre/gui2/dialogs/restore_library.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import (QDialog, QLabel, QVBoxLayout, QDialogButtonBox,
QProgressBar, QSize, QTimer, pyqtSignal, Qt)... |
chrisfilda/edx_platform | refs/heads/master | lms/djangoapps/branding/tests.py | 10 | """
Tests for branding page
"""
import datetime
from pytz import UTC
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.test.utils import override_settings
from django.test.client import RequestFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase... |
analyseuc3m/ANALYSE-v1 | refs/heads/master | common/lib/xmodule/xmodule/video_module/__init__.py | 153 | """
Container for video module and it's utils.
"""
# Disable wildcard-import warnings.
# pylint: disable=wildcard-import
from .transcripts_utils import *
from .video_utils import *
from .video_module import *
from .bumper_utils import *
|
ClearCorp/server-tools | refs/heads/9.0 | auth_totp/controllers/main.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from datetime import datetime, timedelta
import json
from werkzeug.contrib.securecookie import SecureCookie
from openerp import _, http, registry, SUPERUSER_ID
from openerp.api import Environ... |
jgmanzanas/CMNT_004_15 | refs/heads/master | project-addons/stock_valued_picking/stock.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Pexego All Rights Reserved
# $Jesús Ventosinos Mayor <jesus@pexego.es>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... |
singingwolfboy/seamless-karma | refs/heads/master | seamless_karma/extensions.py | 1 | # coding=utf-8
from __future__ import unicode_literals
from flask.ext.heroku import Heroku
heroku = Heroku()
from raven.contrib.flask import Sentry
sentry = Sentry()
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from .subclass import Api
api = Api(prefix="/api")
from .restful import *
|
nicobustillos/odoo | refs/heads/8.0 | openerp/report/printscreen/ps_form.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... |
Varriount/Colliberation | refs/heads/master | libs/twisted/test/process_stdinreader.py | 59 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Script used by twisted.test.test_process on win32."""
import sys, time, os, msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
sys.stdout.write("out\n")
sys.stdout.flush()
sys.stderr.writ... |
juanalfonsopr/odoo | refs/heads/8.0 | addons/account_chart/__init__.py | 526 | # -*- 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... |
MartinHvidberg/jobman | refs/heads/master | misc_and_fun/fun_ftp/ecpass.py | 1 | """
Expect input like:
# FTP sites
conn: 1: ftp.somewhere.net
1: host: ftp.some.net
1: port:
1: prot: Explicit FTP over TLS if available
1: user: auser
1: pass: 98765
1: ddir: /public_html/auser/
conn: 2: ftp.work.dk
2: host: ftp.work.dk
2: port: 21
2: prot: Explicit FTP over TLS if available
2: user: emp678
2: pass:... |
miguelsousa/Robofont-scripts | refs/heads/master | PenBallWizard/PenBallWizard.roboFontExt/lib/penBallWizard/parameterObjects/vanillaParameterObjects.py | 2 | # coding=utf-8
# Loïc Sander — 2014
from baseParameter import SingleValueParameter
from vanilla import Group, Slider, EditText, TextBox, CheckBox
class BaseParameterVanillaInput:
vanillaInputs = []
def __init__(self, parameter, posSize, callback=None):
self.parameter = parameter
self.callback... |
XtremeTeam/Lucy-bot | refs/heads/master | brain/plugins/gstatus.py | 1 | #===islucyplugin===
# -*- coding: utf-8 -*-
def change_bot_status(gch, status, show):
prs=xmpp.protocol.Presence(gch+'/'+get_bot_nick(gch))
if status:
prs.setStatus(status)
if show:
prs.setShow(show)
JCON.send(prs)
def status_change_tmp(type, source, par... |
taotie12010/bigfour | refs/heads/master | common/djangoapps/student/management/commands/anonymized_id_mapping.py | 186 | # -*- coding: utf-8 -*-
"""Dump username, per-student anonymous id, and per-course anonymous id triples as CSV.
Give instructors easy access to the mapping from anonymized IDs to user IDs
with a simple Django management command to generate a CSV mapping. To run, use
the following:
./manage.py lms anonymized_id_mappin... |
mattrobenolt/invoke | refs/heads/master | invoke/vendor/yaml3/tokens.py | 986 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... |
mfelker/p2pool | refs/heads/master | p2pool/test/bitcoin/test_script.py | 275 | import unittest
from p2pool.bitcoin import script
class Test(unittest.TestCase):
def test_all(self):
data = '76 A9 14 89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA 88 AC'.replace(' ', '').decode('hex')
self.assertEquals(
list(script.parse(data)),
[('UNK_118... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scattercarpet/selected/marker/_size.py | 1 | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="scattercarpet.selected.marker", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_n... |
valentin-krasontovitsch/ansible | refs/heads/devel | lib/ansible/modules/cloud/docker/_docker.py | 71 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Cove Schneider
# Copyright: (c) 2014, Joshua Conner <joshua.conner@gmail.com>
# Copyright: (c) 2014, Pavel Antonov <antonov@adwz.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import abso... |
carmilso/TFG | refs/heads/master | scripts/formatNumbers_en.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
EXAMPLE USAGE: cat ../logs/google_en.log | ./formatNumbers_en.py
'''
import sys
import codecs
import fileinput
from string import *
from re import *
from num2words import num2words
UTF8Reader = codecs.getreader('utf-8')
sys.stdin = UTF8Reader(sys.stdin)
hourspatter... |
molotof/infernal-twin | refs/heads/master | build/pip/build/lib.linux-i686-2.7/pip/_vendor/requests/api.py | 435 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... |
rotofly/odoo | refs/heads/master | addons/hw_posbox_upgrade/controllers/main.py | 172 | # -*- coding: utf-8 -*-
import logging
import os
import time
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import threading
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
upgrade_template = """
<!DOCTY... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/utils/dia2django.py | 37 | # -*- coding: UTF-8 -*-
##Author Igor Támara igor@tamarapatino.org
##Use this little program as you wish, if you
#include it in your work, let others know you
#are using it preserving this note, you have
#the right to make derivative works, Use it
#at your own risk.
#Tested to work on(etch testing 13-08-2007):
# Pytho... |
bennettp123/CouchPotatoServer | refs/heads/master | couchpotato/core/providers/metadata/base.py | 5 | from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.helpers.variable import mergeDicts
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
import os
import shutil
impo... |
mezz64/home-assistant | refs/heads/dev | homeassistant/components/remote/reproduce_state.py | 16 | """Reproduce an Remote state."""
import asyncio
import logging
from typing import Any, Dict, Iterable, Optional
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
)
from homeassistant.core import Context, State
from homeassistant.helpers.typing... |
guerrerocarlos/odoo | refs/heads/8.0 | addons/sale/wizard/sale_line_invoice.py | 222 | # -*- 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... |
anqxyr/jarvis | refs/heads/master | jarvis/stats.py | 1 | #!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import pyscp
import textwrap
from dominate import tags as dt
from . import core, lex, ext
########################... |
rgommers/scipy | refs/heads/master | scipy/linalg/decomp_cholesky.py | 17 | """Cholesky decomposition functions."""
from numpy import asarray_chkfinite, asarray, atleast_2d
# Local imports
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
__all__ = ['cholesky', 'cho_factor', 'cho_solve', 'cholesky_banded',
'cho_solve_banded']
def _cholesky(a, lower... |
FlorentChamault/My_sickbeard | refs/heads/master | sickbeard/clients/requests/packages/charade/langcyrillicmodel.py | 184 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Ri... |
jhuapl-marti/marti | refs/heads/master | env-crits/lib/python2.7/site-packages/pip/_vendor/cachecontrol/wrapper.py | 953 | from .adapter import CacheControlAdapter
from .cache import DictCache
def CacheControl(sess,
cache=None,
cache_etags=True,
serializer=None,
heuristic=None):
cache = cache or DictCache()
adapter = CacheControlAdapter(
cache,
c... |
blockstack/packaging | refs/heads/master | imported/future/src/libpasteurize/fixes/fix_printfunction.py | 71 | u"""
Fixer for print: from __future__ import print_function.
"""
from lib2to3 import fixer_base
from libfuturize.fixer_util import future_import
class FixPrintfunction(fixer_base.BaseFix):
# explicit = True
PATTERN = u"""
power< 'print' trailer < '(' any* ')' > any* >
"""
de... |
javierder/dogestart.me | refs/heads/master | django/contrib/admin/templatetags/admin_modify.py | 106 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and in... |
sssemil/cjdns | refs/heads/socket | node_build/dependencies/libuv/build/gyp/test/rules-rebuild/src/make-sources.py | 337 | #!/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.
import sys
assert len(sys.argv) == 4, sys.argv
(in_file, c_file, h_file) = sys.argv[1:]
def write_file(filename, contents):
open(filenam... |
1st/django | refs/heads/master | django/views/decorators/debug.py | 712 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... |
enthought/etsproxy | refs/heads/master | enthought/pyface/split_dialog.py | 1 | # proxy module
from pyface.split_dialog import *
|
broodplank/broodKernel-zImage | refs/heads/master | scripts/rt-tester/rt-tester.py | 1094 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... |
SummerCamp17/Gymkhana-Nominations | refs/heads/master | forms/migrations/0006_auto_20170613_1626.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-13 16:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forms', '0005_auto_20170613_0824'),
]
operations = [
migrations.AlterField(... |
Seichis/seldon-server | refs/heads/master | external/predictor/python/template/server.py | 20 | import importlib
from flask import Flask, jsonify
from flask import request
app = Flask(__name__)
import json
import pprint
app.config.from_object('server_config')
_recs_mod = importlib.import_module(app.config['PREDICTION_ALG'])
def extract_input():
client = request.args.get('client')
j = json.loads(request.... |
ajmirsky/couchdb-python | refs/heads/master | couchdb/tests/package.py | 17 | # -*- coding: utf-8 -*-
import unittest
import couchdb
class PackageTestCase(unittest.TestCase):
def test_exports(self):
expected = set([
# couchdb.client
'Server', 'Database', 'Document',
# couchdb.http
'HTTPError', 'PreconditionFailed', 'ResourceNotFound'... |
abhishekarora12/ansible | refs/heads/devel | lib/ansible/plugins/lookup/subelements.py | 103 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... |
AnasGhrab/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_truncated_svd.py | 240 | """Test truncated SVD transformer."""
import numpy as np
import scipy.sparse as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.utils import check_random_state
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
assert_raises, assert_greater,
... |
sergiodlc/cmarked | refs/heads/master | src/cmark.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example for using the shared library from python
# Will work with either python 2 or python 3
# Requires cmark library to be installed
#from ctypes import CDLL, c_char_p, c_long
from ctypes import *
import sys
import platform
sysname = platform.system()
if sysname == ... |
belltailjp/scikit-learn | refs/heads/master | examples/linear_model/plot_lasso_lars.py | 363 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... |
liorvh/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/applypatch.py | 128 | # Copyright (C) 2010 Google Inc. 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 conditions and th... |
gnowledge/OTM2 | refs/heads/master | opentreemap/treemap/migrations/0069_mobile_search_config.py | 3 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
# Change treePhoto search to mapFeaturePhoto search
for instance in orm.Instance.objects.all():
if 'm... |
slevenhagen/odoo-npg | refs/heads/8.0 | addons/base_action_rule/__openerp__.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
amyvmiwei/skia | refs/heads/master | platform_tools/android/tests/test_variables.py | 132 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Common variables for tests.
"""
import os
# Find this file so we can find the python files to test.
SCRIPT_DIR = os.path.dirname(__file__)
ANDROID_DIR = os.path.... |
equialgo/scikit-learn | refs/heads/master | sklearn/svm/tests/test_bounds.py | 49 | import warnings
import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.utils.testing import assert_true, raises
from sklearn.utils.testing import assert_raise_message
dense... |
JJorgeDSIC/ML_PORTAL_CONCEPT | refs/heads/master | ml_portal/prhlt2/celery.py | 1 | from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'prhlt2.settings')
from django.conf import settings
app = Celery('prhlt2')
# Using a string here means the worker will not h... |
funbaker/astropy | refs/heads/master | astropy/utils/compat/numpycompat.py | 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a collection of monkey patches and workarounds for bugs in
earlier versions of Numpy.
"""
from ...utils import minversion
__all__ = ['NUMPY_LT_1_10_4', 'NUMPY_LT_1_11', 'NUMPY_LT_1_11_2',
'NUMPY_LT_1_12', 'NUMPY_LT_1_13', 'NUMPY_LT... |
Beercow/viper | refs/heads/master | viper/modules/rats/bozok.py | 6 | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/Bozok.py
import pefile
def extract_config(raw_data):
pe = pefile.PE(data=raw_data)
try:
rt_string_idx = [
entry.id for entry in
pe.DIRECTORY_ENTRY_RESOURCE.entries
... |
chriskmanx/qmole | refs/heads/master | QMOLEDEV/pygobject-2.16.1/examples/option.py | 10 | #!/usr/bin/env python
# gnome-python/pygobject/examples/option.py
from gobject.option import OptionGroup, OptionParser, make_option
group = OptionGroup("example", "OptionGroup Example", "Shows all example options",
option_list = [
make_option("--example",
action="store_true",
... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/gdata/tests/gdata_tests/base/service_test.py | 89 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... |
creasyw/IMTAphy | refs/heads/master | documentation/toolchain/Sphinx-0.5dev_20081110-py2.5.egg/sphinx/_jinja.py | 4 | # -*- coding: utf-8 -*-
"""
sphinx._jinja
~~~~~~~~~~~~~
Jinja glue.
:copyright: 2007-2008 by Georg Brandl, Horst Gutmann.
:license: BSD.
"""
import codecs
from os import path
from sphinx.util import mtimes_of_files
from sphinx.application import TemplateBridge
from jinja import Environment
from... |
Teamxrtc/webrtc-streaming-node | refs/heads/master | third_party/webrtc/src/chromium/src/third_party/scons-2.0.1/engine/SCons/Tool/MSCommon/__init__.py | 61 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... |
morph027/ansible-modules-extras | refs/heads/devel | cloud/openstack/os_port_facts.py | 30 | #!/usr/bin/python
# Copyright (c) 2016 IBM
#
# This module 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 software is distri... |
shakamunyi/nova | refs/heads/master | nova/virt/vmwareapi/driver.py | 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... |
yhe39/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_ro_connect-src_cross-origin.py | 23 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "connect-src http://ww... |
AaronTao1990/scrapy | refs/heads/master | scrapy/spidermiddlewares/referer.py | 177 | """
RefererMiddleware: populates Request referer field, based on the Response which
originated it.
"""
from scrapy.http import Request
from scrapy.exceptions import NotConfigured
class RefererMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
if not crawler.settings.getbool('REFERER_ENA... |
techdragon/django | refs/heads/master | tests/prefetch_related/test_uuid.py | 48 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... |
signed/intellij-community | refs/heads/master | python/testData/MockSdk3.4/Lib/collections/abc.py | 274 | from _collections_abc import *
from _collections_abc import __all__
|
OptimalPayments/Python_SDK | refs/heads/master | src/PythonNetBanxSDK/HostedPayment/BillingDetails.py | 1 | '''
Created on 05-Feb-2015
@author: Asawari.Vaidya
'''
from PythonNetBanxSDK.common.DomainObject import DomainObject
class BillingDetails(DomainObject):
'''
classdocs
'''
def __init__(self, obj):
'''
Constructor
'''
# Handler dictionary
handler = dict()
... |
def-/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/encodings/cp1255.py | 593 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... |
BT-cserra/sale-workflow | refs/heads/8.0 | __unported__/sale_line_description/__openerp__.py | 3 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Alex Comba <alex.comba@agilebg.com>
#
# 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... |
zihua/scikit-learn | refs/heads/master | sklearn/datasets/california_housing.py | 22 | """California housing dataset.
The original database is available from StatLib
http://lib.stat.cmu.edu/
The data contains 20,640 observations on 9 variables.
This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, averag... |
Sing-Li/go-buildpack | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/ctypes/test/runtests.py | 57 | """Usage: runtests.py [-q] [-r] [-v] [-u resources] [mask]
Run all tests found in this directory, and print a summary of the results.
Command line flags:
-q quiet mode: don't print anything while the tests are running
-r run tests repeatedly, look for refcount leaks
-u<resources>
Add resources t... |
40123103/2015cd_40123103 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/heapq.py | 628 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
nitely/Spirit | refs/heads/master | spirit/user/signals.py | 1 | # -*- coding: utf-8 -*-
from django.db.models.signals import post_save
from django.contrib.auth import get_user_model
from spirit.core.conf import settings
from .models import UserProfile
User = get_user_model()
Notify = UserProfile.Notify
NOTIFY = {
'never': Notify.NEVER,
'immediately': Notify.IMMEDIATELY,
... |
McGillX/edx_data_research | refs/heads/master | edx_data_research/tasks/tasks_email.py | 1 | import os
import smtplib
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from edx_data_research.tasks.tasks import Tasks
class Email(Tasks):
def __init__(self, args):
super(Email, self).__init__()
self.from_a... |
djeo94/CouchPotatoServer | refs/heads/master | couchpotato/environment.py | 56 | import os
from couchpotato.core.database import Database
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.loader import Loader
from couchpotato.core.settings import Settings
class Env(object):
_appname = 'CouchPotato'
''' E... |
imwiththou/GoAgent | refs/heads/master | local/gevent-1.0rc2/greentest/xtest_pep8.py | 2 | import sys
import os
sys.stderr.write('pep8 --version: ')
if os.system('pep8 --version'):
sys.exit('ERROR: pep8 script not found')
if not os.path.exists('gevent') and not os.path.exists('setup.py'):
os.chdir('..')
commands = [
'pep8 --show-source --max-line-length=160 gevent/ setup.py',
'pep8 --sh... |
objmagic/heron | refs/heads/master | integration-test/src/python/integration_test/topology/one_spout_two_bolts/one_spout_two_bolts.py | 8 | # copyright 2016 twitter. 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 agree... |
dominicelse/scipy | refs/heads/master | benchmarks/benchmarks/signal.py | 17 | from __future__ import division, absolute_import, print_function
from itertools import product
import numpy as np
try:
import scipy.signal as signal
except ImportError:
pass
from .common import Benchmark
class CalculateWindowedFFT(Benchmark):
def setup(self):
np.random.seed(5678)
# Cre... |
CPB9/mcc | refs/heads/master | thirdparty/protobuf/python/google/protobuf/internal/api_implementation.py | 80 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
pravsripad/mne-python | refs/heads/master_dev | mne/channels/tests/test_channels.py | 3 | # Author: Daniel G Wakeman <dwakeman@nmr.mgh.harvard.edu>
# Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from copy import deepcopy
from functools import partial
import pytest
import numpy as np
from scipy.io import savemat
from numpy.testing import assert_arra... |
SoreGums/bitcoinxt | refs/heads/master | contrib/linearize/linearize-hashes.py | 214 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pr... |
AICP/external_chromium_org | refs/heads/lp5.0 | third_party/closure_linter/closure_linter/common/error.py | 155 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... |
bharaths/CloudBot | refs/heads/benderbot | plugins/fact.py | 10 | import random
from cloudbot import hook
from cloudbot.util import http, web
types=['trivia', 'math', 'date', 'year']
@hook.command(autohelp=False)
def fact():
"""Gets a random fact about numbers or dates."""
fact_type = random.choice(types)
attempts = 0
while True:
try:
json = htt... |
mishbahr/djangocms-responsive-wrapper | refs/heads/master | responsive_wrapper/__init__.py | 58 | __version__ = '0.2.1'
|
mpld3/mpld3 | refs/heads/master | mpld3/tests/test_figure.py | 21 | """
Test creation of a figure
"""
import matplotlib.pyplot as plt
from .. import fig_to_dict
from numpy.testing import assert_equal
def test_basic_figure():
size = (8, 6)
dpi = 80
fig = plt.figure(figsize=size, dpi=dpi)
rep = fig_to_dict(fig)
plt.close(fig)
assert_equal(list(sorted(rep.keys()... |
Jiangshangmin/mpld3 | refs/heads/master | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 22 | import re, inspect, textwrap, pydoc
import sphinx
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots = config.get('use_plots', False)
NumpyDoc... |
hoangt/NOCulator | refs/heads/master | hring/hw/synthesis/scripts/RCnode_energy/energy.py | 6 | #!/usr/bin/env python
powers = map(lambda x: float(x.split()[1]) / 1000, open('SUMMARY.txt').readlines())
time = 3 * (2e-9)
baseline_energy = powers[0] * time
nj = 1000*1000*1000
print nj * baseline_energy, 'nJ'
for n in [1,2,3,4]:
print nj * (powers[n] - powers[0]) * time, 'nJ'
|
sophiavanvalkenburg/coala | refs/heads/master | coalib/output/dbus/__init__.py | 30 | """
This package holds dbus related objects. Dbus objects are used to communicate
between coala and other applications using dbus.
All dbus clients will first connect to the DbusServer, and request the
DbusServer to create documents which can be analyzed. The DbusServer internally
handles different clients separately ... |
mmcdermo/helpinghand | refs/heads/master | server/venv/lib/python2.7/site-packages/south/tests/otherfakeapp/migrations/0002_second.py | 176 | from south.db import db
from django.db import models
class Migration:
def forwards(self):
pass
def backwards(self):
pass
|
kawasaki2013/python-for-android-x86 | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/utils/Cryptlib_RC4.py | 48 | """Cryptlib RC4 implementation."""
from .cryptomath import *
from .RC4 import RC4
if cryptlibpyLoaded:
def new(key):
return Cryptlib_RC4(key)
class Cryptlib_RC4(RC4):
def __init__(self, key):
RC4.__init__(self, key, "cryptlib")
self.context = cryptlib_py.cryptCreateC... |
unseenlaser/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/process_linger.py | 140 |
"""Write to a file descriptor and then close it, waiting a few seconds before
quitting. This serves to make sure SIGCHLD is actually being noticed.
"""
import os, sys, time
print "here is some text"
time.sleep(1)
print "goodbye"
os.close(1)
os.close(2)
time.sleep(2)
sys.exit(0)
|
aioue/ansible | refs/heads/devel | hacking/conf2yaml.py | 15 | #!/usr/bin/env python
import ast
import yaml
import os
import sys
from ansible.parsing.yaml.dumper import AnsibleDumper
things = {}
stuff = {}
op_map = {
ast.Add: '+',
ast.Sub: '-',
ast.Mult: '*',
ast.Div: '/',
}
def get_values(values):
if not isinstance(values, list):
return get_value... |
deepak02/rasa_core | refs/heads/master | examples/concerts/policy.py | 1 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from rasa_core.policies.keras_policy import KerasPolicy
logger = logging.getLogger(__name__)
class ConcertPolicy(KerasPolicy):
def _build_model(sel... |
glogiotatidis/masterfirefoxos | refs/heads/master | masterfirefoxos/base/migrate/page/0007_auto_20150128_1239.py | 5 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import feincms.module.medialibrary.fields
class Migration(migrations.Migration):
dependencies = [
('medialibrary', '0002_auto_20150128_1239'),
('page', '0006_auto_20150128_0414'),
]
... |
HybridF5/jacket | refs/heads/master | jacket/compute/volume/encryptors/luks.py | 1 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... |
nicolargo/intellij-community | refs/heads/master | python/lib/Lib/pydoc.py | 69 | #!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
GenericStudent/home-assistant | refs/heads/dev | homeassistant/components/serial_pm/sensor.py | 16 | """Support for particulate matter sensors connected to a serial port."""
import logging
from pmsensor import serial_pm as pm
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONF_NAME
import homeassistant.hel... |
jbcayrou/scapy | refs/heads/master | scapy/contrib/avs.py | 26 | #! /usr/bin/env python
# http://trac.secdev.org/scapy/ticket/82
# scapy.contrib.description = AVS WLAN Monitor Header
# scapy.contrib.status = loads
from scapy.packet import *
from scapy.fields import *
from scapy.layers.dot11 import *
AVSWLANPhyType = { 0 : "Unknown",
1 : "FHSS 802.11 '97",
... |
Spooner/pixel-table | refs/heads/master | pixel_table/modes/message/__init__.py | 2 | from .message import Message |
xilax79/m8t4nt | refs/heads/master | mutant/dna.py | 1 | import re
class Dna:
"""
A mutant X detector class
Usage:
dna = Dna()
dna.is_mutant(["ATGG","CAGT","TGGT","GTGA"])
For more details, check please the attached documentation
"""
DNA_SEQUENCE_LENGTH = 4
def __init__(self):
self.dna, self.dna_len, self.valid = ([],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.