code
stringlengths
1
199k
import sublime import timeit from functools import partial from os.path import dirname from ..project_watcher import ProjectWatcher from .. import utils from . import custom_tag_index def generate_tag_map(custom_tag_folders, index, project_file_dir): tag_map = {} for tag_folder in custom_tag_folders: ro...
from ltk.actions.action import * from tabulate import tabulate class ListAction(Action): def __init__(self, path): Action.__init__(self, path) def list_action(self, **kwargs): if 'id_type' in kwargs and kwargs['id_type']: id_type = kwargs['id_type'] if id_type == 'workflo...
from __future__ import unicode_literals import pytest from queue import Queue @pytest.fixture def full_queue(): queue = Queue() queue.enqueue(True) queue.enqueue('a string') queue.enqueue(5) queue.enqueue(10) return queue def test_constructor(): queue = Queue() assert queue.head is None ...
""" Copyright (c) 2015-2017 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distrib...
from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class RouteTablesOperations(object): """RouteTablesOperations operations. :param client: Client for service requests. ...
import os import glob from fabric import local import sys LOCAL_PACKAGES = ( 'examples', '', ) PROJECT_ROOT = os.path.abspath(os.path.curdir) PY_VERSION = 'python%s.%s' % (sys.version_info[0], sys.version_info[1]) def bootstrap(): # Create new virtual environment in a new location. We will atomically swap t...
import os import sys sys.path.insert(0, os.path.abspath('../..')) project = 'Duct' copyright = "2019, Jack O'Connor" author = "Jack O'Connor" extensions = [ "sphinx.ext.autodoc", "sphinx.ext.coverage", "sphinx.ext.napoleon", ] templates_path = ['_templates'] exclude_patterns = [] autodoc_default_options = {...
from .resource import Resource class GalleryImage(Resource): """A gallery image. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The identifier of the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :iv...
import os from flask import Flask, Response, request, url_for import plivoxml from utils import joke_from_reddit PLIVO_SONG = "https://s3.amazonaws.com/plivocloud/music.mp3" IVR_MESSAGE = "Welcome to the Plivo IVR Demo App. Press 1 to hear a random \ joke. Press 2 to listen to a song." NO_INPUT_MESSAGE ...
from callgraph.symbols import InvalidSymbol class NodeLocalVariables(object): pass class NodeRegistry(type): """ Metaclass that registers all subclasses for make_node method. """ def __new__(cls, name, bases, cls_dict): child_cls = type.__new__(cls, name, bases, cls_dict) return child_cl...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('appliances', '0035_auto_20160922_1635'), ] operations = [ migrations.AddField( model_name='template', name='ga_released', field=models.BooleanField(default=F...
""" Gromacs selections ================== Write :class:`MDAnalysis.core.groups.AtomGroup` selection to a `ndx`_ file that defines a Gromacs_ index group. To be used in Gromacs like this:: <GROMACS_COMMAND> -n macro.ndx The index groups are named *mdanalysis001*, *mdanalysis002*, etc. .. _Gromacs: http://www.gromacs.o...
from __future__ import print_function import matplotlib matplotlib.use('Agg') import pylab as plt import numpy as np import os import sys from astrometry.util.fits import fits_table from astrometry.libkd.spherematch import match_radec from astrometry.util.plotutils import PlotSequence from legacyanalysis.ps1cat import ...
""" EasyBuild support for building and installing PSI, implemented as an easyblock @author: Kenneth Hoste (Ghent University) @author: Ward Poelmans (Ghent University) """ from distutils.version import LooseVersion import glob import os import shutil import tempfile import easybuild.tools.environment as env from easybui...
import os import sys import threading import Queue import time import traceback from duplicity import globals from duplicity import log from duplicity.errors import * #@UnusedWildImport from duplicity.filechunkio import FileChunkIO from duplicity import progress from ._boto_single import BotoBackend as BotoSingleBacken...
import os import logging from collections import defaultdict import bb.utils logger = logging.getLogger("BitBake.Cache") try: import cPickle as pickle except ImportError: import pickle logger.info("Importing cPickle failed. " "Falling back to a very slow implementation.") __cache_version__ =...
import warnings from django.conf.urls import patterns, url warnings.warn('showcase_urls.py has been deprecated. Remove it from your urls.py file.', DeprecationWarning) urlpatterns = patterns('wirecloud.platform.widget.views')
import nest import nest.voltage_trace nest.ResetKernel() dep_params={"U":0.67, "weight":250.} fac_params={"U":0.1, "tau_fac":1000.,"tau_rec":100.,"weight":250.} t1_params=fac_params # for tsodyks_synapse t2_params=t1_params.copy() # for tsodyks2_synapse nest.SetDefaults("tsodyks_synapse",t1_params) nest.SetDefaul...
import sys import time from spacewalk.common import rhnFlags from spacewalk.common.rhnConfig import initCFG from spacewalk.server import rhnSQL, rhnChannel, rhnServer, rhnUser def test_server_search(use_key=0): if use_key: user = None else: user = 'mibanescu-plain' u = rhnUser.search(user) ...
""" Provide the event view. """ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext import logging _LOG = logging.getLogger(".plugins.eventview") from gi.repository import Gtk from gramps.gen.lib import Event from gramps.gui.views.listview import ListView, TEXT, MARKUP, ICON from gramp...
from jinja2 import Environment, PackageLoader from sanic.response import html from .config import your_app , your_app_template app_env = Environment(loader = PackageLoader(your_app,your_app_template)) def _render(template,context): html_template = app_env.get_template(str(template)) html_content = html_template...
""" Package init for the cli package. """
''' ''' import sys import binascii def main(argv): argc = len(argv) if argc < 3: print 'Usage:', argv[0], 'input.eml output.mfd' sys.exit(1) try: file_inp = open(argv[1], "r") file_out = open(argv[2], "wb") line = file_inp.readline() while line: li...
from pyramid.config import Configurator def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings) config.include('pyramid_jinja2') config.add_static_view('static', 'static', cache_max_age=3600) config.add_route('home',...
"""Provides the Session class. Sessions are combinations of PtyProcess and Emulation. The stuff in here does not really belong to the terminal emulation framework. It serves it's duty by providing a single reference to TEPTy/Emulation pairs. In fact, it is only there to demonstrate one of the abilities of the framework...
""" Tests for the GitHub plugin """ from __future__ import unicode_literals, absolute_import import pytest import did.cli INTERVAL = "--since 2015-09-05 --until 2015-09-06" CONFIG = """ [general] email = "Petr Splichal" <psplicha@redhat.com> [gh] type = github url = https://api.github.com/ login = psss """ def test_git...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('review', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('core', '0001_initial'...
"""Helper functions for creating the most common surfaces and related tasks. The helper functions can create the most common low-index surfaces, add vacuum layers and add adsorbates. """ from math import sqrt from operator import itemgetter import numpy as np from ase.atom import Atom from ase.atoms import Atoms from a...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import dbmail.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), ] operat...
deviceNumbers = [1, 4, 1, 29] print (deviceNumbers) itemIndex = 0 while itemIndex < len(deviceNumbers): # retrieve current list item currentDeviceNumber = deviceNumbers[itemIndex] if currentDeviceNumber == 1: print("discovered value 1 at position %i" % (itemIndex)) else: # nothing happens otherwise, so far pa...
from omero.cli import BaseControl, CLI import sys import os HELP = "Robot framework configuration/deployment tools" class RobotControl(BaseControl): def _configure(self, parser): sub = parser.sub() config = parser.add( sub, self.config, "Output a config template for the Robot...
import uuid from .servicebase import ServiceBase DIS_SERVICE_UUID = uuid.UUID('0000180A-0000-1000-8000-00805F9B34FB') MANUFACTURER_CHAR_UUID = uuid.UUID('00002A29-0000-1000-8000-00805F9B34FB') MODEL_CHAR_UUID = uuid.UUID('00002A24-0000-1000-8000-00805F9B34FB') SERIAL_CHAR_UUID = uuid.UUID('00002A...
import unittest from mock import patch, sentinel from pysparc import util class UtilTest(unittest.TestCase): def test_clipped_map_clips_low(self): clipped, mapped = util.clipped_map(0, 1, 10, 10, 100) self.assertEqual(clipped, 1) def test_clipped_map_clips_high(self): clipped, mapped = u...
import urllib from core import jsontools from core import scrapertools from core.item import Item from platformcode import logger CHANNELNAME = "youtube_channel" YOUTUBE_V3_API_KEY = "AIzaSyCjsmBT0JZy1RT-PLwB-Zkfba87sa2inyI" def youtube_api_call(method, parameters): logger.info("method=" + method + ", parameters=" ...
""" Unit test for read-write lock based on the following article: http://code.activestate.com/recipes/577803-reader-writer-lock-with-priority-for-writers/ """ import unittest import threading import time import copy from onedrive_d.vendor.rwlock import RWLock class Writer(threading.Thread): def __init__(self, buffe...
from __future__ import absolute_import import logging import sys import warnings import six LOGGING_FORMAT = "%(asctime)s - %(origin)-32s - %(message)s" LOGGING_DATEFORMAT = "%Y-%m-%d %H:%M:%S" class OriginContextFilter(logging.Filter): """Context filter to include 'origin' attribute in record """ def filte...
from abjad import * def test_durationtools_Duration___init___01(): duration = Duration(3, 5) assert isinstance(duration, Duration) duration = Duration((3, 5)) assert isinstance(duration, Duration)
from synch import Synch class NoneSynch(Synch): def __init__(self): pass def exists_source(self): return False
from __future__ import division """ ioHub Eye Tracker Online Sample Event Parser WORK IN PROGRESS - VERY EXPERIMENTAL Copyright (C) 2012-2014 iSolver Software Solutions Distributed under the terms of the GNU General Public License (GPL version 3 or any later version). .. moduleauthor:: Sol Simpson <sol@isolver-software...
from abjad import * def test_developerscripttools_ReplaceInFilesScript___init___01(): script = developerscripttools.ReplaceInFilesScript()
import traceback import helpers from babelfish.exceptions import LanguageError from support.lib import Plex, get_intent from support.plex_media import get_stream_fps, is_stream_forced, update_stream_info from support.storage import get_subtitle_storage from support.config import config, TEXT_SUBTITLE_EXTS from support....
""" chatbot.py Ask Cleverbot something via CloudBot! This one is way shorter! Created By: - Foxlet <http://furcode.tk/> License: GNU General Public License (Version 3) """ import urllib.parse import hashlib import collections import html import requests from cloudbot import hook SESSION = collections.OrderedDic...
'''Render simple text and formatted documents efficiently. Three layout classes are provided: `TextLayout` The entire document is laid out before it is rendered. The layout will be grouped with other layouts in the same batch (allowing for efficient rendering of multiple layouts). Any change to the lay...
import random from canari.maltego.transform import Transform from canari.maltego.entities import URL from canari.framework import EnableDebugWindow from common.entities import NettackerScan from lib.vuln.http_cors.engine import start from database.db import __logs_by_scan_id as find_log __author__ = 'Shaddy Garg' __cop...
type = "passive" def handler(fit, implant, context): fit.ship.boostItemAttr("warpCapacitorNeed", implant.getModifiedItemAttr("warpCapacitorNeedBonus"))
""" Color.py Implements color management for stdout. Copyright(c) 2013 Jonathan D. Lettvin, All Rights Reserved" This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at...
from taboot.tasks import BaseTask, FuncTask, TaskResult JK_ENABLE = 0 JK_DISABLE = 1 JK_STOP = 2 class ToggleHost(FuncTask): def __init__(self, action, proxyhost, **kwargs): super(ToggleHost, self).__init__(proxyhost, **kwargs) self._action = action if action == JK_ENABLE: self._...
''' Pollable socket listener ''' from neubot.pollable import Pollable from neubot.poller import POLLER class Listener(Pollable): ''' Pollable socket listener ''' def __init__(self, parent, sock, endpoint, sslconfig, sslcert): Pollable.__init__(self) self.parent = parent self.lsock = sock...
"""Generic web element related code. Module attributes: Group: Enum for different kinds of groups. SELECTORS: CSS selectors for different groups of elements. """ import collections.abc from PyQt5.QtCore import QUrl, Qt, QEvent, QTimer from PyQt5.QtGui import QMouseEvent from qutebrowser.config import config fro...
from openturns import * TESTPREAMBLE() try: # As the result of these methods is installation dependent, don't check # the output print "Installation directory=", Path.GetInstallationDirectory() wrapperDirectoryList = Path.GetWrapperDirectoryList() for i in range(len(wrapperDirectoryList)): p...
import os import path from jpype import * def maddmodule1(filename, nbyear): return run(filename, nbyear) def build_classpath(basedir): """ list jar in a directory """ res = "" for f in os.listdir(basedir): if(f.endswith(".jar")): res += basedir + os.sep + f + os.pathsep return r...
"""Custom script for evince.""" __id__ = "$Id$" __version__ = "$Revision$" __date__ = "$Date$" __copyright__ = "Copyright (c) 2013 The Orca Team." __license__ = "LGPL" import pyatspi import orca.keybindings as keybindings import orca.orca as orca import orca.orca_state as orca_state import orca.scripts....
from django.conf.urls import patterns, url from idehco3.dashboard import views urlpatterns = patterns('idehco3.dashboard', #urls para listar conhecimentos armazenados url(r'^$', views.DashboardView.as_view(), name='dashboard_user'), #url(r'detail/(?P<pk>\d+)/$', views.CommunityDetail.as_view(), name='detail...
from Bio import SeqIO from Bio.Alphabet import IUPAC from Bio.Seq import Seq from Bio import motifs import gzip import numpy as np import random import itertools import os import sys """ A class for holding static methods that can serve as useful Bioinformatics tools. There are methods here for random sequence generati...
# Author: Nic Wolfe <nic@wolfeden.ca> from __future__ import with_statement import datetime import os import traceback from lib.dateutil.parser import parser from lib.tvinfo_base.exceptions import * import encodingKludge as ek import exceptions_helper from exceptions_helper import ex import sickbeard from . import log...
"""simple.py -- Collection of simple widgets.""" import gtk import gobject import pango from mvc.widgets import widgetconst from .base import Widget, Bin class Image(object): def __init__(self, path): try: self._set_pixbuf(gtk.gdk.pixbuf_new_from_file(path)) except gobject.GError, ge: ...
""" Print the Elements of a Linked List Print elements of a linked list on console head input could be None as well for empty list Node is defined as class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node """ def print_list(head): while head:...
""" store the current version info of the notebook. """ version_info = (4, 1, 0) __version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
debug=False import sys import importlib core_deps=set(sys.modules) def fix_path(dep_path): import os # We DONT want the path on our HOST system pivot='recipe-sysroot-native' dep_path=dep_path[dep_path.find(pivot)+len(pivot):] if '/usr/bin' in dep_path: dep_path = dep_path.replace('/usr/bin''...
BZ2_AVAILABLE = True try: import bz2 except ImportError: BZ2_AVAILABLE = False import os import string import sys import tarfile UNTRUSTED_PREFIXES = tuple(["/", "\\"] + [c + ":" for c in string.ascii_letters]) def main(): if len(sys.argv) != 2 or sys.argv[1] in {"-h", "--help"}: error("usag...
from flask import ( Blueprint, request, render_template, flash, g, redirect, url_for, jsonify ) from flask_login import login_required import re import json from forms import ( UserForm, EditUserForm, PasswordForm, rol_choices, state_choices ) from libs.tools import s...
from rest_framework import serializers from burndown_for_what.models import Sprint, Issue class MilestoneGithubSerializer(serializers.BaseSerializer): def to_representation(self, obj): return { 'id': obj.id, 'title': obj.title, 'description': obj.description, ...
import bdb import wx import wx.grid import threading import thread import sys steps_lock = threading.Lock() terminate = False printing_functions = ["AppendText", "decode", "write"] GRID_ARBITRARY = 45 class OutputRedir(object): def __init__(self, output): self.output = output def write(self, text): if not text ==...
import ply.lex as lxr import logging logger = logging.getLogger(__name__) tokens = ( 'PLUS', # Script specific 'LAYER0_MARK', 'LAYER1_MARK', 'LAYER2_MARK', 'LAYER3_MARK', 'LAYER4_MARK', 'LAYER5_MARK', 'LAYER6_MARK', 'PRIMITIVE', 'REMARKABLE_ADDITION', 'REMARKABLE_MULTIPLIC...
import os from ipalib import api from ipalib.plugable import Plugin, API from ipalib.errors import ValidationError from ipapython import admintool from textwrap import wrap from ipapython.ipa_log_manager import log_mgr """ To add configuration instructions for a new use case, define a new class that inherits from Advic...
import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("documenturls", "0001_initial"), ] operations = [ ...
import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('distrochooser', '0041_auto_20190927_1556'), ] operations = [ migrations.AlterField( model_name='usersession', name='dateTime', field=models.D...
from collections import defaultdict from difflib import SequenceMatcher from itertools import chain import json import math import os import re import requests import time import urllib from django.conf import settings from django.db.models import Q from mapit.models import Generation, Area, Code from pombola.core.mode...
from coalib.bears.LocalBear import LocalBear class TestBear(LocalBear): def run(self, file, filename, result: bool=False, exception: bool = False): if result: yield result if exception: raise ValueError
{ "name": "Account balance reporting engine", "version": "0.3", "author": "Pexego", "website": "http://www.pexego.es", "category": "Accounting", "contributors": [ "Juanjo Algaz <juanjoa@malagatic.com>", "Joaquín Gutierrez <joaquing.pedrosa@gmail.com>", "Pedro M. Baeza <p...
from . import account_analytic_account
try: from unnaturalcode.http import unnaturalhttp except ImportError: import sys, os # Oiugh. sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) from unnaturalcode.http import unnaturalhttp from flask import Flask app = Flask(__name__) app.register_blueprint(unnaturalhttp) ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0056_project_description'), ] operations = [ migrations.AddField( model_name='projectstatus', name='has_metrics', ...
''' This tests are about the configuration system. Extensive use of the 'environ' variable is made: this is in order to simulate the environment without going into heavy mocking. ''' from tempfile import mkstemp import json import os from nose.tools import eq_, raises, assert_raises_regexp from conf.config_utils import...
from django.utils.translation import ugettext as _ from shuup.core.models import ProductVariationResult from shuup.front.views.product import ProductDetailView class ProductPriceView(ProductDetailView): template_name = "shuup/front/product/detail_order_section.jinja" def get_context_data(self, **kwargs): ...
import calendar import logging from flask import Flask, abort, jsonify, render_template, request from flask.json import JSONEncoder from flask_compress import Compress from datetime import datetime from s2sphere import LatLng from pogom.utils import get_args from datetime import timedelta from collections import Ordere...
from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request import werkzeug import datetime import time from openerp.tools.translate import _ from openerp.addons.website_mail.controllers.main import _message_post_helper class sale_quote(http.Controller): @http.ro...
from __future__ import print_function from xmodule.contentstore.content import StaticContent from .django import contentstore def empty_asset_trashcan(course_locs): ''' This method will hard delete all assets (optionally within a course_id) from the trashcan ''' store = contentstore('trashcan') for ...
from Tank_Test import TankTestCase import unittest from yandextank.plugins.ApacheBenchmark import ABReader, ApacheBenchmarkPlugin from yandextank.plugins.Aggregator import AggregatorPlugin class ABTestCase(TankTestCase): def setUp(self): self.core = self.get_core() self.foo = ApacheBenchmarkPlugin(s...
from spack import * class Openblas(Package): """OpenBLAS: An optimized BLAS library""" homepage = "http://www.openblas.net" url = "http://github.com/xianyi/OpenBLAS/archive/v0.2.15.tar.gz" version('0.2.15', 'b1190f3d3471685f17cfd1ec1d252ac9') version('0.2.14', 'b1190f3d3471685f17cfd1ec1d252ac9'...
import sys from resources.datatables import GcwRank def handleRankUp(core, actor, newrank): if newrank >= GcwRank.LIEUTENANT: actor.addAbility('command_pvp_retaliation_rebel_ability') core.collectionService.addCollection(actor, 'pvp_rebel_lieutenant') if newrank >= GcwRank.CAPTAIN: actor.addAbility('command_pvp...
''' Kinetic: kinetic abstraction ''' __all__ = ('MTKinetic', ) from pymt.input import Touch from pymt.vector import Vector from pymt.base import getFrameDt, getCurrentTouches from pymt.utils import boundary from pymt.ui.widgets.widget import MTWidget class KineticTouch(Touch): counter = 0 __attrs__ = ('X', 'Y')...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobileTe...
from config.config import * import logging.config import yaml as yaml log_config = yaml.load(open(ABSOLUTE_LOGGING_PATH, 'r')) logging.config.dictConfig(log_config) myLogger = logging.getLogger() myLogger.setLevel("DEBUG") def run(): pass if __name__ == "__main__": run()
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, encode_dict, int_or_none, ) class XFileShareIE(InfoExtractor): IE_DESC = 'XFileShare based sites: Gorilla...
from __future__ import unicode_literals import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import io import re import string from youtube_dl.extractor import YoutubeIE from youtube_dl.utils import compat_str, compat_urlretrieve _TESTS = [ ( '...
from desk import Desk from engine import Engine import time from config import STEP_TIME import subprocess from utils import plot class Player(object): side = None position = set() engine = None desk_coords = None steps = [] def __init__(self): d = Desk() self.position = d.get_po...
"""This module contains Google Campaign Manager sensor.""" from typing import Dict, Optional, Sequence, Union from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook from airflow.sensors.base import BaseSensorOperator from airflow.utils.decorators import apply_defaults c...
"""Frontend for Fractal demo. Application server for a 3 tier web app. Submits fractal image generation requests. Manages metadata database. Renders pages with Jinja2. """ import datetime import json import os import socket import sys import time import uuid import flask import httplib2 import jinja2 from cassandra....
from typing import Any, Dict from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.models import User...
import logging import json import sys from jobbrowser.apis.base_api import Api, MockDjangoRequest, _extract_query_params, is_linkable, hdfs_link_js from liboozie.oozie_api import get_oozie if sys.version_info[0] > 2: from django.utils.translation import gettext as _ else: from django.utils.translation import ugette...
import unittest from pants.util.memo import ( memoized, memoized_classmethod, memoized_classproperty, memoized_method, memoized_property, per_instance, testable_memoized_property, ) class MemoizeTest(unittest.TestCase): def test_function_application_positional(self): calculations...
"""The command group for gcloud bigquery jobs. """ from googlecloudsdk.calliope import base class Jobs(base.Group): """A group of subcommands for working with BigQuery jobs. """
__all__ = ["Provider", "ContainerState"] class Type(object): @classmethod def tostring(cls, value): """Return the string representation of the state object attribute :param str value: the state object to turn into string :return: the uppercase string that represents the state object ...
"""Helper class for administering halyard. This module is a helper module for commands that need to interact with the halyard runtime repositories (build and release info). It has nothing to do with the static git source repositories. This module encapsulates knowledge of how to administer halyard, and more importantly...
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a plug-in parser to parse a (possibly invalid) XML or HTML document into a tree representation. The parser does the work of building a parse tree, and Beautiful Soup provides provides metho...
from a10sdk.common.A10BaseClass import A10BaseClass class Rip(A10BaseClass): """Class Description:: RIP Routing for IPv6. Class rip supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param DeviceProxy: The device proxy for REST ope...
from java.lang import String asr = Runtime.start("asr", "AndroidSpeechRecognition") speech = Runtime.start("speech", "Speech") pab = Runtime.start("pab", "ProgramAB") pab.startSession() def heard(data): print data resp = pab.getResponse(data) print resp #speech.speakBlocking(resp) #asr.sendToClient(data) asr.star...
"""A binary to train CIFAR-10 using multiple GPU's with synchronous updates. Accuracy: cifar10_multi_gpu_train.py achieves ~86% accuracy after 100K steps (256 epochs of data) as judged by cifar10_eval.py. Speed: With batch_size 128. System | Step Time (sec/batch) | Accuracy ---------------------------------...
"""Simple file-based sample for the Google Assistant Service.""" import json import logging import os import os.path import sys import click import google.auth.transport.grpc import google.auth.transport.requests import google.oauth2.credentials from google.assistant.embedded.v1alpha2 import ( embedded_assistant_pb...