text stringlengths 6.04k 39.5k |
|---|
# -*- coding: UTF-8 -*-
""""
Created on 26.02.20
Module with class for model training.
:author: <NAME>
"""
import time
from abc import ABC, abstractmethod
from enum import Enum
from math import ceil
import torch
from torch.utils.data import Sampler, DataLoader, Dataset
from tqdm import tqdm
from transformers imp... |
#
# Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... |
# 2020
# The BlackEyeSecurity Toolkit was programmed and developed by Taguar258.
# The BlackEyeSecurity Toolkit is published under the MIT Licence.
# The BlackEyeSecurity Toolkit is based on the CLIF-Framework.
# The CLIF-Framework is programmed and developed by Taguar258.
# The CLIF-Framework is published under the MI... |
#!/usr/bin/env python3
# coding: utf8
# Author: <NAME>, 2016
'''
Compute coverage of annotated terms with P/R/F1.
'''
import sys
import logging
import argparse
from collections import defaultdict
# craftanno2ogtsv output:
# doc start end term type concept ontology
# 1 2 3 4 5 6 7
GOLD_FIEL... |
"""
Convert UPenn to TFRecords Video.
Makes both splits.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from glob import glob
from os import makedirs
import os.path as osp
import ipdb
import numpy as np
import tensorflow as tf
from tqdm import tqdm
fr... |
#!/home/wli/env python3
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os.path as osp
import openslide
from pathlib import Path
from skimage.filters import threshold_otsu
import glob
#before importing HDFStore, ... |
#!/usr/bin/env python3
import threading
import webbrowser
import json
from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlencode
import gi
import os
from datetime import datetime
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
gi.require_version('Gtk', '3.... |
import numpy as np
from discretize.utils.matrix_utils import mkvc, ndgrid, sub2ind
from discretize.utils.code_utils import deprecate_function
import warnings
def example_curvilinear_grid(nC, exType):
"""Creates and returns the gridded node locations for a curvilinear mesh.
Parameters
----------
nC :... |
from __future__ import annotations # todo0 remove in 3.11
import base64
import binascii
import copy
import datetime
import json
import pickle
import pprint
import typing
from dataclasses import dataclass, field
from enum import Enum
from typing import AbstractSet, Any, Iterable, Iterator, Sequence
import pymongo.col... |
# encoding: utf-8
import os
import platform
from cffi import FFI
TEMPLATE_FORMAT_ISO19794 = "iso19794"
ffi = FFI()
ffi.cdef(
"""
#define NULL 0
typedef void* HWND;
typedef void* HDC;
typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned s... |
# coding: utf-8
# # Behavioral Cloning | End to End Learning for Self Driving Cars
# **In this project, I used a deep neural network (built with [Keras](https://keras.io/)) to clone car driving behavior.**
#
# **The dataset used to train the network is generated from [Udacity's Self-Driving Car Simulator](https://gi... |
"""
This module implements layers and nn.Module-like building blocks from which a complete
model can be composed.
In this implementation, we account for different edge types in the Graph Neural-Net
(GNN) layers by using a different message function to compute the message passed
along each edge type. This is in contra... |
"""
File: demo_folder.py
Author: Nrupatunga
Email: <EMAIL>
Github: https://github.com/nrupatunga
Description: tracking from folder
"""
import argparse
import sys
from pathlib import Path
import cv2
import numpy as np
import torch
from loguru import logger
from train import GoturnTrain
from helper import image_io
fr... |
import base64
from unittest.mock import patch
import pytest
from rotkehlchen.assets.asset import Asset
from rotkehlchen.assets.converters import (
BINANCE_TO_WORLD,
RENAMED_BINANCE_ASSETS,
UNSUPPORTED_BINANCE_ASSETS,
asset_from_binance,
)
from rotkehlchen.assets.resolver import AssetResolver
from rotk... |
import numpy as np
import pyqtgraph as pg
from PyQt5 import QtCore
import acconeer.exptool as et
A_WEEK_MINUTES = 10080.0
HISTORY_LENGTH_S = 10
SENSITIVITY_MAX = 10.0
MAX_ALLOWED_NOISE = 20
LP_AVERAGE_CONST_MAX = 0.9
LP_AVERAGE_CONST_INIT = 0.7
DOUBLE_PRESS_RATIO = 1.3 # Ratio between lp_constants for the trigger... |
# -*- coding: utf-8 -*-
"""
Core utils for manage face recognition process
"""
import json
import logging
import os
import pickle
import time
from pprint import pformat
import face_recognition
import torch
from sklearn.model_selection import train_test_split
from tqdm import tqdm
from datastructure.Person import Pers... |
'''
ICA Based - Artifact Removal Algorithms:
------------------------------------------
Author @ <NAME>
updated on Date: 26 Sep 2021
Version : 0.0.4
Github : https://github.com/Nikeshbajaj/spkit
Contact: <EMAIL> | <EMAIL>
'''
from __future__ import absolute_import, division, print_function
name = "Signal Processing ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Rokos Smach lib class"""
#import roslib
#import smach_ros
import math
import time
import copy
from datetime import datetime
from ast import literal_eval
from dateutil.relativedelta import relativedelta
import smach
import rospy
import srvt_moveit.srv as srvt_srv
from... |
import warnings
warnings.simplefilter(action="ignore", category=UserWarning)
warnings.simplefilter(action="ignore", category=RuntimeWarning)
warnings.simplefilter(action="ignore", category=PendingDeprecationWarning)
import argparse
import os
import numpy as np
from past.builtins import map
from scipy.sparse import tri... |
import math
from django.contrib import admin
from django.contrib.auth.models import User
from . import models, views
from .utils import mail
from datetime import date, timedelta
from django.db.models import Count, Q
from django import forms
from django.conf import settings
from guardian.admin import GuardedModelAdmin... |
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm as cm
import seaborn as sns
sns.set_style("whitegrid")
import sys
import os
from pathlib import Path
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection i... |
from __future__ import print_function
import argparse
import random
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
from warpctc_pytorch import CTCLoss
import os
import utils
import dataset... |
"""
Handle annotations
"""
import datetime
import re
from imc.endpoints import IMCEndpoint
from imc.models import PatchDocument
from imc.tasks.services.annotation_repository import (
AnnotationRepository,
DuplicatedAnnotationError,
)
from marshmallow import INCLUDE
from restapi import decorators
from restapi.... |
# coding:utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
from tqdm import tqdm
from bert_multi import tokenization
from bert_multi.bert_multi_config import FLAGS
import tensorflow as tf
import pickle
... |
import itertools
from functools import reduce
import networkx as nx
from logic.pref_scltl import *
from ggsolver.ggsolver.mdp.model import *
from ggsolver.ggsolver.mdp.solvers import *
# Gridworld parameters
DIM = (5, 5)
CELL_A = (4, 0)
CELL_B = (0, 2)
CELL_C = (1, 4)
CELL_D = (4, 3)
CELL_E = (0, 0)
LABELS = {
C... |
"""
teleoperate.py
Code for using a trained LILA Model (or End-Effector Control) for Collaborative Teleoperation of the Panda Arm.
Run a `dry-run` AFTER training a model via: python teleoperate.py --name a --task_idx -1 --trial_idx -1
"""
import os
import pickle
import socket
import time
from pathlib import Path
from... |
# (c) 2010 <NAME> and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from paste.util.mimeparse import *
def test_parse_mime_type():
parse = parse_mime_type
assert parse('*/*') == ('*', '*', {})
asse... |
import collections, os
import xlsxwriter
try:
import dreq
import scope_utils
import table_utils
except:
import dreqPy.dreq as dreq
import dreqPy.scope_utils as scope_utils
import dreqPy.table_utils as table_utils
jsh='''
<link type="text/css" href="/css/dreq.css" rel="Stylesheet" />
%s
''' % dreq.dreqMoni... |
#!/usr/bin/env python
from __future__ import print_function
import sys, os
import numpy
from numpy.linalg import norm
from bruhat.argv import argv
from bruhat.util import cross, factorial, write
from bruhat import sparse
from bruhat.sparse import Subspace
EPSILON = 1e-8
def mulclose(gen, maxsize=None, verbose=F... |
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.contrib.staging import StagingArea
from baselines import logger
from baselines.template.util import logger as log_formater
from baselines.util import (
import_function, store_args, flatten... |
#the Art VanDelay imports/exports... but more imports than exports... and that's the problem
import pandas as pd
import os
import re
from itertools import chain
from datetime import date
import numpy as np
from openpyxl import load_workbook
main_folder = os.getcwd()
data_folder = main_folder +'\\Data\\'
x... |
"""CBMA methods from the activation likelihood estimation (ALE) family."""
import os
import logging
import multiprocessing as mp
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from ... import references
from ...due import due
from ...stats import null_to_p
from ...transforms import p_to_z
from ...u... |
import os
import time
import json
import logging
import internetarchive
from archive import managers
from django.db import models
from datetime import datetime
from django.conf import settings
from pytz import common_timezones
from taggit.managers import TaggableManager
from django.core.files.base import ContentFile
fr... |
# <NAME> (<EMAIL>)
from __future__ import division, print_function
from builtins import range
import numpy as np
from sklearn.metrics import auc
from sklearn.metrics.ranking import _binary_clf_curve, precision_recall_curve, roc_curve
import mlpaper.perf_curves as pc
import mlpaper.util as util
from mlpaper.test_cons... |
import argparse
import copy
from collections import namedtuple, Counter
import itertools
import os
from pathlib import Path
import json
"""
TODO:
EitherType
"""
Param = namedtuple("Param", ["name", "type", "optional"])
def longclsname_to_haxeclass(jstype):
splited_type = jstype.split(".")
return ".".j... |
# Copyright 2021 StreamSets 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 writi... |
import torch
import torch.nn.functional as F
# 3DDFA_V2
import cv2
import yaml
from _3DDFA_V2.utils.functions import plot_image
from _3DDFA_V2.TDDFA import TDDFA
import numpy as np
import scipy.io as sio
from _3DDFA_V2.Sim3DR import rasterize_adv,rasterize
from _3DDFA_V2.utils.tddfa_util import _to_ctype
import os.pa... |
# Import
import numpy as np
import numpy.ma as ma
import h5py
import dask.array as da
# Set universal WHIM parameters to divide cosmic phase diagram into 4:
rhoMax = 100.
tMin = 10.**5
# Functions #####################################
def main(path_to_data,path_to_catalog,output_mass_frac,output_WHIM_data):
'''
... |
import json
import geojson
import logging
from geojson import Point, Feature, FeatureCollection
from shapely import wkb, wkt
from shapely.geometry import LineString, CAP_STYLE, JOIN_STYLE, shape, mapping, Point
from shapely.ops import transform, split, snap
from typing import List
from sqlalchemy import text, func
... |
import os
import time
import shutil
import torch
import csv
import vis_utils
from metrics import Result
fieldnames = [
'epoch', 'rmse', 'mae', 'loss', 'depth_loss', 'smooth_loss', 'photometric_loss', 'variance_loss', 'irmse', 'imae', 'mse', 'absrel',
'rel_exp', 'diff_thresh', 'rmse_3', 'diff_3', 'rmse_6', 'dif... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
__all__=('optimize_experimental_design',)
import numpy as np
import networkx as nx
import itertools as it
from .identifiability import infer_identifiability
def get_performance(net, perturbations, di_only=False):#, counter = None):
'''
Re... |
#!/usr/bin/env python3
# BEGIN_LEGAL
# BSD License
#
# Copyright (c)2016 Intel Corporation. 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 abov... |
"""
:mod:`pysgutils.sg_pt`
~~~~~~~~~~~~~~~~~~~~~~
Python port of sg_pt.h from sg3_utils
Comments from sg_pt.h:
Copyright (c) 2005-2014 <NAME>.
All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the BSD_LICENSE file.
"""
from __future__ import absolute_import
import o... |
import random
import os
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from data.anomaly_detection import environment
from data.anomaly_detection import anomaly
from utils import os as os_utils
class TrajectoryGeneratorConfig(object):
# Global parameter scale.
x_loc = 0
... |
import random
import numpy as np
import librosa
from torch.utils.data import Dataset
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
import os
import pickle
from torchvision.transforms import Compose
import torch.utils.data as data
from timeit import default_timer as t... |
import os
import numpy as np
import statistics as stats
from scipy.ndimage import interpolation as inter
from scipy import ndimage as nd
from PIL import Image as im
from PIL import ImageDraw as imd
import logging
from scipy.stats import itemfreq
from .helpers import img_to_bin_arr, bin_arr_to_rgb_img
from .conncomp i... |
import wx
from src.wizard.controller.frmRequiredComboValidator \
import RequiredComboValidator
from src.wizard.controller.frmRequiredValidator \
import RequiredValidator
from src.wizard.controller.frmDigitOnly \
import DigitValidator
from ObjectListView import ObjectListView, ColumnDefn
import wx.lib.maske... |
from __future__ import division
import sys
import json
import numpy as np
from functools import partial
import matplotlib as mpl
import os
mpl.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.animation as animation
#--------------------------------------------------------------... |
#!/usr/bin/env python
# coding: utf-8
# ## This code is for demonstration of using regression model (in my case Ordinary Least Square (OLS) model from statsmodels library) along with Backward Elimination Technique.
# ### Content
#
# * *[Heatmap without dummy variables](#heatmap_nodummy)*
#
# * *[Heatmap with Dummy ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Stellapps Technologies Private Ltd.
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class MaterialPriceList(Document):
def validate(self):
roles = frappe.get_roles()
... |
#! /usr/bin/env python
# Licensed under an MIT style license -- see LICENSE.md
import os
import numpy as np
import math
import argparse
import json
import h5py
from pathlib import Path
from pesummary.utils.utils import logger, check_file_exists_and_rename
from pesummary.utils.dict import paths_to_key
from pesummary.... |
import pygame,sys
from pygame.locals import *
"""Algunos colores y variables que se usaran en el codigo"""
verde = (0,0,238)
blanco = (255,255,255)
ancho = 900
alto = 574
anchoL = 80
largoL = 20
colorL = (150,200,0)
colorl1 = (30,30,30)
colorl3 = (127,255,0)
class Bola(pygame.sprite.Sprite):
"""Clase que rep... |
from __future__ import annotations
from sympy.core import Basic
from sympy import Matrix, Symbol, sympify, ones
from typing import Tuple, Union
from copy import deepcopy
from functools import cmp_to_key
import re
from ._methods import (
_cartan_matrix,
_cocartan_matrix,
_quadratic_form,
_reflection_ma... |
import numpy as np
import netCDF4 as nc
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import sys
###################
# GEOCLIM OUTPUT: #
###################
# Get argument pass to script
output_files = sys.argv
# remove 1st argument: script name
del(output_files[0])
##... |
import argparse
import json
import os
from sys import stdout, stderr
from time import sleep, time
from typing import Iterable, List, Optional, Tuple
import requests
from requests import Response
from tfe_run_wait.argument_types import EnvDefault
from tfe_run_wait.logger import log
def read_token(hostname: str = "app... |
import numpy as np
import tensorflow as tf
import gym
import time
import spinup.algos.IMPALA.core as core
import matplotlib.pyplot as plt
from gym.spaces import Box, Discrete
from spinup.utils.logx import EpochLogger
from spinup.utils.mpi_tf import MpiAdamOptimizer, sync_all_params
from spinup.utils.mpi_tools import mp... |
# Copyright(c) Microsoft Corporation
# 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
#
# THIS CODE IS PROVIDED ON AN *AS IS* B... |
"""
In the module :py:mod:`pyinduct.trajectory` are some trajectory generators defined.
Besides you can find here a trivial (constant) input signal generator as
well as input signal generator for equilibrium to equilibrium transitions for
hyperbolic and parabolic systems.
"""
import warnings
from numbers import Number
... |
import jax
from jax import lax, random, numpy as jnp
from jax import grad, jit, vmap
import flax
from flax import linen as nn
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import scipy.io as sio
import math
from skimage import io as img
from skimage import color, morphology, fi... |
import sys
import logging
import numpy as np
import torch
from . import data_utils, FairseqDataset
from fairseq.tarc_utils import *
# Use this to show warnings (anything else ?) at the command line
logger = logging.getLogger(__name__)
def collate_tokens_ex(values, pad_idx, bos_idx=None, eos_idx=None, left_pad=Fal... |
# Copyright 2022 Sony Semiconductors Israel, 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/licenses/LICENSE-2.0
#
# Unless required b... |
import numpy as np
import os
import tqdm
import matplotlib
import matplotlib.pyplot as plt
from collections import defaultdict, Counter
def run(data, path, comparison_key):
do_reasons = True
do_messages = True
do_symptoms = True
limit = 10000000
label2pkls = list()
for method in data:
... |
"""Generate raw data."""
import argparse
from distutils.util import strtobool
from glob import glob
import multiprocessing as multi
import pathlib
import random
import subprocess
import femio
import numpy as np
import siml
RAW_DIRECTORY = pathlib.Path('data/raw')
CLSCALES = (.1, .2, .3)
MIN_FOURIER_DEGREE = 2
MAX... |
# -*- coding: utf-8 -*-
from .energydiagramopen import ED
import matplotlib.pyplot as plt
import re
ADJUSTEDCOEFFICIENT=0.02
def GetFrontIndex(orbSign):
# In: HOMO/LUMO/HOMO-1/LUMO+1
# Out: {'hoLu': 'HOMO', 'num': -1}
for matchString in [r'HOMO(.*)', r'LUMO(.*)']:
matchObj = re.match(matchString, orbSign)... |
import numpy as np
import pdb # python debugger
from theomethods import *
import tomutils as tu
global KB
global THEOtraceGetValues0
global THEOmaintainInverses
THEOtraceGetValues0=False
THEOmaintainInverses=True
"""
This is a barebones implementation of Theo in Python.
Each entity is represented by a Python dictiona... |
"""
App
===
This module serves as the location where the user interface is built,
all of the functions are joined together and used, and the outputs of the
app are encoded
Functions
---------
:output_read_file_status: returns html object with read file status
:output_file_preview_req_num_clusters_req_cluster_method: r... |
"""
The second most important module of the PaYnter project.
This module will manage all the data relative to the brushes you will create and use inside your scripts.
The :py:class:`Brush` is a quite complex class in the insides, but luckly the Paynter manages all the drawing.
So the final user of the library needs on... |
def read_CESM_var(time_slice, variable,
mean_dims=None,
postprocess=None,
postprocess_kwargs={},
experiment='historical',):
import intake
import intake_esm
import xarray as xr
is_derived = variable in derived_vars_defined
... |
import os
import sys
import time
import glob
import cv2
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
# from skimage.external import tifffile as sktiff
import skimage.color
import skimage.io
from contextlib import suppress
import tensorflow as tf
def min_max_norm(images, norm... |
# coding=utf-8
import inspect
import json
import logging
import os
import re
import shutil
import sys
import warnings
from os.path import join, isfile, isdir, abspath, expanduser, basename, dirname, split
import numpy as np
from phi import struct, math, __version__ as phi_version
from ._field import Field, SampledFie... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
from tensorflow.contrib.slim.nets import resnet_v1, inception, vgg
from scipy.misc import imread
from scipy.misc import imresize
impor... |
# -*- coding: utf-8 -*-
"""
(Base) Element of an general (M-)Expression.
Here we have the base class and related function for element inside an Expression.
"""
from mathics.core.attributes import no_attributes
from typing import Any, Optional, Tuple
def ensure_context(name, context="System`") -> str:
assert isi... |
"""
This program takes a genbank file, as provided by KBase, and creates
a UCF file, as described by Cello, to use as an input to Cello.
The UCF is a genbank file. Follows format described here:
https://science.sciencemag.org/content/sci/suppl/2016/03/30/352.6281.aac7341.DC1/Nielsen.SM.pdf
on page 58
The enti... |
#!/usr/bin/env python3
'''
This script creates FASTA files with transcripts containing novel/non-coding exons, together with tab-delimited file with length and expression values.
'''
# -*- coding: utf-8 -*-
# Importing modules
import os
import sys
import pybedtools as pb
import numpy as np
import tqdm
import gc
impo... |
# 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, softw... |
"""
Module implements X-learner from Kuenzel et al (2019) using NNs
"""
# Author: <NAME>
from typing import Callable, Optional, Tuple
import jax.numpy as jnp
import catenets.logger as log
from catenets.models.constants import (
DEFAULT_AVG_OBJECTIVE,
DEFAULT_BATCH_SIZE,
DEFAULT_LAYERS_OUT,
DEFAULT_LAY... |
import pandas as pd
import numpy as np
from numpy import random
import itertools
import math
import matplotlib.pyplot as plt
import seaborn as sns
from wordcloud import WordCloud
sns_heatmap_colors = [
"Blues",
"Greens",
"Greys",
"Reds",
"Purples"
]
def pd_continuous_null_and_outliers(df, col, 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.
"""
This file implements:
Ghazvininejad, Marjan, et al.
"Constant-time machine translation with conditional masked language models."
arXiv pre... |
# Copyright 2020 Google LLC.
#
# 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, ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
import torch
import torch.nn as nn
from torch.nn import Conv2d, BatchNorm2d, ReLU, init
from torch.nn.intrinsic.qat import ConvBn2d, ConvBnReLU2d
from torch.n... |
"""Manager for Mediation coordination."""
import json
import logging
from typing import Optional, Sequence, Tuple
from ....core.error import BaseError
from ....core.profile import Profile, ProfileSession
from ....storage.base import BaseStorage
from ....storage.error import StorageNotFoundError
from ....storage.recor... |
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import math,cmath
import yue.client.DSP.zbdesign as zbdesign
import yue.client.DSP.linalg as linalg
# proof
# in the time domain:
# x*h1 + x*h2 + x*h3 = y
# x*(h1 + h2 + h3)
# in the freq domain
# X(H1 + H2 + H2)
binary_ranges = [
... |
import os
import yaml
import torch
import argparse
import numpy as np
import pandas as pd
import PIL
import matplotlib.cm as cm
import torch.nn.functional as F
from model import YNetTrainer
from utils.dataset import set_random_seeds, dataset_split, dataset_given_scenes
from utils.visualize import plot_saliency_maps
... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
"""Structure Validator for Demisto files
Module contains validation of schemas, ids and paths.
"""
import json
import logging
import os
import re
import string
from typing import List, Optional, Tuple
import click
import yaml
from demisto_sdk.commands.common.configuration import Configuration
from demisto_sdk.command... |
""" Functions to normalize morphologies and extract density moments for both AIBS and BBP morphologies """
# This file is part of me-types-mapper.
#
#
# Copyright © 2021 Blue Brain Project/EPFL
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the APACHE-2 License.
#
# T... |
from __future__ import print_function
import sys
import re
import sqlparse
from collections import namedtuple
from sqlparse.sql import Comparison, Identifier, Where
from .parseutils.utils import (
last_word, find_prev_keyword, parse_partial_identifier)
from .parseutils.tables import extract_tables
from .parseutils.... |
import random
from collections import OrderedDict, defaultdict
from dataclasses import dataclass
from typing import Iterable, Dict, List, Tuple, Union
from django.contrib.auth.decorators import user_passes_test, login_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
fro... |
import math
import operator
import copy
def to_base(number, base):
assert number>=0
assert base>1
field = GF(base)
ret = []
i = 0
while number > 0:
digit = number%base
ret = [field[digit]]+ret
number/=base
if len(ret) == 0:
ret = [field[0]]
return ret
_p... |
import logging
import pytest
from unittest.mock import patch, call
from collections import namedtuple
from opentrons.config.reset import ResetOptionId
from opentrons.config import advanced_settings
# TODO(isk: 3/20/20): test validation errors after refactor
# return {message: string}
@pytest.mark.parametrize(
"l... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import re
import nltk
import numpy
nltk.download('punkt')
import warnings
warnings.filterwarnings("ignore")
from sklearn.feature_extraction.text import TfidfVectorizer
from tqdm import tqdm
from gensim import corpora, similarities
from gensim.models import TfidfModel
from gensim.corpora import Dictionary, MmCorpus... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
""" Python version of transcoder.
Uses built-in library xml.etree.ElementTree,
rather than lxml.
Revised 02-20-2017 Regarding special handling of slp1 to deva;
search for regexCode variable, and fsmentry['regex'] for where this comes into play.
This ... |
# encoding: utf-8
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
class Setup(object):
def __init__(self):
self._ordering =... |
# BSD 2-CLAUSE LICENSE
# 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 conditions and the following disclaimer.
# Redistributions i... |
import numpy as np
import matplotlib.pyplot as plt
class gradient_descent_sig():
"""
W2 -= learning_rate * ga.derivative_w2(hidden, T, output)
b2 -= learning_rate * ga.derivative_b2(T, output)
W1 -= learning_rate * ga.derivative_w1(X, hidden, T, output, W2)
b1 -= learning_rate * ga.derivative_b1(hi... |
# coding=utf-8
# Copyright 2020 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from __future__ import unicode_literals
import os.path
import hashlib
from contextlib import contextmanager
from collections import OrderedDict
from taggit.managers import TaggableManager
from willow.image import Image as WillowImage
import django
from django.core.files import File
from django.core.exceptions import... |
#!/usr/bin/python
from PyQt5.QtCore import Qt, pyqtSignal, QRect
from PyQt5.QtGui import (QPainter, QPixmap, QColor, QFont, QBrush, QPen, QIcon,
QFontMetrics, QPainterPath)
from PyQt5.QtWidgets import (QLabel, QMessageBox, QScrollArea, QWidget,
QCheckBox, QPushButto... |
# -*- coding: utf-8 -*-
'''
Manage X509 Certificates
.. versionadded:: 2015.8.0
This module can enable managing a complete PKI infrastructure including creating private keys, CA's,
certificates and CRLs. It includes the ability to generate a private key on a server, and have the
corresponding public key sent to a rem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.