text
stringlengths
3.07k
22.1k
import math import warnings from catalyst.contrib.nn import OneCycleLRWithWarmup from torch.optim.lr_scheduler import ( _LRScheduler, ExponentialLR, CyclicLR, MultiStepLR, ReduceLROnPlateau, CosineAnnealingLR, CosineAnnealingWarmRestarts, ) __all__ = ["get_scheduler", "FlatCosineAnnealingL...
#!/usr/bin/python # # Copyright (c) 2013 Protectus,LLC. All Rights Reserved. # import sys, time, os, signal from select import select import socket import traceback from datetime import datetime import subprocess from optparse import OptionParser import math import configparser from datetime import timedelta from ope...
import pandas as pd from datetime import datetime from datetime import timedelta import logging import matplotlib.pyplot as plt import sys def clean_data(df): """ Clean data rows, such as invalid characters, NaN, Landed ... """ _df = df.copy() logging.warning(f'Received df of len {len(_df)}...') ...
import io import numpy as np import sys import math import tensorflow as tf import tensorflow_addons as tfa import tensorflow_datasets as tfds def _normalize_img(img, label): img = tf.cast(img, tf.float32) / 255. return (img, label) def get_data(data_type = 'mnist', data_kind='img'): train_dataset, test...
# # read_exif.py # # Given a folder of images, read relevant EXIF fields from all images, and write them to # a .json file. Depends on having exiftool available, since every pure-Python approach # we've tried fails on at least some fields. # # Does not currently support command-line operation. # #%% Imports and cons...
# Copyright 2020 The TensorFlow Quantum 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...
import os import random import pathlib import logging import datetime import argparse import sys import simplejson as json import pandas as pd import sentencepiece as spm import pickle from collections import namedtuple # logging.basicConfig(format='%(levelname)s: %(message)s', # level=logging.DEBU...
import datetime from sqlalchemy import text from sqlalchemy.orm import relationship from sqlalchemy import Integer, Column, String, DateTime, ForeignKey from urllib.parse import urlparse from pygmy.database.base import Model from pygmy.database.dbutil import dbconnection, utcnow class ClickMeta(Model): __tablen...
"""A training script of Soft Actor-Critic on RoboschoolAtlasForwardWalk-v1.""" import argparse import functools import logging import sys import gym import gym.wrappers import numpy as np import torch from torch import distributions, nn import pfrl from pfrl import experiments, replay_buffers, utils from pfrl.nn.lmbd...
""" Functions that are no longer used in my notebooks due to finding more effective functions. """ import numpy as np import numpy.polynomial.polynomial as poly import matplotlib.pyplot as plt import os from scipy import optimize as opt from scipy.stats import linregress import math import pandas as pd import netCDF4 a...
# -*- coding: utf-8 -*- # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation. # # 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 random import matplotlib import matplotlib.animation as animation import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 from mpl_toolkits.mplot3d import proj3d import numpy as np matplotlib.use("Qt5Agg") from PyQt5 import QtCore from PyQt5.QtWidgets import QApplication, QMainWindo...
# -*- coding: utf-8 -*- # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # #...
# Copyright (c) 2018 Cisco and/or its affiliates. # 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 sc2 from sc2.position import Point2 from sc2.units import Units from typing import List, Callable import py_trees from py_trees.composites import Sequence, Selector from py_trees.idioms import eternal_guard from py_trees.behaviour import Behaviour from unit_ai_data import UnitAiOrderType, UnitAiOrder, UnitAiCont...
#!/usr/bin/env python3 """ Copyright (c) 2018 The Hyve B.V. This code is licensed under the GNU Affero General Public License (AGPL), version 3, or (at your option) any later version. """ import argparse import os import traceback import tempfile import datetime import sys import subprocess def main(args): """Pr...
# ============================================================================= # IMPORTS # ============================================================================= # Python from __future__ import unicode_literals from datetime import datetime, tzinfo, time as datetime_time import pytz import warnings # Django fr...
#!/usr/bin/python ###################################################################### # Ascii TMS Viewer # #-------------------------------------------------------------------- # <NAME> | Initial Release #-------------------------------------------------------------------- # ...
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class unet(nn.Module): def __init__(self): super(unet, self).__init__() self.inplanes = 32 # Encoder self.convbnrelu1_1 = conv2DBatchNormRelu(in_channels=3, k_size=3, n_filters=16, p...
from django.shortcuts import render, redirect, get_object_or_404 from blog.forms import UserDbForm from .models import OrderItem, Order, BillingAddress, ShopMain, Shirts, Shorts, Watches, Pants, Shoes, item, Slippers, \ TopProductOne, TopProduct, LatestProduct, LatestProductOne, ReviewProductOne, ReviewProduct, Pos...
import PyQt5 as qt import PyQt5.QtWidgets as ws import PyQt5.QtGui as gui import PyQt5.QtCore as core import subprocess as sub from sys import path import os.path import requests from bs4 import BeautifulSoup as soup from threading import Thread from webbrowser import open_new_tab class Pip: def __ini...
import pygame from . import pygwrap import glob from . import util MENUFONT = None INIT_DONE = False class MenuItem( object ): def __init__(self,msg,value,desc=None): self.msg = msg self.value = value self.desc = desc def __lt__(self,other): """ Comparison of menu items done...
#!/usr/bin/env python #-*- coding:utf-8 -*- #author: wu.zheng midday.me import os import json import cv2 import random import numpy as np import time from dataset import image_augmation from dataset import data_util import xml.etree.ElementTree as ET IMAGE_WIDTH=1024 IMAGE_HEIGHT=1024 NUM_CLASS=3 def load_image_lis...
# Copyright (c) 2021, Alyf GmbH and contributors # For license information, please see license.txt import frappe from frappe.utils import now_datetime, get_datetime_str, get_date_str, flt from jira.jira_client import JiraClient @frappe.whitelist() def sync_work_logs_from_jira(project=None): filters = {"enabled": 1}...
import logging import os from collections import OrderedDict import torch from torch.nn.parallel import DistributedDataParallel import imix.engine.hooks as hooks import imix.utils.distributed_info as comm from imix.models import build_loss, build_model from imix.solver import build_lr_scheduler, build_optimizer from ...
from __future__ import division, print_function import numpy as np def rect_to_points(r): return (r[0],r[1]), (r[0]+r[2], r[1]+r[3]) def points_to_rect(p1,p2): return (p1[0],p1[1], p2[0]-p1[0], p2[1]-p1[1]) def union_rect(r1, r2): (a1,b1),(c1,d1) = rect_to_points(r1) (a2,b2),(c2,d2) = rect_to_poin...
import pandas as pd import ipywidgets as widgets import src from IPython.display import clear_output import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import scipy.stats as sts def show_tasks_dropdown(dropdown,df=src.get_raw_data()): display(dropdown) def dropdown_eventha...
# -*- coding: utf-8 -*- # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. """ This module is responsible for parsing a compiler invocation. """ import re import os import collections import logging im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Event classes. Event representes events which take plase on browser DOM. Usually users don't need to instantiate these classes directly. """ from asyncio import ensure_future, iscoroutinefunction, Future from collections import defaultdict, OrderedDict from typing i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of "trim-ps2" project # # Author: <NAME> <<EMAIL>> # License: BSD 3-Clause "New" or "Revised" License # # SPDX-License-Identifier: BSD-3-Clause # License text is available in the LICENSE file and online: # http://www.opensource.org/licenses/BSD-...
# Copyright (c) 2008, Humanized, Inc. # 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 conditio...
#!/usr/local/bin/python # -*- coding: utf-8 -*- # file: main.py import re import pandas as pd from os.path import isfile try: from .remarkuple import helper as h except: from remarkuple import helper as h from IPython.display import HTML try: from .isopsephy import greek_letters as letters from .isopse...
import json import argparse import pathlib import time import datetime import subprocess import numpy import tqdm import pybullet as bullet import igl def get_time_stamp(): return datetime.datetime.now().strftime("%Y-%b-%d-%H-%M-%S") def save_mesh(meshes, out_path, index): Vs = [] Fs = [] offset = ...
import torch import shutil import os import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix from sklearn.utils.multiclass import unique_labels import logging import datetime class ImbalancedDatasetSampler(torch.utils.data.sampler.Sample...
import os import json import copy import asyncio import datetime try: # python2 import __builtin__ except ImportError: # python3 import builtins as __builtin__ import discord from discord.ext import tasks from dotenv import load_dotenv # load sensitive info load_dotenv() TOKEN = os.getenv('DISCORD_TOK...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Unofficial python API to datashake reviews API (https://www.datashake.com/review-scraper-api) This module makes it easier to schedule jobs and fetch the results Official web API documentation: https://api.datashake.com/#reviews You need to have datashake API key to use...
#!/usr/bin/env python # coding:utf-8 # Purpose: Drawing R12 # module belongs to package: dxfwrite.py # Created: 09.02.2010 # Copyright (C) 2010, <NAME> # License: MIT License __author__ = "mozman <<EMAIL>>" import os from . import DXFEngine from .base import * from .sections import create_section from . import const...
# -*- coding: utf-8 -*- """ Created on Mon May 28 20:21:27 2018 @author: Administrator """ import numpy as np from MyLibrary import * FPS=120 screenwidth=288 screenheight=512 fontsize=30 player_filename="players.png" player_frame_width=48 player_frame_height=48 player_frame_num=4 base_filename="base....
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by <NAME> at 2019-06-14 """add_metacyc_rea_archive.py :description : script :param : :returns: :rtype: """ # note: not finissed import os import pickle import re import sys import cobra import pandas as pd import My_def # Disable def blockPrint(): sy...
""" @author: <NAME> @contact: <EMAIL> """ from ifpd2.chromosome import ChromosomeData import logging from typing import List, Tuple class GenomicRegion: """Details on genomic region with a central focus region.""" __chrom: bytes __chromStart: int __chromEnd: int __focusStart: int __focusEnd:...
"""Load notebook and cells""" import argparse import os import nbformat as nbf from IPython.core.interactiveshell import InteractiveShell from reproducemegit.jupyter_reproducibility import config from reproducemegit.jupyter_reproducibility import consts import shutil import subprocess from reproducemegit.jupyter_repr...
import numpy as np import pandas as pd from scipy import stats from scipy.stats import ks_2samp from sklearn.cluster import KMeans from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.metrics import silhouette_score from sklearn.model_selection import KFold def get_slope(y): x = np.ones(y...
# File: exp.py # Author: raycp # Date: 2019-05-28 # Description: exp for 2ez4u from pwn_debug import * pdbg=pwn_debug("./2ez4u") pdbg.context.terminal=['tmux', 'splitw', '-h'] pdbg.local("./libc.so","/glibc/x64/2.24/lib/ld-2.24.so") pdbg.debug("2.24") pdbg.remote('127.0.0.1', 22) #p=pdbg.run("local") #p=pdbg.run("r...
#!/usr/bin/env python3 # # Pocket SDR Python AP - Plot PSD and histgrams of digital IF data # # Author: # T.TAKASU # # History: # 2021-10-20 0.1 new # 2021-12-01 1.0 rename pocket_plot.py -> pocket_psd.py # add option -h # 2021-12-10 1.1 improve plotting time # 2022-01-10 1.2 add OFFSE...
from __future__ import annotations import numpy as np import pandas as pd import sklearn.linear_model from sklearn import datasets from IMLearn.metrics import mean_square_error from IMLearn.utils import split_train_test from IMLearn.model_selection import cross_validate from IMLearn.learners.regressors import Polynomia...
#!/usr/bin/env python from __future__ import division import numpy as np import lfd.rapprentice.math_utils as mu from lfd.environment.simulation import DynamicSimulationRobotWorld from lfd.environment.simulation_object import XmlSimulationObject, BoxSimulationObject, CylinderSimulationObject, RopeSimulationObject fr...
import re import itertools # Regular expressions built using RegExr NAME_NO_SPACE = "(?P<name>[a-zA-Z]+)" NAME = NAME_NO_SPACE + "\s+" LABEL = "(?P<label>[a-zA-Z_][_0-9a-zA-Z]+)\s*" IMM = "(?P<imm>-?[0-9][x0-9A-Fa-f]*)\s*" FIRST = "(?P<first>\$[0-9a-zA-Z]+)\s*" SECOND = "(?P<second>\$[0-9a-zA-Z]+)\s*" THIRD = "(?P<thi...
import logging import math from cv2 import split import numpy as np from PIL import Image from torchvision import datasets, transforms from .transforms.randaugment import RandAugmentMC logger = logging.getLogger(__name__) cifar10_mean = (0.4914, 0.4822, 0.4465) cifar10_std = (0.2471, 0.2435, 0.2616) cifar100_mean =...
""" This file contains helper functions for evaluate_segmentation.py script. """ import os import csv import xml.etree.cElementTree as ET import numpy as np import config from utils import get_paths # compare segmentations based on the EvaluateSegmentation software of Taha def segment_comparison( goldstandard_...
from io import FileIO from dataclasses import dataclass import os.path as path from glob import glob from typing import Any, Dict, TextIO import numpy as np import shutil import rioxarray as rxr import xarray as xr import fs from fs import copy from fs.osfs import OSFS from fs.base import FS import zarr import xmltod...
""" Decorators for common Python developer utility. """ from functools import wraps from collections import OrderedDict from time import time from pprint import pformat from copy import deepcopy import random import json import os import dill as pickle import inspect import traceback import wasabi from wasabi import ms...
"""Objects for recording state of a Markov chain and caching computations.""" import copy from functools import wraps from collections import Counter from mici.errors import ReadOnlyStateError def _cache_key_func(system, method): """Construct cache key for a given system and method pair.""" if not isinstance...
""" --- Day 3: Binary Diagnostic --- --- Part 1 --- The submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case. The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded properly, can tell you many useful things about th...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 2 18:08:00 2019 @author: ben """ import pointCollection as pc #import ATL11 import matplotlib.pyplot as plt import numpy as np import os import sys import scipy.stats as sps import argparse def get_map(map_file, bounds=None): #if bounds is Non...
import numpy as np def laguerre_eval_zero(deg, pts): return np.polynomial.laguerre.lagval(pts, np.append(np.zeros(deg), 1)) def laguerre_eval_one(deg, pts): return np.polynomial.laguerre.lagval(pts, np.ones(deg + 1)) class RadialBasis: def __init__(self, beta): self.beta = float(beta) de...
import json import logging import os import re from functools import wraps from pathlib import Path from re import Pattern from typing import Iterator, Union, List import requests import slack_sdk from ratelimit import limits, sleep_and_retry from slackxport.exceptions import SlackXportException from slackxport.slack...
# coding=utf-8 # Copyright 2021 The Google Research 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 required by applicab...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np def linealSolverForward(A, b): """Solves a system of equations given a lower triangular matrix. Arguments: A: Lower triangular matrix. Shape: (n, n) b: System's solutions. Shape: (n, 1) Raises: RuntimeError if A ...
import csv import json from os import listdir from os.path import isfile, join import numpy as np import torch.backends.cudnn as cudnn from PIL import Image from tqdm.auto import tqdm import pandas as pd from adv_patch_bench.utils import get_box, pad_image DATASET = 'mapillaryvistas' # DATASET = 'bdd100k' if DATASE...
# ============LICENSE_START======================================================= # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
import re import json import yaml from random import randint from invoker import ReplyObject, Command from data.pokedex import Pokedex from plugins.pasteImporter import PasteImporter from plugins.battling.battle import Battle, Pokemon from plugins.battling.battleLogic import getAction, getSwitch, getLead # This curren...
from pybit import HTTP from pybit.exceptions import InvalidRequestError from datetime import datetime as dt import numpy as np import time import config def _print(message, level='info'): """ Just a custom print function. Better than logging. """ if level == 'position': print(f'{dt.utcnow()}...
# -*- coding: utf-8 -*- # ====================================== # # @Author : <NAME> # @Email : <EMAIL> # @File : stru.py # ALL RIGHTS ARE RESERVED UNLESS STATED. # ====================================== # import pathlib from collections import OrderedDict import numpy as np from ase.units import Angstrom, Bohr...
import numpy as np from utils.misc import hamming_distance # TODO(andre:2018-05-29): Fazer com que as funcoes de movimento realizem o # numero correto de passos. Atualmente os materiais que sao iguais aos materiais # da direcao para a qual se esta se movendo contam como um passo mesmo que # nenhuma mudanca seja reali...
from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() import unittest import mock import json import pytumblr from urllib.parse import parse_qs import sys import csv from multiprocessing import Process, Queue import re import urllib import random ...
import jax import jax.numpy as jnp import numpy as np import pytest from scipy.integrate import solve_ivp import tornadox @pytest.fixture def ivp(): return tornadox.ivp.vanderpol(t0=0.0, tmax=0.25, stiffness_constant=1.0) @pytest.fixture def d(ivp): return ivp.y0.shape[0] @pytest.fixture def steps(): ...
"""PyTorch-compatible datasets. Guaranteed to implement `__len__`, and `__getitem__`. See: https://pytorch.org/docs/stable/data.html """ import os import sys import torch from PIL import Image import torch.utils.data import cv2 import numpy as np import rasterio as rio from mercantile import Tile from robosat_pink...
#!/usr/bin/env python3 # 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, softw...
# Apply from Tensorflow: # https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/util/nest.py """This module can perform operations on nested structures. A nested structure is a Python sequence, tuple (including `namedtuple`), or dict that can contain further sequences, tuples, and dicts. """ import ...
import configparser import importlib import numpy as np import pandas as pd ############################################################################### #Non-Standard Import ############################################################################### try: from . import model_handler as mh fr...
import cv2 import logging import numpy as np from typing import List, Union, Tuple, Dict from mot.utils.config import Config from mot.structures import Tracklet from mot.utils.io import ImagesCapture from mot.utils.hcc import hierarchical_cluster from mot.tracker import build_tracker, Tracker, TrackerState def _samp...
#Want C(abcspectra, metaframe) from pandas import Series, DataFrame import skspec.core.utilities as pvutils import skspec.config as pvconfig from pandas.core.indexing import _LocIndexer from skspec.units.abcunits import IUnit, Unit, UnitError import numpy as np # Exceptions # ---------- class SpecError(Exception): ...
import torch import torch.nn as nn from modules import content_decoder from modules import sentence_planner from sys import exit from torch.nn.utils.rnn import pack_padded_sequence as pack from torch.nn.utils.rnn import pad_packed_sequence as unpack class EncoderRNN(nn.Module): def __init__(self, opt): ...
from scipy.ndimage import convolve from skimage import morphology import scipy import time from staples_detection.algorithms.utils import * from staples_detection.base.staple_detection_methods import StapleDetectionMethod from staples_detection.base.result.gradient_staple_detection_result import GradientDirectionResu...
import numpy as np import matplotlib.pyplot as plt class Machine(): def __init__(self, mean, sigma, label): self.mean = mean self.sigma = sigma self.label = label def sample(self): return np.random.normal(loc=self.mean, scale=self.sigma, size=1)[0] class Agent(): def __init__(self, epsilon, Nsteps, Nm...
#!/usr/bin/env python from contextlib import contextmanager from deepdiff import DeepDiff import fire import numpy as np import os import pandas as pd import pathlib from penquins import Kowalski from pprint import pprint import questionary import subprocess import sys import tdtax from tdtax import taxonomy # noqa: F...
#!/usr/bin/env python3 import math import logging import time import sys import argparse import torch import numpy as np import pickle from pathlib import Path from evaluation.sliding_window import WindowSlidingForwardNodeClassification from model.tgn import TGN from utils.utils import setup_logger, CheckPoint, ArgsCo...
import argparse import copy import re import xml.etree.ElementTree as et def _bool_to_c_expr(b): if b is True: return 'true' if b is False: return 'false' return b class Extension: def __init__(self, name, ext_version, enable): self.name = name self.ext_version = int(ex...
import argparse import numpy as np import os from keras import backend as K from keras.models import load_model import pdb import sys import traceback import matplotlib.pyplot as plt import numpy as np from keras import layers, models, optimizers from keras import backend as K from keras.utils import to_c...
from collections import OrderedDict from . import BaseULObject from nineml.base import ( DocumentLevelObject, ContainerObject, DynamicPortsObject) from .population import Population from nineml.exceptions import NineMLNameError, NineMLUsageError from nineml.utils import validate_identifier from .component_array imp...
from models.cvdp import CoupledVDP_UnitBox, CoupledVDP from kaa.experi_init import * from kaa.timer import Timer from kaa.modes import BundleTransMode from kaa.temp.diag_static_strat import RandomDiagStaticStrat from kaa.templates import MultiStrategy def test_sapo_CVDP(): num_steps = 40 model = CoupledVDP(de...
""" Heuristics to determine whether re-encoding text is actually making it more reasonable. """ import re import unicodedata from ftfy.chardata import chars_to_classes # The following regex uses the mapping of character classes to ASCII # characters defined in chardata.py and build_data.py: # # L = Latin capital let...
from enum import Enum, IntFlag, unique from django.db import models from django.db.models import Model """ Django permissions are tied to Models, which are in turn typically tied to database objects/tables, or "managed". In some cases this may be too granular for the application; in others, model development may sti...
from PyQt5.QtWidgets import QWidget, QComboBox, QSpinBox, QDoubleSpinBox, QCheckBox, QLineEdit, QMessageBox #from bluesky.callbacks import LivePlot, LiveGrid import bsstudio.window import matplotlib.pyplot as plt from collections import Iterable import time import re from IPython import get_ipython from .lib.pydollarma...
import json import logging import platform import re import threading import time from collections import namedtuple from assemblyline.common.importing import class_by_path from assemblyline.al.common import forge from assemblyline.al.common.message import Message, MT_SVCHEARTBEAT from assemblyline.al.common.queue im...
# Copyright (c) 2022 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...
#!/usr/bin/python import time import threading import socket import os import Steering class Connection: #the class 'receiver_of_message' must implement receive_message(message) def __init__(self, ip_address, port, receiver_of_messages): self.ip_address = ip_address self.port = port se...
import vdomr as vd from .viewcontainer import ViewContainer from .forestviewcontrolpanel import ForestViewControlPanel import uuid import multiprocessing import traceback import sys import time from mountaintools import client as mt # MEDIUM TODO move tabs between north/south containers # MEDIUM TODO cross-correlogram...
from ThesisAnalysis.plotting.setup import ThesisPlotter from ThesisAnalysis import get_data, get_plot, ThesisHDF5Reader import os import numpy as np from matplotlib.ticker import MultipleLocator, FuncFormatter from target_calib import CalculateRowColumnBlockPhase, GetCellIDTCArray def setup_cells(df, camera): fci...
import frappe from frappe.utils import get_link_to_form, now_datetime, nowdate, get_first_day, get_last_day from frappe import _ from erpnext.hr.doctype.upload_attendance.upload_attendance import get_active_employees month_list = ['January','February','March','April','May','June','July','August','September','October',...
# coding: utf-8 import cmath import numpy as np from rcwa.common import matmul, redheffer_star_prod, get_input from rcwa.structure import HomogeneousStructure from rcwa.source import Source from rcwa._constants import UNIT_MAT_2D def save_outputs(R, T): with open('output.toml', 'w') as fid: fid.write('[R...
import os, sys dir_ReDUCE = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(dir_ReDUCE+"/utils") import gurobipy as go import numpy as np from add_piecewise_linear_constraint import add_piecewise_linear_constraint from add_McCormick_envelope_constraint import add_bilinear_constraint...
from __future__ import annotations import base64 from functools import partial from typing import TYPE_CHECKING, Optional from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QFrame, QGridLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QRadioButton, QSizePolicy, ...
# coding: utf-8 # In[1]: """ Process and export all aqueduct 30 data. When users want to download the entire dataset, this is what they will get. Author: <NAME> Date: 20190711 Kernel: python35 Docker: rutgerhofste/gisdocker:ubuntu16.04 """ SCRIPT_NAME = "Y2019M07D11_RH_Aqueduct30_Data_Download" OUTPUT_VERSION =...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Aug 13 08:20:52 2021 @author: smullally """ #Code to look at spectrophotometric standards. import numpy as np import lightkurve as lk import matplotlib.pyplot as plt def examine_tic(ticid): lcs = lk.search_lightcurve('TIC {}'.format(ticid),...
''' Note: Code has been heavily adapted from <NAME>, MD, MPH work on sequential severity prediction for critically ill patients (Source: https://github.com/cosgriffc/seq-severityscore) ''' import numpy as np import pandas as pd # Pipeline from sklearn.pipeline import Pipeline # Preprocessing from sklearn.preprocessin...
import argparse import os import json import faiss import numpy as np import pandas as pd from data import create_multi_splits from validate import L2norm from validate import retrieve, KNN, score # Training settings parser = argparse.ArgumentParser(description='PyTorch SBIR') parser.add_argument('--dir-path', type=s...
import math import torch import torch.nn import torch.nn as nn from src.nn.layers.coordconv import CoordConv2d, CoordConvTranspose2d, AddCoords, make_conv2d from src.nn.layers.srm import setup_srm_layer, setup_srm_weights from src.nn.layers.lambda_layer import LambdaLayer warned_bad_input_size_power2 = False from sr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 <NAME> <<EMAIL>> # # MIT License # # 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...
# Copyright 2019-2020 Not Just A Toy Corp. # # 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...