text
stringlengths
3.07k
22.1k
from flask import request, session import json as Json import time as Time from sqlalchemy import desc from . import rsvRouter from app import db, rsvIdPool, MACHINE_ID from app import comerrs as ErrCode from app.models import * import app.models as Models import app.checkargs as CheckArgs import app.rsvstate as RsvS...
# <NAME> 2014-2020 # mlxtend Machine Learning Library Extensions # # A function for plotting decision regions of classifiers. # Author: <NAME> <<EMAIL>> # # License: BSD 3 clause from itertools import cycle import matplotlib.pyplot as plt import numpy as np from mlxtend.utils import check_Xy, format_kwarg_dictionaries...
#!/usr/bin/python # Copyright (c) 2018, 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 detail...
"""State machine library for AppDaemon (Home Assistant). Repository: https://github.com/PeWu/appdaemon-machine """ from collections import defaultdict, namedtuple from collections.abc import Iterable from enum import Enum from urllib.parse import quote # Pass ANY as the from_state to add a transition from all possi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Simulator designed to show what risk actually means for stocks and how bonds can balance the risk. Stock data: https://www.measuringworth.com/datasets/DJA/index.php """ import csv from datetime import datetime, timedelta import matplotlib.pyplot as plt import matplot...
from requests.utils import requote_uri from django.db.models import Q from django.shortcuts import (render, redirect, HttpResponseRedirect, get_object_or_404, Http404) from django.http import HttpR...
import autograd.numpy as np import autograd.numpy.random as npr from ssmdm.accumulation import Accumulation, LatentAccumulation import copy import matplotlib.pyplot as plt import seaborn as sns sns.set_style("ticks") sns.set_context("talk") from ssmdm.misc import smooth, generate_clicks, generate_clicks_D from ssm.pr...
#dit berekent de prijs per pizza def calculateCosts(dough, pepperoni, cheese, pineapple, ham, tomatosauce, tuna): price = 0 #grootte van pizza if dough == "small": price += 1 if dough == "medium": price += 1.5 if dough == "large": price += 2 #als humongous gekozen is, kie...
from typing import List import classfile from rtda.slot import LocalVars as Slots, newLocalVars as newSlots from rtda.heap.cp import newClassRef, newFieldRef, newMethodRef, newInterfaceMethodRef from rtda.heap.method_descriptor import * ACC_PUBLIC = 0x0001 #class field method ACC_PRIVATE = 0x0002 # ...
# MIT License # Copyright (c) 2020 <NAME> # 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, merge, publish...
#!/usr/bin/env python # encoding: utf-8 import json import pprint pp = pprint.PrettyPrinter(indent=2) def get_ip_addrs(ipv4nets=None): ip_addrs = [] for net in ipv4nets.keys(): ipv4net = ipv4nets[net] for router in ipv4net.keys(): ipv4net_info = ipv4net[router] mbps ...
import json import matplotlib.pyplot as plt import os from functools import reduce from pyrsistent import pmap from pyrsistent.typing import PMap from typing import FrozenSet from rlo import analytics from rlo.dataset import StateValueDataset from rlo.expression_util import SymtabAndDefs from rlo import expr_sets from...
# -*- coding: utf-8 -*- """ jwt_apns_client/jwt_apns_client Client for handling HTTP/2 and JWT based connections to Apple's APNs. """ from __future__ import unicode_literals, absolute_import, print_function, division import json import time from hyper import HTTPConnection from .utils import APNSReasons, make_provi...
#! /usr/bin/python3 # -*- coding: utf-8 -*- ''' A full-screen clock in terminal. main ''' import time from os import get_terminal_size from os.path import sep as path_sep from os.path import expandvars, isfile from json import load import threading import sys class Font: """\ class Font: methods: ...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public...
""" Extract contexts from the unarXive data set where ID mappings have not been extended yet (i.e. only arXiv IDs on the citing side and only MAG IDs on the cited side). """ import json import os import re import sys import string from sqlalchemy import create_engine from nltk import tokenize CITE_PATT = re.c...
from numpy import * from itertools import * from collections import * import time # This program is intended for calculating the inverse kinematics for a robotic arm with one azimuthal degree of freedom # And 3 effectors that do not rotate at a wrist. # First we set the lengths of each arm in our assemblage, th...
''' Functionality to recognize a static/dynamic gesture, given a set of keypoints. ''' import numpy as np import torch from .util.utils import calc_polar # Using the variable ctrl_flag to detect if the ctrl key is set. # Flag set by the Listener Thread (see gesture_receiver.py) # prev_flag is the value of ctrl_flag in...
import boto3 import time import logging import datetime import sdb import os from botocore.exceptions import ClientError from utils import retry LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO") CLOUDWATCH_LOG_GROUP = os.getenv("CLOUDWATCH_LOG_GROUP", "ecs_service_events") POLL_INTERVAL = os.getenv('POLL_INTERVAL', 60) CHECK...
# -*- coding: utf8 -*- """ Dump or load symbols """ from enum import Enum, auto import ida_bytes import ida_lines import ida_nalt import ida_name import ida_offset import ida_struct import ida_ua import idc import iidada.log from ida_idaapi import BADADDR log = iidada.log.get_logger("name") class NameOp(Enum): ...
import os import pickle import re import argparse import pandas as pd ''' Read the input VCF and return processed variants as a dictionary of lists - keys: chromosome - values: position allele ''' def read_vcf(fn_vcf, fn_output): vcf_file_name = fn_output + '.chr_vcf.pickle' f_vcf = open(fn_vcf,...
# -*- coding: utf-8 -*- import tensorflow as tf from tensorflow.keras.metrics import Metric # from sklearn.metrics import classification_report call(y_true, y_pre) --- get pre, recall, f1 .etc information # from sklearn.metrics import f1_score # the metrics as following are not directly connected with model output...
from math import log2 import os import numpy as np import ujson as json import re from collections import Counter import string from tqdm import tqdm import random import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.cuda from torch.utils.data import Dataset import...
# -*- coding: utf-8 -*- """ Created on Mon Feb 5 21:07:27 2018 @author: abaena """ #****************************************************************************** #Add logmapper-agent directory to python path for module execution #****************************************************************************** if __na...
#!/usr/bin/python from __future__ import print_function import configparser import os import sys import re import MySQLdb import argparse import getpass import subprocess import logging import uuid def update(): ## Assemble list of all bookworms on the system. bookworms = [] ### ... ## Create on-disk ve...
#!/usr/bin/env python # # Copyright 2017 Phedorabot # # 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...
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 19:48:37 2019 @author: guill """ import math import random import functools import scipy.stats import numpy as np import pandas as pd import networkx as nx from tqdm import tqdm INTERACTIONS = { 'retweet': 'retweet_userid', 'reply': 'in_reply_to_userid', ...
import random import cv2 import numpy as np import tifffile as tiff import earthpy.plot as ep import matplotlib.pyplot as plt from skimage import measure from skimage import filters def normalize(img): min = img.min() max = img.max() x = 2.0 * (img - min) / (max - min) - 1.0 return x def get_rand_patc...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2018-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
import json import os import shutil import time import numpy as np import onnxruntime as rt import pandas as pd from fastapi import FastAPI from fastapi import HTTPException from fastapi.middleware.cors import CORSMiddleware from features.feature_groups import BOWGroupExtractor from features.feature_groups import SIMG...
# coding: utf-8 import arrow from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.timezone import now from dja...
#!/usr/bin/env python # # Copyright 2010 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 o...
# -*- coding: utf-8 -*- # coding=utf-8 # Copyright 2019 The SGNMT Authors. # # 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 requir...
""" Probability density models for the joint distribution of the test statistics from different layers of a DNN. The models can be made conditional on either the predicted class or the source class. We use a multivariate log-normal mixture as the parametric density model for the test statistics because they are usuall...
# Copyright 2020 winshare # # 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 os, time, functools, argparse, torch, cv2 import numpy as np from torch.optim import SGD, Adam, lr_scheduler from torch.utils.tensorboard import SummaryWriter from PIL import Image from torchvision import transforms from torchvision.transforms import InterpolationMode from yolino_net import net from yolino_datas...
''' Simple web scraper for getting data from issue tracking systems ''' import requests from bs4 import BeautifulSoup from lxml import etree import os import argparse import re import multiprocessing as mp import time from issue import Issue FIREFOX_URL_PREFIX = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' MYLYN...
#!/usr/bin/env python3 import configparser import dbus import glob import os import psutil import struct import subprocess import sys from collections import defaultdict from dbus.mainloop.glib import DBusGMainLoop from errno import EACCES, EPERM from mmio import MMIO, MMIOError from multiprocessing import cpu_count ...
import numpy as np import numpy.testing as npt from aurora.nn.pyx.fast_pooling import max_pool_forward from aurora.nn.pyx.fast_pooling import max_pool_backward from aurora.nn.pyx.im2col import im2col from aurora.nn.pyx.im2col import col2im from tests.utils.gradient_check import gradient_check_numpy_expr # Testing Max...
import os import random import albumentations as A import cv2 import numpy as np import pandas as pd import pytorch_lightning as pl import timm import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as torchdata import wandb from pathlib import Path fro...
# -*- coding:utf-8 -*- """ """ import os import dask import pandas as pd import pyarrow as pa import pyarrow.filesystem as pafs import pyarrow.parquet as pq from dask import dataframe as dd try: import fsspec _has_fsspec = True except: _has_fsspec = False __all__ = ('to_parquet', 'read_parquet') pa_e...
from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import logging import numpy as np import sys from collections import defaultdict from core.config import config as cfg from utils.localization_eval import all_localizati...
""" python spacell_clustering.py \ -i /Users/xiao.tan/st_prostate/aligned_images/150210_1000L2_CN81_C2_P4.2_HE_EB.jpg \ -t /Users/xiao.tan/st_prostate/tile/150210_1000L2_CN81_C2_P4.2_HE_EB \ -c /Users/xiao.tan/st_prostate/adjusted_matrics/P4.2.tsv \ -a /Users/xiao.tan/st_prostate/tm/transformation_matrix150210_1000L2_...
import numpy as np from collections import namedtuple from sklearn.utils.extmath import cartesian from scipy.stats import mode from scipy.stats import itemfreq from attrdict import AttrDict import pdb def max_product_update_var(state, messages, sender_id, recipient_id): variable_index = sender_id[1:] factor_i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Information butler functions""" # Import builtin python libraries import json import logging import sys # Import external python libraries import click # Import custom (local) python packages from .api_call_handler import get_response from .api_endpoint_handler impo...
""" Test the feature of container_checker """ import logging import pytest from pkg_resources import parse_version from tests.common import config_reload from tests.common.helpers.assertions import pytest_assert from tests.common.helpers.assertions import pytest_require from tests.common.helpers.dut_utils import chec...
# This script will be used to update cases, deaths, recovered from # https://twitter.com/AfricaCDC daily updates in the form of images import sys import os from os import listdir from os.path import isfile, join import pandas as pd import re import argparse import yaml from datetime import datetime import cv2 from PI...
import os import sys import html from flask import Flask, render_template INDENT = ' ' def repr_(s): s = repr(s) return '"' + s[1:-1] + '"' class State(object): gstate = None def __init__(self): self.main_queue = [] self.indent = 0 self.stack = [self.main_queue] ...
""" command.py """ import difflib import json import re from ...lib import ruledata def setup(subparsers, name, commonOptions): """ Setup subcommand : diff """ global __subcommand__ __subcommand__ = name parser = subparsers.add_parser(__subcommand__, parents=[commonOptions], ...
r""" Contains helper function to train a network, evaluate its accuracy score, and plot a confusion matrix. The following functions are provided: - *plot_confusion_matrix*: Given a prediction and a ground truth vector, returns a plot of the confusion matrix. - *calculate_accuracy*: Calculates accuracy score bet...
# pylint:disable=wildcard-import # pylint:disable=unused-import # pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name import collections import json from asyncio import Future from copy import deepcopy from pathlib import Path from typing import Dict import pytest fro...
import sys,tkinter from tkinter import ttk, filedialog from CSCI6461_Project_classes import * from CSCI6461_Project_gui_memory import * from CSCI6461_Project_gui_cache import * from CSCI6461_Project_execution import * from CSCI6461_Project_gui_io import * from CSCI6461_Project_data import * def guiInterface()...
import re import sys from os import getenv from pathlib import Path import arrow import requests from dotenv import load_dotenv from jinja2 import Environment, FileSystemLoader, select_autoescape from lxml.html import fromstring from PyQt5.QtCore import * from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import * fro...
import pygsti.algorithms.fiducialpairreduction as fpr import pygsti.circuits as pc from pygsti.circuits import Circuit from . import fixtures from ..util import BaseCase _SEED = 1234 class FiducialPairReductionStdData(object): def setUp(self): super(FiducialPairReductionStdData, self).setUp() sel...
import logging import yaml from toscaparser.nodetemplate import NodeTemplate from toscaparser.tosca_template import ToscaTemplate from toscaparser.topology_template import TopologyTemplate import operator from service.simple_spec_alayzer import SimpleAnalyzer from util import tosca_helper logger = logging.getLogger...
import tensorflow as tf from config import NUM_CLASSES import math import functions from aggregation import Aggregation from subtraction import Subtraction from subtraction2 import Subtraction2 ''' tensorflow 4-D tensor -> (batchsize, width, height, channels) torch 4-D tensor -> (batchsize, channels, height, width) ...
# coding: utf-8 # _This script requires Python 3_ # # Inspecting aggregated impact outputs # # Using _HazImp_ for evaluating the impacts of a severe weather event, # the code automatically aggregates on the basis of a regional areas - # either meshblock, SA1 or SA2. Other regions could also be # considered. # # Current...
''' Usage: benchmark --gold=GOLD_OIE --out=OUTPUT_FILE (--openiefive=OPENIE5 | --stanford=STANFORD_OIE | --ollie=OLLIE_OIE |--reverb=REVERB_OIE | --clausie=CLAUSIE_OIE | --openiefour=OPENIEFOUR_OIE | --props=PROPS_OIE | --tabbed=TABBED_OIE | --benchmarkGold=BENCHMARK_GOLD | --allennlp=ALLENNLP_OIE ) [--exactMatch | ...
# misc things useful for tests. from snakeoil.mappings import AttrAccessible from .. import plugin from ..ebuild.atom import atom from ..ebuild.conditionals import DepSet from ..ebuild.cpv import CPV from ..ebuild.eapi import get_eapi from ..ebuild.ebuild_src import package from ..ebuild.misc import collapsed_restric...
#!/usr/bin/env python3 # See: https://github.com/pr3d4t0r/COVIDvu/blob/master/LICENSE # vim: set fileencoding=utf-8: from covidvu.pipeline.jsonpack import REPORTS from covidvu.pipeline.vujson import SITE_DATA import json import os import pandas as pd # --- constants --- COUNTRIES_REGIONS = { 'Algeria': 'Afr...
import cv2 import numpy as np from math import ceil import matplotlib.pyplot as plt def cal_reproject_error(imgpoints, objpoints, rvecs, tvecs, mtx, dist): #calculate the reprojection error mean_error = 0 for i in range(len(objpoints)): imgpoints2, _ = cv2.projectPoints(objpoints[i], rvecs[i],...
"""SPHERIC benchmark case 6. (2 hours) See https://wiki.manchester.ac.uk/spheric/index.php/Test6 for more details. """ # math from math import exp # PySPH imports from pysph.base.utils import get_particle_array from pysph.base.kernels import QuinticSpline from pysph.solver.solver import Solver from pysph.solver.appl...
import matplotlib.pyplot as plt import numpy as np from sklearn.utils.validation import check_consistent_length from ..utils import check_is_binary from ..metrics import ( uplift_curve, perfect_uplift_curve, uplift_auc_score, qini_curve, perfect_qini_curve, qini_auc_score, treatment_balance_curve, uplift_b...
from dataclasses import dataclass from typing import Any, List, Optional import torch import torch.nn as nn from einops import rearrange from torch import Tensor from perceiver.model.core import DecoderConfig, LitModel, OutputAdapter, PerceiverConfig, PerceiverDecoder, PerceiverIO from perceiver.model.text.common imp...
from __future__ import absolute_import, unicode_literals from fontTools.misc.py23 import * from fontTools.misc.loggingTools import CapturingLogHandler from fontTools.misc.testTools import parseXML, getXML from fontTools.misc.textTools import deHexStr from fontTools.ttLib import TTFont, newTable from fontTools.misc.fixe...
import json import os import sys import requests console_config = dict() # текущая директория HDFS current_directory = '' def sync_config(): print('> Syncing configuration file...') with open('config.json') as json_file: data = json.load(json_file) global console_config console_con...
# -*- coding: utf-8 -*- import os from flask import (Blueprint, current_app, flash, redirect, render_template, request, send_file, url_for) from flask_babel import _ from flask_login import fresh_login_required, login_required from MMCs.decorators import admin_required from MMCs.downloader import ...
"""eval""" import os from time import time import numpy as np from mindspore import Tensor, load_checkpoint, load_param_into_net from mindspore import context import mindspore.common.dtype as mstype import mindspore.numpy as dsnp import Metrics import datahelper as dh from Parserconf import Parserconf from DataModule i...
################################################## ## Author: RuochenLiu ## Email: <EMAIL> ## Version: 1.0.0 ################################################## import os import os.path import time import pickle from PIL import Image import shutil import matplotlib.pyplot as plt import numpy as np import pandas as pd im...
from typing import List, Callable from qrogue.game.logic.actors import StateVector from qrogue.game.logic.actors.controllables import Robot from qrogue.game.logic.actors.puzzles import DummyEnemy, Enemy, Target, Riddle, Boss from qrogue.game.logic.collectibles import Collectible, CollectibleFactory, Instruction, CXGat...
import pytest import os import io import sys import codecs import itertools import pathlib import compress_pickle from compress_pickle.compressers import get_compression_write_mode from compress_pickle.utils import ( _stringyfy_path, _set_default_extension, _infer_compression_from_path, ) COMPRESSION_NAME...
# Common functions for this project import os, time, datetime import numpy as np import pandas as pd import seaborn as sns import matplotlib as mpl from scipy.stats import zscore from copy import deepcopy def ctime(): t = time.time() f = '%Y-%m-%d %H:%M:%S ' return datetime.datetime.fromtimestamp(t).strf...
from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.core.window import Window from kivy.uix.scrollview import ScrollView from in...
#! /usr/bin/env python3 """Simple verilog parser This parser will take verilog and try to break it down into formal lines of verilog. It is focused on preparing code for the Domain Assignment Checker """ import sys import re # Delineators for case and if, added to code lines if_del = ':if:' case_del = ':case:' hasal...
import numpy as np import pandas as pd import logging import sys sys.path.insert(0, '../../smap-nepse') from prediction import prepareInput as pi from preprocessing import moreIndicators as indi from logger import log as log from sklearn import preprocessing from sklearn.tree import DecisionTreeClassifier from sklearn....
#!/usr/bin/env python # Copyright 2015 Yelp 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 ag...
#!/usr/bin/python3 import os import os.path import tensorflow as tf import helper import warnings from distutils.version import LooseVersion import project_tests as tests import time import csv import datetime import scipy.misc def load_vgg(sess, vgg_path): """ Load Pre-trained VGG Model into TensorFlow. ...
import numpy as np from typing import Tuple import pandas as pd def get_cv_of_glucose(bg_values, round_val=2): """ Calculate the average within a set of glucose values Arguments: values -- numpy array contains a list of bg values. round_val -- the number of digits to round the res...
''' lanhuage: python Descripttion: version: beta Author: xiaoshuyui Date: 2020-09-17 11:11:36 LastEditors: xiaoshuyui LastEditTime: 2020-09-22 11:19:46 USELESS ''' import requests import os from pyquery import PyQuery as pq from urllib.request import getproxies from urllib.parse import quote as url_quote, urlparse...
# -*- coding: utf-8 -*- """ Created on Thurs Jul 19 Purpose: To automatically populate spreadsheets with pubmed articles @author: <NAME> twitter: @dalber_ """ from Bio import Entrez import openpyxl import tkinter as tk from tkinter import filedialog import os from time import sleep import gc # ask...
# File for backeend functions to do post processing on from PIL import ImageDraw, Image import cv2 as cv import numpy as np import pandas as pd import os import math from datetime import datetime import itertools def render_image(frame, bboxes, output_image_file, outline_color='yellow', linewidth=10): """Render i...
# -*- coding: utf-8 -*- """ This is the pytest configuration file """ import optparse import pytest from seleniumbase import config as sb_config from seleniumbase.core import log_helper from seleniumbase.core import proxy_helper from seleniumbase.fixtures import constants def pytest_addoption(parser): parser = p...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # from __future__ import print_function import socket import sys import threading import yaml import time import logging from IoTSocketServer.iot_logger import IotServerLogger, IotClientLogger class IotProtocol(object): """The procotol to follow for received bytes, ...
# Leo colorizer control file for smalltalk mode. # This file is in the public domain. # Properties for smalltalk mode. properties = { "commentEnd": "\"", "commentStart": "\"", "indentCloseBrackets": "]", "indentOpenBrackets": "[", "lineUpClosingBracket": "true", } # Attributes dict for...
import argparse import calendar import json import socket import time from datetime import datetime, timezone from multiprocessing.connection import Listener from typing import List from urllib.parse import urljoin from rich.console import Console console = Console() import requests import validators from aries_cloud...
""" @<NAME> ============================================== Training the different models by multiple sequential trials ============================================== How to train mixtures and HMMs with various observation models on the same dataset. """ import bnpy import numpy as np import os from matplotlib import ...
""" Converts the json returned by tools/infer/predict_system.py (--output_json) to label studio formats. The template is Optical Character Recognition with value of image changed to "$image" instead of "$ocr". Depending upon the name/references made in label-studio template, one might have to change the keys of the ...
#!/usr/bin/env python """ <NAME> 02/2022 Set of utility functions used to read/write raster data using Rasterio. Rasterio is and alternative GDAL’s Python bindings using more idiomatic Python types and protocols compared to the standard GDAL library. For more info about the Rasterio project see: https://rasterio.readt...
import matplotlib.pyplot as plt import os import pandas as pd import json import numpy as np import time from kTsnn.src.nets.cnn import Conv1dnn from kTsnn.src.nets.lstm import AutoLSTM from kTsnn.src.nets.window_gen import WindowGenerator from kTsnn.src.nets.lstm_rec import LSTM_rec import multitasking # Line plot of...
from flask import Blueprint, render_template, redirect, url_for, \ flash, request, jsonify from flask_login import current_user, login_required from flask_uploads import UploadSet, IMAGES from config.settings import DEFAULT_REGION_IMAGE from winejournal.blueprints.media.process_banner_image import ProcessBannerIma...
import mmcv import numpy as np from multiprocessing import Pool import itertools import sklearn.metrics as skm from .builder import DATASETS from .custom import CustomDataset from ..core.evaluation.mean_ap import get_cls_results from ..core.evaluation.bbox_overlaps import bbox_overlaps @DATASETS.register_module() cl...
import argparse import importlib.util import logging from logging.handlers import TimedRotatingFileHandler import os from art import text2art from . import config as default_config from .data import check_data_version, load_data from .server import runserver from .util import EasyDict name = "ip2loc_server" CONFIG ...
"""Class for a pokemon used by a PokemonAgent.""" from math import floor from config import MOVE_DATA from config import POKEMON_DATA from config import NATURES from config import (PAR_STATUS, BRN_STATUS, TOX_STATUS) from pokemon_helpers.calculate import calculate_hp_stat from pokemon_helpers.calculate import calcul...
import csv import json import os import re from shutil import copyfile from time import sleep, time from uuid import uuid4 from celery.task import task from django.conf import settings from landscapesim.common.config import CONFIG_IMPORTS, VALUE_IMPORTS from landscapesim.common.consoles import STSimConsole from lands...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 14 00:55:51 2020 @author: zhmingzh """ ##Imput your own data here:## #Your chosen threshold height. ht=1.9 #You do not have to change the following. import matplotlib.pyplot as plt import pandas as pd fig, ax = plt.subplots() #Import your data,...
# ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ----------------------------------------------------------------------------- im...
# /usr/bin/python # -*- encoding:utf-8 -*- import xgboost as xgb import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.ensemble import RandomForestClassifier import pandas as pd import ...
from utils import * import numpy as np import matplotlib.pyplot as plt import random import ast import pandas as pd # size of students, questions and subjects N, D, S = 542, 1774, 388 def sigmoid(x): """ Apply sigmoid function. """ return np.exp(x) / (1 + np.exp(x)) def neg_log_likelihood(data, theta,...
import random import time from os import system, name #used to clear screen def clear(): if name == 'nt': _ = system('cls') def game(): spots = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24...
"""Requests module -- Classes for making requests to the Github API""" from abc import ABC, abstractmethod from datetime import datetime from functools import cached_property import json import requests from .app import App from .downloadable import Dynamic, Finite, Additive, Static from .objects import (Commit, Dep...