text
stringlengths
6.04k
39.5k
# encoding: utf-8 import pytest import six from django import VERSION as DJANGO_VERSION from django.db.models import F, Model, Q from queryable_properties.compat import nullcontext as does_not_raise from queryable_properties.exceptions import QueryablePropertyError from queryable_properties.properties import ( An...
# Copyright (c) 2008-2012 <NAME>, <NAME> # See COPYING for details. try: basestring except NameError: basestring = str unicode = str TIMING = False class ParseError(Exception): """ ?Redo from start """ def __init__(self, input, position, message, trail=None): Exception.__init__(s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Run the UCD model. Usage: python run_ucd.py Input data files: ./data/instagram.pickle, ./data/user_friend_follower.csv, ./data/source_target.csv Time: 30M """ import sys, os, pickle import numpy as np import pandas as pd import networkx as nx from sklearn.metrics im...
################### # FALCON TASKS # pylint: disable=function-redefined from .. import tusks as pbfalcon from pbcommand.cli import registry_builder, registry_runner, QuickOpt from pbcommand.models import (FileTypes, OutputFileType, ResourceTypes) import logging import os import StringIO import sys cd = pbfalcon.cd log...
import dash from dash import dcc from dash import html import numpy as np import plotly.graph_objects as go import tensorflow as tf from tensorflow import keras import pandas as pd from tensorflow.keras import layers from database import fetch_all_voltage_as_df # Define the dash app first app = dash.Dash(__name__) ...
#!/usr/bin/env python # coding: utf-8 import threading from .simple_range import Range switcher = { "RE": ["union", "simple_RE", "simple_RE#union"], "simple_RE": ["concatenation", "basic_RE", "basic_RE#concatenation"], "union": ["RE", "simple_RE", "simple_RE#union"], "concatenation": ["simple_RE", "si...
# Copyright 2016 Huawei Technologies Co. Ltd. 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 # # Unles...
""" /prettify_exceptions/formatter.py Copyright (c) 2020 ShineyDev 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 re...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 TH<NAME> Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in c...
from argparse import ArgumentParser from pathlib import Path import shutil import imageio def silence_imageio_warning(*args, **kwargs): pass imageio.core.util._precision_warn = silence_imageio_warning import gin import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch impor...
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import collections import datetime import os import inspect def _as_np_date(val): ''' Convert a pandas timestamp, string, np.datetime64('M8[ns]'), datetime, date to a numpy datetime64 [D] and remove time info. Returns ...
import keyword import ast from copy import deepcopy import core_logic import make_nodes import operations import validators # TODO: Remove the current attr (Go back one) # TODO: Have a blank line on top of for and while # TODO: Actions that replaces the parent with the selected node # (If the types match), or maybe y...
import string import pandas as pd import calendar import warnings from re import match from collections.abc import Collection from IPython.display import Image, display import os emojis = { 'LIKE_EMOJI': '👍', 'DISLIKE_EMOJI': '👎', 'LAUGHING_EMOJI': '😆', 'HEART_EMOJI' : '❤', 'HEART_EYES_EMOJI': '😍', ...
""" routines for automatic calibration. - peakdet (useful to find maxima in an array without taking derivative) - get_most_prominent_peaks (find by looking for spikes in spectrum derivative) - match_peaks (identify peaks based on ratios between known gamma energies) - calibrate_tl208 (main routine -- fits multiple peak...
import itertools import datetime import time import pathos.multiprocessing as mp from toolbox.file_tools import remove_border_spaces, str_to_list, \ get_bool_from_dict, read_argv_optional, seconds_to_hhmmss, \ cast_to_export, read_optional_from_dict, str_to_bool STD_FILE_PREFIX = "paramvar" SUMMARY_SUFFIX = "...
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd import numpy as np # In[229]: df = pd.read_csv('D:/Titip/german_credit.csv') # In[230]: df['account_check_status'] = df['account_check_status'].str.strip().map({'no checking account' : 'no', ...
#!/usr/bin/env python3 """parser: SignWriting string parse functions Define various regular expressions and use them to validate SignWriting strings. """ import re SYMBOL_BLOCK = 'S[123][0-9a-f]{2}[0-5][0-9a-f]' COORD_BLOCK = 'n?[0-9]+xn?[0-9]+' POS_COORD_BLOCK = '[0-9]+x[0-9]+' re_word = ( '(A(' + SYMBOL_BLOC...
import hcl_mlir from hcl_mlir import GlobalInsertionPoint from hcl_mlir.dialects import builtin from hcl_mlir.dialects import hcl as hcl_d from hcl_mlir.dialects import std from hcl_mlir.ir import * from ..devices import Device, DevMemoryPair from .context import (ImperativeLoopDepth, ImperativeLoopNestCount, ...
import logging import time import copy import collections import os import torch import torch.nn as nn import torch.utils.data from torch.nn.utils import weight_norm import numpy as np from matplotlib import pyplot as plt logger = logging.getLogger(__name__) # -=( MISC )=------------------------------------------...
# Copyright (c) 2009, <NAME> # 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 and th...
#! /usr/bin/env python """Steady-state lat-by-lat RCE throughout the annual cycle using climlab.""" from contextlib import contextmanager, redirect_stdout import os import climlab from climlab.convection import ConvectiveAdjustment from climlab.radiation import ( AnnualMeanInsolation, DailyInsolation, Fix...
# Copyright (C) 2014 eNovance SAS <<EMAIL>> # # 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...
# Copyright 2018 The TensorFlow 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 applica...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import functools from chofer_torchex.nn import SLayerRationalHat from torch_geometric.nn import GINConv, global_add_pool, global_sort_pool from chofer_torchex import pershom import extendedpersistence ph = extendedpersistence.extende...
import logging import math from decimal import Decimal from typing import Any from typing import Dict from typing import Optional from typing import Sequence from typing import Tuple from service_capacity_modeling.interface import AccessConsistency from service_capacity_modeling.interface import AccessPattern from ser...
import json import xlsxwriter import io import copy from utils.esconn import ESConn from utils.common import get_rounding_time_unit from utils.constants import ES_TERMS_AGGR_SIZE, CVE_INDEX, NODE_TYPE_HOST, \ NODE_TYPE_CONTAINER_IMAGE, NODE_TYPE_CONTAINER, NODE_TYPE_POD, DEEPFENCE_SUPPORT_EMAIL, TIME_UNIT_MAPPING, ...
# # Copyright 2020 <NAME> # # This file is part of Library of Graph Algorithms for Python. # # Library of Graph Algorithms for Python is free software developed for # educational # and experimental purposes. It is licensed under the Apache # License, Version 2.0 # (the "License"); you may not use this file excep...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 """SageMaker Processing script to prepare raw documents into SMGT-ready page images Optionally (by specifying a ProcessingOutput with source /opt/ml/processing/output/thumbnails), this job can also generate resized th...
from selfdrive.car import dbc_dict # Car button codes class CruiseButtons: RES_ACCEL = 4 DECEL_SET = 3 CANCEL = 2 MAIN = 1 #car chimes: enumeration from dbc file. Chimes are for alerts and warnings class CM: MUTE = 0 SINGLE = 3 DOUBLE = 4 REPEATED = 1 CONTINUOUS = 2 #car beepss: e...
# -*- coding: utf-8 -*- import datetime import ssl from base64 import urlsafe_b64encode from tempfile import NamedTemporaryFile from contextlib import contextmanager import os import ipaddress import idna from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat....
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the Free Software Foundation, either ...
#!/usr/bin/env python3 """ Test the evidence values for different number of components when varying the noise level. """ import operator from pathlib import Path import h5py import numpy as np import pandas as pd from matplotlib import ticker from matplotlib import pyplot as plt plt.rc('font', size=10, family='seri...
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: <NAME> (<EMAIL>) # from __future__ import absolute_import, division, unicode_literals ...
""" Test package for varana.fit module. """ import unittest from os.path import realpath, split import numpy as np import pytest from varana.fit import ( add_frequencies, amplitude, approximate_parameters, approximate_sines_sum, convert_linear_parameters, final_parameters, final_sines_sum...
#!/usr/bin/env python # # Copyright (c) 2012-2019 Zeex # 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 ...
""" flask_json ~~~~~~~~~~ A Flask extension providing better JSON support. :copyright: (c) 2015 - 2017 by <NAME> :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import sys import collections from functools import wraps from datetime import datetime, date, ti...
import numpy as np import argparse import os import sys import time import cv2 from cv2 import dnn confThreshold = 0.5 def stab_scale(image, box): border = 0.2 im_height = len(image) im_width = len(image[0]) (left, right, top, bottom) = (box[0], box[1], box[2], box[3]) border_height = (bottom - top) * borde...
""" sess_load_util.py This module contains functions for loading data from files generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: <NAME> Date: August, 2018 Note: this code uses python 3.7. """ import copy import logging import os import h5py import numpy as np i...
import math import itertools import random import copy import numpy as np from scipy import stats import sys from birkhoff import birkhoff_von_neumann_decomposition ## Some Settings _DEBUG = False def validate_matrix(score_matrix, partition={}): """ Validate and enforce constraints on a score matrix object: (1) mu...
import csv import os import sqlite3 import pytest import shutil from tempfile import gettempdir from openpyxl import Workbook TMP_DIR = gettempdir() ws_summary_B5_rand = [ 'Cookfield, Rebuild', 'Smithson Glenn Park Editing', 'Brinkles Bypass Havensmere', 'Folicles On Fire Ltd Extradition', 'Pudd...
# ########################################################## # FlatCAM: 2D Post-processing for Manufacturing # # http://flatcam.org # # Author: <NAME> (c) # # Date: 2/5/2014 # # MIT Licence ...
# -*- coding: utf-8 -*- """ /*************************************************************************** Georec A QGIS plugin Geo recommendation Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/ ------------------- begi...
from __future__ import annotations from typing import List, Union, Any import dataclasses import datetime import re import pymongo from spinta import exceptions from spinta.auth import authorized from spinta.core.ufuncs import ufunc from spinta.core.ufuncs import Env from spinta.core.ufuncs import Expr from spinta....
nb = 4 nr = 10 nk = 4 hex_symbols_to_int = {'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14, 'f': 15} sbox = [ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0...
import pandas as pd import random import copy import numpy as np from scipy.optimize import linprog from retrying import retry import warnings # warnings.filterwarnings("ignore") data_path = "./filter_data.csv" class TupleInfo: def __init__(self): self.attri_values = dict() class Mutua...
#!/usr/bin/env python3 import xml.etree.ElementTree as et import glob import re import os import argparse INDENT = " " INPUT_DIR = "." OUTPUT_DIR = "./out" LOG_LEVEL_DEBUG = 0 LOG_LEVEL_INFO = 1 LOG_LEVEL_NOTICE = 2 LOG_LEVEL_WARN = 3 LOG_LEVEL_ERR = 4 LOG_LEVEL_LABEL = ["DEBUG", "INFO", "NOT...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import json import gzip import pickle from tqdm import tqdm import nltk PAD_TOKEN = "<PAD>" UNK_TOKEN = "UNKNOWN" START_TOKEN = "<s>" END_TOKEN = "EOS" PAD_ID = 0 UNK_ID = 1 START_ID = 2 END_I...
import heapq import time from rtd.simulator_files.world.world import world from rtd.simulator_files.agent.agent import segway_agent from rtd.simulator_files.planner.planner import planner import matplotlib.pyplot as plt import sys import matlab.engine import numpy as np from matplotlib.patches import Circle def plot_...
import numpy as np import pyamg import scipy.sparse.linalg as splinalg import scipy.sparse as sparse from simfempy import tools import time scipysolvers=['scipy_gmres','scipy_lgmres','scipy_gcrotmk','scipy_bicgstab','scipy_cgs', 'scipy_cg'] pyamgsolvers=['pyamg_gmres','pyamg_fgmres','pyamg_bicgstab', 'pyamg_cg'] stran...
#!/usr/bin/env python """ Copyright (C) 2018 github.com/volskaya 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,...
import argparse import logging import os import random import time from copy import deepcopy from test import test import numpy as np import torch import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.nn as nn import torch.utils.data import torch.utils.data.distributed import sys sys.path...
import os import sys import numpy as np import pandas as pd import geopandas as gpd import matplotlib import matplotlib.cm as cm import matplotlib.pylab as plt from matplotlib.colors import Normalize import matplotlib.animation as animation from cycler import cycler from colorsys import hls_to_rgb from shapely.geomet...
# File: layers.py # Author: <NAME> <<EMAIL>> # Reference code: https://github.com/ppwwyyxx/tensorpack/blob/master/tensorpack/models/ import tensorflow as tf from tensorflow.contrib.framework import add_arg_scope import numpy as np @add_arg_scope def conv(x, filter_size, out_dim, name='conv', strid...
import os import sys import argparse import importlib import warnings # numpy warnings because of tensorflow warnings.filterwarnings("ignore", category=FutureWarning, module='tensorflow') warnings.filterwarnings("ignore", category=UserWarning, module='gym') import gym import utils.import_envs # pytype: disable=impor...
import bz2 import io import json import logging import multiprocessing as mp import sys from argparse import ArgumentParser from collections import Counter, defaultdict from datetime import datetime as dt from itertools import count from pathlib import Path from typing import ( Callable, Dict, Iterable, ...
#!/usr/bin/env python3 from collections import deque import random import numpy as np import tensorflow as tf import gym import gym.spaces from gym.wrappers import Monitor import click ## partial update of target variables def update_variables(from_vars,to_vars,tau): return_ops = [] for from_var,to_var in zip...
# COPYRIGHT® 2020 # —————————————— # PyFlappy Bird # Made by "<NAME>" # "www.youtube.com/c/EverythingComputerized" ############ ### ############# ##### ### ### ### ### ### ### ### ...
import argparse from pathlib import Path from shutil import rmtree from collections import defaultdict from jinja2 import Environment, FileSystemLoader from meco.diagram_creator import PlantUMLClient from meco.utils import build_model, get_first, find_class_objects from meco.definitions import (TEMPLATES_DIR_PATH, PLA...
import time import torch import torch.nn as nn import torch.optim as optim class Attack(object): r""" Base class for all attacks. .. note:: It automatically set device to the device where given model is. It basically changes training mode to eval during attack process. To change t...
from typing import Optional, Type from datetime import datetime import json import logging import uuid as python_uuid from django.conf import settings from django.db import models from django.db.models.signals import pre_save, pre_delete from django.dispatch import receiver from django.utils import timezon...
import argparse import logging from collections import defaultdict from itertools import chain import torch from torch.utils.data import DataLoader, TensorDataset from utils import get_dataset, get_kogpt2_model, get_kogpt2_tokenizer # Model for fine-tuning from pytorch_lightning import Trainer from pytorch_lightning...
''' This file contains some simple heuristics to complete the extracted aspect and description pairs. For each word, we will find its most frequent left and right neighbors. @author: <NAME> Created on 2019-03-28 Updated on 2019-03-28 ''' import json import operator import nltk import numpy import pickle import r...
# -*- coding: utf-8 -*- import numpy as np # Import from relative path try: from .matrix import NUM_NODES, IDICT, BODY_NAMES # Import from absolute path # These codes are for debugging except ImportError: from jos3.matrix import NUM_NODES, IDICT, BODY_NAMES _BSAst = np.array([ 0.110, 0.029, 0.175, 0....
import asyncio import hashlib import hmac import json import logging import os import socket import aiohttp_jinja2 import jinja2 import socketio import yaml from aiohttp import web from aiohttp.log import access_logger from zeroconf import ServiceInfo, Zeroconf from .const import __version__ from . import (DBGK) from...
import hashlib import os from jdatetime import timedelta from peewee import * from common import config from common.config import * from common.model import BaseModel class Cost(BaseModel): title = CharField(default='') invoiceno = CharField(default='0') amount = DecimalField(20,default=0) ...
# markdown.py """ markdown formatting functionality """ # pylint:disable=consider-using-f-string import html import logging import re import typing import urllib.parse import flask import misaka import pygments import pygments.formatters import pygments.lexers import slugify from . import html_entry, image, links, u...
import typing from hydrus.core import HydrusData from hydrus.core import HydrusGlobals as HG from hydrus.core import HydrusSerialisable from hydrus.client import ClientConstants as CC from hydrus.client import ClientData from hydrus.client.importing import ClientImporting from hydrus.client.importing import ClientImp...
# -*- coding:utf-8 -*- import os import re import json import time import traceback import datetime from collections import Counter from numpy import var, average, percentile from util import get_dir_files from config import config from report import generate_web_log_parser_report from report import generate_web_log_...
# Import useful libraries import cv2 import numpy as np import matplotlib.pyplot as plt from scipy import signal from skimage.measure import compare_ssim as ssim import matplotlib as mpl from mpl_toolkits import mplot3d import csv import os n = 20 s = n * 2 + 1 # Length of square sides category1 = 'bats' category2 = ...
from config import config from config import IS_DEV import backoff import json import os, sys, traceback, time from serverutils.utils import read_string_from_file from serverutils.utils import getjsonbin, getjsonbinobj from lbot.lichess import Lichess from lbot.model import Challenge, Game import threading impor...
# # Copyright (C) 2014 Dell, 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 wri...
from src.config import CENSUS_KEY import json import requests import numpy as np import pandas as pd # from numpy.lib.function_base import quantile def get_census_response(table_url, get_ls, geo): ''' Concatenates url string and returns response from census api query input: table_url (str): census...
# Copyright (c) MONAI Consortium # 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...
from enum import IntEnum, auto math_operations = { # keyword : (function name, number of arguments) 'add': ('ADD', 2), 'sub': ('SUBTRACT', 2), 'mul': ('MULTIPLY', 2), 'mult': ('MULTIPLY', 2), 'div': ('DIVIDE', 2), 'mult_add': ('MULTIPLY_ADD', 3), 'sin': ('SINE', 1), 'sine': ('SINE'...
from time import time import sys sys.path.append("..") import gensim from sklearn.metrics.pairwise import cosine_similarity from models.Gan import Gan from models.persongan.PersonganDataLoader import DataLoader, DisDataloader from models.persongan.PersonganDiscriminator import Discriminator from models.personga...
""" .. module:: grid :synopsis: *Module to handle grid (array of geo-coordinates) related operations.* .. todo:: Revise the module to a factory pattern implementation. """ import numpy as np import pandas as pd from collections import namedtuple import uuid import propcov from instrupy.util import Entity, EnumEnt...
from lxml import html, etree from enum import Enum, auto import re from html2text import html2text class TildesTopic: """Represents a single topic on Tildes, generated from the entire page. :ivar List[str] tags: List of tags this topic has. :ivar str group: The group this topic was posted in. :ivar ...
#!/usr/bin/env python """ ROS node implementing a higher level navigation controller via Mavros """ import threading from functools import partial import rospy import mavros from sensor_msgs.msg import NavSatFix, Imu from mavros_msgs.msg import State, Waypoint, ParamValue from mavros_msgs.srv import SetMode, ParamSe...
# -*- coding: utf-8 -*- """ Created on Mon Nov 26 17:49:58 2018 @author: mike_k Maps locations to grid """ import numpy as np import config from matplotlib import pyplot as plt import math # for testing only from read_wordtable import read_wordtable_to_words_and_locations as read_table #%% GRID_SIZE = 64 # the ...
from topology_radiomics.sanitization import BinaryVoxelMask from topology_radiomics.reporting import SummaryRow from topology_radiomics.config import MorphologyConfig, MarchingCubesAlgorithm import logging from pyvista import PolyData import pyvista as pv from skimage.measure import marching_cubes from scipy.ndimage im...
import pytest import numpy as np import cmath import math from numpy.testing import assert_almost_equal class Test_visualization: def test_induction_motor_circle(self): from electricpy.visu import InductionMotorCircle open_circuit_test_data = {'V0': 400, 'I0': 9, 'W0': 1310} blocked_rotor...
# -*- coding: utf-8 -*- """ This code is auto generated from troposphere_mate.code_generator.__init__.py scripts. """ import sys if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover from typing import Union, List, Any import troposphere.databrew from troposphere.databrew import ( ...
from app.utils_dependency import * from app.models import Notification from app.wechat_send import ( publish_notification, publish_notifications, WechatApp, WechatMessageLevel, ) from boottest import local_dict from random import random from datetime import datetime, timedelta hasher = MySHA256Hasher(...
#!/usr/bin/env python from __future__ import print_function import os import sys import subprocess import scipy.optimize import numpy as np import ThermodynamicProperties as Pr import Wavenumbers as Wvn import Thermal_NumericalAnalysis as TNA import Expand as Ex import System_sensitivity as Ss import matplotlib.pyplot...
from typing import List from fastapi import Response from fastapi.responses import JSONResponse, PlainTextResponse from fastapi.templating import Jinja2Templates from geojson_rewind import rewind from geomet import wkt from rdflib import Graph from rdflib import URIRef, Literal, BNode from rdflib.namespace import DCTE...
#!/usr/bin/env python import wx import os from aqopa.gui.general_purpose_frame_gui import GeneralFrame """ @file gui.py @brief gui file for the financialanalysis module @author <NAME> """ class SingleVersionPanel(wx.Panel): def __init__(self, module, *args, **kwargs): wx.Panel.__init__(se...
import torch import time import math import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from torch.nn import Linear as _linear from torch.nn import Embedding as _Embedding from torch.nn import Module, Parameter from .quant_utils import * import logging logger =...
from threading import Thread from time import sleep import PyQt5 from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import pyqtSignal, QObject, QPoint, Qt from PyQt5.QtGui import QColor, QPalette from PyQt5.QtWidgets import QApplication, QGridLayout, QLabel, QLineEdit, QMainWindow, QPushButton, QWidget from mlib.b...
#!/usr/bin/env python3 ####################################################################### # # SYMBOLS SECTION - Can be edited. Changes will be preserved. # ####################################################################### import collections from functools import partial import os import sys try: scri...
### Original Beautiful Code by <NAME> # ### Code Hacked by <NAME> for a Polyglot Node Server on Universal Devices ISY ############# ####### Used to create controller and single node class for TreatLife product to polyinterface # # This adds api and secert to custom parameters then polls Switches Most in test Node Se...
#!/usr/bin/env python import functools import io import json import os import subprocess import sys import urllib import urllib.parse import urllib.request from typing import Optional, Dict, List, Tuple import numpy as np from tqdm import tqdm sys.path.append("../..") from compute.phononweb.qephonon_qetools import (...
# -*- coding: utf-8 -*- from sklearn.neighbors import KNeighborsRegressor import numpy as np import pandas as pd def return_alike_axis(X,Y): idx = [x for x in X.index if x in Y.index] X = X.loc[idx] Y = Y.loc[idx] return (X,Y) def get_data(series, steps, forward = False): if forward: fb =...
''' Routines useful for wave physics computations, including CG-FFT, phase and magnitude correction for comparison of k-space (FDTD) and integral equation solvers, Green's functions, and a split-step solver. ''' # Copyright (c) 2015 <NAME>. All rights reserved. # Restrictions are listed in the LICENSE file distributed...
""" # Context Free Grammars In pure form, a context free grammar (CFG) consists of: * A set of terminal symbols, * A set of non-terminal symbols, disjoint from the terminals, * A set of production rules, each consisting of: * left-hand side (exactly one symbol) * right-hand side (ordered sequence of zero or mor...
#------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ # Standard import numpy as np import pandas as pd import cvxpy as cp from sklearn.preprocessing import PolynomialFeatures from statsmodels.tools.too...
# -*- coding: utf-8 -*- """ Created on Tue Jan 5 10:55:13 2021 @author: <NAME> """ import os import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import LightSource import numpy as np import progressbar as pgb from scipy import ndimage from scipy.interpolate import RectBivariateSpline from skima...
import argparse from urllib.request import urlopen import AdvancedHTMLParser from AdvancedHTMLParser import TagCollection import os import re import html import itertools def parseCommandLine(): parser = argparse.ArgumentParser() parser.add_argument('--java', help='Java version, for example default value: 8')...
''' Evaluation code for custom dataset in order to compute average precision etc. Code adapted from https://github.com/Kartik17/PointRCNN-Argoverse. ''' import argparse import collections import json import os import sys import pickle import matplotlib.pyplot as plt import numpy as np import numba import t...
# # Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list o...