text stringlengths 3.07k 22.1k |
|---|
import torch
from torch.nn import BatchNorm1d
from torch.nn import BatchNorm2d
from torch.nn import BatchNorm3d
from torch.nn import LayerNorm
from torch.nn.modules.batchnorm import _BatchNorm
from torch.nn.modules.lazy import LazyModuleMixin
from torch.nn.parameter import UninitializedBuffer
from torch.nn.parameter im... |
from sklearn.model_selection import StratifiedKFold, KFold
from skopt.utils import use_named_args
from .pipes_and_transformers import MidasEnsembleClassifiersWithPipeline, wrap_pipeline, get_metadata_fit, _MidasIdentity
from imblearn.pipeline import Pipeline
from sklearn.calibration import CalibratedClassifierCV
from c... |
from django.shortcuts import render, redirect, get_object_or_404
from questions.models import Question, Answer, Candidate, Vote, Category
from questions.forms import QuestionForm, AnswerForm
from mxv.settings import QUESTIONS_VISIBLE_TO_NON_STAFF, NCG_VOTING_URL
from django.contrib.auth.decorators import login_required... |
# -*- coding: utf-8 -*-
"""
SSO Security Helper
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2015, 2017-2019 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long
from base64 import b64encode, b64decode
import datetime
import decimal
import json
from OpenSSL import... |
#!/usr/bin/env python
#
# Copyright 2012 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 o... |
#!/usr/bin/env python
# coding: utf-8
# */Aaipnd-project-master/train_commonfns.py
#
# PROGRAMMER: <NAME>
# DATE CREATED: 01/01/2020
# REVISED DATE:
# PURPOSE: common support needed for train program
# ... |
#!/usr/bin/env python3
# Copyright © 2014, 2015 <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, ... |
"""HTML related implementations.
Mainly following interfaces are defined:
- remove_first_selector_symbol_char : Remove first selector
symbol (`.` or `#`) from string.
- append_html_to_str : Add html string to another string with line
break and specified number's indentation.
- append_indent_to_each_sc... |
import numpy
import simtk.unit
import simtk.unit as units
import simtk.openmm as mm
from openmmtools.integrators import ExternalPerturbationLangevinIntegrator
kB = units.BOLTZMANN_CONSTANT_kB * units.AVOGADRO_CONSTANT_NA
class NCMCGeodesicBAOAB(ExternalPerturbationLangevinIntegrator):
"""
Implementation of a ... |
"""
Tu labor en esta ocasión es ayudar a <NAME>. Para ello, debes
determinar por él si ha aprobado el Programa Formativo como soldado
o no para poder formar parte de la Legión de Reconocimiento. La única
forma de aprobar dicho programa es aprobando todos y cada uno de los N
cursos que lo componen.
- Cada curso está co... |
"""
Image processing utilities
"""
__all__ = ['background_mask', 'foreground_mask', 'overlay_edges', 'diff_image',
'equalize_image_histogram']
from scipy import ndimage
from visualqc import config as cfg
from visualqc.utils import scale_0to1
import numpy as np
from functools import partial
from scipy.ndi... |
import os, subprocess
from itertools import chain
from os.path import join
import pandas as pd
from Modules.Utils import run, make_dir
class FileManager:
"""Project non-specific class for handling local and cloud storage."""
def __init__(self, training=False):
"""create an empty local_paths variable ... |
import pandas as pd
import numpy as np
import plotly.graph_objects as go
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input,Output
import os
print(os.getcwd())
df_input_large=pd.read_csv('C:/Users/Asus/ads_covid-19/data/processed/COVID_large... |
#Hazirlayan: <NAME>
import math
def polinomlar(derece):
if(derece == 1):
a1 = ((xiler[0]*xiyiler[1])-(xiler[1]*xiyiler[0]))/ ((xiler[0]*xiler[2])-(xiler[1])**(2))
a0 = (xiyiler[0]-(a1*xiler[1]))/xiler[0]
with open("sonuc.txt","w") as file: #sonuc.txt dosyasini temizleyip ... |
import torch as th
import time
import numpy as np
import pandas as pd
import os
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
sns.set()
sns.set_style("darkgrid", {"axes.facecolor": "#f0f0f7"})
linestyle = [':', '--', '-.', '-']
fontsize = 20
#EXP_PATH = os.path.join(... |
from hashlib import sha256
from hmac import new as hmac
from random import randint
from re import fullmatch
from socket import socket
from struct import pack as encode
from subprocess import PIPE, STDOUT, Popen
from crcmod.predefined import mkCrcFun
from goodix import FLAGS_TRANSPORT_LAYER_SECURITY_DATA, Device
from ... |
import sys
import os
import logging
import argparse
import time
import json
import serial
import yaml
import ssl
import paho.mqtt.client as mqtt
from struct import *
def buildFrame(command, data=''):
frame = [255]
frame.extend(map(ord, command))
frame.extend(map(ord, data))
frame.insert(0, len(frame))
retur... |
from data.models import Student, Grade_8, Grade_9, Grade_10, Grade_11, Grade_12
from itertools import zip_longest
from django.db.models import Q
from django.http import QueryDict
def get_year_keys(dict):
'''checks if there are grade_XX_year:0000 keys'''
for key, val in dict.items():
if key[:6] == "gra... |
# -*- coding: utf-8 -*-
#
# BBRMom
# Copyright (C) 2021 <NAME> - Istituto Nazionale di Ricerca Metrologica (INRIM)
#
# 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, incl... |
import argparse
import importlib.util
import os
import yaml
from datetime import datetime
from descriptors import cachedproperty
from argcmdr import RootCommand, Command, main, cmdmethod
from sqlalchemy.engine.url import URL
from triage.component.architect.feature_generators import FeatureGenerator
from triage.compo... |
#!/usr/bin/env python
"""
File: DataSet
Date: 5/1/18
Author: <NAME> (<EMAIL>)
This file provides loading of the BraTS datasets
for ease of use in TensorFlow models.
"""
import os
import pandas as pd
import numpy as np
import nibabel as nib
from tqdm import tqdm
from BraTS.Patient import *
from BraTS.structure impo... |
# @author: <NAME>
# @license: General Public License (GPL)
# @contact: <EMAIL>
# @Hardware Note: CPU:AMD3900
# @Hardware Note: GPU: EVGA GTX1080ti
# @Software Note: Python3.6+CUDA+CUDNN+Pycharm+Pytorch
# @Version: 1.0
import pandas as pd # use functions in panda package to save the loss value into html files
import tor... |
#!/usr/bin/env python3
# Copyright (c) 2021, The University of Southern California.
# 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 cop... |
#!/usr/bin/env python
"""Computes the result of a stats cPickle file.
A stats cPickle file has the following format:
- List of N elements, each representing a track.
- Each position (or track) contains the rank index of the covers
corresponding to this position.
The results this script computes are:
- Mean Avera... |
"""Package entroq provides a client library for working with EntroQ.
"""
import base64
import json
import threading
import time
import uuid
import grpc
from google.protobuf import json_format
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
from grpc_status import rpc_status
from . i... |
import torch
from collections import defaultdict, OrderedDict
import numba
import numpy as np
def _group_by(keys, values) -> dict:
"""Group values by keys.
:param keys: list of keys
:param values: list of values
A key value pair i is defined by (key_list[i], value_list[i]).
:return: OrderedDict w... |
import cv2
import math
import numpy as np
from utils.pPose_nms import pose_nms
def get_3rd_point(a, b):
"""Return vector c that perpendicular to (a - b)."""
direct = a - b
return b + np.array([-direct[1], direct[0]], dtype=np.float32)
def get_dir(src_point, rot_rad):
"""Rotate the point by `rot_rad` ... |
import numpy
import numpy.fft
import pytest
import numpy.testing
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import librosa
import librosa.display
import pandas
import emlearn
import eml_audio
FFT_SIZES = [
64,
128,
256,
512,
1024,
]
@pytest.mark.parametrize('n_... |
# Lint as: python2, python3
# Copyright 2019 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 l... |
# Copyright (c) 2016 Orange.
# 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 a... |
from collections import namedtuple
import numpy as np
from untwist import data, utilities, transforms
Anchors = namedtuple('Anchors', ['Distortion',
'Artefacts',
'Interferer',
'Quality'],
)
class ... |
"""
get_offset determines the optimal p-site offset for each read-length on the top 10 most abundant ORFs in the bam-file
usage:
python get_offset.py --bam <bam-file> --orfs <ribofy orfs-file> --output <output-file>
By default, get_offset analyses reads between 25 and 35 nt,
but this is customizable with the --min_... |
# -*- coding: utf-8 -*-
# Written by yq_yao
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from models.attention import PAM_Module
from models.model_helper import weights_init
def conv3x3(in_planes, out_planes, stride=1):
"3x3 convolution with padding"
... |
import jax.numpy as jnp
import numpy as np
import matplotlib.pyplot as plt
import jax
from jax.experimental.optimizers import adam
from dataclasses import dataclass
@dataclass
class InterceptSettings:
min_duration: float = 0.02
min_duration_final: float = 0.05
duration: float = 0
distance: float = 1.0
... |
# May 2018 xyz
import numpy as np
import numba
def Rx( x ):
# ref to my master notes 2015
# anticlockwise, x: radian
Rx = np.zeros((3,3))
Rx[0,0] = 1
Rx[1,1] = np.cos(x)
Rx[1,2] = np.sin(x)
Rx[2,1] = -np.sin(x)
Rx[2,2] = np.cos(x)
return Rx
def Ry( y ):
# anticlockwise, y: radi... |
import torch
from torch import nn
import torch.nn.functional as F
from typing import Tuple, Optional
class Graph(dict):
def __dir__(self):
return super().__dir__() + list(self.keys())
def __getattr__(self, key):
try:
return self[key]
except KeyError:
raise ... |
#! /usr/bin/python3
from modules.filter import src_query
from modules.generator import menu_gen, save_res, make_cfg
import tkinter as tk
import tkinter.messagebox as messagebox
def switch(ls,idx,ost):
ls[idx], ls[idx+ost] = ls[idx+ost], ls[idx]
return ls
def isInt(s):
try:
i = int(s)
ret... |
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
@brief:
"""
from __future__ import print_function
import os
import re
import sys
import shutil
import tempfile
import subprocess
import numpy as np
import scipy.sparse as sps
from pylightgbm.utils import io_utils
from sklearn.base import BaseEstimator, ClassifierMix... |
import io
import requests
import csv
import time
from typing import Union, Callable
from os.path import join
import pandas as pd
from comotion import Auth
from comotion import comodash_api_client_lowlevel
from comodash_api_client_lowlevel.comodash_api import queries_api
from comodash_api_client_lowlevel.model.query_tex... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2016, Battelle Memorial Institute
# 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. Redistri... |
# coding=utf-8
# Copyright 2020 The Google Research 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... |
import pgzrun
import random
def draw():
global status_game, Object, Meter, Max_Meter, health, blood, text_space
screen.clear()
if status_game == "menu":
img_home.draw()
text_space.draw()
head_tuu.draw()
tank_home.draw()
elif status_game == "start" or status_game == "boom... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2018
# Author: <NAME> (<EMAIL>)
# file: io_helpers.py
import sys
import os
import unicodedata
import locale
import logging
from graphit import __module__, version
from graphit.graph_py2to3 import StringIO, urllib, urlparse, PY_STRING, to_unicode
__all__ = ['initial_nod... |
"""
Defines some useful utilities for plotting the evolution of a Resonator Network
"""
import copy
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib.lines import Line2D
from utils.encoding_decoding import cosine_sim
class LiveResonatorP... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: vad_test.py
@Time: 2019/11/16 下午6:52
@Overview:
"""
import pdb
from scipy import signal
import numpy as np
from scipy.io import wavfile
import torch
import torch.nn as nn
import torch.optim as optim
from Proces... |
from collections import OrderedDict
import sys
import numpy as np
import onnx
from array import array
from pprint import pprint
def onnx2darknet(onnxfile):
# Load the ONNX model
model = onnx.load(onnxfile)
# Check that the IR is well formed
onnx.checker.check_model(model)
# Print a huma... |
"""
Base generator
"""
import csv
import json
import os
from .util import camelcase_to_snakecase
class TextField:
def __init__(self, input, output):
self.input = input
self.output = output
class BaseGen:
"""Base generator.
Args:
config: config.yaml
id: csv / json id, e... |
#!/usr/bin/env python
"""
This module does some of the math for doing ADMM.
All the 3D ADMM math is a Python version of the ideas and code in the
following references:
1. "High density 3D localization microscopy using sparse support recovery",
Ovesny et al., Optics Express, 2014.
2. "Computational methods in si... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
"""
Copyright (c) 2018-2021 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain... |
""""""
from collections import OrderedDict
import logging
import mmap
from struct import unpack
from pydcmjpeg._markers import MARKERS
from pydcmjpeg.jpeg import get_jpeg
LOGGER = logging.getLogger('pdcmjpeg')
def jpgmap(fpath):
"""Return a memory-mapped representation of the JPEG file at `fpath`."""
LOGG... |
from __future__ import annotations
from typing import Dict, List, Optional
import yaml
from base.basic import Circuit
from base.block import IBlock
from templates.block import BlockType, BlockTemplate, BlockFactory
from templates.conn import ConnTemplate
__author__ = "<NAME>"
__copyright__ = "Copyright 2021"
class... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import os
i... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: wtte-dev
# language: python
# name: wtte-dev
# ---
# %% [markdown]
# # WTTE-RNN in PyTorch
#
# <NAME>
... |
import os
import sys
import periphery
from .test import ptest, pokay, passert, AssertRaises
if sys.version_info[0] == 3:
raw_input = input
pwm_chip = None
pwm_channel = None
def test_arguments():
ptest()
# Invalid open types
with AssertRaises("invalid open types", TypeError):
periphery.PW... |
import sys
from postagger.utils.classifier import MaximumEntropyClassifier
from postagger.utils.common import timeit, get_data_path
from postagger.utils.common import get_tags
from postagger.utils.preprocess import load_save_preprocessed_data
from postagger.utils.decoder import CompData
from postagger.utils.classifier ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# 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 ... |
''' Forecast time series '''
import random
import sys
import argparse
import numpy as np
import tensorflow as tf
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
def build_lstm_graph(n_features, n_targets, quantiles, burn_in,
num_units, input_k... |
'''
Copyright 2020 Xilinx 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, software... |
# Author: <NAME>
# This script will monitor product availability
# of some specfic publishers and retailers.
# Copyright 2021 <NAME>.
# Licensed under the MIT License.
import enum
import json
import re
import requests
import sched
import time
import validators
# import traceback
from datetime import datetime
class ... |
# coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import os
import time
import pickle
import numpy as np
import pandas as pd
from multiprocessing import Pool, cpu_count
from itertools import repeat
from ensemble_boxes import *
from map_boxes import *
def save_in_file_fast(arr, file_name):
pickl... |
import os
from glob import glob
from microbench.google_benchmark.gbench_run_result import GBenchRunResult
from microbench.google_benchmark.gbench_historical_results import GBenchHistoricalResults
from microbench.jenkins.jenkins import Jenkins
from microbench.constants import LOCAL_REPO_DIR, JENKINS_URL
from microbench... |
import math
import numpy as np
def quaternion_to_rotation_matrix(q):
# Original C++ Method defined in pba/src/pba/DataInterface.h
qq = math.sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3])
qw = qx = qy = qz = 0
if qq > 0: # NORMALIZE THE QUATERNION
qw = q[0] / qq
qx = q[1]... |
#!/usr/bin/env python3
import argparse
import logging
import os
import sys
import time
import youtube_dl
import xlsxwriter
import shutil
import re
from requests import get
import formats
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel('WARNING')
logging.basicConfig(level=logging.INFO,
... |
# coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
from pymatgen.core import Structure
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
def _make_spcecies_shortname(label: str, species: list):
"""make secies short name
Args:
l... |
import numpy as np
import pandas as pd
from collections import Counter
from skmultilearn.model_selection.measures import get_combination_wise_output_matrix
from skmultilearn.model_selection import iterative_train_test_split
from tqdm import tqdm
def get_section(report, section_name, section_status = False):
if rep... |
import torch
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import to_dense_adj, contains_self_loops, contains_isolated_nodes
from torch_cluster import knn_graph
import torch.nn as nn
from torch_geometric.nn.inits import reset
from torch.nn import Sequential as Seq, Linear as Lin, R... |
# https://github.com/micropython/micropython-lib/blob/master/umqtt.simple/example_sub_led.py
#edited on march 22nd by <NAME>
from cmath import e
from network import WLAN # For operation of WiFi network
import time # Allows use of time.sleep() for delays
import pycom # Base libra... |
#!/usr/bin/env python3
####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: profile_builder.py
# Authors: <NAME>
#
# Requires: Python 3.x
#
####################################################################... |
# -*- coding: utf-8 -*-
import time
import sys
from gamedb import COLORS
from gamedb import Weapon
from gamedb import WEAPONS
from gamedb import LEVEL_UP_MSG
from gamedb import NEWITEM_MSG
from gamedb import Party
from gamedb import party_weapons
from gamedb import equiped_weapons
import battle_system
fro... |
import numpy as np
import argparse
import os
import random
from tensorflow.python.training.tracking.util import Checkpoint
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import time
import json
import tensorflow as tf
from tensorflow.keras import optimizers
from tensorflow.keras.layers import *
from tensorflow.keras.models ... |
from tkinter import *
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.backend_bases import key_press_handler
import numpy as np
#commandline
import argparse
#visualization
import matplotlib.pyplot as plt
#font
import matplotlib.font_manager as fm
# import pyglet
#... |
import dataclasses
from types import MethodType
from typing import ( # type: ignore
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
_TypedDictMeta,
)
from dictdaora import DictDaora
from .decorator import jsondaora
from .exceptions import DeserializationError
class StringField(Dic... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import glob
import argparse
import ninja_syntax
class Configuration:
def __init__(self, options):
self.root_dir = os.path.dirname(os.path.abspath(__file__))
self.source_dir = os.path.join(self.root_dir, "src")
... |
""" Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the t... |
from __future__ import print_function
class Rule(object):
def __init__(self):
pass
def __repr__(self):
return self.name()
@classmethod
def name(cls):
return cls.__name__.split('.')[-1]
@classmethod
def explain(cls):
return cls.__doc__
def __cmp__(self, other)... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2021 <NAME> <EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation fi... |
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
from modules.path import add_to_path, add_var
import modules.images
import urllib.request
import os
import threading
import ctypes
import winshell
from win32com.client import Dispatch
import pythoncom
class Ui_MainWindow(object):
def setupUi(self, MainWindow):... |
#!/usr/bin/env python3
# SPDX-License-Identifier: BlueOak-1.0.0
import datetime as dt
import mimetypes
import subprocess
import os
import tempfile
import urllib.parse
import mimetypes
from functools import partial
from pathlib import Path, PurePosixPath
import pygments
import pygments.lexers
import pygments.formatte... |
__author__ = 'Todd.Hay'
# -------------------------------------------------------------------------------
# Name: ProtocolViewer.py
# Purpose:
#
# Author: Todd.Hay
# Email: <EMAIL>
#
# Created: April 13, 2016
# License: MIT
#-------------------------------------------------------------------... |
import os
import tensorflow_datasets as tfds
import tensorflow as tf
import numpy as np
from common.inputs.data_input import DataInfo
bxs_m2 = [[1, 1], [1, -1], [-1, 1], [-1, -1]]
def parse_multi_mnist1(serialized_example):
""" Data parsing function.
"""
features = tf.io.parse_single_example(serialized... |
"""Contains transformer embedding layers.
"""
__author__ = '<NAME>'
from typing import List, Dict, Tuple
from dataclasses import dataclass, field
import logging
import itertools as it
import torch
from torch import Tensor
from torch import nn
from zensols.deeplearn import DropoutNetworkSettings
from zensols.deeplearn... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... |
#! /usr/bin/python3
"""Visualisation script for Git repositories.
Requires the `evince` and `dot` command line tools.
"""
import time
import subprocess
import tempfile
from pathlib import Path
import sys
from itertools import groupby
from collections import namedtuple
ENCODING = sys.getdefaultencoding()
class Ref(n... |
"""Blueprint for a micropub endpoint implementation.
Kept separate from indieauth, but note that it must know of the indieauth token
endpoint in advance, so there is some coupling.
"""
import json
import os.path
import re
import typing
from urllib.parse import unquote
from flask import (
Blueprint,
Request,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
================
Network Rewiring
================
:Author:
<NAME>
:Date:
2011-03-01
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
randomisation.py
"""
import numpy
import networkx as nx
def standard_direct... |
#
# Copyright (c) 2021 The GPflux Contributors.
#
# 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 agr... |
import os
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class ReplayBuffer:
def __init__(self, state_dim, action_dim,max_size=1e6, device = torch.device('cpu')):
self.state_dim = state_dim
self.action_dim = action_dim
self.max_size = max_size
... |
"""
PVANet mainly consists of two different kinds of blocks:
1. conv-crelu-bn blocks
2. inception blocks
"""
from collections import namedtuple
import tensorflow as tf
slim = tf.contrib.slim
BLOCK_TYPE_MCRELU = 'BLOCK_TYPE_MCRELU'
BLOCK_TYPE_INCEP = 'BLOCK_TYPE_INCEP'
BlockConfig = namedtuple('BlockConfig',... |
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
from functools import wraps
from logging import getLogger
from typing import Dict, Union
import requests
from ethereum.utils import (check_checksum, checksum_encode, ecrecover_to_pub,
privtoaddr, sha3)
from hexbytes import HexBytes
from web3 import HTTPProvider, Web3
from web3.middleware im... |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# Author: <NAME>
# <EMAIL>
#
# File Created: Wednesday, 10th January 2018 11:38:17 pm
# Last Modified: Sunday, 4th March 2018 6:26:29 pm
# Modified By: <NAME> (<EMAIL>)
#
# Give the best to the world
# Copyright - 2018 Ardz.Co
# +++++++++++++++++++... |
from pypsrp.client import Client
import os
import zipfile
from util import util
import tempfile
from pypsrp.powershell import PowerShell, RunspacePool
from pypsrp.wsman import WSMan
from pypsrp.shell import WinRS
from pypsrp.shell import Process
from pypsrp.shell import SignalCode
def winRsGetWinstallFolder():
sc... |
from gripper import GripperInfo
from grasp import *
from klampt.model import ik
from klampt.math import vectorops,so3,se3
from klampt.model import contact
from klampt import io
import copy
import json
import os
def _object_name(obj):
if isinstance(obj,str):
return obj
elif hasattr(obj,'name'):
... |
import sqlite3
import operator
import subprocess
import os
import csv
import apsw
import time
import threading
DB_NAME = "example.db"
# A class to store flight information.
class Flight:
def __init__(self, fid = -1, dayOfMonth=0, carrierId=0, flightNum=0, originCity="", destCity="", time=0, capacity=0, price=0):
... |
"""
Unit tests for scCODA
"""
import unittest
import numpy as np
import scanpy as sc
import tensorflow as tf
import pandas as pd
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
from sccoda.util import cell_composition_data as dat
from sccoda.util import comp_ana... |
# -*- coding: utf-8 -*-
import typing
import collections
import inspect
import functools
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.4'
__all__ = (
'aiter',
'arange',
'transform_factory',
'alist',
'atuple',
'aset',
'adict',
'amap',
'anext',
'afilter',
... |
# coding: utf-8
# In[1]:
import sklearn
import numpy as np
from glob import glob
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import... |
import datetime as dt
import hydra
import logging
import numpy as np
import os
import time
import torch
import torch.distributed as dist
from hydra.utils import instantiate
from ignite.contrib.handlers import ProgressBar
from ignite.engine import Engine, Events
from ignite.handlers import Checkpoint, TerminateOnNan
fr... |
"""
================================================================================
Utilities for handling data types and transformations
================================================================================
**<NAME>**
4/18/2018
"""
#########################################################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.