repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jameinel/juju | refs/heads/develop | acceptancetests/repository/trusty/haproxy/hooks/charmhelpers/core/decorators.py | 10 | # Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the hope ... |
KaptenJon/calvin-base | refs/heads/master | calvin/actorstore/systemactors/std/Sum.py | 8 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
ibinti/intellij-community | refs/heads/master | python/helpers/pydev/pydev_ipython/inputhookgtk.py | 51 | # encoding: utf-8
"""
Enable pygtk to be used interacive by setting PyOS_InputHook.
Authors: Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license ... |
janusnic/21v-python | refs/heads/master | unit_10/7.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Code PyQt4
In this example, we create a simple
window in PyQt4.
"""
import sys
from PyQt4 import QtGui
class Example(QtGui.QMainWindow):
def __init__(self):
super(Example, self).__init__()
self.initUI()
def initUI(self):
self.status... |
MphasisWyde/eWamSublimeAdaptor | refs/heads/master | src/third-party/dateutil/easter.py | 202 | # -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... |
jackdesert/lyxblogger | refs/heads/master | src/coalesce.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# eLyXer -- convert LyX source files to HTML output.
#
# Copyright (C) 2009 Alex Fernández
#
# 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 Foundat... |
alokc83/metasyntactic | refs/heads/master | protobuf-2.0.3/python/google/protobuf/internal/wire_format.py | 4 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
ChawalitK/odoo | refs/heads/master | addons/website_forum_doc/__init__.py | 598 | # -*- coding: utf-8 -*-
import controllers
import models
|
joberreiter/pyload | refs/heads/stable | module/plugins/hoster/SpeedLoadOrg.py | 15 | # -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SpeedLoadOrg(DeadHoster):
__name__ = "SpeedLoadOrg"
__type__ = "hoster"
__version__ = "1.03"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?speedload\.org/(?P<ID>\w+)'
__co... |
jaredhasenklein/the-blue-alliance | refs/heads/master | datafeeds/csv_advancement_parser.py | 4 | import csv
import StringIO
from datafeeds.parser_base import ParserBase
class CSVAdvancementParser(ParserBase):
@classmethod
def parse(self, data, matches_per_team):
"""
Parse CSV that contains round robin playoff advancement
Format is as follows:
alliance_number, cmp_points_m... |
synconics/odoo | refs/heads/8.0 | addons/web_tests/__init__.py | 385 | # -*- coding: utf-8 -*-
import tests
|
kylef/maintain | refs/heads/master | maintain/process.py | 1 | import os
import subprocess
import tempfile
import shutil
import click
def invoke(command, error_message=None):
status = subprocess.call(command)
if status != 0:
if error_message is None:
error_message = 'Command failed: {}'.format(' '.join(command))
click.echo(error_message)
... |
kyleabeauchamp/CBioSIP2014 | refs/heads/master | src/plot_phi.py | 4 | import mdtraj as md
traj = md.load("frame0.h5") # From mdtraj/MDTraj/testing/reference/
indices, phi = md.compute_phi(traj)
plot(phi)
title("Phi Backbone Angle")
xlabel("Timestep")
ylabel("Phi [degrees]")
savefig("./phi.png", bbox_inches=None)
|
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.5/django/contrib/markup/tests.py | 102 | # Quick tests for the markup templatetags (django.contrib.markup)
import re
import warnings
from django.template import Template, Context
from django import test
from django.utils import unittest
from django.utils.html import escape
try:
import textile
except ImportError:
textile = None
try:
import markd... |
dowjones/respawn | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
""" Setup script. Used by easy_install and pip. """
import os
from setuptools import setup, find_packages
from setuptools.command.test import test
import sys
class PyTest(test):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
... |
llcao/keras | refs/heads/master | keras/layers/normalization.py | 18 | from ..layers.core import Layer
from ..utils.theano_utils import shared_zeros, shared_ones, ndim_tensor
from .. import initializations
import theano.tensor as T
class BatchNormalization(Layer):
'''
Reference:
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covaria... |
gsnbng/erpnext | refs/heads/develop | erpnext/startup/report_data_map.py | 9 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
# mappings for table dumps
# "remember to add indexes!"
data_map = {
"Company": {
"columns": ["name"],
"conditions": ["docstatus < 2"]
},
"Fisc... |
imruahmed/microblog | refs/heads/master | flask/lib/python2.7/site-packages/wheel/bdist_wheel.py | 219 | """
Create a wheel (.whl) distribution.
A wheel is a built archive format.
"""
import csv
import hashlib
import os
import subprocess
import warnings
import shutil
import json
import wheel
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
i... |
sirex/couchdbkit | refs/heads/master | couchdbkit/ext/django/testrunner.py | 3 | # -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
from django.test.simple import DjangoTestSuiteRunner
from django.conf import settings
from . import loading
from ...exceptions import ResourceNotFound
class CouchDbKitTestSuiteRunner(Djan... |
cmcantalupo/geopm | refs/heads/dev | scripts/test/TestPolicyStore.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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, thi... |
freedesktop-unofficial-mirror/packagekit__PackageKit | refs/heads/master | backends/conary/conaryCallback.py | 8 | #!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later ver... |
KyoungRan/Django_React_ex | refs/heads/master | Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py | 580 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
IS_PYOPENSSL,
assert_fingerprint,
re... |
libracore/erpnext | refs/heads/v12 | erpnext/manufacturing/doctype/bom_item/__init__.py | 37694 | from __future__ import unicode_literals
|
kaedroho/django | refs/heads/master | tests/template_tests/filter_tests/timezone_utils.py | 523 | from datetime import date, datetime
from django.test import SimpleTestCase
from django.utils import timezone
class TimezoneTestCase(SimpleTestCase):
def setUp(self):
self.now = datetime.now()
self.now_tz = timezone.make_aware(
self.now, timezone.get_default_timezone(),
)
... |
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/gettext.py | 202 | """Internationalization and localization support.
This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.
I18N refers to the operation by which a program is made aware of multiple
languages. L10N r... |
kkfong/android_kernel_oneplus_msm8974 | refs/heads/cm-12.1-caf | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
Xeralux/tensorflow | refs/heads/master | tensorflow/contrib/compiler/__init__.py | 158 | # 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... |
direvus/pyxero | refs/heads/master | examples/receipts_importer/receipts.py | 7 | #!/usr/bin/env python
"""Upload receipts to Xero from a CSV file"""
# Contributed by @davidbitton, https://github.com/freakboy3742/pyxero/pull/48
# http://developer.xero.com/documentation/api/receipts/
import argparse
import csv
import os.path
import pickle
import sys
import webbrowser
#from config import xero_co... |
mrinaldhar/TranslatorsDesk | refs/heads/master | migrations/env.py | 605 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
YOTOV-LIMITED/kuma | refs/heads/master | vendor/packages/translate/convert/po2ical.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
cpennington/edx-platform | refs/heads/master | openedx/core/lib/log_utils.py | 5 | """
Helper functions for logging.
"""
import logging
log = logging.getLogger(__name__)
def audit_log(name, **kwargs):
"""
DRY helper used to emit an INFO-level log message.
Messages logged with this function are used to construct an audit trail. Log messages
should be emitted immediately after the ... |
warner83/micropython | refs/heads/master | tests/import/import_pkg6.py | 114 | # This tests relative imports as used in pkg6
import pkg6
|
emory-libraries/pidman | refs/heads/master | pidman/pid/__init__.py | 1 | '''Core application to represent pid objects and build central behaviors
for them. All (non-scripted) management and editing is handled
through the Django Admin interface.'''
|
miguelpalacio/python-for-android | refs/heads/master | python-modules/twisted/twisted/python/test/test_zipstream.py | 60 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.zipstream}
"""
import sys
import random
import zipfile
from twisted.python.compat import set
from twisted.python import zipstream, filepath
from twisted.python.hashlib import md5
from twisted.trial import ... |
ingenieroariel/pinax | refs/heads/master | apps/account/templatetags/other_service_tags.py | 12 | import re
from django import template
from account.models import other_service
register = template.Library()
class OtherServiceNode(template.Node):
def __init__(self, user, key, asvar):
self.user = user
self.key = key
self.asvar = asvar
def render(self, context):
user = s... |
finalion/WordQuery | refs/heads/master | src/libs/pystardict.py | 1 | #-*- coding:utf-8 -*-
from struct import unpack
from warnings import warn
import gzip
import hashlib
import re
import warnings
import os
class _StarDictIfo(object):
"""
The .ifo file has the following format:
StarDict's dict ifo file
version=2.4.2
[options]
Note that the current "version" st... |
pombredanne/viewflow | refs/heads/master | viewflow/fields.py | 1 | from __future__ import unicode_literals
from django.db import models
from .compat import get_app_package, get_containing_app_data, import_string
from .exceptions import FlowRuntimeError
from .token import Token
def import_flow_by_ref(flow_strref):
app_label, flow_path = flow_strref.split('/')
return import_s... |
sciCloud/OLiMS | refs/heads/master | lims/setuphandlers.py | 2 |
""" Bika setup handlers. """
from dependencies.dependency import ObjectInitializedEvent
from dependencies.dependency import permissions
from dependencies.dependency import getToolByName
from dependencies.dependency import PloneMessageFactory
from lims import bikaMessageFactory as _
from lims.utils import t
from lims ... |
mattcaldwell/django-cms | refs/heads/master | cms/test_utils/fixtures/fakemlng.py | 33 | # -*- coding: utf-8 -*-
from cms.api import add_plugin
from cms.test_utils.project.fakemlng.models import MainModel, Translations
class FakemlngFixtures(object):
def create_fixtures(self):
main = MainModel.objects.create()
en = Translations.objects.create(master=main, language_code='en')
Tr... |
awkspace/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_log_disk_filter.py | 23 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
glensc/node-gyp | refs/heads/master | gyp/test/mac/gyptest-type-envvars.py | 249 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test that MACH_O_TYPE etc are set correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(form... |
tealover/nova | refs/heads/master | nova/tests/functional/__init__.py | 89 | # Copyright (c) 2011 Justin Santa Barbara
#
# 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 applicab... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/aws_netapp_cvs_FileSystems.py | 19 | #!/usr/bin/python
# (c) 2019, NetApp Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""AWS Cloud Volumes Services - Manage fileSystem"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... |
luogangyi/Ceilometer-oVirt | refs/heads/stable/juno | ceilometer/network/notifications.py | 6 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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/LI... |
seanli9jan/tensorflow | refs/heads/master | tensorflow/python/keras/engine/training_arrays.py | 2 | # Copyright 2018 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... |
guewen/odoo | refs/heads/master | addons/base_import_module/models/ir_module.py | 20 | import logging
import os
import sys
import zipfile
from os.path import join as opj
import openerp
from openerp.osv import osv
from openerp.tools import convert_file
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
MAX_FILE_SIZE = 100 * 1024 * 1024 # in megabytes
class view(osv.osv):
_... |
necaris/python3-openid | refs/heads/master | openid/message.py | 5 | """Extension argument processing code
"""
__all__ = [
'Message', 'NamespaceMap', 'no_default', 'registerNamespaceAlias',
'OPENID_NS', 'BARE_NS', 'OPENID1_NS', 'OPENID2_NS', 'SREG_URI',
'IDENTIFIER_SELECT'
]
import copy
import warnings
import urllib.request
import urllib.error
from openid import oidutil
fr... |
Spleen64/Sick-Beard | refs/heads/master | lib/requests/packages/chardet2/__init__.py | 52 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... |
aginor/wesnoth | refs/heads/master | scons/lua.py | 49 | # vi: syntax=python:et:ts=4
from pkgconfig import run_pkg_config
from config_check_utils import find_include
from os.path import join
def CheckLua(context, require_version):
env = context.env
backup = env.Clone().Dictionary()
context.Message("Checking for Lua development files version " + require_version... |
tmhorne/simplewiki | refs/heads/master | tests/datetimetz.py | 5 | # -*- coding: utf-8 -*-
# Copyright 2014 Jaap Karssenberg <jaap.karssenberg@gmail.com>
from __future__ import with_statement
import tests
import warnings
import zim.datetimetz as datetime
class TestDateTimeZ(tests.TestCase):
# FIXME would be better to test correctness of results
# but first check funct... |
sameer2800/sam-s-club-auctions | refs/heads/master | flask/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py | 508 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import base
from ..constants import voidElements, namespaces
class T... |
bangoocms/bangoo | refs/heads/master | tests/settings/base_settings.py | 3 | SECRET_KEY = 'aaa'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
INSTALLED_APPS = (
'django.contrib.contenttypes', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.staticfiles',
'hvad', 'taggit',
### Bangoo core m... |
azure-contrib/splunk-azure-website-logs | refs/heads/master | bin/requests/packages/charade/gb2312prober.py | 231 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... |
yukoba/sympy | refs/heads/master | sympy/functions/special/elliptic_integrals.py | 75 | """ Elliptic integrals. """
from __future__ import print_function, division
from sympy.core import S, pi, I
from sympy.core.function import Function, ArgumentIndexError
from sympy.functions.elementary.hyperbolic import atanh
from sympy.functions.elementary.trigonometric import sin, tan
from sympy.functions.elementary... |
ryfeus/lambda-packs | refs/heads/master | Keras_tensorflow_nightly/source2.7/keras/applications/xception.py | 7 | # -*- coding: utf-8 -*-
"""Xception V1 model for Keras.
On ImageNet, this model gets to a top-1 validation accuracy of 0.790
and a top-5 validation accuracy of 0.945.
Do note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input p... |
alvaroaleman/ansible | refs/heads/devel | lib/ansible/plugins/callback/debug.py | 137 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
class CallbackModule(CallbackModule_default): # pylint: disable=too-few-public-methods,no-init
'''
Override for the default callback m... |
vitan/django | refs/heads/master | tests/template_tests/test_engine.py | 9 | import os
from django.template import Context
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
@ignore_warnings(cate... |
awacha/cct | refs/heads/master | cct/qtgui/devices/vacuum/__init__.py | 1 | from .vacuum import VacuumGauge
|
defance/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/dashboard.py | 15 | # -*- coding: utf-8 -*-
"""
Student dashboard page.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class DashboardPage(PageObject):
"""
Student dashboard, where the student can view
courses she/he has registered for.
"""
def __init__(self, browser):
"""Initialize th... |
maxdeliso/elevatorSim | refs/heads/master | Lib/test/test_importlib/test_util.py | 34 | from importlib import util
from . import util as test_util
import imp
import sys
import types
import unittest
class ModuleForLoaderTests(unittest.TestCase):
"""Tests for importlib.util.module_for_loader."""
def return_module(self, name):
fxn = util.module_for_loader(lambda self, module: module)
... |
Nikolay-Kha/PyCNC | refs/heads/master | tests/test_pulses.py | 1 | import unittest
from cnc.pulses import *
from cnc.config import *
from cnc.coordinates import *
from cnc import hal_virtual
class TestPulses(unittest.TestCase):
def setUp(self):
self.v = min(MAX_VELOCITY_MM_PER_MIN_X,
MAX_VELOCITY_MM_PER_MIN_Y,
MAX_VELOCITY_MM_PE... |
openpeer/webrtc-gyp | refs/heads/master | test/generator-output/actions/subdir1/make-prog1.py | 997 | #!/usr/bin/env python
# Copyright (c) 2009 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
contents = r"""
#include <stdio.h>
void prog1(void)
{
printf("Hello from make-prog1.py\n");
}
"""
open(sys.argv[1], 'w').wri... |
alexbruy/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/ExecuteSQL.py | 1 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ExecuteSQL.py -- use virtual layers to execute SQL on any sources
---------------------
Date : Jan 2016
Copyright : (C) 2016 by Hugo Mercier
Email : hugo... |
jettify/aiohttp_admin | refs/heads/master | demos/motortwit/motortwit/main.py | 2 | import asyncio
import logging
import pathlib
import aiohttp_jinja2
import jinja2
from aiohttp import web
import aiohttp_admin
import aiohttp_security
from motortwit import db
from motortwit.routes import setup_routes
from motortwit.views import SiteHandler
from motortwit.utils import (load_config, init_mongo, robo_a... |
rue89-tech/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py | 35 | """ Tests for library reindex command """
import sys
import contextlib
import ddt
from django.core.management import call_command, CommandError
import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTe... |
ktosiek/pytest-vcr | refs/heads/master | tests/test_vcr.py | 1 | # -*- coding: utf-8 -*-
from unittest import TestCase
import pytest
@pytest.fixture(scope='session', autouse=True)
def plugin_was_loaded(pytestconfig):
# Check that the plugin has been properly installed before proceeding
assert pytestconfig.pluginmanager.hasplugin("vcr")
def test_iana_example(testdir, liv... |
MyRookie/SentimentAnalyse | refs/heads/master | venv/lib/python2.7/site-packages/numpy/lib/tests/test_nanfunctions.py | 21 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
assert_raises, assert_array_equal
)
# Test data
_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.na... |
rbalda/neural_ocr | refs/heads/master | env/lib/python2.7/site-packages/django/core/files/utils.py | 395 | from django.utils import six
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
... |
ChinaMassClouds/copenstack-server | refs/heads/master | openstack/src/nova-2014.2/nova/scheduler/filters/all_hosts_filter.py | 115 | # Copyright (c) 2011-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
#
# Un... |
hsaputra/tensorflow | refs/heads/master | tensorflow/python/debug/wrappers/framework_test.py | 57 | # 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... |
petewarden/tensorflow | refs/heads/master | tensorflow/python/data/kernel_tests/list_files_test.py | 13 | # Copyright 2017 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... |
zurawiki/advert-crm | refs/heads/master | mysite/receivers.py | 1 | from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from account.signals import password_changed
from account.signals import user_sign_up_attempt, user_signed_up
from account.signals import user_login_attempt, user_logged_in
from eventlog.models import log
from django.core.mai... |
mcus/SickRage | refs/heads/master | lib/dateutil/tz.py | 20 | # -*- coding: utf-8 -*-
"""
This module offers timezone implementations subclassing the abstract
:py:`datetime.tzinfo` type. There are classes to handle tzfile format files
(usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ
environment string (in all known formats), given ranges (with help fr... |
calexil/FightstickDisplay | refs/heads/master | pyglet/lib.py | 1 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
adminneyk/codificacionproyectando | refs/heads/master | application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/lib2to3/fixes/fix_intern.py | 4 | # Copyright 2006 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for intern().
intern(s) -> sys.intern(s)"""
# Local imports
from .. import pytree
from .. import fixer_base
from ..fixer_util import Name, Attr
class FixIntern(fixer_base.BaseFix):
PATTERN = """
power< 'intern'
... |
tjw/swift | refs/heads/master | utils/bug_reducer/bug_reducer/bug_reducer.py | 65 | #!/usr/bin/env python
import argparse
import func_bug_reducer
import opt_bug_reducer
import random_bug_finder
def add_subparser(subparsers, module, name):
sparser = subparsers.add_parser(name)
sparser.add_argument('swift_build_dir',
help='Path to the swift build directory '
... |
eeshangarg/oh-mainline | refs/heads/master | mysite/profile/migrations/0049_add_year_started_field_to_citation.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... |
potatolondon/django-mediagenerator | refs/heads/master | mediagenerator/generators/manifest.py | 14 | from django.conf import settings
from django.template.loader import render_to_string
from mediagenerator.base import Generator
from mediagenerator.utils import get_media_mapping, prepare_patterns
OFFLINE_MANIFEST = getattr(settings, 'OFFLINE_MANIFEST', {})
if isinstance(OFFLINE_MANIFEST, basestring):
OFFLINE_MANIF... |
kgrvamsi/lightwave | refs/heads/master | vmdir/tools/test/python/common.py | 5 | import os
import sys
import re
DEFAULT_DOMAIN = 'vsphere.local'
DEFAULT_USER = 'administrator'
DEFAULT_PASSWORD = 'vmware'
DEFAULT_PORT = '389'
print 'running on %s' % (os.name)
if(os.name == 'nt'):
build = 'c:\\PROGRA~1\\vmware\\cis\\vmdird\\'
vdcpromo = build+'vdcpromo.exe'
vdcmerge = build+ 'vdcmerge.... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/235_test_warnings.py | 9 | import warnings
import os
import unittest
from test import test_support
# The warnings module isn't easily tested, because it relies on module
# globals to store configuration information. setUp() and tearDown()
# preserve the current settings to avoid bashing them while running tests.
# To capture the warning messa... |
LittleTodd/pythonWork | refs/heads/master | pyCheck.py | 1 | requested_toppings = []
if requested_toppings:
for requested_topping in requested_toppings:
print("Adding " + requested_topping + ".")
else:
print("Are you sure you want a plain pizza?")
available_toppings = ['mushrooms','olives','green peppers','pepperoni','pineapple','extra cheese']
requested_toppings = ['mush... |
xerosanyam/yowsup | refs/heads/master | yowsup/layers/protocol_media/protocolentities/test_iq_requestupload_result.py | 65 | from yowsup.layers.protocol_iq.protocolentities.test_iq_result import ResultIqProtocolEntityTest
from yowsup.layers.protocol_media.protocolentities import ResultRequestUploadIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
class ResultRequestUploadIqProtocolEntityTest(ResultIqProtocolEntityTest):
def se... |
maxsocl/django | refs/heads/master | django/contrib/flatpages/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FlatPagesConfig(AppConfig):
name = 'django.contrib.flatpages'
verbose_name = _("Flat Pages")
|
URXtech/scrapy | refs/heads/master | scrapy/linkextractors/sgml.py | 18 | """
SGMLParser-based Link extractors
"""
from six.moves.urllib.parse import urljoin
import warnings
from sgmllib import SGMLParser
from w3lib.url import safe_url_string
from scrapy.selector import Selector
from scrapy.link import Link
from scrapy.linkextractors import FilteringLinkExtractor
from scrapy.utils.misc impo... |
pyblish/pyblish-qml | refs/heads/master | pyblish_qml/host.py | 1 | import os
import sys
import inspect
import logging
import traceback
from functools import wraps
import pyblish.api
from . import ipc, settings, _state
from .vendor.six.moves import queue
MODULE_DIR = os.path.dirname(__file__)
SPLASH_PATH = os.path.join(MODULE_DIR, "splash.png")
log = logging.getLogger(__name__)
d... |
zak-k/cartopy | refs/heads/master | lib/cartopy/examples/aurora_forecast.py | 1 | """
Plotting the Aurora Forecast from NOAA on Orthographic Polar Projection
-----------------------------------------------------------------------
The National Oceanic and Atmospheric Administration (NOAA) monitors the
solar wind conditions using the ACE spacecraft orbiting close to the L1
Lagrangian point of the Sun... |
craigds/mapnik2 | refs/heads/master | scons/scons-local-1.2.0/SCons/Tool/jar.py | 12 | """SCons.Tool.jar
Tool-specific initialization for jar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is... |
xsynergy510x/android_external_chromium_org | refs/heads/cm-12.1 | tools/telemetry/telemetry/timeline/inspector_importer_unittest.py | 33 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.timeline import inspector_importer
from telemetry.timeline import inspector_timeline_data
from telemetry.timeline import model... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/pip/utils/encoding.py | 485 | import codecs
import locale
import re
BOMS = [
(codecs.BOM_UTF8, 'utf8'),
(codecs.BOM_UTF16, 'utf16'),
(codecs.BOM_UTF16_BE, 'utf16-be'),
(codecs.BOM_UTF16_LE, 'utf16-le'),
(codecs.BOM_UTF32, 'utf32'),
(codecs.BOM_UTF32_BE, 'utf32-be'),
(codecs.BOM_UTF32_LE, 'utf32-le'),
]
ENCODING_RE = r... |
draklaw/lair | refs/heads/master | python/lair/sys_sdl2.py | 1 | #!/usr/bin/env python3
##
## Copyright (C) 2015 Simon Boyé
##
## This file is part of lair.
##
## lair 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 o... |
cryptapus/electrum | refs/heads/master | electrum/gui/kivy/uix/dialogs/seed_options.py | 19 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
Builder.load_string('''
<SeedOptionsDialog@Popup>
id: popup
title: _('Seed Options')
size_hint: 0.8, 0.8
pos_hint: {'top':0.9}
BoxLayout:
orientation: 'vertical... |
SoftwareMaven/django | refs/heads/master | django/core/files/utils.py | 395 | from django.utils import six
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
... |
nwiizo/workspace_2017 | refs/heads/master | pipng/gravitate2/Options.py | 2 | #!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or 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)... |
mitchrule/Miscellaneous | refs/heads/master | Django_Project/django/Lib/site-packages/pip/_vendor/html5lib/inputstream.py | 435 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from pip._vendor.six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import util... |
jalama/drupdates | refs/heads/master | drupdates/tests/behavioral/test_yaml_report.py | 1 | """ Test a valid yaml file is output. """
import os, yaml
from drupdates.tests.behavioral.behavioral_utils import BehavioralUtils
from drupdates.tests import Setup
class TestYamlReport(object):
""" Test a valid yaml file is output. """
@classmethod
def setup_class(cls):
""" Setup test class. """
... |
looooo/py-eigen | refs/heads/master | setup.py | 1 | from distutils.core import setup, Extension
from distutils import sysconfig
import sys
include_dirs = ["/usr/include/eigen3/"]
setup(name='paraEigen',
version='0.0.1',
author='Loooo',
author_email='sppedflyer@gmail.com',
url="https://github.com/looooo/py-eigen",
description='Wrap parts o... |
abaditsegay/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/SimpleHTTPServer.py | 64 | """Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.6"
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import shutil
import mimetypes... |
oleduc/nefertari-sqla | refs/heads/master | setup.py | 2 | from setuptools import setup, find_packages
install_requires = [
'elasticsearch',
'nefertari',
'psycopg2',
'pyramid_sqlalchemy',
'pyramid_tm',
'six',
'sqlalchemy',
'sqlalchemy_utils',
'zope.dottedname',
]
setup(
name='nefertari_sqla',
version="0.4.1",
description='sqla ... |
Kamp9/scipy | refs/heads/master | scipy/sparse/dia.py | 53 | """Sparse DIAgonal format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dia_matrix', 'isspmatrix_dia']
import numpy as np
from .base import isspmatrix, _formats
from .data import _data_matrix
from .sputils import isshape, upcast_char, getdtype... |
slisson/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_imports.py | 326 | """Fix incompatible imports and module references."""
# Authors: Collin Winter, Nick Edds
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {'StringIO': 'io',
'cStringIO': 'io',
'cPickle': 'pickle',
'__builtin__' : 'builtins',
'c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.