content
string
import logging import tornado.ioloop import tornado.web import tornado.options import tornado.websocket import math import os import json import constants from decorators import new_cursor class Web_handler(tornado.web.RequestHandler): def get(self): self.render( 'ports.html', GROU...
## Send a Single Email to a Single Recipient import os import json from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, From, To, Subject, PlainTextContent, HtmlContent, SendGridException message = Mail(from_email=From('<EMAIL>', 'Twilio SendGrid'), to_emails=To('<EMAIL>', 'Elm...
""" Analysis defaults options for DM pipelien analysis """ from __future__ import absolute_import, division, print_function generic = { 'outfile': (None, 'Path to output file.', str), 'infile': (None, 'Path to input file.', str), 'summaryfile': (None, 'Path to file with results summaries.', str), } common...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import matplotlib.pyplot as plt import lt def read_msa(msa_f): with open(msa_f) as o_f: lines = o_f.readlines() lines = [line.rstrip('\r\n') for line in lines if line] pro_line_num = [i for i, line in enumerate( ...
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KStandardGuiItem(): # s...
"""SageMakerComponentSpec for defining inputs/outputs for SageMakerComponents.""" # 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 requi...
"""Tabular SVD learner.""" from typing import Union import numpy as np import tensorflow as tf import tensorflow_probability as tfp from tf_agents import specs class TabularBCSVD(tf.keras.Model): """Tabular behavioral cloning with representations learned via SVD.""" def __init__(self, dataset_spe...
import _plotly_utils.basevalidators class ZcalendarValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="zcalendar", parent_name="scatter3d", **kwargs): super(ZcalendarValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name...
""" Abstraction for MaxCDN's SSL abstraction """ from maxcdn import MaxCDN from . import exception from . import cryptography class SslApiClient(object): """ High-level abstraction of MaxCDN's SSL API """ __slots__ = ('_api', ) def __init__(self, alias, key, secret, **kwargs): """ ...
# -*- coding: utf-8 -*- """Consolidates all necessary models from the framework and website packages. """ from framework.auth.core import User from framework.guid.model import Guid, BlacklistGuid from framework.sessions.model import Session from website.project.model import ( Node, NodeLog, Tag, WatchConfig, ...
from StringIO import StringIO from terml.nodes import Term, coerceToTerm, termMaker as t def writeBytecode(expr): print "Gonna compile", expr from ometa.grammar import TreeTransformerGrammar from ometa.runtime import TreeTransformerBase Compiler = TreeTransformerGrammar.makeGrammar(open("../ometa/vm....
from rest_framework import viewsets, decorators from rest_framework.response import Response from datetime import datetime from serializers import * from models import * from django import forms from PIL import Image from rest_framework.views import APIView import os import pytesseract # Create your models here...
""" WSGI config for simplecrm project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`...
"""Play a drum pattern via MIDI. MIDI output circuit: https://www.midi.org/articles/midi-electrical-specifications 1. 3.3V connected to MIDI output socket pin 4 via a 35 ohm resistor 2. GND connected to MIDI output socket pin 2 3. Pin 0 (TX) connected to MIDI output socket pin 5 via a 10 ohm resistor """ # -------...
import __main__, requests, threading from pybotutils import fixHTMLCharsAdvanced, strbetween info = { "names" : [ "g", "google" ], "access" : 0, "version" : 1 } def command( message, user, recvfrom ): # There is a lot of shit. Cut off as much as possible before sending it to the HTML parser in an effort to speed up ...
from . import partner_activities from . import invoice_turn
from diktya.numpy.utils import tile, zip_tile import matplotlib.pyplot as plt import numpy as np def zip_visualise_tiles(*arrs, show=True): tiled = zip_tile(*arrs) plt.imshow(tiled, cmap='gray') if show: plt.show() def plt_imshow(image, axis=None): """ Plot ``image`` on ``axis``. Can han...
#!/usr/bin/env python ''' Author : Huy Nguyen, and David C.Ream Program : Given the operon directory, for each operons file, get the info about the gene in each genomes, map it into alphabet letter , get the gap, map gap to '|' and write to ouputfile. Start : 05/04/2016 End : 05/05/2016...
import sys import time import datetime import re import threading import os.path, json, ast, traceback import shutil import signal try: import PyQt4 except Exception: sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'") from PyQt4.QtGui import * from PyQt4....
#!/usr/bin/python # coding:utf8 import sys import math from operator import itemgetter import numpy as np import pandas as pd from scipy.sparse.linalg import svds from sklearn import cross_validation as cv from sklearn.metrics import mean_squared_error from sklearn.metrics.pairwise import pairwise_distances def spl...
from ika.service import Command, Permission from ika.enums import Flags from ika.models import Account, Channel class Information(Command): name = '정보' aliases = ( 'INFO', ) syntax = '[계정명 또는 채널명]' regex = r'(?P<name>\S+)?' permission = Permission.LOGIN_REQUIRED description = ( ...
import time import unittest import uuid from kubernetes.client import api_client from kubernetes.client.apis import core_v1_api from kubernetes.e2e_test import base def short_uuid(): id = str(uuid.uuid4()) return id[-12:] class TestClient(unittest.TestCase): @classmethod def setUpClass(cls): ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """---------- General functions and variables ----------""" h2b = {"0":"0000", "1":"0001", "2":"0010", "3":"0011", "4":"0100", "5":"0101", "6":"0110", "7":"0111", "8":"1000", "9":"1001", "a":"1010", "b":"1011", "c":"1100", "d":"1101", "e":"1110", "f":"1111"} ...
import logging from mongoengine.fields import * from pulp_cds.api.exceptions import * from pulp_cds.api.models.cds_cluster import Cluster log = logging.getLogger(__name__) class CDSClusterManager(): def create(self, **params): """ params - dictionary """ c = Cluster(**params) ...
from __future__ import absolute_import from . import exception as dns_exception from . import rdata as dns_rdata from . import rdatatype as dns_rdatatype from . import name as dns_name class NXT(dns_rdata.Rdata): """NXT record @ivar next: the next name @type next: dns_name.Name object @ivar bitmap: t...
from __future__ import print_function import PyKCS11 # the CKA_ID of the objects to destroy object_id = (0x22,) # slot PIN code pin = "1234" pkcs11 = PyKCS11.PyKCS11Lib() pkcs11.load() slot = pkcs11.getSlotList(tokenPresent=True)[0] session = pkcs11.openSession(slot, PyKCS11.CKF_RW_SESSION) session.login(pin) temp...
# Symbol Value # I 1 # V 5 # X 10 # L 50 # C 100 # D 500 # M 1000 import io _symbols = { 1000: 'M', 500: 'D', 100: 'C', 50: 'L', 10: 'X', 5: 'V', 1: 'I' } class Solution: def intToRoman(self, num...
from Framework.BancoDeDados import BancoDeDados from Database.Models.Sala import Sala as ModelSala class Sala(object): def pegarSalas(self, condicao, valores): salas = [] for sala in BancoDeDados().consultarMultiplos("SELECT * FROM sala %s" % (condicao), valores): salas.append(ModelSala(sala)) return sal...
# -*- encoding: utf-8 -*- from abjad.tools.datastructuretools.TypedList import TypedList class NoteHeadInventory(TypedList): r'''An ordered list of note heads. :: >>> chord = Chord([0, 1, 4], (1, 4)) >>> inventory = scoretools.NoteHeadInventory( ... client=chord, ... ...
""" This is a middleware layer which keeps a log of all requests made to the server. It is responsible for removing security tokens and similar from such events, and relaying them to the event tracking framework. """ from __future__ import absolute_import import hashlib import hmac import json import logging import ...
from __future__ import absolute_import, division, print_function from .tree import Tree class TreeTraversal(object): def __init__(self, tree): if not isinstance(tree, Tree): raise TypeError("Input is not a tree object: %s" % type(tree)) self.tree = tree ...
from Catalog.Schema import DBSchema from Query.Operator import Operator import itertools class Union(Operator): def __init__(self, lhsPlan, rhsPlan, **kwargs): super().__init__(**kwargs) self.lhsPlan = lhsPlan self.rhsPlan = rhsPlan self.validateSchema() # Unions must have equivalent ...
import argparse import os import requests import shutil # Mapping: (class, Name, groups) STYLE_MAPPING = [ (0, 'Bokeh', ['1543486@N25']), (1, 'Bright', ['799643@N24']), (2, 'Depth_of_Field', ['75418467@N00', '407825@N20']), (3, 'Detailed', ['1670588@N24', '1131378@N23']), (4, 'Ethereal', ['907784@...
""" Tests for the examples given in stem's tutorial. """ import itertools import os import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import stem.response import stem.descriptor.remote import stem.prereq import test.util from stem.control import Controller from stem...
import os import pytest import shutil import tempfile from large_image_tasks import tasks def test_conversion(): testDir = os.path.dirname(os.path.realpath(__file__)) imagePath = os.path.join(testDir, 'test_files', 'yb10kx5k.png') tmpdir = tempfile.mkdtemp() outputPath = tasks.create_tiff(imagePath,...
import abc import datetime import string from oslo_log import log as logging import six from sahara import conductor as c from sahara import context from sahara.i18n import _ from sahara.i18n import _LI from sahara.service import networks from sahara.utils import cluster_progress_ops as cpo from sahara.utils import e...
#Python Import import logging #Django Imports from django.http import HttpResponse from django.shortcuts import render, redirect from django.views.decorators.csrf import csrf_exempt from django.utils import timezone #Local Imports import forms import contacts.models as cont import transports # Get an instance of a ...
import unittest import os from test.test_support import TESTFN, run_unittest, unlink, import_module gdbm = import_module('gdbm') filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): if self.g is not None: self.g.close() ...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 your option) any l...
import ctypes import numpy as np import pyastar.astar from typing import Optional, Tuple, Union # Define array types ndmat_f_type = np.ctypeslib.ndpointer( dtype=np.float32, ndim=1, flags="C_CONTIGUOUS") ndmat_i_type = np.ctypeslib.ndpointer( dtype=np.int32, ndim=1, flags="C_CONTIGUOUS") ndmat_i2_type = np.ct...
import abc import datetime import uuid from oslo.utils import timeutils import six from keystoneclient import access from keystoneclient.auth import base from keystoneclient.auth.identity import v2 from keystoneclient.auth.identity import v3 from keystoneclient import fixture from keystoneclient import session from k...
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = '01f555a4'.decode('hex') P2P_PORT = 20888 ADDRESS_VERSION = 88 RPC_PORT = 20889 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'myriadcoinaddress'...
__author__ = 'Simon Hofmann' from nb_classifier import NaiveBayesClassifier as NBC import unittest class NaiveBayesTest(unittest.TestCase): __nb = NBC() def test_learning(self): china = [["chinese", "bejing"], ["chinese", "shanghai"], ["chinese", "macao"]] japan = [["tokyo", "japan"]] ...
"""Utilities for handling Python callables.""" import tensorflow.compat.v2 as tf JAX_MODE = False NUMPY_MODE = False def get_output_spec(fn, *args, **kwargs): """Traces a callable to determine shape and dtype of its return value(s). Tracing incurs the Python execution cost of running the callable to build a ...
from __future__ import unicode_literals import webnotes from controllers.trends import get_columns,get_data def execute(filters=None): if not filters: filters ={} data = [] conditions = get_columns(filters, "Delivery Note") data = get_data(filters, conditions) return conditions["columns"], data
from kafka.tools.protocol.responses import BaseResponse class StopReplicaV0Response(BaseResponse): schema = [ {'name': 'error', 'type': 'int16'}, {'name': 'partitions', 'type': 'array', 'item_type': [ {'name': 'topic', 'type': 'string'}, {'name': 'partit...
import unittest from util.graphalgorithim import exclusiongraph class TestExclusionGraph(unittest.TestCase): def forward(self, node): return self.G.get(node, ()) def exclusive(self, node): return True def build(self, G, roots): self.G = G self.roots = roots self.exg = exclusiongraph.build(roots, self....
# -*- coding: utf-8 -*- import webtest import os from openprocurement.api.tests.base import PrefixedRequestClass from openprocurement.tender.belowthreshold.tests.base import BaseTenderWebTest as APIBaseTenderWebTest class BaseTenderWebTest(APIBaseTenderWebTest): def setUp(self): self.app = webtest.TestAp...
import ConfigParser import ast import paramiko __author__ = 'oleh.hrebchuk' class GetConfig(object): def get_value_confing(self, section, key): configParser = ConfigParser.RawConfigParser() configFilePath = r'/root/repwakeonlandjango/wakeonlanapp/wakeonlan.conf' configParser.read(configFil...
module([ Class("HelloWorld", [ function(parameterNames=["$parm1", "$parm2"], parameterTypes=["Int", "Int"], isStatic=True, returnType="int", functionName="addTwoNumbers", body=[ Return(add(["$parm1", "$parm2"])), ]), function(parameterNames=["$parm1", "$parm2"], parameterTypes=["Int", "Int"], isStatic=True...
import serial from ..config import Config import threading from ..responses.response_parser import ResponseParser from ..commands import * import time import rospy import traceback class SerialCom: listeners = {} read_thread = None error_published = False write_lock = threading.Lock() connected =...
# coding: utf-8 import numpy import numpy as np import scipy.stats as stats __author__ = "Adrien Guille" __email__ = "<EMAIL>" def symmetric_kl(distrib_p, distrib_q): return numpy.sum([stats.entropy(distrib_p, distrib_q), stats.entropy(distrib_p, distrib_q)]) def myjaccard(r_i, r_j): return len(set.interse...
import os import sys import shutil try: import markdown md = markdown.Markdown(['extra', 'meta']) except: use_md = False else: use_md = True try: from docutils.core import publish_parts except: use_docutils = False else: use_docutils = True app_name = "ReText Webpages generator" app_version = "0.5.1" app_site...
""" Entry file for the topydo Prompt interface (CLI). """ import os.path import sys from topydo.cli.CLIApplicationBase import CLIApplicationBase, error, usage from topydo.cli.TopydoCompleter import TopydoCompleter from prompt_toolkit.shortcuts import prompt from prompt_toolkit.history import InMemoryHistory from top...
"""Module contenant le paramètre 'detail' de la commande 'calendrier'""" from primaires.interpreteur.masque.parametre import Parametre class PrmDetail(Parametre): """Commande 'calendrier detail'""" def __init__(self): """Constructeur du paramètre""" Parametre.__init__(self, "détail",...
def menu(): print() print("1 --> Ajouter une enzyme") print("2 --> Afficher les enzymes") print("3 --> Afficher les stats des enzymes") print("4 --> Afficher les enzymes au poids supérieur à la moyenne") print("5 --> Afficher les info concernant une enzyme") print("6 --> Importer les enzymes...
u""" This modules contains a script for the user to output all boxes sorted by their coverage. This can be used to adjust magic values for checkbox recognition. """ from sdaps import model from sdaps import script from sdaps.ugettext import ugettext, ungettext _ = ugettext parser = script.subparsers.add_parser("boxg...
from __future__ import print_function, unicode_literals from mach.decorators import ( CommandArgument, CommandProvider, Command ) from mozbuild.base import MachCommandBase @CommandProvider class MozbuildFileCommands(MachCommandBase): @Command('mozbuild-reference', category='build-dev', descr...
""" Parameter Wrapper >>> wrapped_element.parameters['Length'] 10.0 >>> wrapped_element.parameters['Length'] = 5 5.0 """ # from rpw import revit, DB from rpw.db.builtins import BipEnum from rpw.base import BaseObjectWrapper from rpw.exceptions import RpwException, RpwWrongStorageType from rpw.exceptions import RpwPa...
import fileinput # allows easy iteration over a file import sys # For importing the arguments given import re # RegEx package for sorting data import os.path # Allows for checking if file already exists from time import strftime # Allows for putting time with temp file name # Current time and date a...
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/dobbscoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' f...
from ghidra.framework.options import Options from ghidra.framework.plugintool import PluginTool tool = state.getTool() options = tool.getOptions("name of my script") fooString = options.getString("foo", None) if fooString is not None : #does not exist in tool options fooString = askString("enter foo", "what valu...
import sys sys.path.append("zklib") from zklib import zklib import time import zkconst zk = zklib.ZKLib("192.168.1.201", 4370) ret = zk.connect() print "connection:", ret if ret == True: print "Disable Device", zk.disableDevice() print "ZK Version:", zk.version() print "OS Version:", zk.osversion()...
import numpy # pylint: disable=too-many-locals, too-many-statements def _refine(node_coords, cells_nodes, edge_nodes, cells_edges): """Canonically refine a mesh by inserting nodes at all edge midpoints and make four triangular elements where there was one. This is a very crude refinement; don't use for ac...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ------------------------------------------------------------------------------------------------- dlg_trj_edit_new mantém as informações sobre a dialog de edição de trajetória This program is free software: you can redistribute it and/or modify it under the terms of t...
import time import random import log import openair import core import os import shutil # copy file NUM_UE=1 NUM_eNB=1 NUM_TRIALS=3 PRB=[25,50,100] MCS=[0,4,9,10,13,16,17,22,27] #PRB=[100] #MCS=[16] ANT_TX=1 # 2 ANT_RX=2 # 2 CHANNEL=["N"] #CHANNEL=["C","E","F","G","H","I","L","M"] # A,B,C,D,E,F, TX_MODE=2 # 2...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to find Flickr users exposed to deletions. https://blog.flickr.net/en/2018/11/07/the-commons-the-past-is-100-part-of-our-future/ """ # # (C) Federico Leva, 2018 # # Distributed under the terms of the MIT license. # __version__ = '0.1.0' import sys from time impo...
import unittest from abpytools.features.regions import ChainDomains from abpytools.core.chain_collection import ChainCollection class AbDomainTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.ab_file = './tests/Data/chain_collection_heavy_2_sequences.json' def test_ChainDomains_inst...
import pandas as pd saav_table_fname = "S-LLPA_SAAVs_20x_10percent_departure.txt" nonoutlier_gene_cov_fname = "ALL_SPLITS-gene_non_outlier_coverages.txt" # load table saav_table = pd.read_csv(saav_table_fname, sep='\t', header=0, index_col=False) # neglect inter-gene stop codons, which have invalid BLOSUM scores saa...
import auracle_test import json class TestRawQuery(auracle_test.TestCase): def testRawInfo(self): r = self.Auracle(['rawinfo', 'auracle-git']) self.assertEqual(0, r.process.returncode) parsed = json.loads(r.process.stdout) self.assertEqual(1, parsed['resultcount']) names ...
# Imports import commands import crypt import hashlib import random import string # Exports __all__ = ( "DIGITS", "LETTERS", "RandomPassword", ) # Constants DIGITS = [0, 1, 2, 3, 4, 5, 6, 8, 9] LETTERS = [ "a", "b" "C", "d", "e" "f", "g", "h", "i", "j", "K",...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
# -*- coding: utf-8 -*- import os import sys import struct def blue(msg): return "\033[1;36m%s\033[1;m" % msg def red(msg): return "\033[31m%s\033[1;m" % msg def green(msg): return "\033[32m%s\033[1;m" % msg def purple(msg): return "\033[1;35m%s\033[1;m" % msg def print_error(msg): print ...
# coding: utf-8 import time from threading import Lock class BlacklistItem(object): def __init__(self, item_id, item, next_try=30): self._count = 1 self._next_try = None self._item = item self._item_id = item_id self._interval = next_try self._next_try = next_try +...
"""ImageLocalFinder URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
from pyscf import lib from pyscf.tdscf import uks from pyscf.pbc.tdscf.uhf import TDA from pyscf.pbc.tdscf.uhf import TDHF as TDDFT RPA = TDUKS = TDDFT class TDDFTNoHybrid(uks.TDDFTNoHybrid): def gen_vind(self, mf): vind, hdiag = uks.TDDFTNoHybrid.gen_vind(self, mf) def vindp(x): with...
from vtk.util import numpy_support import stk if stk.useObsLn==True: from obsln.core.stream import Stream as obsStream from obsln.core.trace import Trace as obsTrace else: from obspy.core.stream import Stream as obsStream from obspy.core.trace import Trace as obsTrace import stk.tracePanelDataUt...
""" Helper functions for reports testing. Please /do not/ import this file by default, but only explicitly call it through the code of python tests. """ import logging import os import tempfile from subprocess import Popen, PIPE from .. import api from . import pycompat, ustr, config from .safe_eval import s...
{ "name": "Fidelizacion de Clientes", #"version": "1.0", #"description": """ #En este modulo se imprementa la sumatoria de puntos segun los Datos Cargados Por la Compañia #Colaboradores: #- Johan Alejandro Olano <<EMAIL>> #- Julián Andrés García Álvarez <<EMAIL>> #""", "au...
# -*- coding: utf-8 -*- import datetime from factory import Sequence, Faker, SubFactory from factory.alchemy import SQLAlchemyModelFactory from liebraryrest.database import db from liebraryrest.models import Author, Book, User class BaseFactory(SQLAlchemyModelFactory): """Base factory.""" class Meta: ...
from twisted.cred.error import UnauthorizedLogin from twisted.internet.defer import inlineCallbacks from twisted.trial import unittest from leap.bitmask.bonafide._srp import SRPAuthError from mock import patch, Mock from pixelated.authentication import Authenticator from pixelated.bitmask_libraries.provider import L...
from conans import ConanFile, CMake from conans.tools import download, unzip import os import shutil class Flow(ConanFile): name = "Flow" version = "2.0" description = """Flow is a pipes and filters implementation tailored for microcontrollers. It provides 3 base concepts: component, port and connection.""" url...
import gtk from os.path import join from general_dialogs import Input_Dialog from guiutils import GUI_Page, new_button, Action_List from pathname import ICON_DIR, get_dir class Watches_GUI: # list store columns COL_ICON = 0 COL_NAME = 1 COL_TARGET = 2 def __init__(self, main_gui, getstatecb, mod...
from osv import orm, osv, fields from tools.translate import _ class account_tax_declaration_analysis(orm.TransientModel): _name = 'account.vat.declaration.analysis' _description = 'Account Vat Declaration' _columns = { 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscalyear', ...
from Tools import * class Connmon: def __init__(self, config): self.logger = logging.getLogger('browbeat.Connmon') self.config = config self.tools = Tools(self.config) return None # Start connmond def start_connmon(self, retry=None): self.stop_connmon() to...
import sys from six import b as b_ from webtest import TestApp from pecan import expose, make_app from pecan.secure import secure, unlocked, SecureController from pecan.tests import PecanTestCase if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest # noqa try: set() except: ...
import bibtexparser import os # function parse names for bib authors def parse_authors(authorStr): # parse author's names and output authors names in format of # H. Wang (or Haining Wang depending on wether full name is provided) authors = authorStr.split(" and "); for idx in range(len(authors)): ...
from django.db import models from osis_common.models.serializable_model import SerializableModel, SerializableModelAdmin from reference.models.enums import grade_type_coverage, institutional_grade_type as enum_institutional_grade_type class GradeTypeAdmin(SerializableModelAdmin): list_display = ('name', 'readabl...
#!/usr/bin/python # -*- coding: ascii -*- ''' Common utilities. (C) 2007-2008 - Viktor Ferenczi (<EMAIL>) - Licence: GNU LGPL ''' #============================================================================ import sys #============================================================================ __all__ = ['wraps...
from datetime import datetime, timedelta from optparse import make_option from os import path from django.conf import settings from django.core.management.base import BaseCommand, CommandError import commonware.log import amo from addons.models import Addon # TODO: use UpdateCount when the script is proven to work c...
import feedparser from .config import beanstalk, articles, g import json class FeedScraper(object): def __init__(self, publications): self.publications = publications def produce(self): for publication, feed_url in self.publications: feed = feedparser.parse(feed_url) fo...
import os import re import shutil import subprocess import requests PACKAGE_URL = re.compile(r'http://pub.dartlang.org/packages/(\w+).json') PUBSPEC = ''' name: %s dependencies: %s: %s ''' ARCHIVE_URL = "https://commondatastorage.googleapis.com/pub.dartlang.org/packages/{}-{}.tar.gz" package_urls = [] # Downloa...
"""Python command line interface for running TOCO.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys from tensorflow.contrib.lite.python import lite from tensorflow.contrib.lite.python import lite_constants from tensor...
import logging import os from wic import WicError from wic.pluginbase import SourcePlugin from wic.utils.misc import exec_cmd, get_bitbake_var from wic.filemap import sparse_copy logger = logging.getLogger('wic') class RawCopyPlugin(SourcePlugin): """ Populate partition content from raw image file. """ ...
from __future__ import division as __division__ import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches import numpy as np from . import trace # All lens drawing and ray drawing functions def draw_surface(r,x0,d1,d2): ''' d1: diameter that rays go through d2: m...
from __future__ import absolute_import from pkg_resources import get_distribution __version__ = get_distribution("google-cloud-trace").version from google.cloud.trace.client import Client from google.cloud.trace_v2 import types from google.cloud.trace_v2.gapic import enums from google.cloud.trace_v2.gapic import tra...
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald core beans definition :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.3 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you...
#!/usr/bin/env python3 """Validate the relationship between Envoy dependencies and core/extensions. This script verifies that bazel query of the build graph is consistent with the use_category metadata in bazel/repository_locations.bzl. """ import re import subprocess import sys from importlib.machinery import Sourc...
from django.conf.urls.defaults import * from django.contrib import admin from django.views.generic.simple import redirect_to from django.views.decorators.cache import cache_page from django.conf import settings import apps.ip_blocking.admin from apps.share_tracking import views from canvas import api, sitemaps from c...
# -*- coding: utf-8 -*- ''' :author: Patrick Lauer This class holds the Artificial Bee Colony(ABC) algorithm, based on Karaboga (2007): D. Karaboga, AN IDEA BASED ON HONEY BEE SWARM FOR NUMERICAL OPTIMIZATION,TECHNICAL REPORT-TR06, Erciyes University, Engineering Faculty, Computer Engineering Department 2005. D. Ka...