repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sergecodd/FireFox-OS | refs/heads/master | B2G/gecko/python/simplejson-2.1.1/simplejson/tests/__init__.py | 34 | import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... |
alheinecke/tensorflow-xsmm | refs/heads/master | tensorflow/python/platform/gfile.py | 106 | # 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... |
yusaira-khan/Brain-Soother | refs/heads/master | OpenBCI_Python/plugins/streamer_osc.py | 5 |
# requires pyosc
from OSC import OSCClient, OSCMessage
import plugin_interface as plugintypes
# Use OSC protocol to broadcast data (UDP layer), using "/openbci" stream. (NB. does not check numbers of channel as TCP server)
class StreamerOSC(plugintypes.IPluginExtended):
"""
Relay OpenBCI values to OSC clients
A... |
zzzombat/lucid-python-django | refs/heads/master | django/conf/locale/en/formats.py | 318 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... |
davidharrigan/django | refs/heads/master | django/utils/synch.py | 586 | """
Synchronization primitives:
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
"""
import contextlib
import threading
class RWLock(object):
"""
Classic implementation of reader-writer lock with preference to writers.
Readers can access a resource simult... |
jericksanjuan/lab-student-draft | refs/heads/master | lab_student_draft/students/views.py | 1 | from django.forms import ValidationError, Select
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from braces.views import SetHeadlineMixin, LoginRequiredMixin
from crudwrapper.views import UpdateWithInlinesView, InlineFormSet, BaseInlineFormSet
from crudwrapper.forms imp... |
derekjchow/models | refs/heads/master | research/syntaxnet/syntaxnet/graph_builder.py | 3 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Cinntax/home-assistant | refs/heads/dev | homeassistant/components/beewi_smartclim/__init__.py | 27 | """The beewi_smartclim component."""
|
bccp/nbodykit | refs/heads/master | nbodykit/tests/test_cache.py | 2 | from nbodykit import GlobalCache
from nbodykit.lab import UniformCatalog
from runtests.mpi import MPITest
@MPITest([1])
def test_cache(comm):
cat = UniformCatalog(nbar=10000, BoxSize=1.0, comm=comm)
cat['test'] = cat['Position'] ** 5
test = cat['test'].compute()
# cache should no longer be empty
... |
GreenWolf13/GordonLite | refs/heads/master | core/db.py | 24 | import os
import sqlite3
def get_db_connection(conn, name=''):
"returns an sqlite3 connection to a persistent database"
if not name:
name = '%s.%s.db' % (conn.nick, conn.server)
filename = os.path.join(bot.persist_dir, name)
return sqlite3.connect(filename, timeout=10)
bot.get_db_connection... |
zakuro9715/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/localflavor/pe/pe_region.py | 422 | # -*- coding: utf-8 -*-
"""
A list of Peru regions as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
REGION_CHOICES = (
('AMA', u'Amazonas'),
('ANC', u'Ancash'),
('APU', u'Apurímac'),
('ARE', u'Arequipa'),
('AYA', u'... |
Heart2009/buck | refs/heads/master | test/com/facebook/buck/java/testdata/fat_jar/print_lib_path.py | 47 | import os
import sys
import json
json.dump(dict(os.environ), sys.stdout)
|
berteh/import-audacity-labels-keyframes | refs/heads/master | pystache/parser.py | 2 | # coding: utf-8
"""
Exposes a parse() function to parse template strings.
"""
import re
from pystache import defaults
from pystache.parsed import ParsedTemplate
import collections
END_OF_LINE_CHARACTERS = ['\r', '\n']
NON_BLANK_RE = re.compile(r'^(.)', re.M)
# TODO: add some unit tests for this.
# TODO: add a t... |
gcodetogit/depot_tools | refs/heads/master | third_party/oauth2client/appengine.py | 154 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
Drooids/odoo | refs/heads/8.0 | addons/l10n_vn/__init__.py | 425 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... |
HiSPARC/station-software | refs/heads/master | user/python/Lib/email/test/test_email.py | 8 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
import textwrap
from cStringIO import StringIO
from random import choice
try:
from threading import Thread
ex... |
willzhang05/postgrestesting1 | refs/heads/master | postgrestesting1/lib/python3.5/site-packages/django/db/models/query_utils.py | 11 | """
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
from collections import namedtuple... |
luogu-dev/cyaron | refs/heads/master | examples/test_vector_bzoj4824.py | 2 | #!/usr/bin/env python
from cyaron import *
_n = ati([0,10,18,20,25,30,80,100,100,100,100])
for i in range(1, 11):
test_data = IO(file_prefix="keyborad", data_id=i)
n = _n[i]
ostr = String.random(n,charset="<>")
if i==7:
ostr = '<'*n
if i==8:
ostr='<'*(n-1)+'>'
test_data.input... |
GreenteaOS/Kernel | refs/heads/master | third-party/reactos/sdk/lib/3rdparty/freetype/src/tools/docmaker/formatter.py | 45 | #
# formatter.py
#
# Convert parsed content blocks to a structured document (library file).
#
# Copyright 2002-2016 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing ... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/platform/tf_logging.py | 74 | # 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... |
Kazade/NeHe-Website | refs/heads/master | google_appengine/google/appengine/ext/mapreduce/input_readers.py | 1 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
gatsinski/kindergarten-management-system | refs/heads/master | kindergarten_management_system/kms/contrib/children/migrations/0002_child_personal_id.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('children', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='child',
name='personal... |
seanwestfall/django | refs/heads/master | tests/template_tests/syntax_tests/test_now.py | 443 | from datetime import datetime
from django.test import SimpleTestCase
from django.utils.formats import date_format
from ..utils import setup
class NowTagTests(SimpleTestCase):
@setup({'now01': '{% now "j n Y" %}'})
def test_now01(self):
"""
Simple case
"""
output = self.engin... |
wbinventor/openmc | refs/heads/develop | tests/regression_tests/void/test.py | 3 | from tests.testing_harness import TestHarness
def test_void():
harness = TestHarness('statepoint.10.h5')
harness.main()
|
lertech/extra-addons | refs/heads/master | network/model/__init__.py | 3 | import network
|
WatanabeYasumasa/edx-platform | refs/heads/gacco2/master | lms/lib/comment_client/comment.py | 27 | from .utils import CommentClientRequestError, perform_request
from .thread import Thread, _url_for_flag_abuse_thread, _url_for_unflag_abuse_thread
import models
import settings
class Comment(models.Model):
accessible_fields = [
'id', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
'endor... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/canary/coordinator.py | 12 | """Provides the Canary DataUpdateCoordinator."""
from datetime import timedelta
import logging
from async_timeout import timeout
from canary.api import Api
from requests import ConnectTimeout, HTTPError
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.helpers.update_coordinator import Dat... |
huzichunjohn/2014 | refs/heads/master | test_producer_consumer.py | 1 | #!/bin/env python
#-*- coding=utf-8 -*-
# Author: John Hu
# Email: huzichunjohn@126.com
# Date: 2014-3-3
# Version: 1.0
import threading
import Queue
import logging
import time
import random
import sys
queue = Queue.Queue()
class Producer(threading.Thread):
def __init__(self, thread_name, queue):
t... |
arnif/CouchPotatoServer | refs/heads/master | libs/migrate/versioning/script/__init__.py | 151 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from migrate.versioning.script.base import BaseScript
from migrate.versioning.script.py import PythonScript
from migrate.versioning.script.sql import SqlScript
|
rohitwaghchaure/alec_frappe5_erpnext | refs/heads/develop | erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class LeaveBlockListAllow(Document):
pass |
GNOME/conduit | refs/heads/master | conduit/gtkui/UI.py | 1 | """
Draws the applications main window
Also manages the callbacks from menu and GUI items
Copyright: John Stowers, 2006
License: GPLv2
"""
import thread
import gobject
import gtk
import os.path
import gettext
import threading
from gettext import gettext as _
import logging
log = logging.getLogger("gtkui.UI")
import ... |
clayz/crazy-quiz-web | refs/heads/master | lib/requests/requests/packages/urllib3/exceptions.py | 73 |
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(self, pool, message):
self.pool ... |
stdweird/aquilon | refs/heads/master | lib/python2.6/aquilon/worker/commands/show_building_building.py | 2 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... |
SUSE/azure-sdk-for-python | refs/heads/master | azure-mgmt-compute/azure/mgmt/compute/compute/v2016_03_30/models/virtual_machine_scale_set_vm_instance_required_ids.py | 9 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
sassoftware/catalog-service | refs/heads/master | catalogService/libs/viclient_vendor/ZSI/resolvers.py | 2 | #! /usr/bin/env python
# $Header$
'''SOAP messaging parsing.
'''
from ZSI import _copyright, _child_elements, EvaluateException, TC
import multifile, mimetools, urllib
from base64 import decodestring as b64decode
import cStringIO as StringIO
def Opaque(uri, tc, ps, **keywords):
'''Resolve a URI and return its co... |
ansp-2015/arquea | refs/heads/master | evento/tests.py | 269 | # 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/.
|
jeffwdoak/PhononModes | refs/heads/master | PhononModes/atomic_participation_ratio.py | 1 | #!/usr/bin/env python
"""
Script to calculate atom-decomposed participation ratios of a phonon
calculation.
Assumes the phonon mode file is named 'phonons.out', the atomic mass file is
named 'apos.dat', and both are located in the directory where this script is
run.
Script takes 1 command line argument, the index of... |
mistwave/leetcode | refs/heads/master | Python3/no283_Move_Zeroes.py | 1 | class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
z = 0
for nz in range(len(nums)):
if nums[nz]:
nums[nz], nums[z] = nums[z], nums[nz]
... |
DeMille/emailhooks | refs/heads/master | django_nonrel/django/utils/baseconv.py | 238 | # Copyright (c) 2010 Guilherme Gondim. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF
# ... |
theheros/kbengine | refs/heads/master | kbe/src/lib/python/Lib/tkinter/font.py | 51 | # Tkinter font wrapper
#
# written by Fredrik Lundh, February 1998
#
# FIXME: should add 'displayof' option where relevant (actual, families,
# measure, and metrics)
#
__version__ = "0.9"
import tkinter
# weight/slant
NORMAL = "normal"
ROMAN = "roman"
BOLD = "bold"
ITALIC = "italic"
def nametofont(name):
... |
benh/twesos | refs/heads/master | third_party/boto-2.0b2/boto/services/__init__.py | 782 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
stvstnfrd/edx-platform | refs/heads/master | openedx/features/content_type_gating/tests/test_models.py | 1 | import pytest
import itertools
from datetime import datetime, timedelta
import ddt
import pytz
from django.utils import timezone
from edx_django_utils.cache import RequestCache
from mock import Mock
from opaque_keys.edx.locator import CourseLocator
from common.djangoapps.course_modes.tests.factories import CourseMo... |
phihag/adhocracy | refs/heads/develop | src/adhocracy/config/environment.py | 4 | """Pylons environment configuration"""
import os
import time
import sys
import traceback
from mako.lookup import TemplateLookup
from paste.deploy.converters import asbool
from pylons import tmpl_context as c
from pylons.configuration import PylonsConfig
from sqlalchemy import engine_from_config
from sqlalchemy.interfa... |
tkinz27/ansible-modules-core | refs/heads/devel | system/selinux.py | 198 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Derek Carter<goozbach@friocorte.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 the ... |
diedthreetimes/VCrash | refs/heads/master | utils/grid.py | 189 | #!/usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import cairo
import sys
import re
import gtk
class DataRange:
def __init__(self, start = 0, end = 0, value = ''):
self.start = start
self.end = end
self.value = value
class EventStri... |
wshallum/ansible | refs/heads/devel | lib/ansible/modules/notification/irc.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jan-Piet Mens <jpmens () 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 the L... |
lz1988/django-web2015 | refs/heads/master | build/lib/django/middleware/csrf.py | 20 | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
from __future__ import unicode_literals
import hashlib
import logging
import re
import random
from django.conf import settings
from django.core.urlresolvers import g... |
arabenjamin/pyNES | refs/heads/0.1.x | pynes/examples/helloworld.py | 28 | import pynes
from pynes.bitbag import *
if __name__ == "__main__":
pynes.press_start()
exit()
palette = [
0x22,0x29, 0x1A,0x0F, 0x22,0x36,0x17,0x0F, 0x22,0x30,0x21,0x0F, 0x22,0x27,0x17,0x0F,
0x22,0x16,0x27,0x18, 0x22,0x1A,0x30,0x27, 0x22,0x16,0x30,0x27, 0x22,0x0F,0x36,0x17]
chr_asset = import... |
stonegithubs/odoo | refs/heads/8.0 | addons/website_event_sale/models/__init__.py | 428 | import product
import website
import sale_order
|
Glottotopia/aagd | refs/heads/master | moin/local/moin/MoinMoin/action/sisterpages.py | 2 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - "sisterpages" action
This action generates a list of page urls and page names, so that other wikis
can implement SisterWiki functionality easily.
See: http://usemod.com/cgi-bin/mb.pl?SisterSitesImplementationGuide
@copyright: 2007 MoinMoin:Thomas... |
a-parhom/edx-platform | refs/heads/master | lms/envs/devstack.py | 1 | """
Specific overrides to the base prod settings to make development easier.
"""
from os.path import abspath, dirname, join
from corsheaders.defaults import default_headers as corsheaders_default_headers
from .production import * # pylint: disable=wildcard-import, unused-wildcard-import
# Don't use S3 in devstack, ... |
neilhan/tensorflow | refs/heads/master | tensorflow/contrib/framework/python/framework/checkpoint_utils_test.py | 11 | # 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... |
MacHu-GWU/angora-project | refs/heads/master | angora/dataIO/js.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module description
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is re-pack of some json utility functions.
- :func:`load_js`: Load Json from file. If file are not exists, returns
user defined ``default value``.
... |
Extractcoin/Extractcoin | refs/heads/master | qa/rpc-tests/netutil.py | 328 | #!/usr/bin/env python2
# Copyright (c) 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.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
import bi... |
renaelectronics/linuxcnc | refs/heads/master | configs/sim/axis/vismach/VMC_toolchange/toplevel.py | 10 | #!/usr/bin/env python
import remap
|
deokjinkim/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/tests/test_serializer.py | 131 | # 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/.
import unittest
from cStringIO import StringIO
from .. import parser, serializer
class TokenizerTest(unittest.TestCa... |
davidvon/pipa-pay-server | refs/heads/master | site-packages/pip-1.5.1-py2.7.egg/pip/_vendor/html5lib/trie/_base.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from collections import Mapping
class Trie(Mapping):
"""Abstract base class for tries"""
def keys(self, prefix=None):
keys = super().keys()
if prefix is None:
return set(keys)
# Python 2.6: no set compre... |
JioCloud/nova | refs/heads/master | nova/tests/unit/virt/hyperv/test_snapshotops.py | 67 | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... |
anistark/mozillians | refs/heads/master | mozillians/groups/api/v2.py | 2 | from django.shortcuts import get_object_or_404
import django_filters
from funfactory.urlresolvers import reverse
from rest_framework import viewsets, serializers
from rest_framework.response import Response
from mozillians.common.helpers import absolutify
from mozillians.groups.models import Group, GroupMembership, S... |
40123248/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/etree/ElementPath.py | 785 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... |
mdrumond/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/candidate_sampler_ops_test.py | 110 | # 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... |
dhrone/pydPiper | refs/heads/master | sources/musicdata_mpd.py | 1 | #!/usr/bin/python
# coding: UTF-8
# musicdata service to read from MPD
# Written by: Ron Ritchey
from __future__ import unicode_literals
import json, mpd, threading, logging, Queue, time, sys, getopt
import musicdata
class musicdata_mpd(musicdata.musicdata):
def __init__(self, q, server=u'localhost', port=6600, ... |
valexandersaulys/airbnb_kaggle_contest | refs/heads/master | venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/raise_op.py | 7 | """Symbolic Op for raising an exception."""
from theano import gof
__authors__ = "James Bergstra"
__copyright__ = "(c) 2011, Universite de Montreal"
__license__ = "3-clause BSD License"
__contact__ = "theano-dev <theano-dev@googlegroups.com>"
__docformat__ = "restructuredtext en"
class Raise(gof.Op):
"""Op who... |
apple/swift-lldb | refs/heads/stable | packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py | 1 | from __future__ import print_function
import unittest2
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemote_qThreadStopInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__fil... |
40123227/2016springcd_aG7 | refs/heads/master | static/plugin/liquid_tags/youtube.py | 284 | """
Youtube Tag
---------
This implements a Liquid-style youtube tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% youtube id [width height] %}
Example
-------
{% youtube dQw4w9WgXcQ 640 480 %}
Output
------
<iframe
width="640" height="480" src="https://www.youtube.com/embed/dQw4... |
voidfiles/mmmercury_bot | refs/heads/master | mmmercury/stream_store.py | 1 | import json
import logging
import langid
from .stream_consumer import StreamConsumer
from .redis_utils import PostStore, PostActivitySet
logger = logging.getLogger(__name__)
class StreamStore(StreamConsumer):
def __init__(self, *args, **kwargs):
self.key_prefix = kwargs.pop('key_prefix')
self.po... |
2014c2g23/2015cd_midterm- | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/__init__.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
sigmavirus24/pip | refs/heads/master | tests/unit/test_proxy.py | 62 | """
Tests for the proxy support in pip.
"""
import pip
from tests.lib import SRC_DIR
from tests.lib.path import Path
def test_correct_pip_version():
"""
Check we are importing pip from the right place.
"""
assert Path(pip.__file__).folder.folder.abspath == SRC_DIR
|
lintzc/gpdb | refs/heads/master | src/test/tinc/ext/simplejson/tests/test_pass1.py | 34 | # from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -9876.543210,
"e": 0.123456789e-12,
"E": 1.... |
etmaifo/BoilerPlate2D | refs/heads/master | gamelib/objectanimation.py | 2 | import pygame
class SimpleAnimation(object):
def __init__(self, image_list, speed):
self.frames = image_list * speed
self.frames.sort()
self.frame_index = 0
self.numberofframes = len(self.frames)
def get_frame(self):
return self.frames[self.frame_index]
def update(... |
inspyration/odoo | refs/heads/master | addons/l10n_in_hr_payroll/report/payslip_report.py | 340 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
AMObox/teammaniac | refs/heads/master | plugin.video.PsychoTV/resources/lib/resolvers/filmon.py | 23 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... |
chidaobanjiu/works-on-LPTHW | refs/heads/master | ex24.py | 1 | print "Let's practice everything."
print 'You\'d need to know \'bout escape with \\that do \n newlines and \t tabs.'
poem = """
\tThe lovely world
with logic so firmly planted
cannot discern \n the needs of love
nor comprehend passion from intuition
and requires an explanation
\n\t\twhere there is none.
"""
print "--... |
danilovaz/ogitrev | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/PRESUBMIT.py | 293 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... |
JohnGeorgiadis/invenio | refs/heads/master | invenio/base/wrappers.py | 4 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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 (a... |
onelab-eu/sfa | refs/heads/geni-v3 | sfatables/commands/Delete.py | 2 | import os, time
from sfatables.globals import sfatables_config
from sfatables.command import Command
class Delete(Command):
options = [('-D','--delete')]
help = 'Delete a rule from a chain'
key='delete_rule'
matches = False
targets = False
def __init__(self):
return
def call(self,... |
mdavid/horizon | refs/heads/master | openstack_dashboard/dashboards/project/stacks/api.py | 95 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
OCA/sale-workflow | refs/heads/12.0 | sale_merge_draft_invoice/model/__init__.py | 1 | # Copyright 2017 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import sale_order
from . import res_company
from . import res_config_settings
|
Peque/xpython | refs/heads/master | grade-school/example.py | 12 | from collections import defaultdict
class School(object):
def __init__(self, name):
self.name = name
self.db = defaultdict(set)
def add(self, student, grade):
self.db[grade].add(student)
def grade(self, level):
return self.db[level]
def sort(self):
return sor... |
IndraVikas/scikit-learn | refs/heads/master | sklearn/linear_model/ridge.py | 89 | """
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/tests/test_only_directive.py | 22 | # -*- coding: utf-8 -*-
"""
test_only_directive
~~~~~~~~~~~~~~~~~~~
Test the only directive with the test root.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from docutils import nodes
from util import with_app, test_roots... |
tgquintela/TimeSeriesTools | refs/heads/master | TimeSeriesTools/release.py | 1 | """Release data for TimeSeriesTools.
The information of the version is in the version.py file.
"""
from __future__ import absolute_import
import os
import sys
import time
import datetime
basedir = os.path.abspath(os.path.split(__file__)[0])
## Quantify the version
MAJOR = 0
MINOR = 0
MICRO = 0
ISRELEASED = False
... |
patricklam/stqam-2017 | refs/heads/master | 2015-notes/live-coding/L03/line-intersection-test.py | 3 | # run this test as 'python line-intersection-test.py'
from line_intersection import *
import unittest
class TestIntersection(unittest.TestCase):
def test_aAbB(self):
a = LineSegment(0,2)
b = LineSegment(3,7)
self.assertFalse(intersect(a,b))
self.assertFalse(intersect(b,a))
def... |
wd5/jangr | refs/heads/master | django/contrib/gis/geos/prototypes/geom.py | 311 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import \
check_geom, check_minus_one, check_sized_string, check_string, check_zero
from django.contrib.gis.... |
rfree2/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/win/gyptest-midl-includedirs.py | 108 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Verify that 'midl_include_dirs' is handled.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(format... |
alephobjects/Cura | refs/heads/master | Cura/util/meshLoaders/amf.py | 1 | """
AMF file reader.
AMF files are the proposed replacement for STL. AMF is an open standard to share 3D manufacturing files.
Many of the features found in AMF are currently not yet support in Cura. Most important the curved surfaces.
http://en.wikipedia.org/wiki/Additive_Manufacturing_File_Format
"""
__copyright__ = ... |
RahulMahalingam/raft | refs/heads/master | analyzers/Timing.py | 11 | #
# Author: Seth Law
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 ve... |
chamaelj/tools-artbio | refs/heads/master | unstable/local_tools/clustering2.py | 4 |
#!/usr/bin/python
# script find clusters of small RNA reads in the genome
# version 3 - 24-12-2013 evolution to save memory !!! TEST !!!
# Usage clustering.py <bowtie input> <output> <bowtie index> <clustering_distance> <minimum read number per cluster to be outputed> <collapse option> <extention value> <average_clust... |
garbear/EventGhost | refs/heads/master | eg/Classes/Translation.py | 1 | # This file is part of EventGhost.
# Copyright (C) 2005 Lars-Peter Voss <bitmonster@eventghost.org>
#
# EventGhost 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
# (a... |
tonk/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/bar2/__init__.py | 298 | data = 'bar2'
|
JoseALermaIII/python-tutorials | refs/heads/master | pythontutorials/books/CrackingCodes/Ch07/PracticeQuestions/Question4.py | 1 | """Chapter 7 Practice Question 4
What value does each of the following expressions evaluate to?
Note:
aka "Lists are OP"
"""
def main():
print(len([2, 4]))
print(len([]))
print(len(['', '', '']))
print([4, 5, 6] + [1, 2, 3])
print(3 * [1, 2, 3] + [0]) # I hate you
print(42 in [41, 42, 4... |
GREO/gnuradio-git | refs/heads/master | gnuradio-examples/python/usrp/usrp_wfm_rcv_fmdet.py | 9 | #!/usr/bin/env python
#
# Copyright 2005,2006,2007 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 you... |
ryfeus/lambda-packs | refs/heads/master | LightGBM_sklearn_scipy_numpy/source/sklearn/mixture/tests/test_bayesian_mixture.py | 84 | # Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy.special import gammaln
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_almost_equal
from sklearn.mixture.bayesian... |
lmazuel/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_vmkernel.py | 70 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 the Li... |
thliebig/openEMS | refs/heads/master | python/openEMS/physical_constants.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de)
#
# 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 opt... |
ToFuProject/tofu | refs/heads/devel | tofu/geom/_core.py | 1 | """
This module is the geometrical part of the ToFu general package
It includes all functions and object classes necessary for tomography
on Tokamaks
"""
# Built-in
import os
import warnings
import copy
import inspect
# Common
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# ToFu-specifi... |
dsquareindia/scikit-learn | refs/heads/master | sklearn/mixture/bayesian_mixture.py | 19 | """Bayesian Gaussian Mixture Model."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import math
import numpy as np
from scipy.special import betaln, digamma, gammaln
from .base import BaseMixture, _check_shape
from .gaussian_mixture impo... |
wbyne/QGIS | refs/heads/master | python/plugins/GdalTools/tools/doRasterize.py | 4 | # -*- coding: utf-8 -*-
"""
***************************************************************************
doRasterize.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
****************... |
rwgdrummer/maskgen | refs/heads/master | maskgen/batch/batch_process.py | 1 | # =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
#==============================================================================
#
"""
Batch Journal Extensions Processing
"""
f... |
rtucker-mozilla/inventory | refs/heads/master | vendor-local/src/django-tastypie/tastypie/resources.py | 5 | from __future__ import with_statement
import logging
import warnings
import django
from django.conf import settings
from django.conf.urls.defaults import patterns, url
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, ValidationError
from django.core.urlresolvers import NoReverseMatch, rev... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.