text
stringlengths
6.04k
39.5k
# %% [markdown] # ## import os import time import colorcet as cc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from scipy.linalg import orthogonal_procrustes from tqdm import tqdm from graspy.cluster import GaussianCluster from graspy.embed import AdjacencySpectralEmbed ...
""" The MIT License (MIT) Copyright (c) 2021-Present AbstractUmbra 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, modif...
# -*- coding: utf-8 -*- from __future__ import with_statement import collections import glob import json import os import os.path import re import shutil import subprocess import sys import tempfile import unittest import warnings from six import PY3, StringIO, b, text_type from werkzeug.test import Client from werkz...
# ##### 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 3 # of the License, or (at your option) any later version. # # This program is distrib...
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ########################################################################################################### # # # Filter List Manager # A plugin for the Glyphs font editor # Copyright 2018 <NAME> # Apache License 2.0 # # ######...
# -*- coding: utf-8 -*- """ VAE <NAME>, NOVA FCT, MIEI <NAME> """ import sys sys.path.append("..") import data_access import tensorflow as tf from tensorflow.keras.layers import Dense,Reshape,Conv2D,Flatten,UpSampling2D,ReLU from tensorflow.keras.optimizers import Adam from sklearn.manifold import...
import os import inspect import pytest import sys from bluesky_queueserver.manager.profile_tools import ( global_user_namespace, load_devices_from_happi, set_re_worker_active, clear_re_worker_active, is_re_worker_active, ) from bluesky_queueserver.manager.profile_ops import load_profile_collection,...
# -*- coding: utf-8 -*- # @author: <NAME> # @date: 2020-11 ''' This file will help you get infomation you need from baidu map or amap by official API - Baidu: http://lbsyun.baidu.com/index.php?title=webapi - Amap: https://lbs.amap.com/api/webservice/summary Continuing updating..... ''' import osmnx as ...
""" ..class:: ProductTypeBox :synopsis: A subclass of QComboBox to define a desired product data type. Allows setting the QComboBox index via string. ..class:: SelectFiles :synopsis: Creates a PyQt widget that allows a user to define data file types with various PyQt tools. These data definitions ...
#!/usr/bin/env python # This is the priliminary control script that will talk # with the competition rostopics from __future__ import print_function import roslib roslib.load_manifest('enph353_gazebo') import sys import rospy import cv2 from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 UnitedStack Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
import json from random import random, randrange, choice import argparse import numpy as np from PIL import Image import shutil import os class Generator: def __init__(self, args): self.images_path = args.images_path self.output_path = args.output_path self.number_articles = a...
""" Demo for dearpygui_animate add-on https://github.com/mrtnRitter/DearPyGui_Animate """ from dearpygui.core import * from dearpygui.simple import * import dearpygui_animate as animate #----------------------------------------------------------------------------- # Render Callback #-------------...
"""This module implements methods to load dictonaries from text-based configuration files. """ # noqa: E501 import sys import os import io from os import PathLike import errno from pathlib import Path import yaml import toml import json from functools import partial from typing import Any, MutableMapping, Dict, Calla...
#!/usr/bin/env python from __future__ import print_function import pywren import boto3 import click import shutil import os import sys import json import zipfile import glob2 import io import time import botocore from pywren import ec2standalone @click.group() @click.option('--filename', default=pywren.wrenconfig.g...
""" Jaguar Landrover Component for In Control API Includes Sensor Devices and Services https://github.com/msp1974/homeassistant-jlrincontrol.git <EMAIL> """ import asyncio import json import logging from datetime import timedelta from functools import partial from typing import Optional from homeassistant.helpers im...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import json import math import string import collections import numpy as np from keras import backend from six.moves import xrange from nets.layers import BatchNormalization from keras import layers ...
#!/usr/bin/env python3 import libcalculus from libcalculus import ComplexFunction, RealFunction, Contour, integrate import numpy as np import scipy.misc, scipy.integrate import operator import argparse import pqdm.processes import multiprocessing as mp import requests import warnings class Tester: def run(self): ...
''' @Author: <NAME> https://github.com/lindawangg/COVID-Net/blob/master/create_COVIDx_v2.ipynb @Date: 2020-04-06 15:50:21 @ # Description: ''' import numpy as np import pandas as pd import os import random from shutil import copyfile import pydicom as dicom import cv2 from torch.utils.data import Dataset,DataLoader f...
import os import logging import boto3 import json import glob import time import subprocess import shutil from pathlib import Path from subprocess import PIPE, TimeoutExpired, CalledProcessError from botocore.exceptions import ClientError class Worker: # Initializer / Instance Attributes def __init__(self, envs): ...
#!/usr/bin/python #Budget Buddy (GUI Version) #A Money Management Tool try: import Tkinter as tk import tkFileDialog except: import tkinter as tk import tkinter.filedialog as tkFileDialog root = tk.Tk() root.title("Budget Buddy") root.geometry("510x636") root.option_add("*Font", "TkDefaultFont 9") ...
import os from ctypes import * if os.name == "nt": from ctypes.wintypes import * glfwdll = cdll.LoadLibrary(os.path.join(os.path.dirname(os.path.abspath(__file__)), "bin/glfw3.dll")) # Key and button state/action definitions RELEASE = 0 PRESS = 1 """ Keyboard raw key codes. These key codes are inspired by th...
""" Copyright (C) 2010 - 2013 TopCoder Inc., All Rights Reserved. This file contains claim type's detail info. @version 1.0 (Healthcare Fraud Prevention - Partner Database Appliance - Assembly) @author: zeadom, TCSASSEMBLER @since 2013-12-10 """ import os, sys sys.path.insert(0, os.path.dirname(os.path.abspath(__fil...
''' This module contains the program that runs the numerical experiments.''' from bayescg_k import bayescg_k from bayescg import bayescg, bayescg_post_cov from cgqs import cgqs from utilities import mv_normal import numpy as np from scipy import linalg from scipy.special import erfinv import matplotlib.pyplot as plt ...
from collections.abc import Generator from dataclasses import dataclass from enum import Enum from typing import Optional from pydantic import Field from .announcement import AnnouncementApi from ..forwarding import ForwardingApi, FeatureSelector from ..hg_and_cq import HGandCQ, Policy, Agent from ...base import to_c...
import torch from retriever import DualEncoder import argparse import numpy as np import os import random import torch.nn as nn from transformers import BertTokenizer, BertModel, AdamW, \ get_linear_schedule_with_warmup, get_constant_schedule from datetime import datetime import json from collections import Ordered...
# TODOs: # - verify doesn't work with incremental backups as not all files in the database # are available on the media # - uncompressible zpaq is handled by zpaq, precomp(especially gif) not yet. for uncompressible # gif even worse a defect file is left on the disc! # - gif-handling seems to be broken in precomp,...
# Copyright 2016 <NAME>, All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
from motor.motor_asyncio import AsyncIOMotorClient import psycopg2 import aiopg import hashlib import time import logging logger = logging.getLogger() async def create_storage(config, plugin_manager, loop): """Creates and initializes a storage object. Args: plugin_manager -- sarlacc plugin_manager ...
import os import csv import argparse import logging import json import time import torch import torch.nn.functional as F import numpy as np import pandas as pd import utils from utils import isNaN class NLIExample(object): '''used for training models with CQA data''' def __init__(self, ...
#!/usr/bin/env python # coding: utf-8 # In[ ]: # MIND # In[1]: from typing import Mapping, Union, Sequence, Any, Tuple import random import subprocess import os import pyspark from pyspark.sql import HiveContext, SparkSession import pyspark.sql.functions as F from pyspark.sql.window import Window from pyspark.sq...
import sys import util class Parser: def __init__(self): self.MONTHS = ('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec') self.page_parser_flag_count = 4 self.last_episode = None self.episode_offset = 0 self.postponed_set_episode_offset = Fa...
# ---------------------------------------------------------------------------- # Copyright (c) 2020, <NAME>. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------------------------...
# # Copyright (c) 2019-2020 Mike's Pub, see https://github.com/mikespub-org # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import logging import os.path import pickle import time import flask.json from flask import Flask, jsonify, request from flask.views import MethodView from ...
import warnings from sys import stderr import numpy as np from sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, ClassifierMixin from sklearn.cross_decomposition import PLSRegression from sklearn.metrics import accuracy_score, roc_auc_score, roc_curve, r2_score from sklearn.model_selection import KF...
# -*- coding: utf-8 -*- """ The seismic data class """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from ..core import core, io #, core3d, io # from ..core.pair import Pair # from ..core.window import Window # from . import eigval, rotcorr, transmin, si...
import numpy as np # set print option for numpy to print all int as hex np.set_printoptions(formatter={'int':hex}) def encrypt(plain_text, key, pdc='x', subByte = None, mix_const=None, RCon=None): if(subByte is None): sub_byte = np.array([[0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x...
# deepROC.py # # Copyright 2021 Ottawa Hospital Research Institute # # 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...
import torch import torch.nn as nn import numpy as np import os from sklearn.cluster import KMeans from sklearn.neighbors import KernelDensity from sklearn.preprocessing import MinMaxScaler from tqdm import tqdm from model.model import EncoderRNN, Transformation from utils.preprocess import MyDataset, get_sliding_data...
import re from enum import IntEnum from typing import Tuple, Optional from datetime import datetime, timedelta, timezone from flask import redirect, url_for, request, current_app, g, make_response from flask.views import MethodView from flask_smorest import Blueprint, abort from swpt_lib.utils import u64_to_i64 from sw...
""" Logging class that incorporates making file and console logs. The actions taken can be altered for different message types and level ranges. """ # from io import open from builtins import range from .py3 import textstring from datetime import datetime from . import dictionary, funcargparse from . import files as ...
import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection cache = dict() def load_wordnet(directory=None, recache=False): """Load the wordnet graph and wordnet categories used in [Huth et al 2012]. Parameters ---------- directory : str or None Direc...
__author__ = '<NAME>' import pygame import numpy as np from .game_objects import Sheep, Wolf, Fireplace class Card(pygame.Surface): # Some colors black = (0,0,0) white = (255,255,255) white2 = (244,244,244) grey = (130,130,130) grey2 = (230,230,230) dark = (51,51,51) dark2 = ...
from scipy.stats import itemfreq from sklearn.model_selection import StratifiedKFold from keras_utils.keras_utils import * from keras.utils.np_utils import to_categorical from keras.layers import Input, Embedding, Dense, GlobalAveragePooling1D, Flatten from keras.layers import add, multiply, LSTM, Bidirectiona...
"""redCrown MongoDB QueryBuilder This module contains the builder and query classes for usage with ``pymongo``. Example: Basic Usage (select/find queries):: import pymongo mongo = pymongo.MongoClient() db = mongo['db_foobar'] qb = Builder(collection=db['collection_foobar']) ...
import os import numpy as np import pandas as pd from datetime import datetime from data_management import * from et_models import * from gs_models import * lai_file = '/mnt/m/Original_data/FLUXNET/lai-combined-1/lai-combined-1-MCD15A3H-006-results.csv' sites_params = pd.read_csv( '../../DATA/EEGS/sel2_sites_params.cs...
import funcy import functools import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import shap from copy import deepcopy font = { "size": 30 } matplotlib.rc("font", **font) def plot_results_2x2(summaries, save_fpath, fformat="pdf", dpi=300): fig = plt...
# -*- coding: utf-8 -*- """ Created on Sun Jan 15 02:53:11 2017 @author: Karol """ import pygame, sys, math, random WINDOW_SIZE = 800, 600 MAX_ANGLE = math.radians(75) S_MENU = 0 S_PLAY = 1 S_LVLCMPL = 2 S_WIN = 3 S_GAMEOVER = 4 class Paddle: def __init__(self, image, height): self.image = image ...
# -------------------------------------------------------------------------- # Copyright 2014 Digital Sapphire Development Team # # 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://...
import os import json import numpy as np import pickle from airflow.operators.python import BranchPythonOperator from airflow.exceptions import AirflowSkipException from sdss_access import SDSSPath from ast import literal_eval from astra.database import astradb, session from astra.database.utils import create_task_out...
from PyQt5.QtWidgets import QFileDialog from scipy import signal import numpy as np from scipy.io import loadmat from matplotlib.pyplot import get_cmap from sklearn.metrics import confusion_matrix import seaborn as sns import os from torch import nn import torch import matplotlib.pyplot as plt from torchvisi...
""" This file adds batch-training support to the original tutorial. the model translates French to English """ import random import re import unicodedata import matplotlib.pyplot as plt import matplotlib.ticker as ticker import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F f...
import numpy as np import numpy.testing as npt import unittest import wisdem.floatingse.substructure as subs from wisdem.commonse import gravity as g NSECTIONS = 5 NPTS = 100 class TestSubs(unittest.TestCase): def setUp(self): self.inputs = {} self.outputs = {} self.resids = {} se...
import os from flask import Flask, render_template, jsonify, redirect, url_for, request from urlextract import URLExtract from googleapiclient.discovery import build from werkzeug.utils import secure_filename import re import textract as tt #----------------------| ASSIGNMENT |-------------------------------...
# Licensed under the terms of the BSD-3-Clause license. # Copyright (C) 2019 <NAME> # <EMAIL> # apollon/som/som.py # SelfOrganizingMap module # import numpy as _np import matplotlib.pyplot as _plt from scipy import stats as _stats from scipy.spatial import distance as _distance from apollon.io import save as _save f...
import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import gaussian_kde from sklearn.mixture import GaussianMixture from sklearn.model_selection import KFold # code adapted from https://github.com/dimonenka/DEDPUL def compute_log_likelihood(preds, kde, kde_outer_fun=lambda kde, x:...
# -*- coding: utf-8 -*- import os import time import argparse import json import copy import yaml import pandas as pd from tqdm import tqdm from sklearn.metrics import precision_recall_curve, roc_auc_score,\ average_precision_score def create_parser(): # SET THE PARAMETERS parser = argparse.ArgumentParser(...
from falcon_kit import run_support as support from pypeflow.simple_pwatcher_bridge import ( PypeLocalFile, makePypeLocalFile, fn, PypeTask, PypeProcWatcherWorkflow, MyFakePypeThreadTaskBase) from falcon_kit.FastaReader import FastaReader import glob import json import logging import os import pp...
from datetime import timedelta from django.db.models import signals from django.utils import timezone import factory import pytest from app.common.enums import AdminGroup, GroupType, MembershipType from app.content.factories import EventFactory from app.forms.enums import EventFormType from app.forms.tests.form_fact...
import os import shutil import config import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torchvision from classifier_models import PreActResNet18, ResNet18 from dataloader import get_dataloader from networks.models import Generator, NetC_MNIST f...
# -*- coding: utf-8 -*- """ Created on Thu Mar 26 22:55:37 2020 @author: <NAME> <EMAIL> Data and Model from: A conceptual model for the coronavirus disease 2019 (COVID-19) outbreak in Wuhan, China with individual reaction and governmental action DOI:https://doi.org/10.1016/j.ijid.2020.02.058 https://ww...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # Modified by <NAME> # ------------------------------------------------------------------------------ from __future__ import absolute_import from __...
import os import sys import warnings import importlib import inspect import os.path as osp import numpy as np import tensorflow as tf from tensorflow.keras.utils import Sequence from tensorflow.python.keras import callbacks as callbacks_module from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint from ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # """RAMSES RF - a RAMSES-II protocol decoder & analyser. Construct a command (packet that is to be sent). """ import asyncio import logging import struct import zlib from datetime import timedelta as td from typing import Optional, Tuple import voluptuous as vol from ...
""" copy of the famous snake game written in python SOURCES / CREDITS: Fonts: -CamingoCode-Regular.ttf (Creative Commons Attribution - No Derivative Works 3.0 Unported, https://creativecommons.org/licenses/by-nd/3.0/) by <NAME> published on https://www.fontsquirrel.com/fonts/camingocode (last visited: 20. N...
import discord from discord import SlashCommandGroup, option, Option, ApplicationContext, slash_command from discord.ext import commands, tasks from typing import List, Union, Any, Optional import os from extra import utils from extra.view import GiveawayView from extra.prompt.menu import ConfirmButton from extra.misc...
#you should home this program using the standard PI homing program on buffer 8 #look at page 262 of ACS programing C book for Input (airlock) checking # import SimpleITK as sitk #used for image saving and manipulation #this is dumb import dxchange as dx import numpy as np # import MMCorePy import time from datetime im...
"""Sync worker to update Blazar from Doni.""" from datetime import datetime from re import I from textwrap import shorten from typing import TYPE_CHECKING from dateutil.parser import parse from keystoneauth1 import exceptions as kaexception from oslo_log import log from pytz import UTC from doni.common import args, e...
#!/usr/bin/env python import os import shlex import shutil from shutil import copy2 from requests import get from argparse import ArgumentParser PROPER_HEADER_FIELD = 'TT_TEAMLIST_TRAINING_5_CD' SNOWFLAKE_HEADER_FIELD = 'TT_TEAMLIST_TRAINING_5_STEAM' PROPER_TITLE_FIELD = 'TRAINING_COMBO_ENTRIES_5_CD' SNOWFLAKE...
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Train a new model on one or across multiple GPUs. """ import collections import math import random import os imp...
################################# # This script performs the data loading, data preparation and feature enginnering. # It takes two arguments: # 1. The configuration file which contains the Azure # storage account name, key and data source location. # By default, it is "./Config/storageconfig.json" # 2. a DEBUG...
# Importing stock libraries import json from typing import List import pickle import math import numpy as np import pandas as pd import torch from torch.cuda import device import torch.nn as nn from torch.nn import parallel import wandb # Importing the T5 modules from huggingface/transformers from transformers impor...
from torch.utils.data import DataLoader from modules.data import tokenization import torch import pandas as pd import numpy as np from tqdm import tqdm from modules.utils import read_json, save_json import logging import os from modules.utils import if_none class InputFeatures(object): """A single set of features...
import pickle from flashtext import KeywordProcessor import pandas as pd import re import sentencepiece as spm from unidecode import unidecode import numpy as np from nltk.tokenize import RegexpTokenizer import unicodedata from flair.embeddings import BertTokenizer import signal from contextlib import contextmanager ...
# -*- coding: utf-8 -*- import numpy as np from polyline.codec import PolylineCodec from polyline import encode as polyline_encode from pandas import DataFrame from . import RequestConfig try: from urllib.request import urlopen, Request from urllib.parse import quote except: from urllib2 import urlopen, Re...
from __future__ import division import io import os import logging from math import ceil import numpy as np from sklearn.utils import Bunch from keras.models import Sequential, Model from keras.layers import (Conv2D, Dropout, Input, concatenate, MaxPooling2D, Conv2DTranspose, UpSampling2D) ...
# subtitler.py # <NAME> # Tue Apr 28 19:50:37 PDT 2020 import argparse import base64 import json import math import os import subprocess import sys import time from typing import (Any, Dict, IO, List, Optional, Tuple) import urllib.parse try: import spleeter except ImportError: spleeter = None from align_lyrics ...
"""Please Not Another Compiler Compiler -- LR parser generator library. """ from collections import namedtuple from operator import methodcaller from functools import partial import sys import re _str_type = globals().get("basestring", str) def identity(x): """Identity functions, useful as semantic action for ru...
# 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, software # distributed under the...
try: import numpy as np import networkx as nx from hmm_profile import reader from hmm_profile.models import HMM import time except ImportError: print('[Error] Seems you do not have the required python packages. Please check it.') # python modules from math import log from typing import List, Di...
######################################################################## ######################################################################## ### THIS PROGRAM WAS MADE BY DEATHHACKZ ### ### YOU ARE FREE TO MODIFY THIS IN ANY WAY WHATSOEVER, AS LONG ### ### AS YOU CLEARLY STATE T...
""" Module with various utilities """ import os import logging import collections import numpy as np import cv2 class Annotation: """ A simple class for bundling bounding box and category of an object """ def __init__(self, bounding_box, label=None, category_id=None): self.bounding_box = t...
#!/usr/local/bin/python # coding: latin-1 # Version 5.0 import selenium import time import random import threading import queue import subprocess as s from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui...
# encoding: utf-8 # Copyright (c) 2017-2019, <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: # # * Redistributions of source code must retain the above copyright # notice, this list of co...
# You should first load the snapshots and define two new keys: # one is the 'delta' which is rho/rho_M # and the other is 'coords' which is the coordinates of the particles in the 3D simulation grid # This module takes care of the data preparation: it generates the DataGenerator used in the model. import numpy as np ...
import sys import math import json import pygame from modules.map import Map EVAL_MODE = False pixel_constant = 50 display_width = 0 display_height = 0 COLORS = { 'black': (0, 0, 0), 'white': (255, 255, 255), 'gray': (127, 127, 127), 'red': (255, 0, 0), 'blue': (0, 0, 255), 'green': (0, 255, ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import gzip import hashlib from collections import OrderedDict # For serializing we (try) to import some modules: IS_ORJSON=False try: import orjson as JSON IS_ORJSON=True # orjson is much faster then standard json but m...
""" Test perforce module for managing workspaces """ from contextlib import closing, contextmanager from functools import partial from threading import Thread import os import shutil import socket import subprocess import tempfile import time import zipfile import pytest from perforce import P4Repo def find_free_port...
''' Adding some new features.. Combining categorical features. ''' import os import json import numpy as np import pandas as pd from pandas.io.json import json_normalize import time from datetime import datetime import gc import psutil from sklearn.preprocessing import LabelEncoder PATH="../input/" NUM_ROUNDS = 20000...
import functools import inspect import logging import typing from typing import Any, Optional, Type from dbnd._core.configuration.environ_config import get_dbnd_project_config from dbnd._core.current import current_task_run, get_databand_run, try_get_current_task from dbnd._core.errors import show_exc_info from dbnd....
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2018 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify...
""" This module contains DC related optimization algorithms """ import cvxpy import numpy import cmath def sample_spherical(dim): vec = numpy.random.randn(dim) vec /= numpy.linalg.norm(vec) return vec def rand_a(pre_aa): # unsatisfied dim = numpy.linalg.matrix_rank(pre_aa) sup_vec = sample_s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Rules for validating whether a conversational Finnish word # can be a reduced form of a standard Finnish word. def is_uoa(ch): return ch in ("u", "o", "a") def is_ie(ch): return ch in ("i", "e") def is_yoa(ch): return ch in ("y", "รถ", "รค") def is_vowel(ch): ret...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import os import json import shutil from crds.bestrefs import BestrefsScript from crds.tests import test_config """ Bestrefs has a number of command line parameters which make it operate in different modes. ...
from __future__ import annotations import random from abc import ABC, abstractmethod from dataclasses import field, dataclass from functools import cached_property from itertools import groupby, zip_longest from typing import Iterable, Any, Literal, Callable from turing_complete_interface.circuit_compiler import Pos ...
""" This module executes the Flask application. """ import sqlite3 from sqlite3 import Error from flask import Flask, render_template, json, request, session from flask_session import Session from werkzeug.security import generate_password_hash, check_password_hash from sqlite3 import Error from db_init import create...
# Copyright (C) 2016 Ion Torrent Systems, Inc. All Rights Reserved # Custom Tastypie APIs to support the TS Mesh # Wiki page @ https://confluence.amer.thermo.com/x/SwnCBQ import requests import multiprocessing import datetime import json import logging from tastypie.resources import ModelResource, Resource from tasty...
import sys _, test_set, figure_path = sys.argv class_count = 18 experiments_count = 11 max_threshold = 3 threshold_multiplier = max_threshold/(experiments_count-1) algorithms = { 'AWE': { 'tf_model':None, 'concat_target_definitions':True, 'with_semantic_shifting':True, 'with_topic_scaling':False, 'with_docu...
from __future__ import print_function from builtins import bytes # For python2/3 compatibility from serial import Serial from construct import Struct, Const, Int8ul, Int16ul, Int16sl, Int32ul, Int32sl import struct import time import traceback MSP_SERIAL_BAUD = 115200 MSP_SERIAL_TIMEOUT = 5 # Message IDs (commands)...
# This file is part of the NESi software. # # Copyright (c) 2020 # Original Software Design by <NAME> <https://github.com/etingof>. # # Software adapted by inexio <https://github.com/inexio>. # - <NAME> <https://github.com/unkn0wn-user> # - <NAME> <https://github.com/Connyko65> # - <NAME> <https://github.com/Dinker1996...