repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lokirius/python-for-android | refs/heads/master | python-modules/twisted/twisted/persisted/journal/picklelog.py | 64 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# -*- test-case-name: twisted.test.test_journal -*-
"""Logging that uses pickles.
TODO: add log that logs to a file.
"""
# twisted imports
from twisted.persisted import dirdbm
from twisted.internet import defer
from zope.interface ... |
40223231/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testhelpers.py | 737 | import unittest
from unittest.mock import (
call, _Call, create_autospec, MagicMock,
Mock, ANY, _CallList, patch, PropertyMock
)
from datetime import datetime
class SomeClass(object):
def one(self, a, b):
pass
def two(self):
pass
def three(self, a=None):
pass
class AnyT... |
tectronics/quirkysoft | refs/heads/master | waf_tools/pytest.py | 5 | import sys
import Task
import Utils
import Options
from Constants import RUN_ME
from TaskGen import extension
def set_options(opt):
opt.add_option('--all-tests',
action='store_true',
default=False,
help='Exec all unit tests')
opt.add_option('--test',
action='store',
help... |
hyperspy/hyperspy | refs/heads/RELEASE_next_minor | hyperspy/utils/model.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
IV-GII/SocialCookies | refs/heads/master | ENV1/lib/python2.7/site-packages/django/contrib/auth/tests/test_signals.py | 227 | from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=Fa... |
bhmm/legacy-bhmm-force-spectroscopy-manuscript | refs/heads/master | examples/synthetic-three-state-model/synthetic-example.py | 3 | #!/usr/bin/env python
"""
Generate plots for synthetic three-state force spectroscopy model.
"""
import argparse
import bhmm
from bhmm.util import testsystems
from bhmm.util.analysis import generate_latex_table
# dynamically import plotting tools
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(i... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/ipykernel/kernelapp.py | 3 | """An Application for launching a kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
import os
import sys
import signal
import traceback
import logging
from tornado import ioloop
import zmq
from zmq.event... |
bowen0701/algorithms_data_structures | refs/heads/master | lc0201_bitwise_and_of_numbers_range.py | 1 | """Leetcode 201. Bitwise AND of Numbers Range
Medium
URL: https://leetcode.com/problems/bitwise-and-of-numbers-range/
Given a range [m, n] where 0 <= m <= n <= 2147483647,
return the bitwise AND of all numbers in this range, inclusive.
Example 1:
Input: [5,7]
Output: 4
Example 2:
Input: [0,1]
Output: 0
"""
class ... |
drpngx/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py | 14 | # 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... |
berny6969/enigma2 | refs/heads/master | lib/python/Tools/Directories.py | 20 | # -*- coding: utf-8 -*-
import os
from os import mkdir, rmdir, system, walk, stat as os_stat, listdir, readlink, makedirs, error as os_error, symlink, access, F_OK, R_OK, W_OK, rename as os_rename
from stat import S_IMODE
from re import compile
from enigma import eEnv
try:
from os import chmod
have_chmod = True
exce... |
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/modeltests/custom_methods/models.py | 92 | """
3. Giving models custom methods
Any method you add to a model will be available to instances.
"""
from django.db import models
import datetime
class Article(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateField()
def __unicode__(self):
return self.headline
... |
joelpinheiro/safebox-smartcard-auth | refs/heads/master | Client/veclient/lib/python2.7/locale.py | 4 | /usr/lib/python2.7/locale.py |
AndreyPopovNew/asuswrt-merlin-rt-n | refs/heads/master | release/src/router/samba36/source4/torture/libnet/python/samr-test.py | 67 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
#
# 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 Founda... |
albert-chin/yowsup | refs/heads/master | yowsup/layers/protocol_presence/__init__.py | 70 | from .layer import YowPresenceProtocolLayer
|
paran0ids0ul/infernal-twin | refs/heads/master | build/pip/pip/__main__.py | 834 | from __future__ import absolute_import
import os
import sys
# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off ... |
redhat-cip/tempest | refs/heads/master | tempest/tests/common/test_cred_provider.py | 22 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
ximenesuk/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/gatewaytest/test_connection.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2009-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
pytest fixtures used as defined in conftest.py:
- gatewaywrapper
- author_testimg
"""
import omero
import Ice
from omero.gateway.sc... |
edmorley/django | refs/heads/master | tests/user_commands/urls.py | 156 | from django.conf.urls import url
urlpatterns = [
url(r'^some/url/$', lambda req:req, name='some_url'),
]
|
lupyuen/RaspberryPiImage | refs/heads/master | home/pi/GrovePi/Software/Python/others/temboo/Library/CloudMine/FileStorage/GetFile.py | 4 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetFile
# Retrieves a file from the CloudMine server with a given key.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ... |
meska/SoCo | refs/heads/master | soco/exceptions.py | 9 | # -*- coding: utf-8 -*-
"""Exceptions that are used by SoCo."""
from __future__ import unicode_literals
class SoCoException(Exception):
"""Base class for all SoCo exceptions."""
class UnknownSoCoException(SoCoException):
"""An unknown UPnP error.
The exception object will contain the raw response s... |
imajes/Sick-Beard | refs/heads/master | lib/hachoir_parser/audio/aiff.py | 90 | """
Audio Interchange File Format (AIFF) parser.
Author: Victor Stinner
Creation: 27 december 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt16, UInt32, Float80, TimestampMac32,
RawBytes, NullBytes,
String, Enum, PascalString32)
from lib.hachoir_core.endia... |
asrozar/perception | refs/heads/master | perception/database/migrations/versions/1dda1836ac55_create_host_using_sshv1_table.py | 1 | """create host_using_sshv1 table
Revision ID: 1dda1836ac55
Revises: 3132f6875d83
Create Date: 2017-05-22 09:58:07.585231
"""
from sqlalchemy.dialects import postgresql
from alembic import op
import sqlalchemy as sa
import datetime
def _get_date():
return datetime.datetime.now()
# revision identifiers, used by... |
LiChenda/NeuralNetwork | refs/heads/master | IMGPC.py | 1 | #!/usr/bin/env python
# encoding: utf-8
from PIL import Image
from numpy import *
#from pylab import *
def getVectFromImg(filename):
img = Image.open(filename)
img = img.convert('1')
img.thumbnail((32,32))
img = img.resize((32,32))
imgbw = zeros((1, 1025))
for i in range(32):
for j in ra... |
arnavd96/Cinemiezer | refs/heads/master | myvenv/lib/python3.4/site-packages/django/contrib/admin/sites.py | 42 | from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.db.models.base import ModelBa... |
alshedivat/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/datasets/imdb/__init__.py | 39 | # 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... |
lokeshpancharia/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch06/04_sent.py | 22 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
#
# This script trains tries to tweak hyperparameters to improve P/R AUC
#
import time
start_time = ti... |
henrysher/aws-cloudinit | refs/heads/v0.7.2 | cloudinit/url_helper.py | 1 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
# Copyright (C) 2014 Amazon.com, Inc. or its affiliates.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefl... |
UmassJin/Leetcode | refs/heads/master | Array/Gray_Code.py | 1 | ```
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.
For example, given n = 2, return [0,1,3,2]. Its gray code sequence... |
ruimashita/django-haystack | refs/heads/master | haystack/__init__.py | 9 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from haystack.constants import DEFAULT_ALIAS
from haystack import signals
from haystack.utils import loading
... |
abdulbaqi/quranf | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/compat.py | 571 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... |
waldyrious/GraphUI | refs/heads/master | gui/draw/rounded.py | 3 | # Copyright (c) 2007 Enough Project.
# See LICENSE for details.
import pygame
import backend
from math import pi
def _rounded_rect(surface, color, rect, width, corner_radius):
backend.lock(surface)
rect.height -= width//2
rect.width -= width//2
diameter = corner_radius * 2
for offset, angles, corn... |
iniverno/RnR-LLC | refs/heads/master | gen-scripts/workloads.py | 1 | # checkpoint name/path pairs
all_checkpoints = [
("/simics/checkpoints-u3/barnes/barnes-512", "barnes_512", [1, 2, 4, 8, 16, 32]),
("/simics/checkpoints-u3/barnes/barnes-16k", "barnes_16k", [1, 2, 4, 8, 16, 32]),
("/simics/checkpoints-u3/barnes/barnes-64k", "barnes_6... |
rafadev/django-guardian | refs/heads/master | docs/exts.py | 21 |
def setup(app):
app.add_crossref_type(
directivename = "admin",
rolename = "admin",
indextemplate = "pair: %s; admin",
)
app.add_crossref_type(
directivename = "command",
rolename = "command",
indextemplate = "pair: %s; command",
)
app.add_c... |
ossdemura/django-miniblog | refs/heads/dev | Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3132 | ######################## 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 Rights R... |
Lilywei123/tempest | refs/heads/master | tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py | 2 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
goku1997/bitcoin | refs/heads/master | qa/rpc-tests/zapwallettxes.py | 25 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 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 test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ... |
codingforentrepreneurs/try-django-19 | refs/heads/master | src/trydjango19/wsgi.py | 4 | """
WSGI config for trydjango19 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... |
youdonghai/intellij-community | refs/heads/master | python/testData/intentions/PyConvertToFStringIntentionTest/percentOperatorDynamicWidth.py | 31 | "%*s" % (5, 'spam')
|
fumen/gae-fumen | refs/heads/master | lib/requests/auth.py | 68 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
import warnings
from base64 import b64encode
from .compat import urlparse, str, basestring
from .cookies import extract_cookies_... |
markbrough/maedi-projects | refs/heads/master | maediprojects/views/users.py | 1 | from flask import Flask, render_template, flash, request, Markup, \
session, redirect, url_for, escape, Response, abort, send_file, \
current_app
from flask.ext.login import (LoginManager, current_user, login_required,
login_user, logout_user, UserMixin,
c... |
mrrrgn/olympia | refs/heads/master | apps/users/helpers.py | 14 | import random
from django.utils.encoding import smart_unicode
import jinja2
from jingo import register, env
from tower import ugettext as _
import amo
@register.function
def emaillink(email, title=None, klass=None):
if not email:
return ""
fallback = email[::-1] # reverse
# inject junk somewh... |
pitah81/android_kernel_elephone_p8000 | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
mhbu50/erpnext | refs/heads/develop | erpnext/setup/utils.py | 3 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, add_days
from frappe.utils import get_datetime_str, nowdate
from erpnext import get_def... |
ekzhu/datasketch | refs/heads/master | examples/hyperloglog_examples.py | 3 | '''
Some examples for MinHash
'''
from datasketch.hyperloglog import HyperLogLog
data1 = ['hyperloglog', 'is', 'a', 'probabilistic', 'data', 'structure', 'for',
'estimating', 'the', 'cardinality', 'of', 'dataset', 'dataset', 'a']
data2 = ['hyperloglog', 'is', 'a', 'probabilistic', 'DATA', 'structure', 'for',... |
gt945/CodeIgniter | refs/heads/3.0-stable | user_guide_src/source/conf.py | 1 | # -*- coding: utf-8 -*-
#
# CodeIgniter documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 07:24:38 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... |
brijeshkesariya/odoo | refs/heads/8.0 | addons/account/project/project.py | 273 | # -*- 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... |
tswicegood/ns.py | refs/heads/master | tests.py | 1 | import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
sys.path[0:0] = [os.path.join(os.path.dirname(__file__), "support", a) \
for a in ["a", "b", "y", "z"]]
import unittest
class BasicTestCase(unittest.TestCase):
def test_bar_is_imported_from_b(self):
from foo import bar
sel... |
terrelln/python-zstandard | refs/heads/master | tests/test_module_attributes.py | 1 | from __future__ import unicode_literals
import unittest
import zstandard as zstd
from . common import (
make_cffi,
)
@make_cffi
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 2, 0))
def test_constants(self):
self.assertEqu... |
rdjdejong/LerenEnBeslissen-2017 | refs/heads/master | main.py | 1 | open('__init__.py', 'a')
import os
from getAuthors import makeSeperateDir, seperatePortraits, makeAuthorDirFromFile
from readtsv import addAuthorToImage
from makeDir import createAuthorFolders
from affine import makeAffine
import csv
from skimage import io
import cv2
# import demos.classifier as dcl
if __name__ ==... |
fumitoh/modelx | refs/heads/master | modelx/tests/core/api/test_traceback.py | 1 |
import modelx as mx
from modelx.core.errors import (
FormulaError,
DeepReferenceError,
NoneReturnedError)
import pytest
from textwrap import dedent
@pytest.fixture(scope="module")
def errormodel():
m = mx.new_model("ErrorModel")
s = m.new_space("ErrorSpace")
@mx.defcells
def foo(x):
... |
vgan/soiqbot | refs/heads/master | oauthlib/common.py | 16 | # -*- coding: utf-8 -*-
"""
oauthlib.common
~~~~~~~~~~~~~~
This module provides data structures and utilities common
to all implementations of OAuth.
"""
from __future__ import absolute_import, unicode_literals
import collections
import datetime
import logging
import random
import re
import sys
import time
try:
... |
cloudcomputinghust/IoT | refs/heads/master | platform_manager/api/migrations/0002_auto_20170224_0831.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-02-24 08:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
Xeralux/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/model_analyzer.py | 166 | # 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... |
henaras/sahara | refs/heads/master | sahara/plugins/hdp/confighints_helper.py | 7 | # Copyright (c) 2015 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... |
barachka/odoo | refs/heads/master | addons/payment_paypal/models/res_company.py | 422 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class ResCompany(osv.Model):
_inherit = "res.company"
def _get_paypal_account(self, cr, uid, ids, name, arg, context=None):
Acquirer = self.pool['payment.acquirer']
company_id = self.pool['res.users'].browse(cr, uid, uid, context=co... |
iradul/qtwebkit | refs/heads/pjs | Tools/Scripts/webkitpy/bindings/__init__.py | 6014 | # Required for Python to search this directory for module files
|
jinluyuan/osf.io | refs/heads/develop | scripts/tests/test_dataverse_migrate_to_external_account.py | 47 | from nose.tools import *
from scripts.dataverse.migrate_to_external_account import do_migration, get_targets
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, UserFactory
from website.addons.dataverse.model import AddonDataverseUserSettings
class TestDa... |
opennode/nodeconductor-assembly-waldur | refs/heads/develop | src/waldur_pid/exceptions.py | 2 | class DataciteException(Exception):
pass
|
MCDong/barbican | refs/heads/master | barbican/api/__init__.py | 2 | # Copyright (c) 2013-2015 Rackspace, 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 ... |
sandeepkbhat/pylearn2 | refs/heads/master | pylearn2/models/rbm.py | 44 | """
Implementations of Restricted Boltzmann Machines and associated sampling
strategies.
"""
# Standard library imports
import logging
# Third-party imports
import numpy
N = numpy
np = numpy
from theano.compat import six
from theano.compat.six.moves import xrange
import theano
from theano import tensor
from theano.com... |
plamut/ggrc-core | refs/heads/develop | src/ggrc_basic_permissions/migrations/versions/20131010221316_3adc42b4f6b9_rename_admin_role.py | 7 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Rename admin role.
Revision ID: 3adc42b4f6b9
Revises: 10adeac7b693
Create Date: 2013-10-10 22:13:16.470076
"""
# revision identifiers, used by Alembic.
revision = '3adc42b4f6b9'
down_revision = '10ade... |
willingc/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/internet/threads.py | 25 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Extended thread dispatching support.
For basic support see reactor threading API docs.
Maintainer: Itamar Shtull-Trauring
"""
import Queue
from twisted.python import failure
from twisted.internet import defer
def deferToThreadPool(reacto... |
vasiliykochergin/euca2ools | refs/heads/master | euca2ools/commands/s3/deletebucket.py | 6 | # Copyright 2013-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... |
christoph-buente/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/botinfo.py | 127 | # Copyright (c) 2011 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 the ... |
AVADOLearning/moodle-ubiquitous | refs/heads/master | _states/mssql_login.py | 2 | #
# Ubiquitous Moodle
#
# @author Luke Carrier <luke@carrier.im>
# @copyright 2018 The Ubiquitous Authors
#
def present(name, **kwargs):
ret = {
'name': name,
'result': False,
'changes': {},
'comment': '',
}
if __salt__['mssql.login_exists'](name, **kwargs):
ret['re... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/tests/relatedapp/tests.py | 25 | import os, unittest
from django.contrib.gis.geos import *
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, postgis, spatialite, no_mysql, no_oracle, no_spatialite
from django.conf ... |
ettm2012/MissionPlanner | refs/heads/master | LogAnalyzer/UnitTest.py | 160 | #!/usr/bin/env python
#
#
# Unit and regression tests for the LogAnalyzer code
#
#
# TODO: implement more unit+regression tests
import DataflashLog
import traceback
try:
# test DataflashLog reading 1
logdata = DataflashLog.DataflashLog()
logdata.read("examples/robert_lefebvre_octo_PM.log", ignoreBadlines=False)
... |
kbourgoin/hiicart | refs/heads/master | hiicart/gateway/paypal2/errors.py | 2 | from hiicart.gateway.base import GatewayError
class Paypal2GatewayError(GatewayError):
pass
|
simpeg/simpegem | refs/heads/master | simpegEM/Tests/test_TDEM_forward_Analytic.py | 2 | import unittest
from SimPEG import *
import simpegEM as EM
from scipy.constants import mu_0
import matplotlib.pyplot as plt
try:
from pymatsolver import MumpsSolver
except ImportError, e:
MumpsSolver = SolverLU
def halfSpaceProblemAnaDiff(meshType, sig_half=1e-2, rxOffset=50., bounds=[1e-5,1e-3], showIt=Fals... |
DEVSENSE/PTVS | refs/heads/master | Python/Tests/TestData/Classification/MultiLineString.py | 7 | x = '''
contents = open(%(filename)r, 'rb').read().replace("\\r\\n", "\\n")
''' |
cclauss/Pythonista_ui | refs/heads/master | ValidatingView.py | 1 | # coding: utf-8
import ui
# See: https://forum.omz-software.com/topic/2499/textfield-validation-example
class ValidatingView(ui.View):
def __init__(self):
for name in 'lower upper title numeric'.split():
text_field = ui.TextField(name=name)
text_field.delegate = self
t... |
LogicalDash/kivy | refs/heads/master | kivy/effects/dampedscroll.py | 70 | '''
Damped scroll effect
====================
.. versionadded:: 1.7.0
This damped scroll effect will use the
:attr:`~kivy.effects.scroll.ScrollEffect.overscroll` to calculate the scroll
value, and slows going back to the upper or lower limit.
'''
__all__ = ('DampedScrollEffect',)
from kivy.effects.scroll import S... |
colinnewell/odoo | refs/heads/8.0 | addons/project/tests/test_project_flow.py | 198 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
Dark-Hacker/horizon | refs/heads/master | openstack_dashboard/contrib/sahara/content/data_processing/data_sources/tests.py | 11 | # 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... |
ibinti/intellij-community | refs/heads/master | python/testData/inspections/PyCompatibilityInspection/ellipsisInSubscriptionPy2.py | 83 | import numpy
x = numpy.zeros((3, 4, 5))
y = x[..., 0] # pass
y = x[..., 0, :] # pass
|
py-geek/City-Air | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/contenttypes/views.py | 115 | from __future__ import unicode_literals
from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
def shortcut(request, conte... |
yuvadm/django-storages | refs/heads/master | storages/backends/couchdb.py | 11 | """
This is a Custom Storage System for Django with CouchDB backend.
Created by Christian Klein.
(c) Copyright 2009 HUDORA GmbH. All Rights Reserved.
"""
import os
from cStringIO import StringIO
from urlparse import urljoin
from urllib import quote_plus
from django.conf import settings
from django.core.files import Fi... |
drnextgis/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/Eliminate.py | 2 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Eliminate.py
---------------------
Date : August 2012
Copyright : (C) 2013 by Bernhard Ströbl
Email : bernhard.stroebl@jena.de
**************************... |
hahnicity/ucdpv_vent_infrastructure | refs/heads/master | raspi/scripts/__init__.py | 4 | """
ucdv_vent_infrastructure "Platform for collecting, aggregating, and storing ventilator data"
Copyright (C) 2017 Gregory Rehm
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 th... |
redhat-openstack/django | refs/heads/epel7-patches | django/contrib/gis/tests/geo3d/tests.py | 109 | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
from django.utils.unittest impor... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildmac/Resources/env/lib/python2.7/site-packages/twisted/internet/test/test_threads.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorThreads}.
"""
from __future__ import division, absolute_import
__metaclass__ = type
from weakref import ref
import gc, threading
from twisted.python.threadable import isInIOThread
from twisted.interne... |
ruben2020/codequery | refs/heads/master | scintilla/scripts/Face.py | 4 | # Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Requires Python 2.5 or later
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
line = line.... |
CameronLonsdale/sec-tools | refs/heads/master | python2/lib/python2.7/site-packages/setuptools/namespaces.py | 31 | import os
from distutils import log
import itertools
from six.moves import map
flatten = itertools.chain.from_iterable
class Installer:
nspkg_ext = '-nspkg.pth'
def install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filename, ext = os.path.s... |
nordaux/tornado | refs/heads/master | tornado/test/escape_test.py | 38 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import tornado.escape
from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode, squeeze, recursive_unicode
from tornado.util import u, unicode_ty... |
elkingtowa/pyrake | refs/heads/master | tests/test_logformatter.py | 1 | import unittest
from pyrake.spider import Spider
from pyrake.http import Request, Response
from pyrake.item import Item, Field
from pyrake.logformatter import LogFormatter
class CustomItem(Item):
name = Field()
def __str__(self):
return "name: %s" % self['name']
class LoggingContribTest(unittest.... |
pichuang/ryu | refs/heads/master | ryu/ofproto/oxx_fields.py | 10 | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
wallnerryan/flocker-profiles | refs/heads/profile_metadata | flocker/provision/_libcloud.py | 8 | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Helpers for using libcloud.
"""
from zope.interface import (
Attribute as InterfaceAttribute, Interface, implementer)
from characteristic import attributes, Attribute
from twisted.conch.ssh.keys import Key
from flocker.provision._ssh import run_rem... |
isrohutamahopetechnik/MissionPlanner | refs/heads/master | Lib/netrc.py | 55 | """An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
import os, shlex
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __init__(self, msg, filename=No... |
dfalt974/SickRage | refs/heads/master | lib/babelfish/converters/countryname.py | 89 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from . import CountryReverseConverter, CaseInsensitiveDict
from ..country import... |
shownotes/snotes20-restapi | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shownotes.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/test/test_file_eintr.py | 96 | # Written to test interrupted system calls interfering with our many buffered
# IO implementations. http://bugs.python.org/issue12268
#
# This tests the '_io' module. Similar tests for Python 2.x's older
# default file I/O implementation exist within test_file2k.py.
#
# It was suggested that this code could be merged... |
indictranstech/trufil-frappe | refs/heads/develop | frappe/website/doctype/blog_category/blog_category.py | 45 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
class BlogCategory(WebsiteGenerator):
def autoname(self... |
mrow4a/smashbox | refs/heads/master | lib/test_dirDelete.py | 4 | from smashbox.utilities import *
__doc__ = """ This test creates a deeply nested directory structure and then removes it
"""
import os.path
NESTING_LEVELS = config.get('dirDel_nestingLevels', 50)
nfiles = int(config.get('dirDel_nfiles', 100))
TEST_FILES = ['test%02d.dat'%i for i in range(nfiles)]
@add_worker
de... |
ryfeus/lambda-packs | refs/heads/master | Skimage_numpy/source/scipy/weave/examples/md5_speed.py | 100 | """
Storing actual strings instead of their md5 value appears to
be about 10 times faster.
>>> md5_speed.run(200,50000)
md5 build(len,sec): 50000 0.870999932289
md5 retrv(len,sec): 50000 0.680999994278
std build(len,sec): 50000 0.259999990463
std retrv(len,sec): 50000 0.0599999427795
This test actually takes several ... |
40223125/40223125-2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_testcapi.py | 742 |
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -2... |
rs2/bokeh | refs/heads/master | examples/models/file/gauges.py | 12 | from __future__ import print_function
from math import pi, sin, cos
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.resources import INLINE
from bokeh.util.browser import view
from bokeh.models.glyphs import Circle, Arc, Ray, Text
from bokeh.models import ColumnDataSource, Range1d, P... |
HybridF5/nova | refs/heads/master | nova/tests/unit/scheduler/weights/test_weights_ioopsweight.py | 73 | # 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
# d... |
dkliban/pulp_puppet | refs/heads/master | pulp_puppet_plugins/pulp_puppet/forge/urls.py | 4 | from django.conf.urls import patterns, url
from pulp_puppet.forge.views.releases import ReleasesView, ReleasesPost36View
from pulp.server.db import connection
connection.initialize()
urlpatterns = patterns('',
url(r'^pulp_puppet/forge/([^/]+)/([^/]+)/api/v1/releases.json', ReleasesView.as_view(),
name='p... |
vjFaLk/frappe | refs/heads/bloomstack-production | frappe/desk/page/backups/backups.py | 1 | from __future__ import unicode_literals
import os
import frappe
from frappe import _
from frappe.utils import get_site_path, cint, get_url
from frappe.utils.data import convert_utc_to_user_timezone
import datetime
def get_context(context):
def get_time(path):
dt = os.path.getmtime(path)
return convert_utc_to_user... |
anisku11/sublimeku | refs/heads/master | Packages/CodeComplice/libs/codeintel2/accessor.py | 1 | #!python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.