text
stringlengths
3.07k
22.1k
import os import time import json import select import random import requests import urllib.request from _sha1 import sha1 from cryptography.hazmat.primitives.asymmetric.padding import PKCS1v15 from cryptography.hazmat.primitives.serialization import load_der_public_key from connection import * from packet import * #...
# -*- coding: utf-8 -*- # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # This program was made based on the original run_glue.py program with Copyright # from the companies above and licensed under the Apache License,...
#!/usr/bin/env python # After you've done an inversion, what are the results? # How much moment is created, and how big is the misfit? # Writes into a summary text file, and prints to screen. # Useful for L-curve analysis. import numpy as np import sys import json import slippy.io # -------- INPUT FUNCTIONS -----...
""" Main file for generate Federated Multiview Dataset ################################ There are two steps to generate the sample dataset 1. Generate the images from blender given camera view parameters 2. Postprocess these images for desired object size and image size Usage: 1. first set BLENDER_PATH variable accor...
import json import os import ipynb_py_convert import nbformat from nbconvert import HTMLExporter from nbconvert.preprocessors import ExecutePreprocessor from nbconvert.writers import FilesWriter import oscovida class BaseReport: def __init__( self, *, country, title, over...
# 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. from google.appengine.ext import ndb from common.findit_http_client import FinditHttpClient from dto.flake_try_job_result import FlakeTryJobResult from dto....
# -*- coding: utf-8 -*- """ Parser for a subset of Lua, useful for autocompletion. """ import string from operator import attrgetter from collections import namedtuple from funcparserlib import parser as p # ===================== Helper data structures ============================== from splash.utils import to_bytes ...
from personTracker import PersonTracker import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from tello import Tello # pylint: disable=import-error import pygame import numpy as np import time import cv2 # Speed of the drone S = 60 # Frames per second of the pygame window displa...
# Copyright 2021 <NAME> # # 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...
from area import * from formation import * from minion import * from sieve import * from skill import * from status import * import effect import tactic import libtcodpy as libtcod import math class General(Minion): def __init__(self, battleground, side, x=-1, y=-1, name="General", color=libtcod.orange): super...
#!/usr/bin/env vpython # Copyright 2015 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. """Symbolizes a log file produced by cyprofile instrumentation. Given a log file and the binary being profiled, creates an orderfile....
import ctypes from pyarcan.libarcan import libarcan_tui # Opaque pointer class TuiConn(ctypes.Structure): pass # Opaque pointer class TuiContext(ctypes.Structure): pass TuiContext_pointer = ctypes.POINTER(TuiContext) # TODO: Opaque? class ArcanIoevent(ctypes.Structure): pass # TODO: Opaque? class...
################################################################################# # # University of Nice Côte d’Azur (UCA) - # National Center of Scientific Research (CNRS) – # CHU of Nice (CHUN) - # Instituto Federal do Espirito Santo (IFES) # Copyri...
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """An implementation of a data store based on mongo.""" import hashlib import threading import time from bson import binary from bson import objectid import pymongo from pymongo import errors import logging from grr.lib import config_lib from grr.lib imp...
""" The list of basic analysers includes: - WordSegmentation - IDNADecoder - HomoglyphsDecoder - FeaturesGenerator (generate various features for further downstream processing) - BulkDomainMarker """ import re import tldextract import wordsegment from nostril import nonsense import idna from confusa...
# Copyright 2020 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/LICE...
#You can download data from link - https://www.kaggle.com/START-UMD/gtd import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import matplotlib.pyplot as plt import seaborn as sns import folium import folium.plugins # Input data files are available in the "../input...
# Copyright 2018 <NAME> # # 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, softwa...
#! /usr/bin/env python3 import argparse import gym import sys import time import os import logger import monitor as M import os.path as osp import numpy as np import tensorflow as tf import utils as U from collections import deque from ppo_cliped import PPOCliped parser = argparse.ArgumentParser(description='proxim...
#!/usr/bin/env python3 import sys import re from os import environ from jinja2 import Template from create_modfile import get_msgfmods, categorize_mod, parse_cmd_mod, modpos, NON_BLOCKING_MODS aa_weights_monoiso = { # From ExPASY 'A': 71.03711, 'R': 156.10111, 'N': 114.04293, 'D': 1...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # https://github.com/pytorch/vision/blob/8635be94d1216f10fb8302da89233bd86445e449/torchvision/datasets/utils.py import os im...
# coding:utf8 import tqdm import os import time import json from collections import defaultdict import sys import pdb import traceback from bdb import BdbQuit import torch from opts import parse_opt from models.captioner import Captioner from models.sent_senti_cls import SentenceSentimentClassifier from dataloader imp...
import logging import time from urllib.parse import urljoin import datetime import requests import dateutil.parser from sqlalchemy import func, desc, or_, and_ from src.models import Play from src.tasks.celery_app import celery logger = logging.getLogger(__name__) # The number of listens to get per request to identit...
''' 软件 Aperio ImageScope 的 XML文件 读取和写入工具 目前支持 轮廓,方框,椭圆,箭头 的读入和写入操作 注意,除了标签数据,其他非必要的信息目前不提供支持 读取后将会返回 区域列表和颜色元组列表 存档时需要的也是 区域列表和颜色元组列表 如何使用? 请看本文件最下面的测试样例 注意: 这里读取返回和储存时需要的坐标点格式不是 xy,而是 yx。使用时请务必注意。 数据格式: CONTOUR:一串坐标点。[point1, point2, point3, ...] BOX: 有两种方式,可通过 use_box_y1x1y2x2 参数选择。方式1:[左上角坐标,右下角坐标],方式2:[左上角坐标,右上...
""" Doom or Bloom Course: CS 30 Period: 3 Date created: April 1, 2019 Date completed: April 5, 2019 By: <NAME> This is a text-based Python game """ # import modules import json import os import time from print import * slow("Hi") class Cover(): """ title screen """ def title(self): print(""" ...
#!/usr/bin/env python3 # Copyright 2018 <NAME> # # 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 a...
# coding:utf-8 import numpy as np import os def getframeGTScore(gtpath,key): nyfile = os.path.join(gtpath,key+'.npy') framegt = np.load(nyfile) return framegt def creatdict(framepath, GTfile): with open(file=GTfile,mode='r') as f: gtfile = f.readlines() test_video_list = []...
import numpy as np from pickle import dumps as pdumps, loads as ploads import os import json from py3dtiles import TileContentReader from py3dtiles.feature_table import SemanticPoint from py3dtiles.points.utils import name_to_filename, node_from_name, SubdivisionType, aabb_size_to_subdivision_type from py3dtiles.point...
from docria import Document, DocumentIO from docria.model import Text from docria.algorithm import span_translate, group_by_span, dominant_right, sequence_to_textspans from docria import T def test_span_remap(): doc = Document() raw_text = doc.add_text("raw", "0123456789012345678901234567890") clean_text ...
# Copyright (c) 2020 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 # # Unless required by appli...
import imageio import numpy as np import cv2 from PIL import Image from scipy.spatial import distance as dist import pyautogui import time import os pyautogui.PAUSE = 0.1 DIFFICULTIES = ['medium'] CELL_DEF = { "medium": (14,18) } # Background Color Definitions BACKGROUND_COLORS = [(229,193,161), (215,183,155), (1...
from discord.ext import commands from discord import utils, Embed import discord import lavalink import os class MusicCog(commands.Cog): """ MusicCog for our bot Members: bot - commands.Bot our bot (handled by the setup function) playlistPath - str path of the file containing our playlists Functions: ...
# # Copyright 2019 Delphix # # 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, so...
""" Schema to represent a knowledge base to build models of prokaryotes :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Date: 2018-09-10 :Copyright: 2018, Karr Lab :License: MIT """ from wc_utils.util import chem import obj_model from...
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import json from rest_framework import mixins, viewsets, status from rest_framework.response import Response from django.shortcuts import get_object_or_404 from . import models from . import serializers from ....
import os, json, requests, base64, re, math from datetime import datetime from flask import jsonify, Blueprint, request, url_for, Response from flask_login import login_required from pprint import pformat from icalendar import Calendar, Event, vCalAddress, vText import simplekml import dateutil import hashlib from tos...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: lry """ import tensorflow as tf import numpy as np import time import os import random import opt_rnn_attention as opt from rnn_attention_model import rnn_model index1 = np.arange(0, opt.N1, opt.scale) index2 = np.arange(0, opt.N2, opt.scale) Xl_big = np.zero...
#!/usr/bin/env python3 import argparse import logging import netrc import os import sys import pycurl from plexapi.exceptions import NotFound from plexapi.library import ShowSection from plexapi.media import MediaPart from plexapi.myplex import MyPlexAccount from plexapi.playlist import Playlist from plexapi.video im...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'statusbar.ui' # # Created by: PyQt5 UI code generator 5.15.1 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, QtG...
#!/usr/bin/env python3 """Assigns taxonomy to sequences in a DADA2 CSV by aligning them to a database FASTA using BLAST.""" import argparse import os import subprocess import sys from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord def arg_fasta_file(in_fasta): """Checks if a spec...
import itertools import pickle from pathlib import Path import git import humanize import numpy as np import torch import torch.nn as nn from nltk.corpus import stopwords from tqdm.auto import tqdm repo = git.Repo(Path(".").absolute(), search_parent_directories=True) ROOT = Path(repo.working_tree_dir) PROCESSED = R...
#!/usr/bin/env python3 import stepwise, appcli, autoprop from appcli import Key, Method, DocoptConfig from stepwise import UsageError, StepwiseConfig, PresetConfig, pl, ul, dl from stepwise_mol_bio import Main, ConfigError from inform import plural def parse_num_samples(name): try: return int(name) ex...
# custom utilies for displaying animation, collecting rollouts and more import numpy as np import pong_utils import torch import gym import time import matplotlib import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from parallelEnv import par...
import sys import os import json from datetime import datetime from celery import Celery from celery.canvas import chain from celery import task from django_celery_beat.models import PeriodicTask from django_celery_beat.models import PeriodicTasks from django_celery_beat.models import CrontabSchedule from pcts_crawler...
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Also available under a BSD-style license. See LICENSE. import contextlib import re import traceback import warnings from...
# -*- coding: utf-8 -*- """ pysteps.tracking.tdating ======================== Thunderstorm Detection and Tracking (DATing) module This module was implemented following the procedures used in the TRT Thunderstorms Radar Tracking algorithm (:cite:`TRT2004`) used operationally at MeteoSwiss. Modifications include advecti...
import asyncio import threading import time from base64 import standard_b64encode from concurrent.futures import ThreadPoolExecutor import pytest from replicat import exceptions, utils # TODO: tests for make_main_parser class PlainBackend: def __init__(self, arg, raise_on): self.results = arg s...
""" Convert a Jupyter Notebook-format homework problem. The single input Jupyter Notebook is converted into four files: - A Notebook without the solution for students to fill in - A PDF without the solution for students to fill in - A Notebook with the solution - A PDF with the solution The solution is detected as a...
#!/usr/bin/env python3 # The original source code of Poincare Embedding can be found in https://github.com/facebookresearch/poincare-embeddings # This source code is partially modified for the application to HiG2Vec. import torch as th import numpy as np import logging import argparse from hype.sn import Embedding, i...
import os import sys import shutil import argparse import string from build.sdk_build_utils import * ANDROID_ABIS = ['armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'] SDK_VERSION = "4.4.2" def javac(args, dir, *cmdArgs): return execute(args.javac, dir, *cmdArgs) def jar(args, dir, *cmdArgs): return execute(args.jar, ...
import numpy as np import torch as torch from sklearn.model_selection import train_test_split from tqdm import tqdm from torch.autograd import Variable from plot import * import _pickle as cPickle import os import signal from timeit import timeit # ----------------------------------------------------------- class Cf...
# The code in this file is copied from https://github.com/praekelt/vumi/blob/master/vumi/codecs/vumi_codecs.py # which is in turn largely copied from http://stackoverflow.com/questions/13130935/decode-7-bit-gsm # Vumi's license is included below: # Copyright (c) Praekelt Foundation and individual contributors. # All r...
import copy from logging import getLogger import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal from torch.optim import Adam from accel.replay_buffers.replay_buffer import Transition logger = getLogger(__name__) class CriticNet(nn.Module): ...
# Copyright (c) 2011-2021, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions an...
from scipy import ndimage import numpy as np import random from skimage.color import rgb2hsv, hsv2rgb def add_hsv_noise(rgb, hue_offset, saturation_offset, value_offset, proba=0.5): mask = np.all(rgb != 0, axis=2) hsv = rgb2hsv(rgb/255) if random.uniform(0, 1) > proba: hsv[:, :, 0] = ( ...
# coding=utf-8 import random from game_log import log def showGameRules(): # This function prints out the rules at the beginning of the game print("Tic Tac Toe!\n\n") print("RULES...................\n\n") print("1. Two players select spaces on the 3×3 grid. The two players alternate when choos...
"""Bulk geocoding API wrapper. Attributes: CENSUS_GEO_COLNAMES: column names in output from geocoding API. """ import asyncio import csv from io import StringIO from itertools import islice import logging import glob import os import os.path import geopandas as gpd import httpx import pandas as pd import shapely ...
# -*- coding: utf-8 -*- """Views file for stein app""" import ast from django.db.models import Count, Case, When from django.db.models.query import QuerySet from django.shortcuts import render from django.views.generic.list import ListView from rest_framework import generics, status from rest_framework.viewsets impo...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import os import torch import numpy as np from torch import nn param_dict = { 0: {'max_vel_x': 0.5, 'max_vel_theta': 1.57, 'vx_samples': 6, 'vtheta_samples': 20, 'occdist_scale': 0.1, 'path_distance_bias': 0.75, 'goal_distance_bias': 1.00, 'inf...
import sys from datetime import datetime, timedelta from disco.worker.classic.worker import Params from disco.core import result_iterator from disco.func import chain_stream from disco.func import disco_output_stream from disco.func import gzip_stream from disco.func import map_output_stream from disco.func import red...
from typing import List import networkx as nx import numpy as np from overrides import overrides import tqdm from env import Node from planners.rrtPlanner import RRTPlanner from samplers import prmSampler from utils import planner_registry volume_of_unit_ball = { 1: 2, 2: 3.142, 3: 4.189, 4: 4.935, ...
import argparse, glob, os, cv2, sys, pickle import numpy as np import tensorflow as tf import config as cfg from models.stgru import STGRU from models.lrr import LRR from models.dilation import dilation10network from models.flownet2 import Flownet2 from models.flownet1 import Flownet1 from tensorflow.python.framework i...
# -*- coding: utf-8 -*- from __future__ import division, print_function import pickle import random import numpy as np import json import sys import os.path import argparse import os import pprint import pdb from efficiency.log import fwrite, show_var from bs4 import BeautifulSoup from collections import defaultdict,...
import json from MalwationAIMA import Client import demistomock as demisto BASE_URL = 'https://test.com' client = Client(base_url=BASE_URL, verify=False, proxy=False, headers={ 'Authentication': 'Bearer some_api_key' }) AIMA_SCAN_RES...
import re from mitsubishi_central_controller.util.constants import DRIVE_STRINGS, MODE_MAP, AIR_DIRECTION_MAP, FAN_SPEED_MAP, \ REMOTE_CONTROL_PERMISSION_MAP, ITEM_MAP, VENTILATION_MAP, SIGN_MAP, MODEL_MAP, STATUS_MAP, SCHEDULE_MAP, \ IC_KIND_MAP, FAN_SPEED_STATUS_MAP, AIR_STAGE_STATUS_MAP def bulk_string_to...
import numpy as np from sequence_jacobian import simple, solved, create_model, markov_rouwenhorst, agrid from sequence_jacobian.classes.impulse_dict import ImpulseDict from sequence_jacobian.hetblocks.hh_sim import hh '''Part 1: Household block''' def make_grids(rho_e, sd_e, nE, amin, amax, nA): e_grid, e_dist,...
# Copyright (c) 2019 Western Digital Corporation or its affiliates. from mmcv.cnn import ConvModule from mmcv.runner import BaseModule import torch import torch.nn as nn from torch.nn.modules.batchnorm import _BatchNorm class DWConv(nn.Module): """Depthwise Conv + Conv""" def __init__(self, in_channels, out...
import gym from gym import error, spaces, utils from gym.utils import seeding import numpy as np import scipy.interpolate as interp import time import sys import scipy PI = 3.14159265358979323846264338327 # import boatfunc_discrete as boatf class boatfunc(): def __init__(self): # super(ClassName, self...
import os import zipfile from typing import Tuple, Any, Mapping, Iterable, Union, List, Dict import numpy as np import pandas notebook_dir = os.path.dirname(__file__) def read_nind(zip: zipfile.ZipFile, run_id: str, ids: Iterable[str], out: Dict[int, List[str]]): for id in ids: path = os.path.join(run_i...
""" Stateful neural network models. """ import numpy as np import tensorflow as tf from tensorflow.contrib.framework import nest # pylint: disable=E0611 from tensorflow.contrib.layers import fully_connected # pylint: disable=E0611 from .base import TFActorCritic from .util import mini_batches, product, mix_init_sta...
import numpy as np import bempp.api import os from bempp.api.operators.boundary import sparse, laplace, modified_helmholtz from .common import calculate_potential_one_surface invert_potential = True def verify_parameters(self): alpha = self.pb_formulation_alpha beta = self.pb_formulation_beta if np.isnan...
# Copyright 2016 Symantec, 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 agreed to in writi...
#_*_ coding: UTF-8 _*_ from flask import render_template, redirect, request from flask.views import View import db import renderers import data_models import custom_fields import properties import urls def view_user_controls(model): logout_url = data_models.logout_url() help_url = 'http://members.pont-mbale....
import json import re from typing import List from allennlp.common.util import JsonDict, sanitize from allennlp.data import Instance from allennlp.predictors.predictor import Predictor from overrides import overrides from utils.transition_sdp_reader import parse_sentence @Predictor.register('transition_predictor_eu...
""" Linker utilities. """ from templar.exceptions import TemplarError import os import re def link(source_path): """Links the content found at source_path and represents a Block that represents the content.""" if not os.path.isfile(source_path): raise SourceNotFound(source_path) with open(source_...
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from reporting.reporting.report.financial_statements import (get_period_list, get_columns, get_data) from reporting.reporting...
from __future__ import absolute_import from collections import OrderedDict from cached_property import cached_property import ctypes import numpy as np import sympy from devito.compiler import jit_compile, load from devito.dimension import Dimension from devito.dle import transform from devito.dse import rewrite fro...
import serial import sys import decimal import copy DEFAULT_TIMEOUT = 5 class Lakeshore_Model331(): """ This is a very simple Python wrapper for the Lakeshore Model331 temperature controlers. This uses pyserial as the backbone. This class only supports RS-232 connections. """ ...
"""Tests for functions for generating interesting polynomials.""" import random import pytest from diofant import (ZZ, cyclotomic_poly, interpolating_poly, random_poly, ring, swinnerton_dyer_poly, symbols, symmetric_poly) from diofant.abc import x, y, z __all__ = () def test_swinnerton_dyer_...
import enum from datetime import datetime from pathlib import Path from typing import Any, Callable, Optional, cast from PyQt5.QtCore import (QEasingCurve, QEvent, QObject, QPoint, QPropertyAnimation, Qt, QTimer) from PyQt5.QtGui import QHideEvent, QKeyEvent from PyQt5.QtWidgets import (QAbst...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. """ tf2onnx.tf2onnx - select op conversion """ import numpy as np from onnx.onnx_pb import TensorProto from tf2onnx import utils from tf2onnx.utils import port_name, make_sure # pylint: disable=unused-argument,m...
from . import kepio from . import kepmsg from . import kepstat from . import kepkey from .utils import PyKEArgumentHelpFormatter import math import numpy as np from astropy.io import fits as pyfits from matplotlib import pyplot as plt from scipy import stats from copy import copy from tqdm import tqdm __all__ = ['kep...
import operator import peewee from fate_manager.db.db_models import DB, FateSiteJobInfo, AccountInfo, FateUserInfo, ApplyInstitutionsInfo, \ FederatedInfo, ChangeLog, FateSiteInfo, backup_database_table, init_database_tables from fate_manager.entity.status_code import UserStatusCode from fate_manager.entity.types ...
#coding=utf-8 import re, os, time, random import sys if sys.version_info >= (2, 6, 0): import json as json else: import simplejson as json from django.core.paginator import Paginator, InvalidPage, EmptyPage, PageNotAnInteger from django.db.models import Q from django.core.urlresolvers import reverse from dja...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Misfit method :copyright: <NAME> (<EMAIL>), 2020 :license: None """ import abc import obspy as _obspy import numpy as _np from typing import List as _List # from obspy.signal.cross_correlation import xcorr_max as _xcorr_max, correlate as _correlate from SS_...
# PyLinuxToolkit # Copyright (C) 2022 JWCompDev # # LicenseHeader.txt # Copyright (C) 2022 JWCompDev <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation; either version 2.0 of the License, or # (at...
from sklearn.metrics import confusion_matrix from keras.callbacks import ModelCheckpoint from biosppy.signals import ecg from sklearn.model_selection import StratifiedKFold from sklearn.metrics import accuracy_score from sklearn.preprocessing import MinMaxScaler, RobustScaler import pandas as pd import scipy.io ...
import torch.nn as nn import torch import numpy as np import torchvision import torch.utils.model_zoo as model_zoo class FCN8_VGG16(nn.Module): def __init__(self, n_classes): super().__init__() self.n_classes = n_classes # PREDEFINE LAYERS self.pool = nn.MaxPool2d(kernel_size=2, s...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from datetime import datetime, date, timedelta import pymysql import spbu from app.constants import emoji, subject_short_types server_timedelta = timedelta(hours=0) def parse_event_time(event): return "{0} {1:0>2}:{2:0>2}{3}{4:0>2}:{...
import os import errno import csv import random import math import datetime import pickle import threading import cv2 import numpy as np import matplotlib import matplotlib.image as mpimg import matplotlib.pyplot as plt #====================== CTrainingRecord() ===================== class CTrainingRecord(): ''' ...
import json import os from uuid import uuid4 from web3 import Web3 from common import blockchain_util, boto_utils from common import ipfs_util from common.constant import StatusCode from common.logger import get_logger from registry.config import NETWORK_ID, SERVICE_CURATE_ARN, REGION_NAME, CONTRACT_BASE_PATH from re...
import sys sys.path.insert(0, '/srv/wcdo/src_viz/apps_dev') from dash_apps_dev import * from gender_homepage_visibility_metrics import get_gendercount_by_lang, get_last_data_update ######################################################## ############DATA COMPUTATION############################ territories = w...
# This script reads in Biteau's catalog stored in # BiteauWilliams2015_AllData_ASDC_v2016_12_20.ecsv, # it creates the corresponding ecsv-sed files and stores # them in /input/data from astropy.table import Table from astropy.io import ascii from astropy.constants import h,e from pathlib import Path import astropy.un...
from collections import defaultdict import random import numpy as np from sklearn.metrics.pairwise import pairwise_distances from sklearn.cluster import DBSCAN from eden.graph import Vectorizer from eden.converter.rna.rnaplfold import rnaplfold_to_eden from eden.modifier.graph.vertex_attributes import list_reweight,...
''' This module contains the Lexicon classes where each class is a sub class of the :py:class:`bella.lexicons.Lexicon` class. The following classes are in the module: 1. Lexicon -- Base class 2. HuLiu -- `Hu and Liu <https://www.cs.uic.edu/~liub/publications/kdd04-revSummary.pdf>`_ lexicon. 3. Mpqa -- `<NAME> and Hof...
# Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #!/usr/bin/python3 """ This module tests various enclave commands. """ import json import math import time import subprocess from subprocess import PIPE from subprocess import check_output from subproce...
""" Author: <NAME> Purpose: To test functions in scaffolding Credit to: https://docs.python.org/3.10/library/unittest.html """ import unittest import pandas as pd import numpy as np import scaffolding class TestEnergyIntensity(unittest.TestCase): """ A unit test for energy_intensity function in the ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Pytroll_satpy. This file is part of the complex_terrain algorithm <NAME>, <NAME>, <NAME> (IGE, CEN). """ import numpy as np from glob import glob from satpy import Scene import xarray as xr from pyresample import create_area_def from pyproj import Proj, transform from ...
from collections import deque from pprint import pprint import Helpers as h # graph error classes class GraphError(Exception): def __init__(self, message, values=0): self.message = message self.values = values def __str__(self): return self.message class NodeNotExistError(GraphError): ...