content
stringlengths
5
1.05M
""" Messages for the :mod:`~django_dicom.models.managers` module. """ DATA_ELEMENT_CREATION_FAILURE = ( "Failed to create DataElement instance for:\n{data_element}\n{exception}" ) HEADER_CREATION_FAILURE = "Failed to read header information!\n{exception}" IMPORT_ERROR = ( "Failed to import {path}\nThe following...
{ "targets": [{ "target_name": "binding", "sources": [ "src/main.cc" ], "conditions": [ ['OS=="mac"', { "sources":[ "src/clip_osx.h", "src/clip_osx.mm" ], 'defines': [ '__MACOSX_CORE__', '__MAC__' ], 'link_settings': { ...
from __future__ import absolute_import from lxml.builder import ElementMaker from sciencebeam_gym.utils.bounding_box import ( BoundingBox ) from sciencebeam_gym.structured_document.svg import ( SvgStructuredDocument, SvgStyleClasses, SVG_NS, SVG_VIEWBOX_ATTRIB, SVGE_BOUNDING_BOX, format_b...
import logging from PyQt4.QtCore import SIGNAL,Qt,QCoreApplication from PyQt4.QtGui import QWidget from Vispa.Views.AbstractView import AbstractView from Vispa.Main.Exceptions import exception_traceback from Vispa.Share.BasicDataAccessor import BasicDataAccessor try: import ROOT import pxl.core,pxl.astro,pxl...
# BEGIN_COPYRIGHT # # Copyright (C) 2016-2017 Open Microscopy Environment: # - University of Dundee # - CRS4 # # 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/lice...
#!/usr/bin/env python ## # omnibus - deadbits # module execution for CLI application ## import importlib from common import info from common import error from common import success from common import warning from common import lookup_key from common import detect_type from models import create_artifact class Dispa...
class LatticeType: Honeycomb = 0 Square = 1 class EndType: FivePrime = 0 ThreePrime = 1 class StrandType: Scaffold = 0 Staple = 1 class Parity: Even = 0 Odd = 1 class BreakType: Left5Prime = 0 Left3Prime = 1 Right5Prime = 2 Right3Prime = 3 class Crossovers: ...
#!/usr/bin/env python # Imports import time import appdash # Appdash: Socket Collector from appdash.sockcollector import RemoteCollector # Create a remote appdash collector. collector = RemoteCollector(debug=True) collector.connect(host="localhost", port=7701) # Create a tracer tracer = appdash.create_new_tracer(co...
""" Provides a simple and mostly transparent way of defining orm-cached properties on the application class. For example:: from onegov.core import Framework from onegov.core.orm import orm_cached class App(Framework): @orm_cached(policy='on-table-change:users') def users(self): ...
from django.contrib.auth.models import AbstractUser from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from rest_framework.authtoken.admin import User from django.utils import timezone from django.db.models import Q from django.db import models from datetime import timede...
import socket from com.xhaus.jyson import JysonCodec as json from Forest import Forest import BatchObjects class BatchRemote(object) : def __init__(self) : self.HOST = 'smarmy-pirate.cs.utexas.edu' self.PORT = 9825 self.ops = {'ADD':'+', 'SUB':'-', 'MUL':'*', 'DIV':'/', 'EQ':'==', 'NOTE...
from setuptools import setup setup( name='foobar', description='A test package', author='John T. Wodder II', author_email='git@varonathe.org', py_modules=['foobar'], )
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import random import mxnet as mx import numpy as np def set_random_seed(value): wrapped_value = value % (2**32 - 1) random.seed(wrapped_value) np.random.seed(wrapped_value) mx.random.seed(wrapp...
from .mapper import RevisionMapper from cron_migration.revisions.manager import TaskManager from cron_migration.app.models.environment import Environment import json class RevisionApply: def __init__(self, mapper: RevisionMapper, environment: Environment): self._mapper = mapper self._environment =...
from nmrpystar.unparse.maybeerror import MaybeError from nmrpystar.unparse.combinators import * __version__ = '0.0.6'
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools import ormcache TYPE2FIELD = { 'char': 'value_text', 'float': 'value_float', 'boolean': 'value_integer', 'int...
from pyramid.i18n import TranslationStringFactory MessageFactory = TranslationStringFactory("Apex")
from relaxrender.beerlaw.Point2D import Point2D from relaxrender.beerlaw.Ray import Ray from relaxrender.beerlaw.Object import Object from relaxrender.beerlaw.Opengl import opengl from OpenGL.GLU import * from OpenGL.GLUT import * if __name__ == '__main__': p1=Point2D(0,0) o=Object(4,2,p1,3,4) p0=Point2D(-1...
from redict.base import BaseRemapper class DictRemapper(BaseRemapper): pass
import importlib.util from utils import run_process, link_files, copy_lads from shutil import unpack_archive, move, rmtree, move from pathlib import Path from settings import ( NISMOD_PATH, NISMOD_DATA_PATH, NISMOD_SCENARIOS_PATH, NISMOD_SOCIO_ECONOMIC_PATH, ) spec = importlib.util.spec_from_file_locat...
import StringIO import binascii import struct import miningpool.lib.logger import util import merkletree import halfnode from coinbasetx import CoinbaseTransaction from Crypto.Hash import SHA256 log = miningpool.lib.logger.get_logger('block_template') # Remove dependency to settings, coinbase extras should be # provi...
from gallery.models import Image, Collection from products.models import Product, Category def navbar_options(request): """ Allows categories/services/collections/images to be accessed across all templates to dynamically populate the navbar dropdown menus """ collections = Collection.objects.a...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import simplejson as json from derrick.core.common import * from derrick.core.exceptions import UnmarshalFailedException from derrick.core.logger import Logger class Recorder(object): def load(self):...
# Digital Light Sensor from logging import getLogger from time import sleep import argparse import smbus ADDRESS = 0x23 COMMAND_POWER_DOWN = 0x00 COMMAND_POWER_ON = 0x01 COMMAND_RESET = 0x07 # Start measurement at 4lx resolution. Time typically 16ms. COMMAND_CONTINUOUS_LOW_RES_MODE = 0x13 # Start measurement at 1lx ...
# This file is automatically generated by QuTiP's setup.py. short_version = '4.7.0.dev0' version = '4.7.0.dev0+acb6cfe' release = False
from django.contrib.sites.models import Site from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.urls import get_script_prefix from django.utils.encoding import iri_to_uri from django.utils.translation import gettext_lazy as _ from oms_gallery.models import Photo, Gal...
#!/usr/bin/env python import unittest from playhouse.test_utils import test_database from peewee import * from parsemypsa.storage import objects # Data for testing test_db = SqliteDatabase(':memory:') model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip] class TripTestCase(unittest.TestCase): ...
import abc import os import signal from . import menu from . import params class ExperimentBase(abc.ABC): """ Base class for experiments that defines the API. """ def __init__(self, save_file="experiment.rhp", hyperparams=None, status=None): """ Args: save_file: Fi...
""" Tuple is a collection which is ordered and UNCHANGEABLE. Allows duplicate members. Tuples are written in round brackets () """ mtup = ("apple","banana","mango","banana","orange") #alter mtup=tuple(("apple","banana",....)) #here the tuple() is a constructor to create tuples print(mtup) print(mtup[1]) ...
import requests from watchmelog.models.players import Player, ApiKey def get_player_from_api_key(api_key: str) -> Player: api_key: ApiKey = ApiKey.objects(key=api_key).first() player = None if api_key: player = api_key.player return player def create_or_update_player(access_token: str, regi...
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import numpy as np from configs._base_.models.faster_rcnn_r50_fpn import * from configs._base_.datasets.dota_detection import * from configs._base_.schedules.schedule_1x import * from alpharotate.utils.pretrain_zoo import Pretrai...
""" Copyright (c) Microsoft Corporation Licensed under the MIT license. """ from deepspeed.runtime.config_utils import get_scalar_param, get_dict_param, DeepSpeedConfigObject from deepspeed.autotuning.constants import * class DeepSpeedAutotuningConfig(DeepSpeedConfigObject): def __init__(self, param_dict): ...
# Generated by Django 3.0.7 on 2020-06-26 11:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('album', '0005_remove_photos_photo_image'), ] operations = [ migrations.AddField( model_name='photos', name='photo_im...
from cosac_groups import CosacParallel from aggregator_groups import StreamGroupCosac import glob from joblib import Parallel, delayed from optparse import OptionParser import time import os def parse_args(): parser = OptionParser() parser.set_defaults(data_path="./", path_to_save="./", global_topics_path="./...
# coding=utf-8 """Bots repository get service testing.""" import behave @behave.when(u'I get a bot by the name of "{bot_name}"') def step_impl(context, bot_name): context.bot_get = context.project.bots.get(bot_name=bot_name) @behave.then(u'Received bot equals created bot') def step_impl(context): assert co...
#!/usr/bin/env python """ PGmigrate - PostgreSQL migrations made easy """ # -*- coding: utf-8 -*- # # Copyright (c) 2016-2019 Yandex LLC <https://github.com/yandex> # Copyright (c) 2016-2019 Other contributors as noted in the AUTHORS file. # # Permission to use, copy, modify, and distribute this software and i...
## MIT License ## ## Copyright (c) 2021 conveen ## ## 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, mer...
#!/usr/bin/env python #-*- coding:utf-8 -*- ''' Pentestdb, a database for penetration test. Copyright (c) 2015 alpha1e0 ''' from pentest.libs.exploit import Exploit from pentest.libs.exploit import Result class DiscuzAB(Exploit): expName = u"DiscuzX 3.2绕过虚拟币支付查看内容" version = "1.0" author = "alpha1e0" ...
from django.urls import path from .views import RecruiterHomeView app_name = 'recruiters' urlpatterns = [ path('home/', RecruiterHomeView.as_view(), name='home'), ]
# # The MIT License (MIT) # # Copyright (c) 2015 Dmitry Sovetov # # https://github.com/dmsovetov # # 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 limit...
import os from asyncaws import SQS from tornado.testing import AsyncTestCase, gen_test from random import randint aws_key_id = os.environ['AWS_ACCESS_KEY_ID'] aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY'] aws_region = os.environ['AWS_REGION'] aws_test_account_id = "637085312181" class TestSQS(AsyncTestCase): ...
from fractions import Fraction print(Fraction(1, 3)) # 1/3 print(Fraction(2, 6)) # 1/3 print(Fraction(3)) # 3 print(Fraction(0.25)) # 1/4 print(Fraction(0.33)) # 5944751508129055/18014398509481984 print(Fraction('2/5')) # 2/5 print(Fraction('16/48')) # 1/3 a = Fraction(1, 3) print(a) # 1/3 print(a.numerator) p...
# coding=utf-8 from __future__ import unicode_literals from apps.auth.models import User from apps.dataset.models import DatasetModel from apps.taskapi.models import MLMethod, MethodKwargs __all__ = [ "User", "DatasetModel", "MLMethod", "MethodKwargs" ]
"prevent #-*- coding:utf-8 -*-" from os import listdir, mkdir, rename, remove, makedirs, walk from os.path import isfile, join, splitext, isdir, getsize from shutil import rmtree,copy#remove not work if filled.rmtree(tempdir) from jar import getJar, imgtower_dir, jar_dir import newdb import userdb from jsonio import ...
# 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, ...
import torch import torch.nn as nn from torchvision import models from torch.autograd import Variable pretrained_model = models.vgg19_bn(pretrained=True) class Vgg19bnFeats(nn.Module): def __init__(self): super(Vgg19bnFeats, self).__init__() self.features_nopool = nn.Sequential(*list(pretrained_model.featur...
from django.conf import settings from django.db import models from blog.models import Article class Comment(models.Model): body = models.TextField('body', max_length=300) created_time = models.DateTimeField('Created Time', auto_now_add=True) last_mod_time = models.DateTimeField('Modified', auto_now=True)...
""" Analytical solution for Gaussian with a boundary at the origin. Produces Fig. 10 from the Feldman Cousins paper. """ from functools import partial import numpy as np from astropy.utils.console import ProgressBar import matplotlib.pyplot as plt from gammapy.stats import fc_find_acceptance_interval_gauss, fc_fix_lim...
from .build_history_table import BuildHistoryTableRenderable from .button import ButtonRenderable from .executor_status_table import ExecutorStatusTableRenderable from .figlet_text import FigletTextRenderable from .help import HelpRenderable from .paginated_table import PaginatedTableRenderable from .text import TextRe...
from .physics import *
from stompclient.simplex import PublishClient from stompclient.duplex import PublishSubscribeClient from stompclient.connection import ConnectionPool, ThreadLocalConnectionPool
# Copyright 2017 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 by applicable law or ag...
""" 深交所网页 上市公司列表 上市公司 暂停上市 终止上市 全称变更 简称变更 上市公司信息 上市公司公告 定期报告 退市整理期公司公告 限售股份解限与减持 """ import random import pandas as pd HOST_URL = 'http://www.szse.cn/api/report/ShowReport' def fetch_companys_info(): """获取当前在市的股票概要信息 Return...
"""autogenerated by genmsg_py from AuctioneerBidServiceRequest.msg. Do not edit.""" import roslib.message import struct import auction_msgs.msg import std_msgs.msg class AuctioneerBidServiceRequest(roslib.message.Message): _md5sum = "cfd8f1da51fcd78c9f2cfa91a1f870ec" _type = "auction_srvs/AuctioneerBidServiceRequ...
import numpy as np import scipy.ndimage import scipy.signal import cv2 X = np.array([1, 2, 3]).reshape(1, 3) # input data H = np.array([4, 5, 6]).reshape(1, 3) # kernel # display scipy.signal.correlate2 results print("scipy.signal.correlate2d results") print("full: {}".format(scipy.signal.correlate2d(X, H, 'full'))...
from service_config.api_config import configure_api, api_db_user from service_config.proxy_config import configure_proxy from service_config.contrib_portal_config import configure_contrib_portal from service_config.static_server_config import configure_static_server from service_config.task_queue_config import configur...
"""CLASSIFICATION SERVICE""" import logging import ee from gfwanalysis.errors import ClassificationError class ClassificationService(object): @staticmethod def classify(img_id): """ For a given area classify the forest amount and return a image with the classified forest and amount. ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2018-06-24 22:26 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('nurture', '0001_initial'), ] ...
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates a file describing the js_library to be used by js_binary action. This script takes in a list of sources and dependencies as described by a js_l...
cont = 0 while True: num = int(input('Quer ver a tabuada de qual valor? ')) if num < 0: break while cont < 10: cont += 1 print(f'{num} x {cont} = {num * cont}') cont = 0 print('-=' * 15) print('Finalizando algoritmo...')
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2017-04-28 09:57 from __future__ import unicode_literals from django.db import migrations, models import kernel.action import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
import numpy as np import luigi from pathlib import Path import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from sklearn.model_selection import train_test_split from src.data.preprocess_dataset import PreprocessData class TrainOneR...
from __future__ import print_function import base64 import io import json import logging import numpy import os import random import socket import struct import time import relaax.algorithm_base.agent_base import relaax.common.metrics class Failure(Exception): def __init__(self, message): self.message =...
import sys, os, json from functools import reduce from os import system, name, sys assert sys.version_info >= (3,7), "This script requires at least Python 3.7" # load the location JSON file game_file = 'locations.json' # fancy function to clear the terminal def clear(): # clear terminal for windows if n...
from __future__ import unicode_literals import datetime from django.utils.timezone import now from common.literals import TIME_DELTA_UNIT_DAYS from documents.tests.test_views import GenericDocumentViewTestCase from sources.links import link_upload_version from user_management.tests import ( TEST_USER_PASSWORD, T...
import os import torch as T import torch.nn.functional as F import torch.nn as nn import torch.optim as optim from torch.distributions.normal import Normal import numpy as np class CriticNetwork(nn.Module): def __init__(self, beta, input_dims, n_actions, name='critic', fc1_dims=256, fc2_dims=256, chkpt_dir='tmp/s...
from plugin.patterns import WIKI_LINK, MD_LINK def fix_page_links_to_zettels(markdown, page, config, files, zettels): def process_match(m): if "url" in m.groupdict().keys(): url = m.groupdict()["url"] if "title" in m.groupdict().keys(): title = m.groupdict()["title"] ...
(ecommerce) PS D:\ProjectsPyCharm\ecommerce\src> python manage.py shell Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from apps.tags.models import Tag >>> Tag.objects.all() <QueryS...
from .base import (share_clim, plot_widths, plot_sem, plot_eb, pcolormesh_45deg, pretty_plot, bar_sem, RdPuBu, nonlinear_cmap, pretty_axes, alpha_cmap) from .circ import (plot_sem_polar, pretty_polar_plot, plot_tuning, circ_fill_between) from .gat_plot import pre...
# # This file is part of AceQL Python Client SDK. # AceQL Python Client SDK: Remote SQL access over HTTP with AceQL HTTP. # Copyright (C) 2021, KawanSoft SAS # (http://www.kawansoft.com). All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
# encoding: utf-8 """082 Create index creator user_id Revision ID: 8ea886d0ede4 Revises: a64cf4a79182 Create Date: 2018-09-04 18:49:17.265729 """ from alembic import op from ckan.migration import skip_based_on_legacy_engine_version # revision identifiers, used by Alembic. revision = '8ea886d0ede4' down_revision = 'a6...
def A_type_annotation(integer: int, boolean: bool, string: str): pass def B_annotation_as_documentation(argument: 'One of the usages in PEP-3107'): pass def C_annotation_and_default(integer: int=42, list_: list=None): pass def D_annotated_kw_only_args(*, kwo: int, with_default: str='value'): pass ...
#!/usr/bin/python import cerastes.protobuf.resourcemanager_administration_protocol_pb2 as rm_protocol import cerastes.protobuf.yarn_server_resourcemanager_service_protos_pb2 as yarn_rm_service_protos import cerastes.protobuf.applicationclient_protocol_pb2 as application_client_protocol import cerastes.protobuf.yarn_se...
from numpy import matmul, eye, transpose, sin, linspace, pi, array, cos, dot, append, multiply, inner import numpy as np from scipy.integrate import solve_ivp, trapz from IVP import IVP from FVP import FVP from Qn_op import Qn_op from RTcost import RTcost from RTgrad import RTgrad from state_op import state_op from sci...
import os basedir = os.path.abspath(os.path.dirname(__file__)) DATABASE = 'flasktaskr.db' USERNAME = 'ivos' PASSWORD = 'cisco123' #WTF_CSRF_ENABLED = True CSRF_ENABLED = True SECRET_KEY = '91b407a4e95ac4c327691b0d489fb3ca7913c36b94fbdb8429bbd65edbfcaf09' # define the full path for the database DATABASE_PATH = os.path....
"""Abstract base class that performs TFIDF on some corpus Author(s): Carl Anderson (carl.anderson@weightwatchers.com) """ from abc import abstractmethod from primrose.base.model import AbstractModel from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity ...
from __future__ import annotations from typing import Literal from prettyqt import statemachine from prettyqt.qt import QtStateMachine from prettyqt.utils import InvalidParamError, bidict CHILD_MODE = bidict( exclusive=QtStateMachine.QState.ChildMode.ExclusiveStates, parallel=QtStateMachine.QState.ChildMode...
import csv class FileCSV: ''' Class responsible for managing the reading and writing of the query file. ''' def __init__(self, file): ''' Instance and makes the call to read the file. Args: ---- - file (str) filepath to access ''' self.lines = [] self.filepath = file self.valid = self.__rea...
# stdlib import re # deps from django.test import TestCase # local from anon import utils class UtilsTestCase(TestCase): def test_fake_word(self): text = utils.fake_word(min_size=6) self.assertGreaterEqual(len(text), 6) def test_fake_text(self): text = utils.fake_text(40) se...
import torch from latent_rationale.snli.util import get_z_counts, get_n_correct def evaluate(model, criterion, data_iter): model.eval() n_eval_correct, n_eval_total, eval_loss = 0, 0, 0 # kuma statistics p2h_0, p2h_c, p2h_1 = 0, 0, 0 h2p_0, h2p_c, h2p_1 = 0, 0, 0 with torch.no_grad(): ...
from typing import List from mapswipe_workers.project_types.arbitrary_geometry.task import Task from mapswipe_workers.project_types.base.group import BaseGroup class Group(BaseGroup): def __init__(self, project: object, groupId: int) -> None: super().__init__(project, groupId) def create_tasks( ...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
#!/usr/bin/env python import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) packages = ['atlasplots'] requires = [ 'numpy>=1.18', ] about = {} with open(os.path.join(here, 'atlasplots', '__version__.py'), 'r') as f: exec(f.read(), about) # The text of the README file wi...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from .exception_wrapper import wrap_exceptions __all__ = ["wrap_exceptions"]
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 3 09:56:42 2018 @author: lewis """ #chris test message from __future__ import division import numpy as np import matplotlib.pyplot as plt import matplotlib as cm from scipy import ndimage from scipy import signal import scipy.signal as sg from as...
# Testing for script2_3.py import sys import os lucas_path = os.environ['LUCAS_PATH'] sys.path.insert(1, lucas_path) from general import general as gen from devices.devices import node, base_station, mobile_user, d2d_user, d2d_node_type from pathloss import pathloss from plots.plots import plot_positions, plot_spec...
# -*- coding: utf-8 -*- # Copyright (c) 2019 PaddlePaddle 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 # #...
import sys import requests from requests_toolbelt import MultipartEncoder from os.path import dirname, join from com.chaquo.python import Python import uuid import json import base64 def translate(target_Language,image_dir,file_name,efile_name): image_dirs = str(image_dir) filenames = join(dirname(image_dirs)...
"""Defines the templating context for SQL Lab""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import inspect from jinja2.sandbox import SandboxedEnvironment from datetime import datetime, timedelta from dateutil.re...
from flask import Flask from flask_caching import Cache cache = Cache(config={"CACHE_TYPE": "simple"}) def configure_cache(app: Flask): cache.init_app(app)
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- """" Created on 4. 3. 2019 SVM classifier plugin for ClassMark. :author: Martin Dočekal :contact: xdocek09@stud.fit.vubtr.cz """ from distutils.core import setup setup(name='ClassMarkPluginClassifierCEEF', version='1.0', description='CEEF classifier plugi...
""" Ideal membership algorithm. Does an element belong to a given ideal? """ from sage.all import * from x1_buchberger_algorithm import buchberger_algorithm from x3_multivariate_division import multivariate_division_with_remainder from sage.rings.polynomial.polynomial_ring import is_PolynomialRing from sage.rings.polyn...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File name : get_drupal_paths.py # Author : Podalirius (@podalirius_) # Date created : 21 Nov 2021 import json import os import sys import requests import argparse from bs4 import BeautifulSoup def parseArgs(): parser = argparse.Argument...
# -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use, line-too-long """Function implementation""" import copy import logging import json import re import sys from resilient_lib import str_to_bool # <field> <operator> <value>. ex: org_...
# pylint: disable=protected-access,invalid-name import pprint from netsim.simulator.core.simcore import SimTime from netsim.simulator.netsim_base import ( PacketSink, PacketSource, PacketSize, ) from netsim.simulator.netsim_switch import PacketProcessor, PacketSwitch from netsim.simulator.netsim_simulator ...
import unittest import tensorflow as tf from panaugment import tf_utils from . import augmenter_test # from IPython import embed class TFUtilsTest(unittest.TestCase): def setUp(self): self._augmenter = augmenter_test.mock_augmenter() def test_randaugment_dataset(self): dataset = tf_utils.randaugment_da...
import numpy as np import sys from typing import List, Dict, Tuple, Optional from dover_lap.libs.utils import groupby, info from dover_lap.libs.turn import Turn from .map_utils import * class GreedyMap: def __init__(self, second_maximal: Optional[bool] = False) -> None: self.second_maximal = second_maxi...
import random from .battleship import Game from .constants import LETTERS class Brainiac: """Decision Robot TODO: Change when hit a Ship """ shot_directions = ('l', 'r', 'd', 'u') def __init__(self, player_board): self.player_board = player_board self.matrix = self._clean_board()...
import datetime from typing import List from typing import Union, Optional, Tuple from uuid import UUID, uuid4 import pymongo from pydantic import BaseModel, Field from pymongo import IndexModel from beanie import Document, Indexed class Option2(BaseModel): f: float class Option1(BaseModel): s: str clas...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class StockLocationRoute(models.Model): _inherit = "stock.location.route" sale_selectable = fields.Boolean("Selectable on Sales Order Line") class StockMove(models.Model)...