text stringlengths 3.07k 22.1k |
|---|
from sksurv import metrics, util
from lifelines import KaplanMeierFitter, CoxPHFitter
from sklearn.metrics import auc
import pandas as pd
import numpy as np
from tqdm import tqdm
def survival_diff_metric(metric, outcomes, treatment_indicator,
weights=None, horizon=None, interpolate=True,
... |
#!/usr/bin/env python
#coding=utf-8
"""TreeMaker"""
__author__ = '<NAME> <<EMAIL>>'
__copyright__ = 'Copyright (c) 2018 <NAME>'
__license__ = 'New-style BSD'
import os
import re
import sys
import codecs
import argparse
from functools import total_ordering
VERSION = "1.4"
NEXUS_TEMPLATE = """#NEXUS
begin trees;
t... |
import numpy as np
from scipy.io import wavfile
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15
from Crypto.Hash import SHA256
from Crypto.Util.Padding import pad, unpad
from Crypto.Util.strxor import strxor
import random
import struct
from reedsolo import RSCodec
im... |
import sqlite3
from scripts import Warnings, Constants, Log, Parameters
"""
Tables:
- Users
+ ID: self id #
+ Name: name
+ Password: password
+ Permission: permission level (0 = basic user, 1 = admin)
+ ID_Models: access to which models
+ ID_Datasets: access to which datasets
- Models
~ Ge... |
from pathlib import Path, PosixPath
from pygraphviz import AGraph
YFM_KEY = 'yfm'
ID_KEY = 'id'
NAME_KEY = 'name'
SECTIONS_KEY = 'sections'
TITLE_KEY = 'title'
REL_KEY = 'relates'
REL_TYPE_KEY = 'type'
REL_ID_KEY = 'id'
REL_PATH_KEY = 'path'
GV_KEY = 'gv_attributes'
class DublicateSectionID(Exception):
pass
cl... |
#!/usr/bin/env python3
# Copyright 2018 The GraphicsFuzz Project 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
from datetime import datetime, date, timedelta, time
from django.utils.safestring import mark_safe
from djaveDT import tz_dt_to_str, time_to_time_str, d_to_str, tz_dt_to_tz_dt
from djmoney.money import Money
class CellContent(object):
def as_html(self):
raise NotImplementedError('as_html')
def as_csv(self):... |
import argparse # parsing command line arguments
import importlib # dynamically importing modules
import random # randint
import time # delay & timing
from math import sqrt
from operator import add, attrgetter
import copy
import sys # to exit and append to path
sys.path.append('../utils')
sys.path.append('../functions... |
import json
import os
import re
import hashlib
import threading
from File.file import File
from Performance import recoder
from .operate import Operate
from .task import *
import GPUtil
import tensorflow as tf
import psutil
# noinspection PyTypeChecker
class Distributor:
def __init__(self, modelConfig, adb_path,... |
# -*- coding: utf-8 -*-
# This code is a part of BELA package: https://github.com/letuananh/bela
# :developer: <NAME> <<EMAIL>>
# :license: MIT, see LICENSE for more details.
"""
BELA version 1.x convention
"""
from collections import defaultdict as dd
from collections import OrderedDict
from chirptext import chio
... |
"""
A collection of properties and their measurements.
"""
from __future__ import annotations
import os
import time
import json
from itertools import groupby, combinations
from typing import List, Dict, Iterable, Any
from ..property import Property
from ..measurement.validation import ValidationResult
from .._privat... |
# Copyright 2019 Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
"""
@project : Queens College CSCI 365/765 Computational Finance
@Instructor : Dr. <NAME>
@Group Name : Group 7
@Student Name : <NAME>
<NAME>
<NAME>
@Date : Fall 2021
A Bond Calculator Class
"""
import math
import pandas as pd
import numpy ... |
# ERCOT imports
import json
import time
import logging
from bs4 import BeautifulSoup
import requests
import boto
from apscheduler.schedulers.blocking import BlockingScheduler
# Non-overlapping MISO imports, overlapping commented out
# import json
import datetime
# import time
# import logging
# import requests
# imp... |
import copy
import sys
sys.path.append('/home/xuchengjun/ZXin/smap')
import cv2
import json
import numpy as np
import os.path as osp
import torch
from torch.utils.data import Dataset
import random
from path import Path
from dataset.ImageAugmentation import (aug_croppad, aug_croppad_for_test, aug_flip, aug_rotate)
from ... |
#!/usr/bin/env
u"""
calc_gz.py
by <NAME> (12/2020)
Calculate the width of the grounding zone by drawing an intersecting
line in the direction of flow based on the velocity field
"""
from logging import warn
import os
import sys
import getopt
import pathlib
import random
import numpy as np
import geopandas as gpd
impo... |
#!env python
# -*- coding: utf-8 -*-
import argparse
import base64
import collections
import logging
import math
import multiprocessing
import os
import queue
import shlex
import socket
import subprocess
import sys
import tempfile
import time
from contextlib import closing
from multiprocessing import Queue
from multip... |
import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QAction, QFileDialog, QDesktopWidget, \
QWidget, QHBoxLayout, QTextEdit, QDialog, QLabel, QInputDialog, QLineEdit
from PyQt5.QtGui import QIcon, QPalette, QColor, QFont, QTextCursor, QTextCharFormat
from PyQt5.QtCore import Qt
# Returns palette se... |
"""
Common PyTorch Utilities
author: <NAME>
"""
import torch
from torch.nn import init
from torch.autograd import Variable
import torch.autograd as autograd
import numpy as np
USE_GPU = torch.cuda.is_available()
def safe_cuda(x):
if USE_GPU:
return x.cuda()
return x
def batch_to_cuda(batch, exclu... |
"""
Contains classes Tanner_graph and QC_tanner_graph.
"""
import matplotlib.pyplot as plt
import numpy as np
class Tanner_graph:
"""
Sparse implementation of a tanner graph with dimensions m x n
Check nodes are stored in self.nodes[0:n_cn] and variable nodes are stored
in self.nodes[n_cn:n_node... |
#!/usr/bin/python3
import os
import sys
import json
import websocket
import time
import datetime
from tkinter import *
from PIL import ImageTk, Image
from threading import Thread
from textwrap3 import wrap
from ..database.datalocal import *
from ..database.database import *
class ChatSocket_C:
def _... |
#!/usr/bin/env python
###############################################################################
# Copyright (c) 2011-2013, Pacific Biosciences of California, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followi... |
import os
from matchbox import models
from matchbox.database import db_initialization
db_initialization(os.environ['FIRESTORE'])
print("Test Model.")
class Class(models.Model):
name = models.TextField()
active = models.BooleanField(column_name='is_active')
list_f = models.ListField(blank=True)
map_... |
import csv
import datetime
import lzma
import os
from itertools import chain, islice
from lxml import html
import grequests
import requests
CAMARA_URL = (
'http://www2.camara.leg.br/transparencia/recursos-humanos/'
'quadro-remuneratorio/consulta-secretarios-parlamentares/'
'layouts_transpar_quadroremuner_... |
"""
"""
## python imports
from random import randint
## source.python imports
from effects.base import TempEntity
from engines.precache import Model
from engines.sound import StreamSound
from entities.entity import Entity
from listeners.tick import Delay
from mathlib import Vector
## warcraft.package imports
fro... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2021, <NAME> (<EMAIL>)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ... |
#!/usr/bin/env python
# coding: utf-8
# # Porting genome scale metabolic models for metabolomics
#
# **Human-GEM as default human model, for better compatibility**
# https://github.com/SysBioChalmers/Human-GEM
#
# **Use cobra to parse SBML models whereas applicable**
#
# Not all models comply with the formats in co... |
import copy
import numpy as np
from deap import tools
import math
class ReferencePoint(list):
'''A reference point exists in objective space an has a set of individuals
associated to it.'''
def __init__(self, *args):
list.__init__(self, *args)
self.associations_count = 0
self.associ... |
from math import ceil
import re
from pip._internal.cli.cmdoptions import pre
values = {
"TUN_METADATA_TOT_OPT_SIZE": 256,
"FLOW_MAX_VLAN_HEADERS" : 2,
"FLOW_N_REGS": 16,
"ROUND_UP(FLOW_MAX_MPLS_LABELS, 2)": int(ceil(3 / 2))
}
# typename: (size, be)
sizes = {
"ovs_u128": (16, False),
"in6_add... |
from typing import Optional, Sequence
import tensorflow as tf
from fv3fit.emulation.thermobasis.thermo import (
RelativeHumidityBasis,
ThermoBasis,
SpecificHumidityBasis,
)
from fv3fit.emulation.layers.normalization import (
StandardNormLayer,
StandardDenormLayer,
)
from fv3fit.emulation.thermobasi... |
import asyncio
import json
import os
import string
from os.path import dirname, join
from typing import List, Optional
import asyncpg
import traceback2
from dotenv import load_dotenv
from tqdm import tqdm
load_dotenv(verbose=True)
load_dotenv(join(dirname(__file__), '.env'))
# 36進数用の文字列
numbers = "0123456789"
alphab... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
import scipy
import numpy as np
f... |
import os
import sys
import json
from datetime import datetime
from .SoftwareHttp import *
from .blake2 import BLAKE2b
from .SoftwareUtil import *
from .CommonUtil import *
# Add vendor directory to module search path
# This needs to be here to load the snowplow_tracker library
vendor_dir = os.path.abspath(os.path.join... |
from imports.Processes import *
from imports.Rop_File_Intake import *
from imports.Graphing_functions import *
from imports.ROP_Counting_Functions import *
from imports.Count_Side_Effects import *
import ropgadget
import os.path
from os import system, getcwd, chdir
import sys
import re
from textwrap import ... |
##
# Copyright : Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File : modelLib.py
#
# Purpose: Library of simple building blocks in Mosek Optimizer API.
##
import mosek
inf = 0.0
# Add new constraints and return the index of the first one
def msk_newcon(task, num):
c = task.getnumcon()
ta... |
import math
from copy import deepcopy
from itertools import product
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels.api as sm
import tensorflow as tf
from statslib.utils.common import to_namedtuple
class DesignMatrix:
def __init__(self, y=None, X=N... |
"""DataArray provides a thin wrapper around multidimensional arrays and metadata
"""
from logging import getLogger
import numpy as np # type: ignore
from smif.exception import SmifDataError, SmifDataMismatchError
from smif.metadata.spec import Spec
# Import pandas, xarray if available (optional dependencies)
try:
... |
"""
README
This script stores the rho and U data of all particles in all clusters and
calculates the the unit and number for scaling these properties.
See the function calculate_unit_and_scaling() for how the units and numbers are calculated.
"""
import sys
sys.path.insert(1, '/data/s2675544/git/neural_deprojection/'... |
# logit_classify.py
# This code snippet came from sklearn_classifier.py in the andarlib_service project
from __future__ import print_function
from __future__ import division
import pickle
import numpy as np
#import numpy.linalg as linalg
import sklearn.linear_model
def get_classifier_info(classifier):
'''
... |
# Copyright 2020 Cloudbase Solutions Srl
#
# 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 l... |
from __future__ import division
import numpy as np
from numpy import atleast_2d, asanyarray, dot, empty, hstack, vstack, zeros
from numpy.linalg import LinAlgError
from numpy.core import double, intp, Inf
import copy
###############################################################################
__version__ = "0.0.5"
... |
from __future__ import division
import posixpath
from collections import defaultdict
import numpy as np
from satmeta.s2 import meta as s2meta
from satmeta.s2 import utils as s2utils
from satmeta import utils
from satmeta import converters
ANGLES_TAGS = {
'Viewing_Incidence': (
'Viewing_Incidence_... |
from prophyc import model
from prophyc.generators.base import GenerateError, GeneratorBase, TranslatorBase
primitive_types = {
'u8': 'uint8_t',
'u16': 'uint16_t',
'u32': 'uint32_t',
'u64': 'uint64_t',
'i8': 'int8_t',
'i16': 'int16_t',
'i32': 'int32_t',
'i64': 'int64_t',
'r32': 'floa... |
from logging import error
import iptc
import socket
import threading
import ipaddress
from src.logger import logger
# here's the idea. create hpotter chains that mirror the three builtins. add
# drop rules at the end of the hpotter chains. insert a target of each of
# the hpotter chains at the beginning of the builti... |
# Inspired from code from https://github.com/yhu01/PT-MAP. It has been modified.
import collections
import pickle
import random
import numpy as np
import matplotlib.pyplot as plt
import torch
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
impor... |
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import dash_table
from datetime import datetime as dt
import pandas as pd
import numpy as np
from dataclasses import dataclass
import uuid
import plotly.express as px
from copy import copy
... |
"""
This module contains a virtual set of hardware controllers used for simulation and testing only
todo: Need to have all of the controller.py modules follow the same convention and be consistent especially input data
"""
from time import time, sleep
from router import *
from random import randrange, getrandbits
c... |
import argparse
import multiprocessing
import glob
import glymur
import os
import numpy as np
import tifffile
from blockfs import Directory
from precomputed_tif.blockfs_stack import BlockfsStack
from precomputed_tif.ngff_stack import NGFFStack
from pystripe.core import filter_streaks, correct_lightsheet
from pystripe.... |
from __future__ import absolute_import
# development system imports
import os
import random
from django.contrib.auth.models import AbstractUser
from django.contrib.humanize.templatetags import humanize
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueVal... |
import six
import wx
import wx.lib.agw.aui as aui
import wx.py.dispatcher as dp
class AuiManagerPlus(aui.AuiManager):
def __init__(self, managed_window=None, agwFlags=None):
aui.AuiManager.__init__(self,
managed_window=managed_window,
agwFlag... |
from modules import *
import time
import random
import numpy as np
class SSE():
""" Create a SSE class assuming we know indices for each class"""
def __init__(self, idx_img_class, idx_txt_class, sse_prob_img, sse_prob_txt,
rho_img, rho_txt, num_img, num_txt):
self.idx_img_class = [list... |
#!/usr/bin/python3
import argparse
import inspect
import json
import os
import requests
import tweepy
from typing import Dict, Any, List, Tuple
from app.instagram import Instagram
from app.twitter import Twitter, TweetMedia, TwitterUser
TEST_USER_ID: str = 'TwicrawlerT'
TEST_TWEET_COUNT = 200
JSON_DIR = f'{os.path.... |
from functools import partial
from collections import namedtuple
from copy import copy
from urllib.parse import urlparse, urljoin
from pulsar import OneTime, isawaitable, create_future, PulsarException
from pulsar.apps.ws import WebSocketProtocol, WS
from pulsar.utils.httpurl import REDIRECT_CODES, requote_uri, Simple... |
import copy
import logging
import numpy as np
import operator
import torch.utils.data
import json
from detectron2.utils.comm import get_world_size
from detectron2.data import samplers
from torch.utils.data.sampler import BatchSampler, Sampler
from detectron2.data.common import AspectRatioGroupedDataset, DatasetFromLis... |
import tensorflow as tf
import tensorflow_ranking as tfr
import os
#tf.enable_eager_execution()
#tf.executing_eagerly()
tf.logging.set_verbosity(tf.logging.DEBUG)
# Store the paths to files containing training and test instances.
# As noted above, we will assume the data is in the LibSVM format
# and that the content... |
"""Job module."""
import logging
import os
import time
from contextlib import nullcontext, suppress
from dataclasses import dataclass, field
from datetime import datetime, timedelta
from salmagundi.utils import ensure_single_instance, AlreadyRunning
from .const import ExitCodes, FileTags
from .exceptions import (Con... |
from tqdm import tqdm
from torch.utils.data import Dataset
from pytorch_pretrained_bert.tokenization import BertTokenizer
import unicodedata, random
import numpy as np
class MyBertTokenizer(BertTokenizer):
"""Runs end-to-end tokenization: punctuation splitting + wordpiece"""
def tokenize(self, text):
... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from gensim.models import KeyedVectors
from models import TripletNet, SimpleEmbedding
device = 'cuda:0' if torch.cuda.is_available() else 'cpu... |
################################################
# BASE DE BOT IRC PAR DUMBER POUR CHATTEURS.FR #
# Code sans licence, seule demande, de laisser #
# Ce commentaire dans tout bot contenant cette #
# Base, et d'en concerver la version. #
################################################
import socket
import sy... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2020 -- <NAME>
# All rights reserved.
#
# License: BSD License
#
"""\
Tests against the colors module.
"""
from __future__ import absolute_import, unicode_literals
import pytest
from segno import writers as colors
def test_illegal():
with pytest.raises(ValueError):... |
from captcha.image import ImageCaptcha
import sys
import os
import random
import time
import shutil
import tensorflow as tf
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
captcha_chars = ['0','1','2','3','4','5','6','7','8','9']
image_path = 'images/'
test_path = 'test/'
model_path = 'model... |
import torch
import torch.nn as nn
import models
import train_configs
from torch.utils.data import Dataset, DataLoader
from load_data_npy import filmDataset
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from cal_times import CallingCounter
import time
import os
import metrics
import numpy as n... |
#!/usr/bin/python
import csv
import subprocess
import requests
import os
import platform
LEVEL_ONE_SPELLS = os.path.join(
os.path.dirname(__file__), "Item Lists", "LevelOneSpells.csv"
)
OVERSIZED_ITEMS = os.path.join(os.path.dirname(__file__), "Item Lists", "Oversized.txt")
TINY_ITEMS = os.path.join(os.path.dir... |
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import GraphConv, SAGEConv, GINConv
from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling
from torch import optim
import numpy as np
dir_path = os.path.dirname(os.path.realpath(__file__))
parent_path = os.path... |
"""
Describes subdomains of a scaffold with attached names and terms.
"""
from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.field import Field, FieldGroup
from opencmiss.zinc.result import RESULT_OK
from scaffoldmaker.utils.zinc_utils import group_get_highest_dimension, \
identifier_ranges... |
from __future__ import absolute_import, division, print_function
import os
import numpy as np
from copy import deepcopy
import torch
from utils.scheduler import setup_scheduler
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
de... |
"""
A simple music bot in Python using disnake-ext-music library
"""
import disnake
import argparse
import asyncio
import os
import youtube_dl
from typing import Any, Dict, Tuple, Union
from youtube_search_requests import AsyncYoutubeSearch, AsyncYoutubeSession
from disnake.ext import commands
from disnake.ext.music.v... |
import numpy
import numpy.typing
import typing
import scipy.stats
from hphmm.model import (CSRMatrix, make_csr_matrix_from_dense)
class Model(typing.NamedTuple):
n: int # number of states
transition_matrix: CSRMatrix # shape (n, n) compressed sparse row
signal_matrix: numpy.typing.NDArray[numpy.float64] ... |
import random
import ssl
import string
import time
import urllib
import urllib2
from datetime import datetime, timedelta
from flask import Flask, render_template, request, json, session as flask_sesion, abort, make_response
app = Flask(__name__)
oauth_server = "https://localhost:8443"
authorize_uri = "/authorize"
to... |
"""A suite of tests for the spectrum.py module"""
import unittest
import copy
from pkg_resources import resource_filename
import numpy as np
import astropy.units as q
from svo_filters import Filter
from sedkit import modelgrid as mg
from sedkit import spectrum as sp
from sedkit import utilities as u
class TestSpect... |
from abc import ABC, abstractmethod
from enum import Enum
from typing import Any
from ts_jsonrpc.jsonrpc.jsonrpc.JsonRpcMessages import Request, Response, Notification, make_response, BatchRequest
class ConfigCommandType(Enum):
DEFAULTS = 1
DESCRIBE = 2
DIFF = 3
GET = 4
MATCH = 5
RELOAD = 6
... |
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import datetime as dt
from os.path import isfile
from sqlalchemy import create_engine
import psycopg2
import os
def main():
csv_check = st.sidebar.checkbox('Use your csv files')
if csv_check:
if ... |
import math
import os
import os.path
import pathlib
max_processes = 16
get_default_args = lambda: [
"configs/akeley/cache-se.py",
"--cpu-type=DerivO3CPU",
"--mem-type=DDR3_1600_8x8",
"--caches",
"--cpu-clock=4.0GHz",
"--l1i_size=16kB",
"--l1i_assoc=2",
"--l1d_size=64kB",
"--l1d_ass... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 18:20:38 2018
@author: <NAME> <<EMAIL>>
"""
import h5py, os
from numpy import where, isin, nan, arange, ones, isnan, isfinite, ndarray
from numpy import array, mean, unique, hstack, vstack, ma, meshgrid, linspace
from datetime import datetime, t... |
import argparse, keras, os, sys
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import matplotlib.pyplot as plt
import numpy as np
import segmentation_models as sm
from azureml.core import Model, Run
print("In score.py")
parser = argparse.ArgumentParser("score")
parser.add_argument("--input_data", type=str, help="input ... |
import argparse
import os
from uuid import uuid4
try:
from .conversion import SIMPLE_CONVERSION, PSEUDOKNOT_CONVERSION
from .common import parse_file, convert_to_file_data
from .fix_pseudoknots import \
representation_to_structure, structure_to_representation
except (SystemError, ImportError):
f... |
'''
Run this to get html files
This file contains code to obtain html data from oslo bors and yahoo finance
'''
import argparse
import re
import threading
import time
from pprint import pprint
from typing import List
import sys
import pathlib
import os
import numpy as np
import pandas as pd
import pypatconsole as ppc... |
# -*- coding: utf-8 -*-
# MIT License
# Copyright (c) 2018-2020 Renondedju
# 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 rig... |
#@+leo-ver=5-thin
#@+node:ekr.20170428084207.536: * @file ../external/npyscreen/wgcheckbox.py
#!/usr/bin/python
#@+others
#@+node:ekr.20170428084207.537: ** Declarations
from .wgtextbox import Textfield
from .wgwidget import Widget
#from .wgmultiline import MultiLine
from . import wgwidget as widget
import curses... |
import unittest
import coremltools
import onnxmltools
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, Conv2DTranspose, \
Dot, Embedding, BatchNormalization, GRU, Activation, PReLU, LeakyReLU, ThresholdedReLU, Maximum, \
... |
# Copyright 2021 ETH Zurich, Media Technology Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 29 21:07:40 2018
@author: user
"""
import matplotlib.pyplot as plt
import learning_singleNeuron as learn
import singleNeuron as sN
import numpy as np
import math
arrowMod = 0.8
path_fig = '../figures/'
def plot_membrane_potentials(membrane_potentials, repetitions,
... |
# -*- coding: utf-8 -*-
import abc
from collections import namedtuple
__all__ = ['Or', 'And', 'Q', 'JOIN', 'F']
NOT_A_VALUE = object()
class Evaluable(object):
"""Evaluable interface class. Just indicate that class has .eval() method
"""
@abc.abstractmethod
def eval(self):
"""This method ... |
from model import *
from dataset import *
from common import *
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
#from train import valid_augment
def valid_augment(image, mask, infor):
mask = cv2.resize(mask, dsize=None, fx=1 /
LOGIT_TO_IMAGE_SCALE, fy=1/LOGIT_TO_IMAGE_SCALE)
return i... |
#!/usr/bin/env python
"""
ththmod.py
----------------------------------
Code for handling theta-theta transformation by <NAME>
"""
import numpy as np
import astropy.units as u
from scipy.sparse.linalg import eigsh
def chi_par(x, A, x0, C):
"""
Parabola for fitting to chisq curve.
"""
return A*(x - x... |
import glob
import os
import math
from datetime import datetime
import random
import logging
from collections import OrderedDict
import natsort
import numpy as np
import cv2
import torch
import yaml
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
... |
"""
Working as of 24/12/19 (commit <PASSWORD>)
"""
import re
import subprocess
from shutil import copy
from pathlib import Path
from os.path import basename
from operator import itemgetter
from json import loads as json_loads
from reset import parse_database_url
from hoconutil import replace_hocon_value
from steputi... |
"""Classes for building networked RIL servers and clients.
.. versionadded:: 0.9
"""
from .robotinterface import RobotInterfaceBase
from .robotinterfaceutils import _RobotInterfaceState,_RobotInterfaceStructure,_RobotInterfaceSettings,_RobotInterfaceCommand,_RobotInterfaceStatefulBase,_RobotInterfaceStatefulWrapper
f... |
# coding=utf-8
"""
author: <NAME>
"""
import pandas as pd
import numpy as np
from datetime import timedelta
from dateutil.relativedelta import relativedelta
import bee_data_cleaning as dc
# haig de buscar el device a reemplazar i per les dates a eliminar les haig de posar a 0
# i haig de extendre les dades (ojo si ... |
# test_runner.py vi:ts=4:sw=4:expandtab:
#
# Copyright (c) 2008 Three Rings Design, 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... |
import face_recognition
import cv2
import time
import boto3
from botocore.exceptions import ClientError
from botocore.vendored import requests
import logging
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
AWS_REGION = "us-east-1"
# if num_stranger > 0, use the message
def sesMessage(nameToPic, namesGot, hasVisi... |
"""
For searching text in a pdf file.
"""
import logging
import fitz
from helper import pdfrw_quadpoint_to_fitz_rect
_LOGGER = logging.getLogger()
TOKENS_MIN_LENGTH = 2
SAME_LINE_TOL = 1.5
class TextNotFoundException(Exception):
"""Exception for text not found in pdf."""
pass
class MultipleInstancesExceptio... |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
#!/bin/python3
"""
Treap with Implicit Keys
"""
# import math
# from random import Random
from random import random
class Treap:
def __init__(self, val: int):
# global R
self.val = val
# self.priority = R.random()
self.priority = random()
self.cnt = 1
self.minimu... |
"""
"""
from math import isclose
from numpy import power, sum, array
from iminuit import Minuit
from os.path import join
from modelmiezelb.utils.helpers import minuit_to_dict, format_param_dict_for_logger, format_sqt_lines_for_logger
from modelmiezelb.utils.util import MIEZE_DeltaFreq_from_time
####################... |
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.ticker import FormatStrFormatter, LogLocator
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.stats import chi2
import tensorflow as tf
def plot_3d_surface(
fitness_fn,
xlim,
ylim,
zlim=None,
... |
import argparse
import json
import logging
from dataclasses import dataclass, replace, asdict
from datetime import datetime
from queue import Empty
from typing import Dict
import torch
from allennlp.common import FromParams
from tqdm import tqdm
from iconary.data.datasets import IconaryDataset
from iconary.eval.eval_... |
import json
import torch
import numpy as np
from scipy import stats
from torch.utils import data
from causal_bald.library import datasets
from causal_bald.library import plotting
from causal_bald.library import acquisitions
from causal_bald.application.workflows import utils
import seaborn as sns
import matplotlib... |
"""
Command Line Interface for the project.
"""
import argparse
import json
from pathlib import Path
from shutil import copyfile
import subprocess
from . import _version
PATH_TEST_DATA = Path(__file__).parent / "tests" / "data"
def main():
"""
Main CLI function with the following signatures:
dynoviz c... |
import math
from timeit import default_timer as timer
import numpy as np
import torch
from nmt import utils
class TrainingParameters:
"""
Bundles up model-training parameters:
- learning_rate: a float - the (initial) learning rate.
- learning_rate_decay: a float between 0 and 1 - when the loss
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.