content
stringlengths
5
1.05M
from logging import log from config import data_db_schema,data_mono from repositories import DataRepo from utilities import LANG_CODES import logging from logging.config import dictConfig log = logging.getLogger('file') repo = DataRepo() class MonolingualModel: def __init__(self): self.db = data_db_s...
from django.contrib import admin from .models import Item # register to site view admin.site.register(Item)
class print_result: def __init__(self): pass def print_result_all(self, contents, result): print(contents, ':', result)
import streamlit as st import pandas as pd import numpy as np from sklearn.metrics.pairwise import cosine_similarity import plotly.express as px from modules import topic_identify import base64 from io import BytesIO from sentence_transformers import SentenceTransformer st.set_option('deprecation.showPyplotGlobalUse', ...
from django.db import models from django.utils.translation import gettext_lazy as _ class TimeStampedModel(models.Model): """ TimeStampedModel is the base abstract class to be used for all models with this project. """ created = models.DateTimeField(_("Created"), auto_now_add=True) modified =...
from pycu.driver import device_primary_ctx_retain, device_primary_ctx_release, ctx_set_current, ctx_synchronize, ctx_create, ctx_destroy, ctx_push_current, ctx_pop_current import threading import weakref from collections import defaultdict class _ContextStack(threading.local): def __init__(self): super().__init__(...
from flask import Blueprint, request, jsonify import logging blueprint = Blueprint('health_check', __name__, url_prefix='/api/health') @blueprint.route('/') def health_check(): logging.info('Health check') return jsonify({'status': 'ok'})
import numpy as np import matplotlib.pyplot as plt func = np.poly1d(np.array([1, 2, 3, 4]).astype(float)) x = np.linspace(-10, 10, 30) y = func(x) func1 = func.deriv(m=1) y1 = func1(x) func2 = func.deriv(m=2) y2 = func2(x) plt.subplot(311) plt.plot(x, y, 'r-') plt.title("Polynomial") plt.subplot(312) plt.plot(x, y1, ...
""" Helpers and wrappers that make usages of mars_util more consistent. """ import os.path from typing import Any, List, Optional, Union import yaml from mars_util.job_dag import JobDAG from mars_util.task import PrestoTask from mars_util.task.destination import PrestoTableDestination import src.jobs.whereami PRESTO...
import os import torch from torchvision.utils import save_image from config import * from dataset import get_div2k_loader from models import Generator_SRGAN, Generator_ESRGAN from utils import denorm # Device Configuration # device = 'cuda' if torch.cuda.is_available() else 'cpu' def single_inference(): # Inf...
''' * TeleStax, Open Source Cloud Communications * Copyright 2011-2016, Telestax Inc and individual contributors * by the @authors tag. * * This 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; ei...
import gin import numpy as np import torch import torch.optim as optim from basics.abstract_algorithms import RecurrentOffPolicyRLAlgorithm from basics.summarizer import Summarizer from basics.actors_and_critics import MLPTanhActor, MLPCritic from basics.replay_buffer_recurrent import RecurrentBatch from basics.utils...
import sublime import sublime_plugin from ..settings import get_setting class InsertPhpConstructorPropertyCommand(sublime_plugin.TextCommand): 'Inserts a constructor argument that sets a property.' placeholder = 'PROPERTY' def description(self): 'The description of the command.' return '...
from django.urls import reverse from rest_framework.test import APITestCase from .models import User class APITests(APITestCase): def test_list_user_status_ok(self): """ Ensure we got a status 200 when listing users """ url = reverse("user-list") response = self.client.get...
from django.apps import AppConfig class MonitoringDbApiConfig(AppConfig): name = 'monitoring_db_api'
import pytest from indy_common.constants import RS_ID, RS_VERSION, RS_NAME, RS_CONTENT, RS_TYPE, \ GET_RICH_SCHEMA_OBJECT_BY_METADATA from indy_common.types import Request from indy_node.server.request_handlers.read_req_handlers.rich_schema.get_rich_schema_object_by_metadata_handler import \ GetRichSchemaObjec...
import os import time import tempfile from django.core.files.base import ContentFile def getSizes(settings): if "sizes" in settings: if isinstance(settings["sizes"], list) and all(isinstance(x, list) for x in settings["sizes"]): return settings["sizes"] return [[1600, 900]] def generateL...
# # Collective Knowledge (individual environment - setup) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net # import os ############################################################################## # ...
from django.db import models from django.conf import settings from projects.models import Project # Create your models here. User = settings.AUTH_USER_MODEL class BalanceManager(models.Manager): def add_new(self, cart): try: for i in cart: p_id = i.get('projects') p...
######## # Copyright (c) 2017 GigaSpaces Technologies Ltd. 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...
import xmltodict import json reply = """ <rpc-reply xmlns:junos="http://xml.juniper.net/junos/21.2R0/junos" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101"> <zones-information xmlns="http://xml.juniper.net/junos/21.2R0/junos-zones" junos:style="detail"> <zones-security> <zones-security-zonename>...
#!/usr/bin/python3 # coding: utf8 """ Global definition of pin numbers. """ # Serial Clock (shared between thermocouples) CLK = 21 # First thermocouple - Chip Select and Serial Output CS1 = 12 SO1 = 5 # Second thermocouple - Chip Select and Serial Output CS2 = 6 SO2 = 13 # Third thermocouple - Chip Select and ...
""" Tests for the measure module """ import star import numpy as np import math import pytest def test_calculate_distance(): r1 = np.array([0, 0, 0]) r2 = np.array([0, 1, 0]) expected_distance = 1 calculated_distance = star.calculate_distance(r1, r2) assert expected_distance == calculated_distance ##assert ...
from django.urls import path from . import views app_name = 'message' urlpatterns = [ path('<slug:username>/', views.index_view, name='index'), path('<slug:username>/create', views.create_view, name='create'), ]
from flask_wtf import FlaskForm from wtforms import StringField, FloatField from wtforms.validators import InputRequired class InputForm(FlaskForm): convert_from = StringField("Converting from", validators=[InputRequired()]) convert_to = StringField("Converting to", validators=[InputRequired()]) amount = F...
""" Problem 005 on CSPLib Examples of Execution: python3 LowAutocorrelation.py python3 LowAutocorrelation.py -data=16 """ from pycsp3 import * n = data or 8 # x[i] is the ith value of the sequence to be built. x = VarArray(size=n, dom={-1, 1}) # y[k][i] is the ith product value required to compute the kth auto...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import logging import torch import torch.nn as nn import models BN_MOMENTUM = 0.1 logger = logging.getLogger(__name__) class PoseDAResNet(nn.Module): def __init__(self, cfg, is_train): ...
from setuptools import setup, find_packages setup( name="mvtech_al", version="2.3.0", description="Anomaly Localization on MVTech images", url="", author="Shrihari Muttagi", author_email="meetshrihari@gmail.com", packages=["mvtech_al"], )
from unittest import TestCase from mock import Mock, call, patch import os from home_greeter.tweeter import Tweeter class TestTweeter(TestCase): def setUp(self): self.mock_tweepy = Mock(autospec='tweepy') self.tweeter = Tweeter(api=self.mock_tweepy) def test_create(self): self.assertIs...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.11 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path impo...
## # Copyright (c) 2013-2015 Apple 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 l...
import logging import os import shutil from tempfile import mkdtemp from pandas import Timestamp from pandas.io.pickle import read_pickle as pd_read_pickle from pandas.io.pickle import to_pickle as pd_to_pickle from featuretools import variable_types as vtypes logger = logging.getLogger('featuretools.entityset') _d...
from unittest import TestCase, mock import numpy as np from copulas.bivariate.base import Bivariate, CopulaTypes from tests import compare_nested_dicts class TestBivariate(TestCase): def setUp(self): self.X = np.array([ [0.2, 0.3], [0.4, 0.4], [0.6, 0.4], ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # 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 # # Unle...
import streamlit as st import utils from classrad.evaluation.evaluator import Evaluator from classrad.config import config def show(): """Shows the sidebar components for the template and returns user inputs as dict.""" with st.sidebar: pass # LAYING OUT THE TOP SECTION OF THE APP col1, ...
from abc import ABCMeta, abstractmethod class IVisitor(metaclass=ABCMeta): def visit(self, element): if isinstance(element, Building): self._visit_building(element) elif isinstance(element, Floor): self._visit_floor(element) elif isinstance(element, Room): ...
from Qt import QtWidgets, QtCore from .base import InputWidget from .widgets import ExpandingWidget from .lib import ( BTN_FIXED_SIZE, CHILD_OFFSET ) from avalon.vendor import qtawesome class EmptyListItem(QtWidgets.QWidget): def __init__(self, entity_widget, parent): super(EmptyListItem, self)....
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name="capi", version="0.1.0", author="Samuel Sokota", license="LICENSE", description="Example implementation of CAPI", long_description=long_description, long_description_...
import arcpy def pprint_fields(table): """ pretty print table's fields and their properties """ def _print(l): print("".join(["{:>12}".format(i) for i in l])) atts = ['name', 'aliasName', 'type', 'baseName', 'domain', 'editable', 'isNullable', 'length', 'precision', 'required...
import opcode import dis import weakref import types from funes.logging import logging # this will store hashes and global lists for functions / values, # without preventing them from being GC'd code_object_global_names_cache = weakref.WeakKeyDictionary() STORE_GLOBAL = opcode.opmap['STORE_GLOBAL'] DELETE_GLOBAL = ...
import click import yaml from freezeyt.freezer import freeze from freezeyt.util import import_variable_from_module @click.command() @click.argument('module_name') @click.argument('dest_path', required=False) @click.option('--prefix', help='URL of the application root') @click.option('--extra-page', 'extra_pages', mu...
# # PySNMP MIB module CISCO-ATM-IF-PHYS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ATM-IF-PHYS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:50:39 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (def...
from .main import * from .LINEAPI import LINE, Channel, OEPoll from .LINEBASE.ttypes import OpType from .GAMES import cows_and_bulls, tic_tac_toe __copyright__ = 'Copyright 2021 by Light Technology' __version__ = '1.0.1' __license__ = 'MIT' __author__ = 'Light Technology' __author_email_...
# -*- coding: utf-8 -*- import phantom.app as phantom from phantom.base_connector import BaseConnector from phantom.action_result import ActionResult # Usage of the consts file is recommended # from mark2server_consts import * import requests import json import tempfile import os class RetVal(tuple): def __new_...
from discord import ChannelType, Message, TextChannel, Thread from discord.abc import Snowflake from discord.ext.commands import Context as _BaseContext class Context(_BaseContext): """A Custom Context for extra functionality.""" async def create_message_thread( self, name: str, *, auto_archive_durat...
import dqcsim._dqcsim as raw from dqcsim.common.handle import Handle class QubitSet(object): @classmethod def _from_raw(cls, handle): #@ with handle as hndl: qubits = [] while raw.dqcs_qbset_len(hndl) > 0: qubits.append(raw.dqcs_qbset_pop(hndl)) return qu...
# ------------------------------- # UFSC - CTC - INE - INE5663 # Exercício da Matriz de Inteiros # ------------------------------- # Classe que permite exibir informações sobre uma matriz. # from view.util import mostra_matriz class PainelAnalisaMatriz: def analise(self, matrizes): print('- - - Analisand...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os.path from io import BytesIO import datetime import pytz import re import json import requests import urllib import csv import pandas as pd import numpy as np import hashlib from django.apps import apps from django.views.generic...
#!/usr/bin/python import cv2 import sys import os from cv2 import cv import numpy as np def showme(pic): cv2.imshow('window',pic) cv2.waitKey() cv2.destroyAllWindows() def main(argv): inputfile = 'test/test-tmp-1-34227-polygon-extracted.tif' if len(argv) == 1: inputfile = argv[0] ci...
n, l = map(int, input().split()) list = [str(input()) for i in range(n)] list.sort() s = ''.join(list) print(s)
"""pymodpde.py: a symbolic module that generates the modified equation for time-dependent partial differential equation based on the used finite difference scheme.""" __author__ = "Mokbel Karam , James C. Sutherland, and Tony Saad" __copyright__ = "Copyright (c) 2019, Mokbel Karam" __credits__ = ["University of Utah ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-06-28 14:57 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('goods2', '0026_auto_20180625_1833'), ] operations = [ migrations.AddField( ...
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/env python """ This is a silly mapper to demonstrate some errors. """ import sys import numpy as np # To use numpy add -cmdenv PATH={PATH} to your Hadoop Job for line in sys.stdin: msg = ("a message") # missing a parenthesis here print 1/1 # dividing by zero is a no-go
import unittest from bubble_sort import bubble_sort class TestBubbleSort(unittest.TestCase): def test_short_sort(self): """ Tests that a short list of integers has been sorted successfully """ list = [4, 6, 9, 3, 5, 2, 6] final = [2, 3, 4, 5, 6, 6, 9] self.a...
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
import threading import time class BankAccount(): def __init__(self): self.amount = 0 def withdraw(self): if self.amount >= 100: print('Withdrawing 100') self.amount -= 100 def credit(self): if self.amount < 0: print('Negative amount !!!!!')...
# coding=utf-8 # This file is automatically generated based on the English CLDR file. # Do not edit manually. from django.utils.translation import ugettext_lazy as _ METAZONE_MAPPING_FROM_TZ = { "Africa/Abidjan": "GMT", "Africa/Accra": "GMT", "Africa/Addis_Ababa": "Africa_Eastern", "Africa/Algiers": "...
import pandas as pd import numpy as np calendar = pd.read_csv('calendar.csv', index_col='date', parse_dates=True) train_validation = pd.read_csv('sales_train_validation.csv') train_evaluation = pd.read_csv('sales_train_evaluation.csv') test_validation = pd.read_csv('sales_test_validation.csv') test_evaluation = pd.rea...
BASE_URL = 'https://api.pagar.me/1/balance'
import babeltrace import statistics def format_event(event): op = event.get('op', '-') return "{0}: {1}: tid={2}, op={3}".format(event.cycles, event.name.ljust(30), event['pthread_id'], op) # Count the number of occurrences of each key class Count: def __init__(self, event_filter, key_func): self....
""" Copyright BOOSTRY Co., Ltd. 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 law or agreed to in writing, software distr...
from django.contrib import admin from .models import UserState, ActivityState, ActivitySessionState admin.site.register(UserState, list_display=["user", "data"]) admin.site.register(ActivityState, list_display=["activity_key", "activity_class_path", "user", "data"]) admin.site.register(ActivitySessionState, list_di...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, datetime, jwt, uuid from flask import Flask, jsonify, request from flask_cors import CORS from werkzeug.security import generate_password_hash, check_password_hash from functools import wraps from model import db, ma from model import User, Tournee, PDI, UserSc...
import sys from termcolor import cprint from pyfiglet import figlet_format cprint(figlet_format('missile!', font='starwars'), 'yellow', 'on_red', attrs=['bold'])
""" Tests for pdfmerger. """ import unittest import src.pdfmerger.pdfmerger as pdfmerger class StripTitleTest(unittest.TestCase): """ Basic test cases """ def test_basic(self): """ check that the function works for a basic case """ result = pdfmerger.strip_title("Interesting title (123) ...
# Copyright 2020 Samsung Electronics Co., Ltd. # # 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 law or agreed...
from rest_framework import permissions class IsOwnerOrReadOnly(permissions.BasePermission): """ Custom permission to only allow owners of an object to edit it. """ # This is currently overriden in the settings.py with a default def has_object_permission(self, request, view, obj): """ ...
n, k, q = map( int, input().strip().split(' ') ) array = [ int(a_temp) for a_temp in input().strip().split(' ') ] def rotate_right_n(arr, k): array_length = len(arr) result = [None] * array_length for i, item in enumerate(arr): new_position = (i + k) % array_length re...
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy from django.test import TestCase from django.http import request from django.template import Context from django.conf import settings from django.core import mail from django.utils.translation import gettext_lazy as _ from mail_helper import utils class Te...
import tensorflow as tf import sys def test1(): with tf.name_scope('123'): with tf.name_scope('456'): with tf.variable_scope('789'): a = tf.Variable(1,name='a') print a.name b = tf.get_variable('b',1) print b.name def test2(): with tf.name_scope('1...
from marshmallow import Schema from marshmallow_sqlalchemy import SQLAlchemyAutoSchema from ICECREAM.http import HTTPError def validate_data(serializer: Schema, data: {}): validation_errors = serializer.validate(data) if validation_errors: raise HTTPError(403, validation_errors) return True
# -*- coding: utf-8 -*- # vim:fenc=utf-8 ''' Universe manager ---------------- It knows everything about market and smartly handle user input :copyright (c) 2014 Xavier Bruhiere :license: Apache 2.0, see LICENSE for more details. ''' import os import random import pytz import dateutil.parser import yaml ...
""" The top-panel in the frame of the gym-idsgame environment """ from gym_idsgame.envs.rendering.util.render_util import batch_label from gym_idsgame.envs.constants import constants from gym_idsgame.envs.dao.idsgame_config import IdsGameConfig from gym_idsgame.envs.dao.game_state import GameState class GamePanel: ...
from itertools import product import torch from torch._C import Size import torch.nn as nn import torch.nn.functional as F from torch import Tensor from . import unsqueeze_as from .decorators import NoGrad @torch.jit.script def gray2JET(x, thresh=0.5): # type: (Tensor, float) -> Tensor """ - x: [..., H,...
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2010-2013 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details import sys, os, string, re from optparse import OptionParser import sqlite3 from bat import extractor ## TODO: replace by generic code fro...
from autograd.blocks.block import SimpleBlock import numpy as np class sin(SimpleBlock): """ vectorized sinus function on vectors """ def data_fn(self, args): new_data = np.sin(args.data) return(new_data) def gradient_fn(self, args): grad = np.cos(args.data) retur...
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Promotions"), "items": [ { "type": "doctype", "name": "Advertisement" }, { "type": "doctype", "name": "Affiliates" }, { "type": "doctype", "name"...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ Encoder that fuses the textual and image features to create the condition input to the RNN """ import torch.nn as nn class ConditionEncoder(nn.Module): def __init__(self, cfg): super(ConditionEncoder, self)._...
"""Webcam Spatio-Temporal Action Detection Demo. Some codes are based on https://github.com/facebookresearch/SlowFast """ import argparse import atexit import copy import logging import queue import threading import time from abc import ABCMeta, abstractmethod import cv2 import mmcv import numpy as np import torch f...
from pyscf import grad def gen_grad_scanner(method): from pyscf import scf, cc if isinstance(method, scf.hf.SCF) and hasattr(method, 'nuc_grad_method'): return method.nuc_grad_method().as_scanner() elif isinstance(method, cc.ccsd.CCSD): return grad.ccsd.as_scanner(method) else: ...
""" Write a Python program to add two objects if both objects are an integer type. """ class Addition: def __init__(self,x,y): self.x = x self.y = y def __add__(self,other): return Addition(self.x+other.x, self.y+other.y) first = Addition(5,7) second = Addition(3,6) result = first + sec...
# Exercise 5.31 # Author: Noah Waterfield Price import numpy as np import matplotlib.pyplot as plt import operator from scitools.std import movie def animate_series(fk, N, tmax, n, exact, exactname): t = np.linspace(0, tmax, n) s = np.zeros(len(t)) counter = 1 for k in range(0, N + 1): s = S(...
__author__ = 'Fabian Isensee' import numpy as np import lasagne import os import sys import fnmatch import matplotlib.pyplot as plt sys.path.append("../../modelzoo/") from Unet import * import theano.tensor as T import theano import cPickle from time import sleep from generators import batch_generator, threaded_generat...
#! /usr/bin/python # -*- coding: utf-8 -*- import time import tensorflow as tf import tensorlayer as tl from keras import backend as K from keras.layers import * from tensorlayer.layers import * X_train, y_train, X_val, y_val, X_test, y_test = \ tl.files.load_mnist_dataset(shape=(-1, 784)) sess = tf....
# -*- coding: utf-8 -*- from odoo import api, fields, models, _ from odoo.exceptions import AccessError, ValidationError import odoo.addons.decimal_precision as dp class product_product(models.Model): _name = 'product.template' _inherit = 'product.template' _description= 'Productos' c_cl...
import json import pytest from flask import url_for def test_add_test_route(client): h = {"Content-Type": "application/json"} d = {"test_type": "aaa"} res = client.post(url_for("test.test"), data=json.dumps(d), headers=h) assert res.status_code == 201 h = {"Content-Type": "application/json"} ...
from conans import ConanFile, CMake, tools class ClsjConan(ConanFile): name = "clsj" version = "0.1" license = "MIT" url = "https://github.com/malwoden/clsj-conan" description = "clsj is a toy package for testing c++, swig, java and conan togther" settings = "os", "compiler", "build_type", "ar...
""" Copyright (c) 2019 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the material herein must be in accordance with t...
from .__imports import * from sqlalchemy.orm import Session from models.user_model import User class UserInfoController(Controller): __view__ = "user_info" __title__ = "%USER%" def __init__(self, session: Session, user_id: int): super(UserInfoController, self).__init__() self.css("user_i...
#!/usr/bin/env python """ Unit tests for SLIG algorithm Class - """ from dataclasses import asdict, astuple from functools import reduce from typing import List, Tuple from unittest import TestCase from numpy import mean from pprint import pprint from slig.datastructs import Interval, Region, RegionSet from slig ...
# -*- coding: utf-8 -*- ''' modified from https://www.github.com/kyubyong/dc_tts ''' from __future__ import print_function, division from hyperparams import Hyperparams as hp import numpy as np import tensorflow as tf import librosa import copy import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt fr...
import collections N, Q = map(int, input().split()) # ab=[list(map(int,input().split())) for _ in range(N-1)] graph = [[] for _ in range(N + 1)] for i in range(N - 1): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) dist = [-1] * (N + 1) dist[0] = 0 dist[1] = 0 d = collections.de...
from bioblend.galaxy.tools.inputs import ( conditional, dataset, inputs, repeat, ) def test_conditional(): # Build up example inputs for random_lines1 as_dict = inputs().set( "num_lines", 5 ).set( "input", dataset("encoded1") ).set( "seed_source", conditional()....
# -*- coding: utf-8 # hi from configparser import ConfigParser from selenium.webdriver.chrome.options import Options from argparse import ArgumentParser from func import * from time import strftime, localtime import warnings import sys warnings.filterwarnings('ignore') def sys_path(browser): path = f'./{browser}...
# USAGE # python object_detector.py --prototxt MobileNetSSD_deploy.prototxt --model MobileNetSSD_deploy.caffemodel # --montageW 2 # --montageH 2 # import the necessary packages from imutils import build_montages from datetime import datetime import cv2 as cv import time import imutils from imutils.video import VideoSt...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-03 18:14 from __future__ import unicode_literals from django.db import migrations def toggle_existing_declarations(apps, schema_editor): Declaration = apps.get_model('core.Declaration') Declaration.objects.update(to_link=True) class Migration...
import abc import asyncpg class AbstractDatabase: @abc.abstractmethod async def get_connection(self): """A coroutine that returns a connection to database.""" @abc.abstractmethod async def call_connection_coroutine( self, coroutine_name, sql_query, *args, connection=None, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @authors: Mihnea S. Teodorescu & Moe Assaf, University of Groningen """ #### Libraries # Third-party libraries import numpy as np #### Class declaration class Network(object): def __init__(self, sizes): # sizes = number of neurons per layer [input, hidden...
#!/usr/bin/env python3 # coding=utf8 import os import time import colorsys import threading import _thread from sys import exit, argv try: from PIL import Image, ImageDraw, ImageFont except ImportError: exit('Lemon requires the pillow module\nInstall with: sudo pip3 install pillow') try: import unicornha...