text
stringlengths
2
999k
""" scoping_high_pass =============== Autogenerated DPF operator classes. """ from warnings import warn from ansys.dpf.core.dpf_operator import Operator from ansys.dpf.core.inputs import Input, _Inputs from ansys.dpf.core.outputs import Output, _Outputs from ansys.dpf.core.operators.specification import PinSpecificatio...
from abc import abstractmethod import requests import jsonpickle import json HTTP_OK = 200 class CommandBase(object): def __init__(self): self._url = "" @property def _method(self): return "PUT" @property def url(self): return self._url @url.setter def url(s...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
import os from flask import Flask from pygments.lexers import * import config __author__ = 'ohaz' app = Flask(__name__) lexers = {'python': Python3Lexer, 'nasm': NasmLexer, 'autoit': AutoItLexer, 'blitzbasic': BlitzBasicLexer, 'blitzmax': BlitzMaxLexer, 'monkey': MonkeyLexer, 'cpp': CppLexer, 'c...
DESCRIPTION = """ Aleph is a powerful tool for people who follow the money. It helps investigators to securely access and search large amounts of data - no matter whether they are a government database or a leaked email archive. # General Overview The Aleph web interface is powered by a Flask HTTP API. Aleph supports...
from enum import Enum from typing import Generic, List, TypeVar from . import fields from .utils import get_bit, set_bit class RegisterAddress: """AddressType of a register.""" def __eq__(self, other: 'RegisterAddress') -> bool: """ Check if this address points to the same memory as other. ...
# -*- coding: utf-8 -*- # Copyright (c) 2019, VMRaid Technologies and Contributors # See license.txt from __future__ import unicode_literals import unittest import vmraid from vmraid.core.doctype.data_import.importer import Importer from vmraid.utils import getdate, format_duration doctype_name = 'DocType for Import'...
# Generated by Django 2.0 on 2021-04-10 05:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0005_auto_20210410_1140'), ] operations = [ migrations.AlterModelOptions( name='product', options={'verbose_name': 'Pr...
import torch from torch import nn as nn from torch.nn import functional as F from basicsr.utils.registry import ARCH_REGISTRY from .spynet_arch import SpyNet from .basicvsr_arch import ConvResBlock, PSUpsample from .edvr_arch import PredeblurModule, PCDAlignment, TSAFusion from .arch_util import ResidualBlockNoBN, flo...
# Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only import os from lxml import etree from pyvcloud.vcd.client import Client from pyvcloud.vcd.client import TaskStatus from ansible.module_utils.basic import AnsibleModule, env_fallback from pyvcloud.vcd.client imp...
""" View logic for calendar event management """ # stdlib from datetime import date # django from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render from django.views.gen...
# Copyright 2018/2019 The RLgraph authors. 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 appli...
# -*- coding: utf-8 -*- I, J = 1, 60 while (J >= 0): print("I=%d J=%d" % (I, J)) I += 3 J -= 5
from datetime import datetime import time import requests import discord from discord.ext import commands from discord.ext.commands import Bot from discord_slash import SlashContext, cog_ext from discord_slash.utils.manage_commands import create_option # MongoDB handle from lib.util import command_decorator, subcomm...
from django.shortcuts import render,redirect from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from partenaires.models import Partenaire # Create your views here. def partenaires_view(request): """ docstring """ partenaire = Partenaire.objects.all().order_by('-created') pagin...
import torch from torch import nn, Tensor import math class LearnedPositionEncoder(nn.Module): """ Learned Position Encoder. Takes tensor of positional indicies and converts to learned embeddings """ def __init__(self, n_timesteps, d_model): super().__init__() self.embeddor = nn.E...
# built-in from collections import Counter from contextlib import suppress # app from ..libraries import prototype from ..utils import find_ngrams libraries = prototype.clone() libraries.optimize() class Base: def __init__(self, qval=1, external=True): self.qval = qval self.external = external ...
import numpy as np import scipy.spatial as ss import torch import atom3d.util.formats as fo # PDB atom names -- these include co-crystallized metals prot_atoms = ['C', 'H', 'O', 'N', 'S', 'P', 'ZN', 'NA', 'FE', 'CA', 'MN', 'NI', 'CO', 'MG', 'CU', 'CL', 'SE', 'F'] # RDKit molecule atom names mol_atoms = ['C', 'N', 'O'...
#! /usr/bin/env python # Bruce Schneier algorithm def mpow(a, b, m): if a < 0: a += m c = 1 while b >= 1: if b % 2 == 1: c = (a * c) % m a = pow(a, 2) % m b = b // 2 return c # extended Euclidean algorithm def minv(a, m): b = m u = 1 v = 0 ...
import json import os import re from typing import Any from ikea_api.endpoints import Cart, OrderCapture token = os.environ["TOKEN"] payloads = { "add_items": {"90428328": 1}, "update_items": {"90428328": 5}, "remove_items": ["90428328"], } class_args = {"OrderCapture": ("101000")} functions_to_skip = ...
# Our program hello world in python3 hello = 'Hello World' print(hello)
import numpy as np import pandas as pd import pytest from rs_metrics.metrics import _ndcg_score from rs_metrics import * from rs_metrics.statistics import item_pop def test_dcg_score_1(): assert _ndcg_score([1], [1], 1) == 1 def test_dcg_score_0(): assert _ndcg_score([1], [0], 1) == 0 def test_dcg_score_...
import configparser import os from cleos import Cleos import subprocess config = configparser.ConfigParser() dirname = os.path.dirname(__file__) configfile = os.path.join(dirname, './config.ini') config.read(configfile) eos0 = "103.235.232.27" eos1 = "103.235.232.21" eos2 = "103.235.232.43" biosnodeaddress="%s:%s" % (...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
from setuptools import setup, find_packages VERSION = 0.2 setup( name='inner_service_api', version=VERSION, url='https://github.com/im-so-sorry/inner-service-module', author="Aidar Rakhimov", author_email="a.v.rakhimov@gmail.com", description="Common services for eos system", long_descript...
from typing import Optional import click from click.exceptions import Exit from urllib.parse import urlparse from valohai_cli import __version__ from valohai_cli.api import APISession from valohai_cli.consts import default_app_host, yes_option from valohai_cli.exceptions import APIError from valohai_cli.messages impo...
import os from natsort import natsorted import pytest import logging logger = logging.getLogger(__name__) ROOT_DIR = "/root" OPT_DIR = "/opt" SCRIPTS_SRC_DIR = "scripts/" ACS_TESTS = "acstests" PTF_TESTS = "ptftests" SAI_TESTS = "saitests" ARP_RESPONDER_PY = "arp_responder.py" CHANGE_MAC_ADDRESS_SCRIPT = "scripts/cha...
# Tai Sakuma <tai.sakuma@gmail.com> import sys import pytest try: import unittest.mock as mock except ImportError: import mock has_no_ROOT = False try: import ROOT except ImportError: has_no_ROOT = True from alphatwirl.heppyresult import EventBuilderConfig if not has_no_ROOT: from alphatwirl.hep...
# Copyright (C) 2020 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Creator reads Program Proposals Create Date: 2019-07-25 11:55:57.361793 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name from ggrc.migr...
"""An implementation of tabbed pages using only standard Tkinter. Originally developed for use in IDLE. Based on tabpage.py. Classes exported: TabbedPageSet -- A Tkinter implementation of a tabbed-page widget. TabSet -- A widget containing tabs (buttons) in one or more rows. """ from tkinter import * class InvalidN...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # GUI module generated by PAGE version 6.2 # in conjunction with Tcl version 8.6 # Sep 14, 2021 08:21:11 PM IST platform: Windows NT import sys try: import Tkinter as tk except ImportError: import tkinter as tk try: import ttk py3...
from __future__ import print_function from __future__ import division import os import sys import time import datetime import os.path as osp import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.nn import functional as F from torch.optim import lr_scheduler from tensor...
get_version = '0.4.2'
# 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,...
from purplex.grammar import Grammar, Production, END_OF_INPUT def test_grammar_mostly(): noop = lambda args: args grammar = Grammar(['+', '*', '(', ')', 'id'], [ Production("E : T E'", noop), Production("E' : + T E'", noop), Production("E' : <empty>", noop), Production("T : F T...
print("Enter the number: ") num = int(input()) if num > 1: for i in range(2,num): if (num % i) == 0: print(num,"is not a prime number") break else: print(num,"is a prime number") else: print(num,"is not a prime number")
from datetime import datetime from pathlib import Path from sepal_ui import sepalwidgets as sw from sepal_ui.scripts import utils as su import ipyvuetify as v from component import scripts as cs from component.message import cm from component import widget as cw from component import parameter as cp class Validation...
""" Django settings for peak_30 project. Generated by 'django-admin startproject' using Django 1.11.5. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" from base64 import b64encode from binascii import hexlify,...
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
import copy import warnings from collections.abc import Iterable, Iterator import numpy as np import scipy import scipy.optimize import scipy.stats from stingray.exceptions import StingrayError from stingray.gti import bin_intervals_from_gtis, check_gtis, cross_two_gtis from stingray.largememory import createChunkedS...
print("test2")
def pow(n,r): if r == 1: return n elif r == 0: return 1 elif r < 0: res = 0 n1 = n i = -1 while i > r: res = n*n1 n1 = res i -= 1 return (1/res) else: res = 0 n1 = n for i in range(r): res = n*n1 n1 = res return res def sigmoid(w_sum): e = 2.71828183 output = 1/(1+(pow(e,-...
""" Miscellaneous Functions """ import sys import copy import warnings import traceback from typing import Any, Callable, Dict from inspect import signature def warn_ignore(*args, **kwargs): # pylint: disable=unused-argument """Function used to ignore all warnings""" pass def warn_with_traceback(message, ...
import random from django.db import models from user.models import User TEAM_ID_LENGTH = 13 def generate_team_id(): s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" pass_len = TEAM_ID_LENGTH return "".join(random.sample(s, pass_len)) class Team(models.Model): team_code = mode...
# Copyright 2020 Google LLC # # 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...
import insightconnect_plugin_runtime from .schema import GetDeviceSoftwareInput, GetDeviceSoftwareOutput, Input, Output, Component # Custom imports below class GetDeviceSoftware(insightconnect_plugin_runtime.Action): def __init__(self): super(self.__class__, self).__init__( name="get_device_s...
from typing import Optional from pincer import Client, command from pincer.objects import InteractionFlags, TextChannel from app.bot import Bot from app.classes.pot import Pot CHANNEL_ID: int = 889523568298307594 MESSAGE_ID: int = 890313495030157313 class TicketCog: """A simple commands cog template.""" d...
import datetime import re import threading import time import tkinter as tk from collections import deque from queue import Queue from time import monotonic import pandas as pd import rasterio import serial from geographiclib.geodesic import Geodesic from matplotlib import pyplot as plt, animation from matplotlib.back...
""" This file offers the methods to automatically retrieve the graph Prauserella rugosa. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protein ass...
# Generated by Django 3.0.5 on 2020-04-16 09:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('publications', '0006_type_zotero_types'), ] operations = [ migrations.AddField( model_name='publication', name='zote...
import json import requests import datetime from pkg_resources import get_distribution from .exceptions import DaqssException, DaqssRequestError __all__ = ['Daqss'] __version__ = get_distribution('daqss').version class Daqss(object): def __init__(self, apikey = None, apipswd = None, version = 'v1.0'): sel...
from unittest import TestCase from office365.runtime.client_value_collection import ClientValueCollection from office365.sharepoint.tenant.administration.secondary_administrators_fields_data import \ SecondaryAdministratorsFieldsData from settings import settings from tests import random_seed from office365.runti...
#const mask = 0xffffffff #bitwise operations have the least priority #Note 1: all variables are unsigned 32-bit quantities and wrap modulo 2**32 when calculating, except for #ml, message length: 64-bit quantity, and #hh, message digest: hex string in little-endian #little-endian for bytes ordering a...
print("""primelist2=[] lower=int(input("please enter the 'lower' or first value: " )) upper=int(input("please enter the 'upper' or last value: " )) for num in range (lower, upper+1): if num>1: for i in range (2,num): if num%i==0: break else: primelist.append(n...
"""Azure Storage Queues transport. The transport can be enabled by setting the CELERY_BROKER_URL to: ``` azurestoragequeues://:{Storage Account Access Key}@{Storage Account Name} ``` Note that if the access key for the storage account contains a slash, it will have to be regenerated before it can be used in the conn...
# reset datetime stamps to make them aware and not naive from django.core.management.base import BaseCommand import datetime import pytz from op_tasks.models import Dataset, Product, OpTask, UserProfile, TaskListItem class Command(BaseCommand): def update_time(self): saved_task_items = TaskListItem.objects.all() ...
from test.test_support import verbose, have_unicode, TestFailed import sys # test string formatting operator (I am not sure if this is being tested # elsewhere but, surely, some of the given cases are *not* tested because # they crash python) # test on unicode strings as well overflowok = 1 def testformat(formatstr,...
#!/usr/bin/python #coding=utf-8 '''This is test module @author: sheng @contact: sinotradition@gmail.com @copyright: License according to the project license. ''' import unittest from sinoera.ganzhi import jiaxu31 TestJiaxu31Functions(unittest.TestCase): def setUp(self): pass def test_XXX(self): ...
# Copyright: see copyright.txt import utils import inspect import functools # the ABSTRACT base class for representing any expression that depends on a symbolic input # it also tracks the corresponding concrete value for the expression (aka concolic execution) class SymbolicType(object): def __init__(self, name, ex...
""" Reporter classes. """ from datadog import api class Reporter(object): def flush(self, metrics): raise NotImplementedError() class HttpReporter(Reporter): def flush_metrics(self, metrics): api.Metric.send(metrics) def flush_events(self, events): for event in events: ...
""" Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ import torch.nn as nn from torch.nn import init class BaseNetwork(nn.Module): def __init__(self): super(BaseNetwork, self).__init_...
# ---------------Constants are here---------- # turn on to limit cpu usage SERVER = False # Save print to file SAVE_PRINTS = False # use coins COINS = False # If not doing training, be sure to set DEFAULT_CLASSIFY_PATH below DO_TRAIN = True DO_CLASSIFY = True # Constants for the algorithm, most important are the t...
import dace as dp import numpy as np sdfg = dp.SDFG('sta_test') s0 = sdfg.add_state() s1 = sdfg.add_state() s2 = sdfg.add_state() # Arrays inp = s0.add_array('inp', [1], dp.float32) A = s0.add_array('A', [1], dp.float32) t = s0.add_tasklet('seta', {'a'}, {'b'}, 'b = a') s0.add_edge(inp, None, t, 'a', dp.Memlet.from_a...
# Xiaokai Wang # xiw69@pitt.edu # CS 0008 # assignmnet #1 # ask the user to input preferred unit system/ distance driven/ gas usage choice = input("Please enter your preferred unit system (USC/Metric): ") dist = float(input("Please input your distance driven: ")) gas = float(input("Please input your gas usage during...
import torch from torch.autograd import Variable from scatwave import Scattering1D from scatwave import fetch_fsdd import matplotlib.pyplot as plt from scipy.io import wavfile import numpy as np import os def loadfile(path_file): sr, x = wavfile.read(path_file) x = np.asarray(x, dtype='float') # make it m...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot module for getting information about the server. """ from asyncio import create_subprocess_shell as asyncr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Feb 29 15:19:36 2020 @author: Francesco Di Lauro @mail: F.Di-Lauro@sussex.ac.uk Copyright 2020 Francesco Di Lauro. All Rights Reserved. See LICENSE file for details """ from Eulerclasssir import SIR_model import numpy as np import matplotlib.pyplot as pl...
''' ELMo usage example with pre-computed and cached context independent token representations Below, we show usage for SQuAD where each input example consists of both a question and a paragraph of context. ''' import tensorflow as tf import os from bilm_model import TokenBatcher, BidirectionalLanguageModel, weight_la...
from itertools import product from numpy.testing import (assert_, assert_allclose, assert_equal, assert_no_warnings, suppress_warnings) import pytest from pytest import raises as assert_raises import numpy as np from scipy.optimize._numdiff import group_columns from scipy.integrate import sol...
# # PySNMP MIB module XEDIA-DIALBACKUP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XEDIA-DIALBACKUP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:36:10 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
import numpy as np import mxnet as mx from autogluon.core.searcher import OneDimensionalWarping, \ Warping, WarpedKernel from autogluon.core.searcher.bayesopt.gpmxnet.constants import DATA_TYPE, \ NUMERICAL_JITTER from autogluon.core.searcher import Matern52 from autogluon.core.searcher import \ GaussianPr...
import math from ga import GA, Individual, IndividualMeta, Selector from ga_codec import CodecPlugin from ga_cm import CmPlugin from ga_iter import StopIterPlugin from ga_generate import GeneratePlugin from ga_selector import Selector def get_fitness(individual: Individual): val = individual.phenotype.phenotype ...
# Generated by Django 2.2 on 2021-09-30 16:00 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('profiles_api', '0002_profilefeeditem'), ] operations = [ migrations.RenameFi...
# vim: expandtab:tabstop=4:shiftwidth=4 """This module comprises Aws specific utility functions.""" import os import re import subprocess from distutils.version import LooseVersion import ruamel.yaml as yaml # Buildbot does not have multi_inventory installed #pylint: disable=no-name-in-module from openshift_tools.in...
""" _WMConfigCache_t_ Test class for the WMConfigCache """ from __future__ import print_function, division import unittest import time from WMCore.Cache.GenericDataCache import GenericDataCache, CacheExistException, \ CacheWithWrongStructException, MemoryCacheStruct class Foo(object): ...
# Generated by Django 2.2.11 on 2021-05-14 15:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('media', '0012_auto_20210418_2350'), ] operations = [ migrations.AddField( model_name='video', name='duration', ...
"""Admin classes for the newsletter_signup app.""" from django.contrib import admin from . import models class NewsletterSignupAdmin(admin.ModelAdmin): """Custom admin for the ``NewsletterSignup`` model.""" list_display = [ 'email', 'first_name', 'last_name', 'source', 'referer', 'current_ref...
__author__ = 'Viktor Winkelmann' __all__ = ['FileManager', 'FileObject']
""" Exporter that exports Basic HTML. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #---...
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import copy import mock import pytest from datadog_checks.aerospike import AerospikeCheck from . import common pytestmark = pytest.mark.unit def test_datacenter_metrics(aggregator): check = Aeros...
from flask import g from flask_httpauth import HTTPBasicAuth, HTTPTokenAuth from app.models import User from app.api.v1.errors import error_response basic_auth = HTTPBasicAuth() token_auth = HTTPTokenAuth() @basic_auth.verify_password def verify_passowrd(username, password): """Receives username and password fr...
##################################################################### # # # /main.pyw # # # # Copyright 2014, Monash University ...
# -*- coding: utf-8 -*- import sys from random import uniform from PySide2 import QtWidgets from PySide2.QtTest import QTest from pyleecan.Classes.CondType21 import CondType21 from pyleecan.Classes.CondType22 import CondType22 from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage from pyleecan.Classes.Machine...
#------------------------------------------------------------------------------- # elftools: dwarf/dwarf_expr.py # # Decoding DWARF expressions # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- from collections impor...
# QUADRATIC EQUATION # ax**2+bx+c=0 a!=0 import math a = int(input("Enter a: ")) b = int(input("Enter b: ")) c = int(input("Enter c: ")) d = b*b-4*a*c if a == 0: print("The value of 'a' should not be zero.") else: if d > 0: r1 = (-b + math.sqrt(b*b-4*a*c))/(2*a) r2 = (-b - math.sqrt(b*b-4*a*...
# Copyright 2017 Battelle Energy Alliance, LLC # # 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 t...
import tldextract as tld import string import random import starlette.status as status import os import os.path as path from pathlib import Path from fastapi import FastAPI, Request, UploadFile from fastapi.responses import HTMLResponse, RedirectResponse from fastapi.templating import Jinja2Templates from fastapi.stat...
import warnings import numpy as np from pygrank.measures.utils import Measure from pygrank.core.signals import to_signal from pygrank.core import backend, GraphSignalGraph, GraphSignalData, BackendPrimitive class Unsupervised(Measure): pass class Conductance(Unsupervised): """ Graph conductance (information...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: import StringIO except ImportError: from io import StringIO import os import yaml from flask import Flask, render_template, request from PIL import Image, ImageFont, ImageDraw class ZeApp(Flask): def __init__(self, *args, **kwargs): super(ZeAp...
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ar' import skimage.io as skio import numpy as np import h5py import time from run00_common import ImageDirParser ############################ def buidImageDataset(imageDirParser=None, datasetName='test-dataset.h5', numberOfSamples=1000, isRawBlob = False): ...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import matplotlib.pyplot as plt import numpy as np n_angles = 36 n_radii = 8 # An array of radii # Does not include radius r=0, this is to eliminate duplicate points radii = np.linspace(0.125, 1.0, n_radii) # An array of angles angles = np.linspace(0,...
from keras.models import Sequential from keras.layers import Dense, Activation, Dropout from keras.layers.pooling import MaxPooling2D from keras.optimizers import Adam from keras.models import load_model class Model(object): def __init__(self, size, learning_rate=0.001): self.model = Sequential() s...
import torch import torch.nn as nn from torch.nn import functional as F import math from torch.utils.data import Dataset import os import pandas as pd import pdb import numpy as np import math import pickle import random from sklearn.utils import shuffle class TCGAPCAWG_Dataloader(Dataset): def ...
# 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...
""" Defines the different exceptions that may arise in the director TODO: Exceptions should provide all info to create Error instances of the API model For instance, assume there is a ficticious exception class FieldValidationError, then it would translate into something like // response - 422 { "error": { "st...
class Robaczek: def __init__(self, x, y, krok): self.x=x self.y=y self.krok=krok def zmien_robaczka(self, x1, y1, krok1): self.x=x1 self.y=y1 self.krok=krok1 def gora(self, ile): self.y += ile*self.krok def dol(self, ile): ...
import tqdm # noinspection PyBroadException def is_notebook(): try: try: from ipywidgets import FloatProgress except ImportError: from IPython.html.widgets.widget_float import FloatProgress from IPython import get_ipython ipython = get_ipython() if ...
from enum import Enum from common import mace_check, ModuleName class SkelMode(Enum): NON_DOMAINS = 0 DOMAINS = 1 class Skel(Enum): V60 = 'V60' V65 = 'V65' V66 = 'V66' class DspType(Enum): ADSP = 'ADSP' CDSP = 'CDSP' class SocSkelTable: def __init__(self, soc_id, mode, skel, d...