text
stringlengths
6.04k
39.5k
"""Implementation of the WebComponent""" # pylint: skip-file import ast import json from html.parser import HTMLParser from typing import Dict, Optional, Set # @philippjfr?: For now i'm using lxml for . Is it ok to add as a requirement? # Or shoudl we find another solution like regex or similar? import lxml.h...
# A grpc model from msggen.model import ArrayField, Field, CompositeField, EnumField, PrimitiveField, Service from msggen.gen import IGenerator from typing import TextIO, List, Dict, Any from textwrap import indent, dedent import re import logging typemap = { 'boolean': 'bool', 'hex': 'bytes', 'msat': 'Am...
""" Copyright (c) 2016 <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, merge, publish, distribute, sublice...
#library imports import uuid from decimal import Decimal from datetime import datetime from flask import request, current_app from flask_restplus import Resource, reqparse, inputs from sqlalchemy_filters import apply_sort, apply_pagination, apply_filters from werkzeug.exceptions import BadRequest, NotFound #app import...
# Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
''' Repairable systems This is a collection of functions used for repairable systems. Currently included functions are: reliability_growth - uses the Duane method to find the instantaneous MTBF and produce a reliability growth plot. optimal_replacement_time - Calculates the cost model to determine how cost varies with...
# coding: utf-8 # http://stackoverflow.com/questions/27889873/clustering-text-documents-using-scikit-learn-kmeans-in-python # http://brandonrose.org/clustering import os import re import sys import frontmatter import matplotlib.pyplot as plt import pandas as pd import pytoml as toml import mpld3 import numpy as np f...
import re from typing import Iterable import numpy as np import pytest from pandas.testing import assert_frame_equal import dask import dask.dataframe from dask.dataframe.shuffle import shuffle_group from dask.sizeof import sizeof from distributed import Client from distributed.utils_test import gen_test from distrib...
# Copyright 2016 Google 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 writing, ...
import logging import sys from pathlib import Path from typing import Dict, Optional, List, Union import ixmp as ix import message_ix import pandas as pd from pandas import ExcelWriter from d2ix import _CONFIG_BASE_TECHNOLOGY, ModelPar, Data, RawData from d2ix import _LOG_CONFIG_FILE from d2ix.demand import add_deman...
import logging import os from collections import OrderedDict from kinto.core.permission import PermissionBase from kinto.core.storage.postgresql.client import create_from_config from kinto.core.storage.postgresql.migrator import MigratorMixin logger = logging.getLogger(__name__) HERE = os.path.dirname(__file__) ...
import os # comment out below line to enable tensorflow logging outputs os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import time import math import tensorflow as tf physical_devices = tf.config.experimental.list_physical_devices('GPU') if len(physical_devices) > 0: tf.config.experimental.set_memory_growth(physical_devi...
import re import struct import envi import envi.bits as e_bits """ A module containing memory utilities and the definition of the memory access API used by all vtoys trace/emulators/workspaces. """ # Memory Map Permission Flags # TODO: move these into envi.const MM_NONE = 0x0 MM_READ = 0x4 MM_WRITE = 0x2 MM_EXEC = 0...
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# Copyright 2018 Google 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 writing, ...
''' api.py <NAME> and <NAME> Fall 2020 ''' import sys import os import datetime import flask import json import config import psycopg2 import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt STOCK_TABLE = 'daily_stock_values' COMPANY_TABLE = 'companies' SECTOR_TABLE = 'sectors' ...
# encoding: utf-8 import os from datetime import datetime, timedelta from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from dateutil.tz import tzlocal from core.utils import slugify def mkpath(*parts): return os.path.abspath(os.path.join...
# Copyright 2021 KU Leuven. # # 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...
# Copyright 2021 The NPLinker Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
import json import logging import random import sentry_sdk from os import getenv from common.constants import MUST_CONTINUE from common.greeting import GREETING_QUESTIONS from common.link import skills_phrases_map, link_to_skill2key_words from common.grounding import what_we_talk_about, are_we_recorded, MANY_INTERESTI...
from flask import Flask, render_template, json, request, redirect, jsonify, url_for, session import os,sys,re import json import requests import datetime,time import html import six import base64 from google.cloud import storage, bigquery from google.cloud import texttospeech #os.environ["GOOGLE_APPLICATION_CREDENTIA...
# Copyright 2016 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...
# Originally written by <NAME> # Extended and currently maintained by <NAME> from __future__ import absolute_import, print_function import pandas as pd import numpy as np import numpy.linalg as la import math import copy def neuroCombat(dat, covars, batch_col, categorical_cols=None, ...
import math import torch import torch.nn as nn import torch.nn.functional as F from functools import partial from timm.models.layers import DropPath, to_2tuple, trunc_normal_ from timm.models.registry import register_model from timm.models.vision_transformer import default_cfgs, _cfg __all__ = [ 'ceit_tiny_patch...
# -*- coding: utf-8 -*- """Test XML parsing in XBlocks.""" import re import StringIO import textwrap import unittest import ddt import mock from lxml import etree from xblock.core import XBlock, XML_NAMESPACES from xblock.fields import Scope, String, Integer, Dict, List from xblock.test.tools import blocks_are_equiva...
from __future__ import print_function import io import os import numpy as np from numpy.testing import assert_allclose, assert_equal import pandas as pd import patsy from statsmodels.api import families from statsmodels.othermod.betareg import BetaModel from .results import results_betareg as resultsb links = familie...
# -*- coding: utf-8 -*- # # This module was initially contributed by <NAME>. # """ This module implements transformations between superoperator representations, including supermatrix, Kraus, Choi and Chi (process) matrix formalisms. """ __all__ = ['super_to_choi', 'choi_to_super', 'choi_to_kraus', 'kraus_to_choi', ...
from django.shortcuts import render from django.utils import dateparse, crypto from django.http import JsonResponse, HttpResponseNotAllowed, HttpResponse, HttpRequest import hmac import datetime from django.views.decorators.csrf import csrf_exempt #import logging import json from django.contrib.auth.models import User ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Train """ import torch as pt import numpy as np import pybullet as pb import ray import pybullet_utils.bullet_client as bc from torch.utils.tensorboard import SummaryWriter def save_ckpt(state, filename, epoch, checkpoint_dir): f_path = checkpoint_dir + filename...
# # @(!--#) @(#) mbtester.py, version 011, 08-february-2019 # # drive the "Generic Modbus/Jbus Tester" windows program # from Schneider Electric # # tester.exe available from: # # https://www.schneider-electric.com/en/faqs/FA180037/ # # version 4.7 (c) 1998-2008 # # Links: # # https://pyautogui.readthedocs.io/en/...
import keras.backend as K from keras.layers import Layer import tensorflow as tf from losses import focal, iou from util_graphs import trim_zeros_graph, prop_box_graph, prop_box_graph_2 from yolo.config import MAX_NUM_GT_BOXES, STRIDES, POS_SCALE, IGNORE_SCALE def level_select(cls_pred, regr_pred, gt_boxes, feature_...
from utils import eddsa_sign from typing import List, NamedTuple, Set, Callable, Union import cbor2 import hashlib import bech32 import requests from gql import gql, Client from gql.transport.requests import RequestsHTTPTransport BIP_44_CONSTANT = 44 ADA_COIN_TYPE = 1815 ADA_TEST_COIN_TYPE = 1 CHANGE_INDEX = 0 CHIMERI...
import asyncio import collections import itertools import logging from pathlib import Path import tempfile import time from typing import ( Any, cast, Dict, Iterable, List, Set, Tuple, Type, Union, ) import cytoolz import rlp_cython as rlp from eth_utils import ( encode_hex, )...
from torch.utils.data import DataLoader import imageio from torch.utils.data import Dataset from os.path import join import numpy as np import json from os.path import basename import torch import matplotlib.pyplot as plt from torchvision.transforms import Compose from datasets.transforms import ToOneHot,CoordEnc,FlipT...
# coding: utf-8 ### # @file __init__.py # @author <NAME> <<EMAIL>> # # @section LICENSE # # Copyright © 2018-2019 <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...
"""Definition of all REST API endpoints of the server module.""" import datetime import functools import uuid import urllib from io import StringIO from requests_futures.sessions import FuturesSession from flask import Blueprint, current_app, request, url_for, Response from flask.json import jsonify from flask_restf...
#coding=utf-8 import numpy import random import torch from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import Matern from scipy.stats import norm import random import os from numpy import argmax import argparse global accuracy_loss_constraint, latency_constr...
############################################################################# # # VFRAME # MIT License # Copyright (c) 2020 <NAME> and VFRAME # https://vframe.io # ############################################################################# from pathlib import Path from dataclasses import dataclass, field, asdict f...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation # Copyright 2015 Lenovo # # 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/LI...
import argparse import math import h5py import numpy as np #import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import socket from random import shuffle import json import pandas as pd import dask.dataframe as dd import dask.array as da from dask.delayed import delayed from scipy.stats ...
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # 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, co...
# == BSD2 LICENSE == # Copyright (c) 2014, Tidepool Project # # This program is free software; you can redistribute it and/or modify it under # the terms of the associated License, which is identical to the BSD 2-Clause # License as published by the Open Source Initiative at opensource.org. # # This program is distri...
import os import requests from performance.driver.core.classes import Reporter # NOTE: The following block is needed only when sphinx is parsing this file # in order to generate the documentation. It's not really useful for # the logic of the file itself. try: import matplotlib matplotlib.use('Agg') ...
# pylint: disable=too-many-statements """ Training and evaluation of a neural network that, given 2D joints, estimates: - 3D localization and confidence intervals - Orientation - Bounding box dimensions """ import copy import os import datetime import logging from collections import defaultdict import sys import time...
import tensorflow as tf from .misc import printt from contextlib import ExitStack from .summaries import video_summary import copy import sys from tensorflow.python.keras.engine import training_utils from tensorflow.python.keras import backend as K import time import os import inspect from .customiser import CustomUser...
from django.shortcuts import render, redirect from django.contrib import messages from rest_framework import status from django.http import HttpResponse # Create your views here. from django.apps import apps from .forms import vd_form from rest_framework.views import APIView from .models import videoUpload, Marks from ...
# coding=utf-8 import numpy as np import rospy # import robot_controller # import time from scipy.spatial.transform import Rotation # from std_msgs.msg import Float32MultiArray # from nav_msgs.msg import Path from geometry_msgs.msg import PoseStamped import moveit_commander import moveit_msgs.msg import tf import move...
""" This algorithm does the following things: depending on the operation mode it is either - training the svm model for extracting subsets - applying the trained model to extract subsets """ import sys #in order to import other python files import cv2 #in order to load the image import dlib #in order to train and extra...
"""Functions for reading and writing ADIPLS binary output. Many return what I call ``cs`` arrays. These are defined in Section 8.2 of the `ADIPLS documentation`_. They are structured arrays containing various scalar results from the frequency calculation. .. _ADIPLS documentation: https://sourceforge.net/p/mesa...
import csv from typing import List, Dict, Tuple, IO import functools from discord.ext import commands import datetime as dt import time import json import os import asyncio from decouple import config from aiohttp import ClientSession import aiofiles import discord URI_DATA = config("uri_data") DATA_PATH = "...
import numpy as np import pandas as pd from scipy.optimize import linprog """ File: support """ # Supporting functions called inside the metalog function call # Build the quantiles through a base function def MLprobs(x, step_len): l = len(x) # Calculate the liklihood as an interpolation pro...
"""RSVP Icon to Icon Matching Task.""" import csv import datetime from os.path import basename, dirname from typing import List, Tuple from psychopy import core from bcipy.display.rsvp.mode.icon_to_icon import IconToIconDisplay from bcipy.feedback.visual.visual_feedback import FeedbackType, VisualFeedback from bcipy....
from functools import reduce import mmap from multiprocessing.managers import DictProxy, SyncManager, Server import os import random import struct import sys try: from posixshmem import _PosixSharedMemory, Error, ExistentialError, O_CREX except ImportError as ie: if os.name != "nt": # On Windows, posixs...
"""Class containing simulation for the GUI.""" # Copyright 2020-2022 Blue Brain Project / EPFL # 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....
#!/usr/bin/python # coding: utf-8 """ Module to manipulate more or less cleanly the measurements from the mooring. Plot sea water temperature and salinity at "Bahia de Palma" and "Canal de Ibiza buoys. The time series are represented for selected months and years, the months are overlaid in order to make easier the c...
from datasets import load_metric import numpy as np from typing import Optional, Tuple import json import collections import os import torch from transformers import ( AutoConfig, AutoModelForQuestionAnswering, EvalPrediction, ) def get_bert_base_pretrained(): config = AutoConfig.from_pretrained("bert...
"""Configuration module.""" import importlib import os from copy import deepcopy from typing import Dict, List, Optional, Type, Union import pkg_resources import yaml from colorama import Style from archan.analysis import AnalysisGroup from archan.errors import ConfigError from archan.logging import Logger from arch...
import os import numpy as np import cv2 import pandas as pd from timeit import default_timer as timer import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data.dataset import Dataset from torch.utils.data import DataLoader from torch.utils.data.sampler import * print('torch version:', t...
import os import cv2 import io import sys import glob import time import zipfile import subprocess import logging import random import numpy as np import matplotlib.pyplot as plt from PIL import Image from contextlib import contextmanager import torch import torch.distributed as dist # set random seed def set_seed(s...
import glob import matplotlib.patches as mpatches import matplotlib.pyplot as plt import matplotlib.ticker as mtick import matplotlib.colors as mpColors import os import sys from pathlib import Path import numpy as np import pandas as pd from pprint import pprint # -----------------------------------------------------...
import numpy as np from copy import deepcopy from random import randint, choice import os import sys import time import shutil import multiprocessing from innovation import * from genotype import * from species import * import pprint pp = pprint.PrettyPrinter(indent=4, width=120, depth=3) class Object(object): ...
# Copyright (C) 2011-2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
import os import numpy as np import torch import shutil from torch.autograd import Variable import gzip import pickle from torch import nn import torch.utils.data as data_utils import torchvision from torchvision import transforms class AvgrageMeter(object): def __init__(self): self.reset() def re...
import atexit import enum import glob import logging import os import pickle import re import sqlite3 import threading import time from abc import abstractmethod, ABC from typing import Any, Callable, Iterator, List, Optional, TypeVar from .hash import pickleHash from .pickle import loadPickle, dumpPickle log = loggi...
#!/usr/bin/python #-*- coding: utf-8 -*- # >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>. # Licensed under the Apache License, Version 2.0 (the "License") # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # --- File Name: run_training_vid.py # --- Creation Date: 23-03-2020 # --- Last Modified: ...
import pytest from ..ingestion.vcf_utils import VCFParser, StructuralVariantVCFParser from ..util import resolve_file_path from .variant_fixtures import ( # noqa GENE_URL, GENE_WORKBOOK, MAX_POSTS_FOR_TESTING, VARIANT_SAMPLE_URL, VARIANT_URL ) pytestmark = [pytest.mark.working, pytest.mark.ingest...
# coding: utf-8 # public items __all__ = ["pca", "chopper_calibration", "r_division", "gauss_fit"] # standard library from logging import getLogger # dependent packages import decode as dc import numpy as np from astropy.modeling import fitting, models from sklearn.decomposition import TruncatedSVD def pca(onar...
# Copyright (c) 2009-2019 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. """De novo motif prediction. This module contains functions to predict *de novo* motifs using one or more *...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from os.path import join, dirname sys.path.insert(0, join(dirname(__file__), '..')) import simulator simulator.load('/home/wang/CARLA_0.9.9.4') import carla sys.path.append('/home/wang/CARLA_0.9.9.4/PythonAPI/carla') from agents.navigation.basic_agent import Ba...
from __future__ import print_function import time import requests import cgi import operator import urllib from jinja2 import Template import base64 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import random import time import uuid import os import json # DEMO demo = [ 'http://cdn2.spiegel.de...
"""Neural Ordinary Differential Equations dynamics.""" import torch from torch import nn from torchdiffeq import odeint from torchdiffeq import odeint_adjoint from .._base_nn_model import BaseModel from ..custom_blocks.wrappers import CheckpointWrapper from ..utils import get_model_device, find_best_match_indices # ...
from transformers import AutoModelForSequenceClassification, AutoTokenizer, AutoConfig import numpy as np import logging import os import sys from typing import Dict, Type, Callable, List import transformers import torch from torch import nn from torch.optim import Optimizer from torch.utils.data import DataLoader from...
import os import sys import json import functools import pickle import numpy as np import tensorflow as tf from functions_parameter_handling import are_identical_dicts sys.path.append('/packages/msutil') import util_stimuli def make_brain_net(input_tensor, n_classes_dict, brain_net_architecture, trainable=True, bat...
""" Containers for different entities """ # TODO: add progress bars to all the stuff, optimize for credit allocation - cocited graphs # TODO: re-create author institution timeline from dataclasses import dataclass, field from typing import Optional, List import pandas as pd import requests from tqdm.auto import tqdm...
#!/usr/bin/env python3 ############################################################################## # EVOLIFE http://evolife.telecom-paris.fr <NAME> # # Telecom Paris 2021 www.dessalles.fr # # ------------------------------------------------------------------------...
# Copyright (c) 2014, whoever # 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 the f...
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import sys import logging activations = { 'relu': F.relu, 'sigmoid': F.sigmoid } class ModelMixin: def n_parameters(self): return sum(p.numel() for p in self.parameters()) class DebugTerminateMixi...
# Copyright (C) 2016 Nokia Corporation and/or its subsidiary(-ies). import string import json import datetime import os import enum import textwrap import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base from . import authorization Base = declarative_base() users...
""" ETL and feature extraction functions for the sleep_classifiers_ML project. Released under Apache 2.0 License. See extended notice at the end of this file. Starts with some very short functions loading data from CSV into numpy arrays, taking magnitude of (x,y,z) coordinates, and taking numerical derivatives. The...
# -*- coding: utf-8 -*- import logging import utool as ut import builtins from utool._internal.meta_util_six import get_funcname print, rrr, profile = ut.inject2(__name__) logger = logging.getLogger('wbia') DEBUG_ADDERS = False DEBUG_SETTERS = False DEBUG_GETTERS = False # DEBUG_ADDERS = ut.get_argflag(('--debug-add...
from __future__ import annotations import attrs import numpy as np from astropy import units from astropy.io import fits from astropy.time import Time, TimeDelta from astropy.coordinates import Angle, EarthLocation, SkyCoord from sigpyproc.io.bits import BitsInfo, unpack from sigpyproc.utils import FrequencyChannels ...
""" PoE (Path of Exile) SPECIFIC COMMANDS """ import re from time import sleep import discord from discord.ext import commands import logging from selenium.webdriver.common.keys import Keys from pyperclip import paste import utils.utilities as ut # from utils.utilities import get_parser, initialize_dri...
from flask_appbuilder import Model from sqlalchemy import Column, Integer, String, ForeignKey,Float from sqlalchemy.orm import relationship import datetime,time,json from sqlalchemy import ( Boolean, Column, create_engine, DateTime, ForeignKey, Integer, MetaData, String, Table, T...
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
# -*- coding: utf-8 -*- # Operational Libs import collections import functools import logging import os # Dash Libs import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go from dash.dependencies import Input, Output, ALL # Analytic Libs import pandas as pd ...
import string, os, random, json from PIL import Image import blobfile as bf from mpi4py import MPI import numpy as np from torch.utils.data import DataLoader, Dataset import torch as th import torch.nn.functional as F import torchvision.transforms as T from .crop import RandomResizedProtectedCropLazy import tokenizers...
import os, functools, json, logging from flask import Flask, redirect, session, request, g, jsonify, make_response, abort, send_from_directory from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, login_user, logout_user, current_user, login_required from flask_socketio import SocketIO, emit fro...
"""Implementation of tools to do with system administration made as platform independent as possible. """ import sys import os from six.moves import urllib #import urllib.request, urllib.parse, urllib.error import getpass import tarfile import warnings import platform import pdb from functools import reduce # Record ...
#!/usr/bin/env python3 import json import warnings import random import numpy as np from datetime import datetime from pathlib import Path from tqdm import tqdm from PIL import Image, ImageEnhance class MaskJsonUtils(): """ Creates a JSON definition file for image masks. """ def __init__(self, output_dir...
import logging import os import shutil import subprocess import sys from contextlib import suppress from copy import deepcopy from pathlib import Path import numpy as np from tqdm import tqdm from wurlitzer import pipes from pyha import Hardware from pyha.common.complex import default_complex from pyha.common.context_m...
# -*- coding: utf-8 -*- from collections import defaultdict from cms.apphook_pool import apphook_pool from cms.models.moderatormodels import (ACCESS_DESCENDANTS, ACCESS_PAGE_AND_DESCENDANTS, ACCESS_CHILDREN, ACCESS_PAGE_AND_CHILDREN, ACCESS_PAGE) from cms.models.permissionmodels import PagePermission, GlobalPagePer...
import numpy as np import h5py from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset import matplotlib.pyplot as plt import matplotlib as mpl import math as m import torch as T from data_loading import loading, separate_dataset import pdb # Set...
########################################################################## # # Copyright (c) 2011-2012, <NAME>. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
# Create your views here. import json from itertools import chain from django.contrib import messages from django.http import HttpResponse from django.shortcuts import render, redirect from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.views import View from django.v...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. from matplotlib import pyplot as plt import numpy as np import os import math import matplotlib.pyplot as plt import matplotlib.ticker as ticker from MiniFramework.EnumD...
''' Script to load data and train ConvNet and LSTM models Goal: to train a classifier to classify speech as female or male. ''' import sqlite3 import numpy as np import pandas as pd import random import math import time #prepping the data from sklearn.model_selection import train_test_split #for the models import k...
#!/usr/bin/python # coding=utf-8 import argparse import logging import logging.config from xmltv import XmltvChannel, XmltvProgramme, XmltvWriter from libschedulesdirect.common import Status, Program, Broadcast, Channel, ProgramArtwork from libschedulesdirect.schedulesdirect import SchedulesDirect from datetime import...
import os import sys import torch import torch_geometric.datasets as GeoData from torch_geometric.data import DenseDataLoader from torch.utils.tensorboard import SummaryWriter import torch_geometric.transforms as T from torch.nn import DataParallel ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.absp...
import numpy as np from scipy.optimize import minimize from scipy.io import loadmat from math import sqrt import os import csv import time def initializeWeights(n_in, n_out): """ # initializeWeights return the random weights for Neural Network given the # number of node in the input layer and ...
import unittest import tempfile import random import string import os import pandas import numpy from numpy import dtype from numpy.testing import assert_equal, assert_almost_equal, assert_raises, assert_array_equal from io import StringIO from cashew.archive_extraction import read_performance, read_database, write_dat...