content stringlengths 4 20k |
|---|
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .brightcove import BrightcoveLegacyIE
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
class RMCDecouverteIE(InfoExtractor):
_VALID_URL = r'https?://rmcdecouverte\.bfmtv\.com/mediaplayer-replay.*?\bid... |
from chaco.api import LinePlot, LinearMapper, DataView, ArrayDataSource
from chaco.tools.api import ZoomTool, PanTool
from enable.api import Pointer
from traits.api import Tuple, Bool, on_trait_change
# =============standard library imports ========================
from numpy import hstack
# =============local library... |
"""Tests for xla.reduce_window."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.tests import xla_test
from tensorflow.compiler.tf2xla.python import xla
from tensorflow.python.framework import dtypes
from tenso... |
#:coding=utf-8:
import csv
from django import forms
from django.forms.formsets import (
TOTAL_FORM_COUNT, INITIAL_FORM_COUNT, MAX_NUM_FORM_COUNT,
DELETION_FIELD_NAME, BaseFormSet, formset_factory
)
from django.forms.models import modelformset_factory, BaseModelFormSet
from utils import UnicodeReader
def csv... |
#!/usr/bin/python
"""
Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Authors and contributors: Eric Shook (<EMAIL>);
Website: http://hpcgis.geog.kent.edu
"""
import json
im... |
import re
import unittest
import urllib
import filters
import jinja2
def linkify(inp, commit):
return str(filters.do_linkify_stacktrace(
inp, commit, 'kubernetes/kubernetes'))
class HelperTest(unittest.TestCase):
def test_timestamp(self):
self.assertEqual(
'<span class="timesta... |
from gppylib import gplog, pgconf
from gppylib.commands import gp
from gppylib.db import catalog, dbconn
from gppylib.utils import toNonNoneString, checkNotNone
logger = gplog.get_default_logger()
class GpMasterEnvironment:
"""
Encapsulates information about the environment in which the script is running AND... |
"""Module that groups code required to handle state restore for component."""
from typing import Iterable, Optional
from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.loader import bind_hass
@bind_hass
async def async_reproduce_states(hass: Hom... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
import os
import time
from collections import defaultdict
from ansible.release import __version__ as ansible_version
# Pylint doesn't understand Python3 namespace modules.
from ..commands import Command # pylin... |
# hack to return special attributes
from _sys import *
from javascript import JSObject
has_local_storage=__BRYTHON__.has_local_storage
has_session_storage = __BRYTHON__.has_session_storage
has_json=__BRYTHON__.has_json
argv = ['__main__']
base_exec_prefix = __BRYTHON__.brython_path
base_prefix = __BRYTHON__.brython... |
# -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.addons.web.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, m... |
from oslo_utils import uuidutils
from nova import context
from nova import exception
from nova.objects import cell_mapping
from nova import test
from nova.tests import fixtures
class CellMappingTestCase(test.NoDBTestCase):
def setUp(self):
super(CellMappingTestCase, self).setUp()
self.useFixture(... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
ARGS = dict(foo=False, bar=[1, 2, 3], bam="bam", baz=u'baz')
ARGUMENT_SPEC = dict(
foo=dict(default=True, type='bool'),
bar=dict(default=[], type='list'),
bam=dict(default="bam"),
baz=dict(default=u"ba... |
"""Misc zlib tests
Made for Jython.
"""
import unittest
import zlib
from array import array
from test import test_support
class ArrayTestCase(unittest.TestCase):
def test_array(self):
self._test_array(zlib.compress, zlib.decompress)
def test_array_compressobj(self):
def compress(value):
... |
"""
Load centrality.
"""
# Copyright (C) 2004-2010 by
# Aric Hagberg <<EMAIL>>
# Dan Schult <<EMAIL>>
# Pieter Swart <<EMAIL>>
# All rights reserved.
# BSD license.
__author__ = "\n".join(['Aric Hagberg (<EMAIL>)',
'Pieter Swart (<EMAIL>)',
'Sasha Gut... |
"""Implementation of Gaussian mixture model (GMM) clustering using tf.Learn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib import framework
from tensorflow.contrib.factorization.python.ops import gmm_ops
from... |
import os
import tempfile
import fixtures
import mock
from oslo_config import cfg
import nova.conf.compute
from nova import config
from nova import test
class ConfTest(test.NoDBTestCase):
"""This is a test and pattern for parsing tricky options."""
class TestConfigOpts(cfg.ConfigOpts):
def __call__... |
"""Tests for samba.registry."""
import os
from samba import registry
import samba.tests
from samba import WERRORError
from subprocess import Popen, PIPE
class HelperTests(samba.tests.TestCase):
def test_predef_to_name(self):
self.assertEquals("HKEY_LOCAL_MACHINE",
registry.get_... |
import command
import gitutil
import os
def FindGetMaintainer():
"""Look for the get_maintainer.pl script.
Returns:
If the script is found we'll return a path to it; else None.
"""
try_list = [
os.path.join(gitutil.GetTopLevel(), 'scripts'),
]
# Look in the list
for pat... |
"""
@summary: Adds file sizes to csv file
"""
import csv
import os
inCsvFn = '/data/geo716/final project/data/projections2.csv'
outCsvFn = '/data/geo716/final project/data/projections.csv'
binDir = '/data/geo716/final project/data/bins/'
rleDir = '/data/geo716/final project/data/rles/'
hilbertDir = '/data/geo716/fina... |
"""
Changes existing question.extra on all registrations and draft registrations
to a list. Required for multiple files attached to a question.
"""
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as scripts_utils
from website.models import Node, DraftRegist... |
import os
import re
import unittest
import xen.xend.XendOptions
xen.xend.XendOptions.XendOptions.config_default = '/dev/null'
from xen.xend.server import netif
FAKE_DOMID = 42
FAKE_DEVID = 63
xoptions = xen.xend.XendOptions.instance()
class test_controllers(unittest.TestCase):
def testNetif(self):
... |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
from past.builtins import basestring
import string
from pyingest.config.utils import u2asc
from .jats import JATSParser
from .author_init import AuthorInitial
from pyingest.config.config import *
from pyingest.parsers.en... |
import os
import sys
import shlex
import subprocess
import select
def run_cmd(cmd, live=False, readsize=10):
#readsize = 10
cmdargs = shlex.split(cmd)
p = subprocess.Popen(cmdargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = ''
stderr = ''
rpipes = [p.stdout, p.stderr]
while... |
"""
Verifies file copies using the build tool default.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('copies.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('copies.gyp', chdir='relocate/src')
test.must_match(['relocate', 'src', 'copies-out', 'file1'], 'file1 contents\n')
test.built... |
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.automation.base import Automation
log = CPLog(__name__)
autoload = 'Hummingbird'
class Hummingbird(Automation):
def getIMDBids(self):
movies = []
for movie in self.getWatchlist():
imdb = self.search(movie[0], movie[1])
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the file system implementation using gzip."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs.vfs import gzip_file_system
from tests import test_lib as shared... |
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '4')
gi.require_version('PeasGtk', '1.0')
from gi.repository import GObject, Gio, Gtk, Gedit, PeasGtk
from .services.services import Services
from .services.apertium import Apertium
from .translateview import TranslateView
from .preferences imp... |
import boto
from tests.compat import unittest
class TestCloudWatchLogs(unittest.TestCase):
def setUp(self):
self.logs = boto.connect_logs()
def test_logs(self):
logs = self.logs
response = logs.describe_log_groups(log_group_name_prefix='test')
self.assertIsInstance(response['... |
from tests.unit import AWSMockServiceTestCase
from boto.ec2.connection import EC2Connection
class TestCancelSpotInstanceRequests(AWSMockServiceTestCase):
connection_class = EC2Connection
def default_body(self):
return b"""
<CancelSpotInstanceRequestsResponse xmlns="http://ec2.amazonaws.... |
import openerp.addons.decimal_precision as dp
from openerp import models, fields, api
class WizCreateInvoice(models.TransientModel):
_name = 'wiz.create.invoice'
_description = 'Wizard to create invoices'
partner_id = fields.Many2one("res.partner", string="Partner")
journal_id = fields.Many2one("acco... |
'''
IAF Neuron example
------------------
A DC current is injected into the neuron using a current generator
device. The membrane potential as well as the spiking activity are
recorded by corresponding devices.
It can be observed how the current charges the membrane, a spike
is emitted, the neuron becomes absolute ... |
from __future__ import unicode_literals
from guessit import fileutils
import os.path
import logging
log = logging.getLogger(__name__)
def process(mtree):
"""Returns the filename split into [ dir*, basename, ext ]."""
components = fileutils.split_path(mtree.value)
basename = components.pop(-1)
compone... |
import threading
class _RequestCache(threading.local):
"""
A thread-local for storing the per-request cache.
"""
def __init__(self):
super(_RequestCache, self).__init__()
self.data = {}
self.request = None
REQUEST_CACHE = _RequestCache()
class RequestCache(object):
@cla... |
"""
@authors: Sergei Garbuzov
@status: Development
@version: 1.1.0
"""
import time
from pysdn.controller.controller import Controller
from pysdn.controller.inventory import (Inventory,
OpenFlowCapableNode,
GroupFeatures)
from pysdn.com... |
import txrestapi
__package__="txrestapi"
import re
import os.path
import doctest
from six import PY2, b, u
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.web.resource import Resource, NoResource
from twisted.web.server import Request, Site
from twisted.web.client im... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['stableinterface'],
'supported_by': 'community'}
# ===========================================
# HipChat module specific support met... |
'''
New Integration Test for pf vip qos.
@author: chenyuanxu
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.zstack_test.zstack_test_port_forwarding as zstack_pf_header
import apibinding.inventory... |
# -*- coding: utf-8 -*-
import sys
import textwrap
import _pytest.assertion as plugin
import _pytest._code
import py
import pytest
from _pytest.assertion import reinterpret
from _pytest.assertion import util
PY3 = sys.version_info >= (3, 0)
@pytest.fixture
def mock_config():
class Config(object):
verbos... |
import logging
from desktop.lib.python_util import force_dict_to_strings
from exception import SqoopException
from config import Config
class Link(object):
SKIP = ('id', 'creation_date', 'creation_user', 'update_date', 'update_user')
def __init__(self, name, connector_id, link_config_values=None, enabled=True... |
#-*- encoding: utf-8 -*-
from django.contrib.auth import authenticate, login as login_user, logout as logout_user
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
fro... |
class gpio:
dir = '0'
set = '0'
clr = '0'
alt = '0'
desc = ''
def __init__(self, dir=0, set=0, clr=0, alt=0, desc=''):
self.dir = dir
self.set = set
self.clr = clr
self.alt = alt
self.desc = desc
# the following is a dictionary of all GPIOs in the system
# the key is the GPIO number
pxa255_alt_fu... |
# -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
import time
import random
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import module_boot, login_redirect
_logger = logging.getLogger(__name__)
html_template = """<!DOCTYPE html>
<h... |
from sympy import Float, I, Integer, Matrix
from sympy.external import import_module
from sympy.utilities.pytest import skip
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.represent import (represent, rep_innerproduct,
rep_expectation, enumerate_... |
apikey='DNi_vTVLPNfTEFuqu5F9MrPI3iecf8iRQ3QtGUH1IM2Nd96wNwNlf7BzmF1W8aw6cE2ejZCgyE53wT5VpzauuA'
secretkey='x4jM12uE4LNho3ZNJa8J-Ve6WsgEXd8df1mGGfeuJHMtolkaSBkD5pLX0tvj8YrWhBgtZbKgYsTB00kb7z_3BA'
path='/client/api'
host='localhost'
port='8080'
protocol='http' |
"""
Tests for line search routines
"""
import sys
from numpy.testing import assert_, assert_equal, dec, \
assert_array_almost_equal, assert_array_almost_equal_nulp
import scipy.optimize.linesearch as ls
import numpy as np
def assert_wolfe(s, phi, derphi, c1=1e-4, c2=0.9, err_msg=""):
"""
Check that stro... |
"""
Provides an emulator/replacement for Python's standard import system.
@@TR: Be warned that Import Hooks are in the deepest, darkest corner of Python's
jungle. If you need to start hacking with this, be prepared to get lost for a
while. Also note, this module predates the newstyle import hooks in Python 2.3
http:/... |
import boto
from boto.connection import AWSQueryConnection
from boto.regioninfo import RegionInfo
from boto.exception import JSONResponseError
from boto.cloudtrail import exceptions
from boto.compat import json
class CloudTrailConnection(AWSQueryConnection):
"""
AWS CloudTrail
This is the CloudTrail API R... |
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.viewkeys() -> d.keys()
d.viewitems() -> d.items()
d.viewvalues() -> d.values()
Except in certain very... |
import os
from .base import NullBrowser, ExecutorBrowser, require_arg
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExecutor, ServoWdspecExecutor
here = os.path.join(os.path.split(__file__)[0])
__wptrunner__ = {
"produc... |
#!/bin/env python
"""
Compress and delete a folder if 50% of the files inside it are less than 2MB.
It only considers files in the first level of the folder.
"""
import os
import shutil
import sys
import tarfile
from contextlib import contextmanager
@contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.... |
import hr_timesheet_current
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from ..geometry import create_sphere
from .mesh import MeshVisual
from .visual import CompoundVisual
class SphereVisual(CompoundVisual):
"""Visual that displays a sphere
Parameters
----------
radius : float
The size of the sphere.
cols : int
Number of cols that make up the sphere ... |
# System library imports
from pygments.token import Token, is_token_subtype
class CompletionLexer(object):
""" Uses Pygments and some auxillary information to lex code snippets for
symbol contexts.
"""
# Maps Lexer names to a list of possible name separators
separator_map = { 'C' : [ '.', '->... |
"""Finds iOS browsers that can be controlled by telemetry."""
import logging
import re
import subprocess
from telemetry import decorators
from telemetry.core import browser
from telemetry.core import platform
from telemetry.core import possible_browser
from telemetry.core.backends.chrome import inspector_backend
from... |
from PIL import Image
from PIL import FontFile
from PIL import _binary
# --------------------------------------------------------------------
# declarations
PCF_MAGIC = 0x70636601 # "\x01fcp"
PCF_PROPERTIES = (1 << 0)
PCF_ACCELERATORS = (1 << 1)
PCF_METRICS = (1 << 2)
PCF_BITMAPS = (1 << 3)
PCF_INK_METRICS = (1 << ... |
# Copyright 2015 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... |
"""
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile
from django.utils.encoding import python_2_unicode_comp... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from sleekxmpp.stanza import Message
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.xmls... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 3 of the License, or (at your
option... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMethods in the Ruby Koans
#
from runner.koan import *
def my_global_function(a,b):
return a + b
class AboutMethods(Koan):
def test_calling_a_global_function(self):
self.assertEqual(__, my_global_function(2,3))
# NOTE: Wro... |
"""
Utility functions for Image transfer and manipulation.
"""
import os
import tarfile
import tempfile
from lxml import etree
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import strutils
from oslo_utils import units
from oslo_vmware import rw_handles
from nova import exception
fro... |
from base import BaseAGSServer
import layer
from filters import LayerDefinitionFilter, GeometryFilter, TimeFilter
########################################################################
class FeatureService(BaseAGSServer):
""" contains information about a feature service """
_url = None
_currentVersion = N... |
import atexit
import fcntl
import grp
import logging as std_logging
from logging import handlers
import os
import pwd
import signal
import sys
from oslo_log import log as logging
from neutron._i18n import _, _LE, _LI
from neutron.common import exceptions
LOG = logging.getLogger(__name__)
DEVNULL = object()
# Note:... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ImportError:... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class hr_grant_badge_wizard(osv.TransientModel):
_name = 'gamification.badge.user.wizard'
_inherit = ['gamification.badge.user.wizard']
_columns = {
'employee_id': fields.many2one("hr.employee", string='Employee', required=T... |
import ray
import os
import signal
import time
import sys
def test_was_current_actor_reconstructed(shutdown_only):
ray.init()
@ray.remote(max_restarts=10)
class A(object):
def __init__(self):
self._was_reconstructed = ray.get_runtime_context(
).was_current_actor_reconstruc... |
apiAttachAvailable = u'API Available'
apiAttachNotAvailable = u'Not Available'
apiAttachPendingAuthorization = u'Pending Authorization'
apiAttachRefused = u'Refused'
apiAttachSuccess = u'Success'
apiAttachUnknown = u'Unknown'
budDeletedFriend = u'Deleted From Friendlist'
budFriend = u'Friend'
budNeverBeenFriend = u'Nev... |
from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import exceptions
from horizon import tabs
from openstack_dashboard.api import base
from openstack_dashboard.api import keystone
from openstack_dashboard.api import nova
from openstack_dashboard.usage import quotas
from openstack_dashboard.... |
import os, time, shutil, xmlrpclib, socket, pprint
from signal import *
from hodlib.Common.logger import hodLog, hodDummyLogger
from hodlib.Common.socketServers import hodXMLRPCServer
from hodlib.Common.util import local_fqdn
from hodlib.Common.xmlrpc import hodXRClient
class hodBaseService:
"""hodBaseService clas... |
import time
from proton.reactor import Reactor
class Program:
# If an event occurs and its handler doesn't have an on_<event>
# method, the reactor will attempt to call the on_unhandled method
# if it exists. This can be useful not only for debugging, but for
# logging and for delegating/inheritance.
... |
import urllib2
import httplib
import base64
import re
import time
try:
import xml.etree.cElementTree as ET
except (AttributeError, ImportError):
import xml.etree.ElementTree as ET
try:
ET.ElementTree.iterfind
except AttributeError as ex:
del(ET)
import etree.ElementTree as ET
def _xml_del_... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class Sport5IE(InfoExtractor):
_VALID_URL = r'http://(?:www|vod)?\.sport5\.co\.il/.*\b(?:Vi|docID)=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://vod.sport5.co... |
#! /usr/bin/env python
# encoding: UTF-8
# Thomas Nagy 2008-2010 (ita)
"""
Doxygen support
Variables passed to bld():
* doxyfile -- the Doxyfile to use
When using this tool, the wscript will look like:
def options(opt):
opt.load('doxygen')
def configure(conf):
conf.load('doxygen')
# check conf.env.DOXYGEN... |
{
'name': 'Membership Management',
'version': '1.0',
'category': 'Sales',
'description': """
This module allows you to manage all operations for managing memberships.
=========================================================================
It supports different kind of members:
-----------------------... |
# -*- coding: utf-8 -*-
from django.utils.translation import get_language
from cms import constants
from cms.apphook_pool import apphook_pool
from cms.utils.permissions import load_view_restrictions, has_global_page_permission
from cms.utils import get_language_from_request
from cms.utils.conf import get_cms_setting
f... |
import glob
import hashlib
import logging
import os
import platform
import re
import shutil
import subprocess
from telemetry import decorators
from telemetry.core import platform as telemetry_platform
from telemetry.core import util
from telemetry.core.platform.profiler import android_prebuilt_profiler_helper
from tel... |
"""Interfaces for platform-specific functionality.
This module exists primarily for documentation purposes and as base classes
for other tornado.platform modules. Most code should import the appropriate
implementation from `tornado.platform.auto`.
"""
from __future__ import absolute_import, division, print_function,... |
"""
MS-DOS structures.
Documentation:
- File attributes:
http://www.cs.colorado.edu/~main/cs1300/include/ddk/winddk.h
"""
from lib.hachoir_core.field import StaticFieldSet
from lib.hachoir_core.field import Bit, NullBits
_FIELDS = (
(Bit, "read_only"),
(Bit, "hidden"),
(Bit, "system"),
(NullBits, "... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
HEADRequest,
str_to_int,
urlencode_postdata,
urlhandle_detect_ext,
)
class HearThisAtIE(InfoExtractor):
... |
{
'name': 'Calendar',
'version': '1.0',
'depends': ['base', 'base_status', 'mail', 'base_action_rule'],
'summary': 'Personal & Shared Calendar',
'description': """
This is a full-featured calendar system.
========================================
It supports:
------------
- Calendar of events
... |
"""Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from warnings import warn
# Try Python 2 first, otherwise load from Python 3
try:
from StringIO import StringIO
except:
from io import StringIO
class Reader(object):
"""A line-based s... |
from email.MIMEBase import MIMEBase
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail import EmailMultiAlternatives
from django.core.exceptions import ImproperlyConfigured
from google.appengine.api import mail as aeemail
from google.appengine.runtime import apiproxy_errors
def _send_def... |
#!/usr/bin/env python
# encoding: utf-8
"""
analyze.py
Created by Jakub Konka on 2012-10-23.
Copyright (c) 2012 University of Strathclyde. All rights reserved.
"""
import argparse
import csv
import numpy as np
import os
import os.path
import scipy.stats as stats
import sys
### Parse command line arguments
parser = a... |
#!/usr/bin/env python
# run with nose: nosetests -v test_euler.py
from nose.tools import *
import networkx as nx
from networkx import is_eulerian,eulerian_circuit
class TestEuler:
def test_is_eulerian(self):
assert_true(is_eulerian(nx.complete_graph(5)))
assert_true(is_eulerian(nx.complete_graph(... |
from flask import Flask, request, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flaskext.auth import Auth, login_required, logout
from flaskext.auth.models.sa import get_user_class
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
db = SQLAlchemy(app)
auth = Au... |
#!/usr/bin/env python3
# coding=utf-8
import json
import os
from shared import domain_list, config_file
# certbot tries to write to /var/log/letsencrypt by default; because of this, running as root is required.
# certbot Error Message:
# Either run as root, or set --config-dir, --work-dir, and --logs-dir to writeable... |
# Use this module for e-mailing.
from django.conf import settings
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
import smtplib
import socket
import time
import random
# Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
# seconds, which... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.shortcuts import render_to_kmz
from django.contrib.gis.tests.utils import no_oracle
from django.db.models import Count, Min
from django.test import TestC... |
# ########################################################################
# elf2MockCreator/findUndefs
#
# Find undefined symbols reffered in the elf object
#
# Artur Lozinski (lozinski dot artur at gmail dor com)
# This code is the public domain
# ######################################################################... |
# encoding: utf-8
"""
Test suite for docx.image.gif module
"""
from __future__ import absolute_import, print_function
import pytest
from docx.compat import BytesIO
from docx.image.constants import MIME_TYPE
from docx.image.gif import Gif
from ..unitutil.mock import initializer_mock
class DescribeGif(object):
... |
from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six
from django.utils import t... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_fill_inventory(osv.osv_memory):
_name = "stock.fill.inventory"
_description = "Import Inventory"
def _default_location(self, cr, uid, ids, context=None):
try:
loc_model, location_id = self.pool.get('i... |
import asyncio
import ssl
import aiomysql
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ctx.check_hostname = False
ctx.load_verify_locations(cafile='../tests/ssl_resources/ssl/ca.pem')
async def main():
async with aiomysql.create_pool(
host='localhost', port=3306, user='root',
password='rootpw... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.training.python.training import sampling_ops
from tensorflow.python.framework import dtypes as dtypes_lib
from tensorflow.python.framework import random_seed
from tensorflow.python.ops i... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from test import test_support
import marshal
import sys
import unittest
import os
class IntTestCase(unittest.TestCase):
def test_ints(self):
# Test the full range of Python ints.
n = sys.maxint
while n:
for expected in (-n, n):... |
from submission import Submission
import random
import networkx as nx
class AyoubSubmission(Submission):
def author(self):
return 'ayoub'
def run(self, input):
graph, start = input
V = set() # Noeuds visités
S = list(graph.keys()) # Liste de tous les noeuds dan... |
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from play_api import views
urlpatterns = patterns('',
url(r'^api/registration/$', views.api_registration ,name='api_registration'),
url(r'^api/facebook_auth/$', views.f... |
"""SCons.Tool.mwld
Tool-specific initialization for the Metrowerks CodeWarrior linker.
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__
#
# Permission is hereby granted, free of charge, to an... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
# response.lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.