content
string
# -*- coding: utf-8 -*- """ Concatenate two big files. """ import h5py import numpy as np import math path="/home/woody/capn/mppi033h/Data/ORCA_JTE_NEMOWATER/h5_input_projections_3-100GeV/4dTo4d/stefan_xzt-c_50b_w-out-geo-fix_timeslice-relative/concatenated/" files = ["elec-CC_and_muon-CC_xyzt_train_1_to_120_shuffled...
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByLocation.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
import re import random def valid(password): """ contains the given password at least 8 characters, 1 uppercase, 1 lowercase, 1 special character and 1 number :param password: the password that should be checked for validity :return: bool if the given password is a valid one """ return ((len(p...
import os, psycopg2, re, time import logging import shutil from urlparse import urlparse logger = logging.getLogger(__name__) class Postgresql: def __init__(self, config): self.name = config["name"] self.params = config.get('parameters', {}) self.listen_addrs = self.params.get('listen_a...
#!/usr/bin/env python from __future__ import absolute_import, division import calendar import logging import re import sys import time import wifi _R = re.compile('"((?:[0-9a-f]{1,2}:){5}[0-9a-f]{1,2})","(\d{9,}\.\d+)","(0|-?\d{1,2}\.\d+)","(0|-?1?\d{1,2}\.\d+)","(-1|\d{2,3})","0","-1","-1","-1","(0|50|60|65|68|70...
from msrest.serialization import Model class ResourceCertificateDetails(Model): """Certificate details representing the Vault credentials. :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray :param friendly_name: Certificate friendlyname. :type friendl...
"""Class for litebitcoind node under test""" import decimal import errno import http.client import json import logging import os import subprocess import time from .util import ( assert_equal, get_rpc_proxy, rpc_url, wait_until, ) from .authproxy import JSONRPCException BITCOIND_PROC_WAIT_TIMEOUT = 6...
""" Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a != b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110;...
# -*- encoding: utf-8 -*- """ pyvas utilities ~~~~~~~~~~~~~~~ """ import collections import six from lxml import etree def dict_to_lxml(root, dct): """Convert dict to ElementTree""" try: root = six.text_type(root) except Exception: raise TypeError("root must be a string") def inner_d...
from __future__ import absolute_import, division, print_function, unicode_literals from .common import BaseTest, functional import base64 import json import time import tempfile import zlib from c7n.exceptions import PolicyValidationError class NotifyTest(BaseTest): @functional def test_notify_address_fro...
import asyncio import socket import time import pickle from typing import List, Dict, Optional, Tuple import uvicorn import starlette.responses import starlette.routing import ray from ray import serve from ray.exceptions import RayActorError, RayTaskError from ray.serve.common import EndpointInfo, EndpointTag from r...
from Ft.Xml import cDomlette from test_domlette_interfaces import test_interface, test_access, test_mutate, test_reader_access from test_domlette_readers import test_reader, test_oasis_suite from test_domlette_memory import test_memory from test_domlette_writers import test_writer #from test_catalog import test_catalo...
import logging import numpy as np import pymongo from pandas import DataFrame from pandas.util.testing import assert_frame_equal from ._config import FW_POINTERS_CONFIG_KEY, FwPointersCfg logger = logging.getLogger(__name__) NP_OBJECT_DTYPE = np.dtype('O') # Avoid import-time extra logic _use_new_count_api = None ...
# -*- coding: utf-8 -*- import string from haystack import indexes from haystack.utils import log as logging from .models import (GitlabProject, GitlabMergeRequest, GitlabIssue, GitlabComment) logger = logging.getLogger('haystack') # The string maketrans always return a string encoded with la...
#!/usr/bin/python # Script to estimate: # - the evolution of the STDP controlled weights between the Retina and # the L1 layer; # - the rate of change of the histogram distance between two weight # distributions separated by writeSteps simulation steps; # - the evolution of the number of weig...
#!/usr/bin/python """ Script to deploy Django using xinetd. """ import os, sys, re import mimetypes import logging import logging.handlers from StringIO import StringIO import django.core.handlers.wsgi from django.utils import importlib DOCUMENT_ROOT = "/path_to_your_project/insert_your_project_name_here/static/docume...
""" Test Cases for decoders. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import tensorflow as tf import numpy as np from seq2seq.decoders import BasicDecoder, AttentionDecoder, AttentionLayerDot from seq2seq....
from pyramid.view import ( view_config, ) from pyramid.httpexceptions import ( HTTPBadRequest, HTTPFound, HTTPSeeOther, HTTPNotFound, HTTPServiceUnavailable, ) from ..models import ( Site, Page, Image, PageSection, PageSectionImage, Gallery, DBSession, ) from p...
""" The following functions were created for testing purposes. """ from OpenSSL import crypto def create_key_pair(type, bits): key_pair = crypto.PKey() key_pair.generate_key(type, bits) return key_pair def get_valid_csr_object(): """Create a valid X509Req object""" key_pair = create_key_pair(cry...
''' work stages ''' import logging import time import os import traceback from functools import wraps from stitches import Expect, ExpectFailed from stitches.connection import StitchesConnectionException from .. import cloud from ..tools.retrying import retrying, EAgain from ..connection.cache import get_connection, ...
"""Review Bot tool to run pydocstyle.""" from __future__ import unicode_literals from reviewbot.tools import Tool from reviewbot.utils.process import execute, is_exe_in_path class PydocstyleTool(Tool): """Review Bot tool to run pydocstyle.""" name = 'pydocstyle' version = '1.0' description = 'Check...
import os import sys import time import cv2 import numpy as np from ikalog.inputs.filters import WarpFilter from ikalog.utils import IkaUtils class ScreenCapture(object): ''' ScreenCapture input plugin This plugin depends on python-pillow ( https://pillow.readthedocs.org/ ). This plugin now supports onl...
#coding: utf-8 from flask import current_app from flask.ext.restplus import marshal from ..models.hail import Hail from ..models.security import User from ..descriptors.hail import hail_model from ..extensions import db, celery import requests, json @celery.task() def send_request_operator(hail_id, operateur_id, env):...
# coding: utf-8 """ Main commands available for flatisfy. """ from __future__ import absolute_import, print_function, unicode_literals import collections import logging import os import flatisfy.filters from flatisfy import database from flatisfy import email from flatisfy.models import flat as flat_model from flatis...
"""Trace a subunit stream in reasonable detail and high accuracy.""" import argparse import functools import os import re import sys import mimeparse import subunit import testtools DAY_SECONDS = 60 * 60 * 24 FAILS = [] RESULTS = {} class Starts(testtools.StreamResult): def __init__(self, output): sup...
from __future__ import print_function import unittest import numpy as np import paddle from operator import mul import paddle.fluid.core as core import paddle.fluid as fluid from functools import reduce from op_test import _set_use_system_allocator from paddle.fluid import Program, program_guard np.random.random(123)...
"""Cleans up old trace from Treadmill.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import time import click from treadmill import context from treadmill import zknamespace as z from treadmill ...
from django_bolts.dinja.base import render_to_string from django_bolts.dinja.decorators import dinja_tag from jinja2 import Markup from django_bolts.utils import get_form_name import re import json from django_bolts.utils.stringutils import camel_to_hyphen def make_css_class(*classes): result = [] history = s...
from touchdown.core.plan import Plan from touchdown.core import argument from ..account import BaseAccount from ..common import Resource, SimpleDescribe, SimpleApply, SimpleDestroy from touchdown.core import serializers from touchdown.core.adapters import Adapter from touchdown.core.diff import DiffSet class Subscri...
import svgdatashapes as s def test_distribs(): # This tests the frequency distribution capabilities of numinfo() and catinfo() # as well as the percentile computation capability of numinfo(). outstr = '' dataset1 = ( (1,2), (1,3), (1,4), (1,5), (2,1), (2,1), (3,1), (4,1), (4,1), (4,1), (5,2)...
# -*- coding: UTF-8 -*- # system imports import os from urllib2 import HTTPError, URLError import traceback # enigma2 imports from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config from Components import Label from enigma import getDesktop from Co...
import pygame, common from visualizer import Visualizer from mouse import Mouse from game import Game from camera import Camera def main(): pygame.init() my_font = pygame.font.SysFont("Courier", 16) screen = pygame.display.set_mode((common.WIDTH, common.HEIGHT), pygame.DOUBLEBUF) pygame.display.set_c...
import click import os from mnogokit import timestamp, mount_s3, mongodump, read_config @click.command( context_settings=dict( ignore_unknown_options=True, allow_extra_args=True, )) @click.option('--environment', '-E', required=False) @click.option('--config-file', '-C', required=F...
import sys from collections import defaultdict import numpy as np import os import h5py import fast64counter import time Debug = False block1_path, block2_path, direction, halo_size, outblock1_path, outblock2_path = sys.argv[1:] direction = int(direction) halo_size = int(halo_size) ###############################...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s...
from zeit.content.image.interfaces import IVariants import sys import zeit.cms.testing import zeit.content.image.testing import zope.interface.verify class VariantTraversal(zeit.cms.testing.FunctionalTestCase): layer = zeit.content.image.testing.ZCML_LAYER def setUp(self): super(VariantTraversal, se...
"""Tests for the shared background EventLoop.""" import asyncio import pytest import time from iotile.core.utilities import BackgroundEventLoop from iotile.core.exceptions import TimeoutExpiredError @pytest.fixture(scope="function") def clean_loop(): """Create and cleanly stop a background loop.""" loop = B...
import os import re import sys import json import sublime import sublime_plugin from collections import OrderedDict import mdpopups CUR_DIR = os.path.dirname(os.path.realpath(__file__)) CCL_PATH = list() PYMAMI = '{0}{1}'.format(*sys.version_info[:2]) ST_VERSION = 3000 if sublime.version() == '' else int(sublime.ve...
"""Utilities.""" # from __future__ import absolute_import, print_function # from datetime import timedelta # from functools import partial # from flask import current_app, render_template, request # from flask_babelex import gettext as _ # from flask_mail import Message # from invenio_accounts.models import User # f...
# -*- coding: utf-8 -*- """ A Random Network Topology This class implements a random topology. All particles are connected in a random fashion. """ # Import standard library import itertools import logging # Import modules import numpy as np from scipy.sparse.csgraph import connected_components, dijkstra from .. i...
""" Generic GeoJSON events platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/geo_location/geo_json_events/ """ from datetime import timedelta import logging from typing import Optional import voluptuous as vol from homeassistant.components.geo_l...
""" Contains methods for creating any supporting files for payloads. """ import os import sys from modules.common import shellcode from modules.common import messages from modules.common import helpers from config import veil import subprocess def supportingFiles(language, payloadFile, options): """ Takes a specif...
import random import logging import os from gettext import gettext as _ log = logging.getLogger('utils') def palabra_aleatoria(path, nivel): """retorna una palabra obtenida del archivo lista_palabras.txt""" path = path + 'nivel%s.palabra' %(nivel) archivo = open(path,'r') palabras = [palabra.lower() fo...
# -*- coding: utf-8 -*- import json import webbrowser import requests from colorama import Fore location = 0 def get_location(): global location if not location: print("Getting Location ... ") send_url = 'http://api.ipstack.com/check?access_key=8f7b2ef26a8f5e88eb25ae02606284c2&output=json&leg...
"""Keep track of internal settings for django-ca.""" import os import re import typing from datetime import timedelta from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding from django.conf import gl...
from nose.tools import assert_equal from nose.tools import assert_raises from solver.core.numbers import Number, Undefined from solver.core.evaluate import * def evalulate_add_test(): assert_raises(ValueError, evaluate_add, 3, 4) assert_equal(evaluate_add(Number(4), Number(6)), Number(10)) asse...
from flask import render_template, session, g, flash, redirect, url_for, request from flask.ext.login import login_user, login_required, logout_user from . import auth from forms import LoginForm, RegisterForm from .. import db, login_manager from ..models import User @auth.route('/login', methods=["GET","POST"])...
from __future__ import absolute_import, division, print_function, unicode_literals import os import re from builtins import str from io import StringIO from types import GeneratorType from colors import blue, green, red from pants.base.file_system_project_tree import FileSystemProjectTree from pants.engine.addressab...
import argparse from base64 import urlsafe_b64encode from glob import glob import os import paramiko import random import sys import yaml def project_encode(name): """Util function from rift.mano.utils.project.""" if isinstance(name, str): name = bytes(name, 'utf-8') proj = urlsafe_b64encode(name)...
# -*- coding: utf8 -*- """test_UniDigit.py """ __module__ = "test_UniDigit.py" __author__ = "Jonathan D. Lettvin" __copyright__ = "\ Copyright(C) 2016 Jonathan D. Lettvin, All Rights Reserved" __credits__ = [ "Jonathan D. Lettvin" ] __license__ = "GPLv3" __version__ = "0.0.1" __maintainer__ = "Jonat...
""" Decorators for registering tunable templates to TOPI. These decorators can make your simple implementation be able to use different configurations for different workloads. Here we directly use all arguments to the TOPI call as "workload", so make sure all the arguments (except tvm.Tensor) in you calls are hashable...
from __future__ import absolute_import from __future__ import with_statement __all__ = ['Queue', 'SimpleQueue', 'JoinableQueue'] import sys import os import threading import collections import time import weakref import errno from Queue import Empty, Full from . import Pipe from ._ext import _billiard from .synchro...
import itertools from vcr.compat import mock import pytest from vcr import matchers from vcr import request # the dict contains requests with corresponding to its key difference # with 'base' request. REQUESTS = { "base": request.Request("GET", "http://host.com/p?a=b", "", {}), "method": request.Request("POS...
import pytest import json try: import selenium except ImportError: selenium = None from ..mimebundle import spec_to_mimebundle # example from https://vega.github.io/editor/#/examples/vega-lite/bar VEGALITE_SPEC = json.loads( """ { "$schema": "https://vega.github.io/schema/vega-lite/v2.json",...
"""Contains the logic for `aq show permission --command`.""" from aquilon.worker.broker import BrokerCommand import xml.etree.ElementTree as ET class CommandShowPermissionCommand(BrokerCommand): required_parameters = ["command"] def render(self, session, command, **arguments): if arguments["option...
import argparse import sys import os from cuttsum.event import read_events_xml from cuttsum.util import gen_dates from datetime import datetime, timedelta import re def main(): event_xml, filter_list, hour_list = parse_args() events = read_events_xml(event_xml) valid_hours = set() for event in e...
import mock import unittest import test_env_setup from google.appengine.ext.ndb.stats import GlobalStat import webtest from stats import app as stats_app import web_test_base class StatsHandlerTest(web_test_base.WebTestBase): def setUp(self): super(StatsHandlerTest, self).setUp() self.testapp = webtest.T...
from sqlalchemy import Index, MetaData, Table def upgrade(migrate_engine): meta = MetaData() meta.bind = migrate_engine # NOTE(mikal): these weren't done in 103 because sqlite already has the # index. for table in ['instance_metadata', 'security_group_instance_association']: ...
"""Invenio search engine utilities.""" from invenio.dbquery import run_sql def get_fieldvalues(recIDs, tag, repetitive_values=True, sort=True): """ Return list of field values for field TAG for the given record ID or list of record IDs. (RECIDS can be both an integer or a list of integers.) If R...
"""Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ import os import shutil from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error from test_framework.berycoinconfig import INITIAL_BLOCK_REWARD, COINBASE_MATU...
# -*- coding: utf-8 -*- """ This module parses a pom XML file in search project variables which can later be accessed through the Project class members. """ import lxml.etree as et import exceptions as chexcept def return_on_error(ret): def guard_fn(fn): def guarded_fn(args): try: ...
# sequence.py """Hold the Sequence class, which stores a dicom sequence (list of Datasets)""" # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, released under a modified MIT license. # See the file license.txt included with this distribution, also # available at http://pydicom.googlecode.com ...
""" model_SIM_iterative.py This solves model SIM from G&L Chapter 3, using an iterative approach. This is based on Matlab code found at ... This modeling approach gives us a base line for calibrating the symbolic methodology. % Parameters theta = 0.2; % tax rate alpha1 = 0.6; % marginal propensity to c...
from unittest import mock import codecs import pytest import hyperframe from mitmproxy.net import tcp, http from mitmproxy.net.http import http2 from mitmproxy import exceptions from ...mitmproxy.net import tservers as net_tservers from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler class TestTCPHand...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the XLSX output module.""" from __future__ import unicode_literals import os import unittest import zipfile from defusedxml import ElementTree from plaso.formatters import manager as formatters_manager from plaso.lib import definitions from plaso.output im...
import time import itertools import random import numpy as np import pandas as pd from sklearn import preprocessing from sklearn.model_selection import train_test_split from keras.preprocessing import sequence from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Activat...
import cherrypy, json, logging, ast from dataingestion.services.ingestion_manager import IngestServiceException from cherrypy import HTTPError from cherrypy._cpcompat import ntob from dataingestion.services import (constants, ingestion_service, csv_generator, ingestion_manager, api_c...
from api import endpoint from twisted.internet import reactor #from twisted.web.client import Agent from network.http_utils import Agent from network.twisted_utils import JsonProducer, JsonReceiver, make_errback from functools import partial from kivy.logger import Logger token = None def get_auth_headers(): if...
import os from pyblake2 import blake2b from .translator import Translator from io import BytesIO import tarfile import simplejson as json from datalake_common import Metadata try: from cStringIO import StringIO except ImportError: from io import BytesIO as StringIO from gzip import GzipFile ITER_SIZE = 1024 * ...
import importlib import os.path as path import sys import unittest import zipfile import jobs class ZippedTestLoader(unittest.TestLoader): def discoverZipped(self, zip_path): """This method discovers unittests inside a zip file which is already in the Python path.""" if zip_path n...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by Lucas Sinclair. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # import os, time, inspect, tempfile, pickle, hashlib, base64 # Internal modules # from autopaths import Path ###############################################################...
import subprocess def Cmd(command, verbose=False, debug=False): if debug: print '==================================================' print cmd print '==================================================' spr = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess...
#!/usr/bin/python # encoding: utf-8 from base import Base from gateway import WowheadGateway from urllib import urlencode from urlparse import urlunsplit from util import show scheme = 'http' netloc = 'www.wowhead.com' fragment = '' arg_separator = '#' default_icon = 'icon/blank.png' class Main(Base): def main...
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class device_mapper_persistent_data(test.test): """ Autotest module for testing basic functionality of device_mapper_persistent_data @author Ramya BS , <EMAIL> ...
from papyon.gnet.constants import * from papyon.gnet.errors import * from papyon.gnet.proxy import ProxyInfos from papyon.gnet.message.HTTP import HTTPRequest from papyon.gnet.io import TCPClient from papyon.gnet.parser import HTTPParser from papyon.gnet.proxy.factory import ProxyFactory from urlparse import urlsplit ...
# -*- coding: utf-8 -*- """ *************************************************************************** dinfdistup_multi.py --------------------- Date : March 2015 Copyright : (C) 2015 by Alexander Bruy Email : alexander dot bruy at gmail dot com **********...
#!/usr/bin/env python # --- skeleton for plugin. # # --- import plugin # --- !! Class name SHOULD BE FileName_plugin class massmsg_plugin(plugin.plugin): def __init__(self, hub): # Don't forget replace 'name_plugin' here super(massmsg_plugin,self).__init__(hub) ...
from glob import iglob import string import os from views import view_js from mangrove.contrib.deletion import create_default_delete_form_model, ENTITY_DELETION_FORM_CODE from mangrove.contrib.registration import create_default_reg_form_model from mangrove.datastore.entity_type import define_type from mangrove.errors.M...
import json import warnings from typing import Optional import numpy as np from .._exception import QuadpyError from ..helpers import QuadratureScheme, expand_symmetries, plot_disks schemes = {} def register(in_schemes): for scheme in in_schemes: schemes[scheme.__name__] = scheme class S2Scheme(Quadr...
"""Decorators for registering schema pre-processing and post-processing methods. These should be imported from the top-level `marshmallow` module. Methods decorated with `pre_load <marshmallow.decorators.pre_load>`, `post_load <marshmallow.decorators.post_load>`, `pre_dump <marshmallow.decorators.pre_dump>`, `post_dum...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Process data and generates some comparison results. Synopsis: python path_to_folder/bbob_pproc/runcompall.py [OPTIONS] FOLDER_NAME... Help: python path_to_folder/bbob_pproc/runcompall.py -h """ from __future__ import absolute_import import os, sys...
def _put(self,key,val,currentNode): if key < currentNode.key: if currentNode.hasLeftChild(): self._put(key,val,currentNode.leftChild) else: currentNode.leftChild = TreeNode(key,val, parent=currentNode) self.updateBalance(current...
#!/usr/bin/env python # FILE: demo_util.py # ROLE: shared parts for demo # MODIFIED: 2015-02-08 22:24:12 import os import sys import dataset import util import run_ofs import run_sol import run_liblinear import run_fgm import run_mRMR import run_bif #train feature selection def train_fs(dataset, model, mode...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], ...
""" from pandajedi.jedicore.JediTaskBufferInterface import JediTaskBufferInterface taskBufferIF = JediTaskBufferInterface() taskBufferIF.setupInterface() """ from pandajedi.jediconfig import jedi_config from pandajedi.jedicore import JediTaskBuffer taskBufferIF= JediTaskBuffer.JediTaskBuffer(None) from pandajedi....
import logging import traceback import argparse import importlib from torba.server.env import Env from torba.server.server import Server def get_argument_parser(): parser = argparse.ArgumentParser( prog="torba-server" ) parser.add_argument("spvserver", type=str, help="Python class path to SPV serv...
"""oslo.i18n integration module for novaclient. See http://docs.openstack.org/developer/oslo.i18n/usage.html . """ from oslo import i18n _translators = i18n.TranslatorFactory(domain='novaclient') # The primary translation function using the well-known name "_" _ = _translators.primary # Translators for log level...
# Jessie A = [1, 3, 4, 6, None, None] B = [2, 5] def merge_two_sorted(list1, list2): index1 = len(list1) - len(list2) - 1 #end of list1 index2 = len(list2) - 1 #end of list2 index3 = len(list1) - 1 #beginning of placement for i in range(index3, -1, -1): if index2 < 0 or list1[index1] > list2[...
#--------------------------------------------------------------------------------------------------------------- # Name: Proyecto Bookig Crawler # Desc: Parser booking basado en la version anterior (Crawler_Booking_HTMLS_to_DB_V6.0) , # completamente refactoreado, aplicacion de principios de diseno y reutilizaci...
""" homeassistant.components.media_player.chromecast ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo implementation of the media player. """ from homeassistant.components.media_player import ( MediaPlayerDevice, STATE_NO_APP, ATTR_MEDIA_STATE, ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_TITLE, ATTR_MEDIA_DURATION...
from odoo import api, fields, models class IrModel(models.Model): _inherit = 'ir.model' @api.multi def _get_first_level_relations(self): Fields = self.env['ir.model.fields'] field_recs = Fields.search([ ('ttype', 'in', ('many2one', 'one2many', 'many2many')), ('mode...
from typing import List, Set, Dict from django.db.models import F from base.models.enums.link_type import LinkTypes from base.models.group_element_year import GroupElementYear from program_management.ddd.business_types import * from program_management.ddd.repositories import _persist_prerequisite from program_managem...
__all__ = ['test_suite', ] from . import (test_deps, test_prof, test_quota, test_restrict, test_signal, test_trace) from .test_deps import * from .test_prof import * from .test_quota import * from .test_restrict import * from .test_signal import * from .test_trace import * from .config import unittest def test_sui...
# -*- coding: utf-8 -*- from api.management.commands.importbasics import * def import_songs(opt): local, redownload, noimages = opt['local'], opt['redownload'], opt['noimages'] events = models.Event.objects.exclude(japanese_name__contains='Score Match').exclude(japanese_name__contains='Medley Festival').exclud...
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import TemplateView from mapit.models import Area, Generation from .election_data_2017.iebc_offices import IEBC_OFFICE_DATA from .forms import Constituency...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from setuptools.command.test import test as test_command from sped import __version__ class PyTest(test_command): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): test_command.init...
""" This script imports data from the original document to generate a consistent text file made of a stream of JSON objects (each object is a dict at its top-level). """ import argparse import gzip import json import sys def load_input(raw): """Takes the original JSON data structure and generates a stream of ...
"""Encapsulates all word and punctuation symbols layer. Layer 0 is the basic layer for all the UCCA annotation, as it includes the actual words and punctuation marks found in the :class:`core`.Passage. Layer 0 has only one type of node, :class:`Terminal`. This is a subtype of :class:`core`.Node, and can have one of t...
""" Copyright (c) 2004, CherryPy Team (<EMAIL>) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditio...
# $language = "python" # $interface = "1.0" # CopyOutputToClipboard.py # # Description: # This script example is designed to run while connected to a Cisco # Pix firewall or other router device. # # When launched, the following commands are sent to the device: # enable # configure terminal # p...