content
stringlengths
5
1.05M
import json from django.contrib.auth.models import User from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APIClient, APITestCase from bulletin.tools.plugins.models import Story class StoryTests(APITestCase): def setUp(self): self.new_story_da...
import aslib_scenario import algsel import argparse import json import logging import os def parse_args(): parser = argparse.ArgumentParser(description='Runs a sklearn algorithm on Oberon splits') parser.add_argument('--oasc_scenario_dir', type=str, default='../../oasc/oasc_scenarios/') parser.add_argumen...
# Generated by Django 2.1.12 on 2019-10-05 20:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('daphne_context', '0003_dialoguecontext'), ] operations = [ migrations.AddField( model_name='dialoguecontext', name=...
import tensorflow as tf import time import numpy as np import DeepLearning.Tensorflow_Base_Functions.initialization as tfInitial def Conv_Dense_0001_a(DataCenter): tfInitial.initialize_placeholders(DataCenter) scope = DataCenter.new_model_scope last_layer = DataCenter.train_output_data.shape[1] with...
# Copyright 2021 Huawei Technologies 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...
# Computing the Dice Scores for individual slices and then the Mean Dice Score and Dice Loss # For non-tumor and background region: def dice_coef_0(y_true, y_pred,smooth=0.000001): y_true_f = K.flatten(y_true[:,:,:,0]) y_pred_f = K.flatten(y_pred[:,:,:,0]) intersection = K.sum(y_true_f * y_pred_f) retu...
# -*- coding: utf-8 -*- # """ # - Author: steve simmert # - E-mail: steve.simmert@uni-tuebingen.de # - Copyright: 2015 # """ """ Manage power spectral densities measurements. """ import pdb from . import ureg from . import name_constants as co from .data_parser import read_PSD_parameter_file from .data_parser import ...
import pandas class Pandas_Dataframe(): def __init__(self, dataframe): """ Args: dataframe(pandas.DataFrame) """ self.dataframe = dataframe def insert_dataframe_at_index(self, index, dataframe_to_insert): """ Args: index(int): In...
"""Parse M3U files.""" # Derived from https://github.com/dvndrsn/M3uParser ... thanks! # # more info on the M3U file format available here: # http://n4k3d.com/the-m3u-file-format/ from typing import List, Union from soco_cli.utils import error_report class Track: def __init__( self, length: Union[str, ...
print(""" 070) Crie um programa que leia o nome e o preço de vários produtos. O programa deverá perguntar se o usuário vai continuar. No final, mostre: A) Qual é o total gasto na compra. B) Quantos produtos custam mais de R$1000 C) Qual é o nome do produto mais barato. """) totalgasto = 0 totalacimade1000 = 0 menorpr...
# UFSC - 2019/1 # PPGEAS - CBCA # Matuzalem Muller dos Santos # Controle proporcional integral import matplotlib.pyplot as plt import numpy as n # Parametros de tempo step = 0.1 stop = 1200 t = n.linspace(0,step*stop, stop) # Entrada reservatorio ki = 1 # Constante de abertura de entrada ai = n.zeros...
# Copyright 2016 Leon Poon and Contributors # # 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 ...
# # jVectorMap version 2.0.2 # # Copyright 2011-2013, Kirill Lebedev # import sys from osgeo import ogr from osgeo import osr import json import shapely.geometry import shapely.wkb import shapely.affinity import codecs import copy class Map: def __init__(self, name, language): self.paths = {} ...
import csv from csv import writer from pathlib import Path from time import sleep class EscreverCSV: def escrevercsv(self, data, pegarDirRaiz): self.pegarDirRaiz = pegarDirRaiz self.data = data fim = 0 pathTratado = str(self.pegarDirRaiz) home = Path(pathTrata...
import numpy as np import pandas as pd BIGNEG = -1e32 MINVAL, MAXVAL = -2, 7 # TOP assay yields of representative n:2 FT and ECF precursors # reported in the literature # Average of n:2 FTs reported in Houtz and Sedlak Table 1, 2012 # and Martin et al. 2019 Table 1 x_ft = [ 0.0245, 0.1850, 0.2874, 0.1943, 0.1425,...
from django.conf.urls import url from train_data import views urlpatterns = [ url('', views.PredictTillDate.as_view()), ]
import scipy.signal as signal def firls(N:int, frequencies, a, weight=None): """ FIR filter design using least squares method. Returns a length N+1 linear phase filter such that the integral of the weighted mean squared error in the specified bands is minimized. The vector F specifies the...
# For TESTING of ALL Modules from colorama import init, Fore, Back init(autoreset=True) #to convert termcolor to wins color from pyqum.instrument import logger, reader, network, toolbox, analyzer from pyqum.instrument.benchtop import MXG, DSO, ESG, PNA, ENA, PSGV, PSGA, RDSO, YOKO, GW32, KEIT, DSA8, RSA5, MXA from py...
# inte_mass is where SG_MAXL becomes truly meaningless inte_mass = 12. # from high mass and above find MS_BEG in this code high_mass = 19. # for low mass stars with no MS_TO listed, where to place it (and ms_tmin) max_age = 10e10 # file column names. Classic PARSEC xcen = 'XCEN' ycen = 'YCEN' MODE = 'MODE' # PARSEC...
from functools import partial import logging from os.path import join, exists import pandas as pd from sklearn.model_selection import KFold, train_test_split from sklearn.preprocessing import PowerTransformer, QuantileTransformer from .tabular_torch_dataset import TorchTabularTextDataset from .data_utils import ( ...
import bz2 import gzip import os import pandas as pd import datetime def get_rir_from_file(file_name: str) -> str: """ :param file_name: str path to the file :return: str name of the rir that produced the file """ return os.path.basename(file_name).split('-')[1] def read_bz(path...
from flask import Blueprint # 'autorizar' é o nome do Blueprint, e __name__ é o nome do módulo/pacote onde o blueprint está localizado secao = Blueprint('secao', __name__) from . import rotas
""" @authors: # ============================================================================= Information: The purpose of this script is to display various graphs and maps about Geoid coefficients Generally used variables: lmax = maximum degree to calculate to for the geopotantial HC...
#!/usr/bin/env python3 from algorithm import * from kernel_lib import * from terminal_print import * from gradients import * from Φs import * from math import e #import debug # max Tr[(DKuD)Kx] # W -> Kx -> D -> γ -> Σ ψA_i,j -> W class linear_unsupv_dim_reduction(algorithm): def __init__(self, db): db['W'] = np.z...
import pandas as pd import copy import numpy as np import re from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from sklearn.base import BaseEstimator, TransformerMixin from sklearn.preprocessing import LabelEncoder, OneHotEncoder class CleanText(BaseEstimator, TransformerMixin)...
from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Rebuild static files and language files' def add_arguments(self, parser): parser.add_argument( '-c', '--clear', action='store_tru...
import math K=int(input()) d=1 for i in range(K): key, value = list(map(int, input().strip().split())) if key==1: d+=value elif key==2: d*=value else: d=math.ceil(d/value) print(d)
from django.contrib.auth.decorators import login_required from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts import render, redirect from django.http import HttpResponse, Http404 # Create your views here. # Model -> View -> Template # Model -> View -> React.js / Vue.js from ...
#Prompts the user to input a file. Identifies the 10 most common words in the file and their respective frequency. #Prints these top 10 most common words in descending order. name = input("Enter file:") handle = open(name) counts=dict() for line in handle: words = line.split() for word in words: ...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by German M. Bravo (Kronuz) # Copyright (c) 2013 German M. Bravo (Kronuz) # # License: MIT # """This module exports the rst plugin linter class.""" from SublimeLinter.lint import highlight, Linter class Rst(Linter): ...
import logging import os import pandas as pd def prepare_data(self_relations_filter, data_df): if self_relations_filter: data_df = data_df.query('participant1 != participant2') data_df = data_df[["abstract", "participant1", "participant2"]] return data_df def run(network, data_file, artifactsd...
import os import re import sys import glob import pytmx import pygame import public import functions # Media loading system # Takes all sounds, images, and maps from /res/ and compiles them into an array for further use. MEDIA = {} images = glob.glob(os.path.join(os.path.dirname(__file__), 'res', '*.png')) audio = glo...
# -*- coding: utf-8 -*- from sys import path, argv path.append('../') from MPScumulant import MPS_c import os import re import numpy as np np.set_printoptions(5,linewidth=4*28) from time import strftime import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocato...
# -*- coding: utf-8 -*- ''' setup.py installation script ''' from pathlib import Path from setuptools import setup, find_packages long_description = (Path(__file__).parent / 'README.md').read_text() def run(): setup( name='pangadfs', version='0.1', description='extensible pandas-based ...
import sys import os import os.path as op import re from util import get_recipe_number, get_recipe_name current_dir = op.dirname(os.path.abspath(__file__)) code_dir = op.join(current_dir, '../') featured_dir = op.join(code_dir, 'featured/') site_dir = op.join(current_dir, '../../ipython-books.github.io') ...
""" Core test case class(es) and exceptions. Author: pnovotny, ltrilety """ # Copyright 2016 Red Hat # # 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/L...
from otp.level import DistributedEntityAI from toontown.coghq import DistributedBarrelBaseAI from direct.directnotify import DirectNotifyGlobal from direct.distributed.ClockDelta import globalClockDelta from direct.task import Task class DistributedMazeAI(DistributedEntityAI.DistributedEntityAI): notify = DirectNo...
#!/usr/bin/env python3 from .cloudflare import Cloudflare from .utils import Fetch, wait_result
#!/usr/bin/python import csv from datetime import datetime import shutil from Tkinter import * import tkSimpleDialog from ttk import Combobox ################################ # the main application class # ################################ class LazyJournal(Frame): def __init__(self, master=None): Frame.__init__(se...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # GNU General Public License v3.0 # # Permissions of this strong copyleft license are conditioned on making available # complete source code of licensed works and modifications, which include larger works # using a licensed work, under the same license. Copyright and license...
import numpy as np import math class MCTSNode: def __init__(self,state="1",parent=None,array=None): self.state=state # Indicate the white or the black self.win=0.0 # Indicate the reward function self.visit=0.0 #Indicate the Total number of visit self.parent=parent self.childr...
#!/usr/bin/env python3 """Updates HelmReleases with an annotation consumeable by rennovate. This script adds annotations fo HelmRelease files so that rennovate can manage chart upgrades. This script accepts a --cluster-path argument which should point at a fluxv2 repository that contains Kustomization yaml files, refe...
# -*- coding:utf-8 -*- import os import sys from os.path import dirname, join, abspath sys.path.insert(0, abspath(join(dirname(__file__), '..'))) folder_path = os.path.dirname(abspath(__file__)) import numpy as np import pyaudio from pathlib import Path import time import wave import argparse import wget import thread...
#! python3 # mcb.pyw - Saves and loads pieces of text to the clipboard. # # NOTES: py.exe mcb.pyw save <keyword> - Saves clipboard to keyword. # py.exe mcb.pyw <keyword> - Loads keyword to clipboard. # py.exe mcb.pyw list - Loads all keywords to clipboard. # py.exe mcb.pyw dele...
import argparse import unirest import sys import os def data_file(name): this_dir = os.path.split(__file__)[0] return os.path.join(this_dir, "files", name) def exec_http_get(url, params=None): if args.verbose: print "GET url = {}".format(url) print "GET params = {}".format(params)...
# Import Flask and needed Dependencies from flask import Flask, jsonify import numpy as np import pandas as pd import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func, inspect # Create an app, being sure to pa...
# Import configurations import FWCore.ParameterSet.Config as cms process = cms.Process("testFlavorHistoryProducer") # set the number of events process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) # initialize MessageLogger and output report process.load("FWCore.MessageLogger.Me...
__author__ = 'dstuebe'
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o import time from tests import pyunit_utils #---------------------------------------------------------------------- ## Verifying that a user can change a column type to Enum if they like. #--------------------------------------------...
''' Copyright 2015 by Tobias Houska This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Tobias Houska This example implements the Rosenbrock function into SPOT. ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ im...
""" Direct Solvers. """ from directSolver import * from pysparseUmfpack import * from pysparseSuperLU import * __all__ = filter(lambda s:not s.startswith('_'), dir())
import os import git import shutil from fnmatch import fnmatch def listdir(cwd: str, prefix: str) -> list: # List files in a directory matches = [] for path, subdirs, files in os.walk(cwd): for name in files: if fnmatch(name, prefix): matches.append(os.path.join(path, na...
# -*- coding: utf-8 -* __author__ = 'shawn' d = {'Michael': 95, 'Bob': 75, 'Tracy': 85} print d['Michael'] d['Michael'] = 100 print d['Michael'] if 'Michael' in d: print d['Michael'] print d.pop('Tracy') print d
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import modelcluster.fields import wagtail.wagtailcore.fields import django.db.models.deletion import wagtail.wagtailimages.blocks import wagtail.wagtailcore.blocks class Migration(migrations.Migration): depe...
#!/usr/bin/env python # coding=utf-8 __version__ = "2.1.4"
import dis code = """ my_dict = {'name': 'Alex'} """ print('Disassembly:\n') dis.dis(code) print('\nCode Details:\n') dis.show_code(code)
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
from pyopenproject.api_connection.exceptions.request_exception import RequestError from pyopenproject.api_connection.requests.get_request import GetRequest from pyopenproject.business.exception.business_error import BusinessError from pyopenproject.business.services.command.relation.relation_command import RelationComm...
# -*- coding: utf-8 -*- from __future__ import division """ .. module :: scheme .. moduleauthor :: Olivier Verdier <olivier.verdier@gmail.com> The :class:`~odelab.scheme.Scheme` class contains methods on how to perform one iteration step. It is its responsibility to take care of the time step. Collection of schemes....
# Generated by Django 3.1.4 on 2021-01-10 11:41 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('app', '0011_eventcomment'), ] operations = [ migrations.RenameField( ...
from cProfile import label from dataclasses import field from django import forms from apps.business.models import business class BusinessForm(forms.ModelForm): """Form definition for MODELNAME.""" class Meta: """Meta definition for MODELNAMEform.""" model = business fields = [ ...
#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # 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...
from aiohttp import web import os import sys import time import asyncio import logging from app.handler import handle_healthcheck async def log_startup(app): """ Log when server starts """ logging.info("Server started at {}".format(time.time()) ) def main(): logging.basicConfig( format=...
from typing import Optional, List from github import ( Github, Repository, Label, Issue, GithubException, UnknownObjectException, ) from results import ScanResultStatus, ScanResult, ScanResults class GitIssueCreator(): def __init__(self, github: Github, verbose: bool = False, create_issue:...
""" byceps.blueprints.admin.authentication.login.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2014-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from flask import abort, g, redirect, request from flask_babel import gettext from .....services.authenticati...
# -*- coding: utf-8 -*- import pytest from box import Box from mock import Mock from pymongo.errors import ServerSelectionTimeoutError import beer_garden.db.mongo.api class TestCheckConnection(object): @pytest.fixture def db_config(self): return Box( { "name": "db_name", ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import random import time import os CODE_DIR = os.path.dirname(os.path.abspath(__file__)) spec_rand = random.Random(time.time()) # For 'truly' random hyperparameter selection. spec = None ''' Runspecs in wmg_agent: Designed to minimize the pa...
# -*- coding: utf-8 -*- db.define_table('fichas', Field('id_paciente', 'reference pacientes', readable=False, writable=False), Field('id_consulta', 'reference consultas', readable=False, writable=False), Field('tipo_consulta'), ...
#!/usr/bin/env python3 from argparse import ArgumentParser from enum import Enum from dnslib import * import logging import threading from random import seed, getrandbits import socketserver import socket import string import sys import os import cmd import datetime from ipaddress import IPv4Address, IPv6Address, IPv...
import numpy as np import pandas as pd gallery = np.load('./gallery_features.npy', allow_pickle=True) probe = np.load('./probe_features.npy', allow_pickle=True) print(gallery.shape, probe.shape)
from argparse import ArgumentParser from cbm3_aws import log_helper from cbm3_aws.instance import instance_task def main(): log_helper.start_logging("instance_process", level="INFO") logger = log_helper.get_logger("instance_process") logger.info("instance_process start up") parser = ArgumentParser( ...
# MIT licensed # Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al. import json import re from nvchecker.api import session NPM_URL = 'https://registry.npmjs.org/%s' def configure(config): global NPM_URL url = config.get('registry') if url: NPM_URL = f'{url.rstrip("/")}/%s' async def get_first_...
from django.urls import path, include from rest_framework.routers import DefaultRouter from stores import views router = DefaultRouter() router.register('stores', views.StoresViewSet) router.register('productContainer', views.ProductContainerViewSet) router.register('products', views.ProductsViewSet) app_name = 'sto...
# Copyright 2019 Open End AB # # 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, s...
### CRUD operations for posts, except probably not the U part from flask import Blueprint, current_app, jsonify, make_response, request from flask_jwt_extended import get_jwt_identity, jwt_required from webargs import fields, validate from webargs.flaskparser import use_args from datetime import datetime from flask_up...
import pandas as pd import mySSA def ssa_decompose(df): p_inds = [i for i in range(3)] df_clean = pd.DataFrame(columns=df.columns) df_residual = pd.DataFrame(columns=df.columns) for c in df.columns: dfc = df[c] cl = [] rs = [] for date in df.index.to_period('M').unique(...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
import cv2 import numpy as np import torch from .video_utils import create_GIF def visualize_three_views(tensor_list, save_name="view_test"): """Visualizes a list of tensors or numpy arrays after the ThreeViews transform Arguments: tensor_list (list): A len 3 list of numpy or tensors of shape...
import struct def list_2d(width, length, default=None): """ Create a 2-dimensional list of width x length """ return [[default] * width for i in range(length)] class BoundingBox: def __init__(self): self.min = Vector3() self.max = Vector3() class Color4: def __init__(self): ...
import h5py import pypet import pathlib import logging import copy from .collections import dotdict def getTrajectorynamesInFile(filename): """ Return a list of all pypet trajectory names in a a given hdf5 file. :param filename: Name of the hdf file :type filename: str :return: List of strings...
import os import emoji nome = "teste2.txt" caminho = "C:/Users/renata/Documents/GitHub/MeuDados/Python_Software/programas em python/" if os.path.exists(caminho+nome): print("O ARQUIVO EXISTE :)") print("Mas eu irei deletar kkkkk >:)") os.remove(caminho+nome) else: print("O arquivo não existe ;-;") ...
from django import forms from pages.models import Page from . import actions def get_live_pages(): return Page.objects.live().filter(depth=4).order_by('title').values_list('id', 'title') class ExportForm(forms.Form): pages = forms.MultipleChoiceField( choices=get_live_pages, required=False, ...
from django.urls import reverse_lazy from django.views import generic from bootstrap_modal_forms.generic import (BSModalCreateView, BSModalUpdateView, BSModalReadView, BSModalDeleteView) fr...
""" Unit test the Go forms. References: - http://stackoverflow.com/a/7304658 """ # Python stdlib Imports from datetime import datetime, timedelta # Django Imports from django.contrib.auth.models import User from django.test import TestCase # App Imports from .forms import URLForm, EditForm from .models import U...
"""Unit tests for crc16_8005. Copyright (c) Jazzy Services Limited 2017 License: ../LICENSE """ import unittest import context import crc16_8005 class Test_CRC(unittest.TestCase): def test_check(I): 'Test that the CRC check value is correct.' message = bytearray(b'123456789') sut = crc...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os import traceback from os import path as opath import json import logging import time import datetime import csv import codecs from threathunter_common.util import json_dumps import settings from nebula.dao.user_dao import authenticated from nebula.dao import cac...
#!/usr/bin/env python3 import os import re import pathlib import requests as reqs from os.path import join, dirname from dotenv import load_dotenv import json import string dotenv_path = join(dirname(__file__), 'variables.env') load_dotenv(dotenv_path) access_token = os.environ.get('ACCESS_TOKEN') headers = {'Author...
import json import uuid from os import environ from flask import Flask, redirect, render_template, request, session, url_for from xrplpers.xumm.transactions import get_xumm_transaction, xumm_login from utils import check_login def create_app(): app = Flask(__name__) app.config.from_object(__name__) app....
import math # day3_input = 23 day3_input = 347991 """ Each new 'square' is an odd number squared. So the first is 1^2, the next is 3^2, then 5^2, etc. In these scenarios, the max distance is at the diagonals. The diagonals are a distance of 1 less than the number squared for that particular square. The min distance ...
# -*- coding: utf-8 -*- """ Created on Sun Apr 11 08:55:25 2021 @author: BKG """ from pathlib import Path import os import sys import sqlite3 from sqlite3 import Error import pandas as pd import uuid import PySimpleGUI as sg def main(): os.chdir(os.path.dirname(sys.argv[0])) layout = [[sg.Text("Please ...
# Phono3pyPowerTools/Phono3pyIO.py # ---------------- # Module Docstring # ---------------- """ Routines for working with Phono3py files. """ # ------- # Imports # ------- import math import h5py import numpy as np import warnings # --------- # Constants # --------- ZeroTolerance = 1.0e-5 # --------------...
def case_two_positive_ints(): """ Inputs are two positive integers """ return 1, 2 def case_two_negative_ints(): """ Inputs are two negative integers """ return -1, -2
# Copyright 2016 Hewlett Packard Enterprise Development Company LP # # 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 # # Unles...
import torch from torch import nn from torch import distributions as dists from torch.nn import Module, Parameter, ModuleList from torch.nn.functional import softplus import numpy as np import math from .distribution import Distribution from .normal import Normal from functools import partial # For ELBO! # AKA Conditi...
# -*- coding: utf-8 -*- import random import numpy as np import re from collections import deque from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam from keras import backend as K import random import numpy as np import pandas as pd import pickle as pkl ...
from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Activation, Flatten, Merge, Lambda from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D, ZeroPadding1D from keras.layers import merge, Convolution2D, MaxPooling2D, Input from keras.engine.topology import Lay...
import os, sys def convert(resolution, input_file_name, output_file_name): command = "HandBrakeCLI -i \""+input_file_name+"\" -o \""+output_file_name+"\" -Z \"Very Fast 720p30\"" #command = "ffmpeg.exe -y -i \""+input_file_name+"\" -vf scale="+resolution+":-2,setsar=1:1 -c:v libx264 -c:a copy \""+output_file_n...
""" Test get_version launcher. """ import os.path from test_common.fs.temp import temp_dir import test_common.fs.ops as fs_ops import test_common.system.output as system_output import rust_app_version.get_version as get_version CARGO_TOML_PATH = "rust_app_version/tests/resources/Cargo.toml" APP_VERSION = "0.9.2+post7...
link = 'https://download.openmmlab.com/mmdetection/v2.0/detr/detr_r50_8x2_150e_coco/detr_r50_8x2_150e_coco_20201130_194835-2c4b8974.pth' model = dict( detector=dict( init_cfg=dict(type='Pretrained', checkpoint=link), type='DETR', backbone=dict( type='ResNet', depth=50, num_stage...
# Generated by Django 3.1.7 on 2021-04-01 21:37 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('events', '0003_auto_20210331_0349'), ] operations = [ migrations.CreateModel( name='Requests', f...