text stringlengths 3.07k 22.1k |
|---|
# To run this, pay attention to this:
# define num_classes when initializing the model
# define f2c when calling train() and test()
'''Train CIFAR10 with PyTorch.'''
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backen... |
from __future__ import annotations
import json
import re
from subprocess import DEVNULL, PIPE
import sys
import tempfile
from dataclasses import dataclass
from datetime import date
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
from anitracker import logger, ffprobe_cmd, ffmpeg_cmd
from ani... |
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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 ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
import keyboard as keyb
# pip install keyboard
from colorama import Fore, Back, Style, init
# pip install colorama
init()
import os
import time
import msvcrt
"""
pip install pyinstaller
to install ability .exe file
pyinstaller main.py
to create .exe file
run it in dist dirictory
"""
### Development started 19.03.22 ... |
# Fundamental libraries
import os
import sys
import time
import glob
import random
import datetime
import warnings
import itertools
import numpy as np
import pandas as pd
import pickle as cp
import seaborn as sns
import multiprocessing
from scipy import stats
from pathlib import Path
from ast import literal_eval
import... |
'''
This file is a part of My-PyChess application.
In this file, we manage the stockfish menu.
This is called from either main menu or singleplayer menu
'''
import os
import platform
import pygame
from ext.pyFish import teststockfish
from tools.loader import STOCKFISH, BACK, putLargeNum
from tools.utils i... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from src.utils.config import cfg
__all__ = [
"ResNet", "ResNet18", "ResNet34", "ResNet50", "ResNet1... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from vedo.utils import sortByColumn
from vedo import Plotter, Points, Spline
from scipy import signal
import os
#########################################################################
class SplinePlotter(Plotter):
def __init__(self, **kwargs):
... |
import torch
import torch.nn as nn
import torchvision.models as models
def double_conv(in_channels, out_channels):
return nn.Sequential(
nn.Conv2d(in_channels, out_channels, 3, padding=1),
nn.ReLU(inplace=True),
nn.Conv2d(out_channels, out_channels, 3, padding=1),
nn.ReLU(inplace=Tr... |
from __future__ import unicode_literals
import copy
import enum
from cryptography import utils as cry_utils
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric... |
from __future__ import print_function
from six.moves import cPickle as pickle
import numpy as np
import os
from scipy.misc import imread
import platform
import random
# 读取文件
def load_pickle(f):
version = platform.python_version_tuple() # 取python版本号
if version[0] == "2":
return pickle.load(f) # pickl... |
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn
from SeleniumLibrary import SeleniumLibrary
from json import dumps
import sys
import random
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.co... |
import json
import enum
import base64
from dataclasses import dataclass, field as dataclass_field, replace
from collections import defaultdict
from typing import Any, Union, Optional
from unittest.mock import MagicMock
from aws_lambda_api_event_utils.aws_lambda_api_event_utils import (
FormatVersion,
EVENT_FOR... |
import pandas as pd
import numpy as np
import re
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib
sns.set(style="ticks", color_codes=True, font_scale=1.4)
sns.set_context("paper", rc={"font.size":10,"axes.titlesize":10,"axes.labelsize":10})
pd.set_option('display.max_columns', None)
# read dat... |
import re
import os.path
import urllib.request
import sublime
from ..emmet.html_matcher import AttributeToken
from ..emmet.action_utils import CSSProperty
pairs = {
'{': '}',
'[': ']',
'(': ')'
}
known_tags = [
'a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio',
'b', 'base'... |
import torch
import torchvision
import numpy as np
import torch.nn.functional as F
import matplotlib.pyplot as plt
def encode_cmap(label):
cmap = colormap()
return cmap[label.astype(np.int16),:]
def denormalize_img(imgs=None, mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375]):
_imgs = torch.zer... |
# Author: a101269
# Date : 2020/3/4
from glob import glob
from collections import Counter
import pathlib
import torch
PAD = '<PAD>' # 词表文件的开头要有<UNK>等
UNK = '<UNK>'
ROOT = '<ROOT>'
VOCAB_PREFIX = [PAD, UNK, ROOT]
def load_vocab(args):
pos_vocab=None
know_vocab=None
rel_vocab=None
bio_vocab=N... |
#!/usr/bin/env python
"""
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, publi... |
'''
Export ROADrecon data into BloodHound's neo4j database
Uses code from aclpwn under an MIT license
Copyright (c) 2020 <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... |
import sys, os
import numpy as np
import argparse
import matplotlib.pyplot as plt
from bloom_filter import BloomFilter
BHAM_DIR = ".\\minimap2\\test\\Bham_decompressed"
class Query:
def __init__(self):
self.x, self.y = [], []
self.name = ""
self.score = 0
def merge(self,... |
"""Test accuracy of the convert modules.
This module provides tests of the conversion modules. This module can be
called from the command line as::
python testcnv.py mod ...
which will run all tests on the module ``mod``. There are only two
conversion modules - ``convert0`` and ``convert5``. If called with no
ar... |
import pytest
slow = pytest.mark.skipif(
not pytest.config.getoption("--slow"),
reason="need --slow option to run"
)
from functools import partial
import numpy as np
import GPy
from elfi.bo.gpy_model import GPyModel
from elfi.methods import Rejection
from elfi import InferenceTask
from sdirl.elfi_utils i... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# vulture - Find dead code.
#
# Copyright (c) 2012-2016 <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... |
# -*- coding: utf-8 -*-
# @Time : 18-12-20
# @Author : <NAME>
# @Site : https://github.com/Lokfar
# @File : co_cluster_wuqiao.py
# @IDE : PyCharm Community Edition
import datetime
import random
import math
import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import make_bicluster... |
"""
Main function for training and evaluating MARL algorithms in NMARL envs
@author: <NAME>
"""
import logging
import argparse
import threading
import configparser
import tensorflow as tf
from .envs.tragedy_env import TragedyEnv
# from envs.cacc_env import CACCEnv
#from envs.real_net_env import RealNetEnv
#from envs.... |
#!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... |
from mongoengine.django.forms import DocForm
from django import forms
from django.core.urlresolvers import reverse, get_urlconf, get_resolver, NoReverseMatch
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.fields.related import RelatedField
from django.utils.encoding impo... |
# -*- coding: utf-8 -*-
"""Shape layer API."""
from __future__ import absolute_import
import logging
from psd_tools.debug import pretty_namedtuple
from psd_tools.constants import TaggedBlock, PathResource
from psd_tools.decoder.actions import UnitFloat
logger = logging.getLogger(__name__)
class StrokeStyle(object):... |
import json
import os
from collections import deque
from statistics import mode
from typing import Any, Callable, Tuple, Union
import cv2
import joblib
import mediapipe as mp
import numpy as np
from xarm_hand_control.modules.utils import FPS
from xarm_hand_control.modules.utils import ClassificationMode
from xarm_han... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import tensorflow as tf
import six
from tools import visualize
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('cls', 10, 'numbers of classifiers')
tf.app.flags.DEFINE_integer('IMG_WIDTH', 299, 'image width')
tf.app.flags.DEFINE_integer('IMG_HEIGHT', 299, 'image heigh... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 <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 without limitation the rights... |
#############################################
# Author: <NAME> #
# E-mail: <EMAIL> #
# Homepage: https://github.com/hwfan #
#############################################
import argparse
import os
import numpy as np
from tqdm import tqdm
import cv2
import copy
import torch
imp... |
"""
api.py
- provides the API endpoints for consuming and producing
REST requests and responses
"""
from flask import Blueprint, jsonify, request
import uuid
from sqlalchemy.sql.expression import func, select
from models import db, UserPool, Survey, SurveyRecord, AnnotationSentences, TestAnnotations, Annotations, De... |
from __future__ import print_function
from enum import IntEnum
import struct
import binascii
import uuid
import threading
from .notifications import GenericClearTileNotification
from .parser import MsftBandParser
from .commands import (
SERIAL_NUMBER_REQUEST, CARGO_NOTIFICATION,
GET_TILES_NO_IMAGES, CORE_WHO_A... |
from webbrowser import get
from bitcoinlib.mnemonic import Mnemonic
from bitcoinlib.wallets import Wallet
from bitcoinlib.keys import HDKey
from bitcoinlib.keys import Key
from dotenv import load_dotenv
from appJar import gui
from appJar.appjar import WIDGET_NAMES
import datetime
import requests
import serial
import ra... |
#!/usr/bin/env python3
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QGridLayout, QVBoxLayout, QLabel, \
QLineEdit, QTabWidget, QPushButton, QGroupBox, QTextEdit, QComboBox
from PyQt5.QtCore import pyqtSlot
from perylune.OrbCalc import *
from math import sin, cos, acos, sqrt
from per... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 29 16:00:13 2021
@author: dani
"""
##### DEVELOPMENT NOTE
# think about how to deal with cells with multiple problems:
# - create separate label for each combination OR label same cell multiple times, once for each problem OR some mix of the two
# - think about 'domi... |
# Copyright (C) 2019 Intel Corporation
#
# SPDX-License-Identifier: MIT
import argparse
import logging as log
import os
import os.path as osp
import shutil
from datumaro.components.project import Project
from datumaro.components.comparator import Comparator
from datumaro.components.dataset_filter import DatasetItemE... |
#!/usr/bin/env python3
#
# Copyright 2021 Assured Information Security, 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 ... |
#!/usr/bin/env python3
""" simulate_model.py: obtains a few netronics parameters for a basic sphere geometry ."""
""" run with python3 simulate_sphere_model.py | tqdm >> /dev/null """
""" outputs results to a file called simulation_results.json """
__author__ = "<NAME>"
import openmc
import os
import json
impor... |
##
# \file utilities.py
#
# \author <NAME> (<EMAIL>)
# \date April 2018
#
import os
import numpy as np
import scipy.linalg
import nibabel as nib
import SimpleITK as sitk
import scipy.ndimage.morphology
import pysitk.python_helper as ph
import pysitk.simple_itk_helper as sitkh
import simplereg.data_writer a... |
# Copyright 2018 Google 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 by applicable law or a... |
import os
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils import weight_norm as wn
import numpy as np
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
def _compute_enery_ising(sample, ... |
"""Site backup and restore functions.
Backup file format is a zipfile with following contents:
backup-name/ - top-level directory
metadata.json - backup metadata
media/ - site media
backup.sql - backup sql data
The zipfile name takes the form <backup-name>-<sha1s... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import logging
import boto3
import re
import time
import urllib2
from contextlib import closing
from boto3.s3.transfer import S3Transfer
from botocore.client import ClientError
from tempfile import NamedTemporaryFile
from lxml import etree
from os.path imp... |
import re
import io
import random
import logging
import discord
from discord.ext import commands
from PIL import Image, ImageDraw, ImageSequence, ImageFont
class Question(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger(self.__class__.__name__)
self.l... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from logging import getLogger
from libcity.model import loss
from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel
class CRANN(AbstractTrafficStateModel):
def __init__(self, config, data_feature):
super().__init_... |
"""Optimization related utils."""
from __future__ import division
import copy
from collections import OrderedDict
import logging
import functools
import importlib
import warnings
import torch
from torch import nn
from utils.rmsprop import RMSprop
from utils.adamw import AdamW
from utils.adam import Adam
def poly_lea... |
# import the necessary packages
import re
import PyCmdMessenger
import math
from pyimagesearch.shapedetector import ShapeDetector
from pyimagesearch.colorlabeler import ColorLabeler
from scipy.spatial import distance as dist
from imutils import perspective
from imutils import contours
import numpy as np
import argparse... |
import os
import warnings
import numpy as np
from pyrates.utility.genetic_algorithm import CGSGeneticAlgorithm
from pandas import DataFrame, read_hdf
from copy import deepcopy
class CustomGOA(CGSGeneticAlgorithm):
def eval_fitness(self, target: list, **kwargs):
# define simulation conditions
wor... |
# -*- coding: utf-8 -*-
import feedparser
import json
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponse, HttpResponseForbidden
#i can use the . dot because models is in the same folder
from .models import Source, Feed
from .... |
#!/usr/bin/env python
import json
import os
import pickle
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import ContextManager
from unittest import main, TestCase
from unittest.mock import patch, Mock
from cli_command_parser import Command, Positiona... |
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(DATA61_BSD)
#
... |
#!/usr/bin/env python
import collections
import itertools
import netaddr
import os.path
import yaml
import six
from ansible.module_utils.basic import *
def open_network_environment_files(netenv_path):
errors = []
try:
with open(netenv_path, 'r') as net_file:
network_data = yaml.load(net... |
#-----------------------------------------------------------------------
# Copyright (C) 2020, All rights reserved
#
# <NAME>
#
#-----------------------------------------------------------------------
#=======================================================================
#
# DESCRIPTION:
# This software is part of a... |
# Copyright 2012 10gen, 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... |
__license__ = "MIT"
__author__ = "<NAME>."
import datetime
import enum
import functools
import logging
import subprocess
import random
import time
import gc
import threading
import configparser
import os
import importlib
from LED import LED
from calculations import questions
import guis
default_update_check_interv... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
import cv2
import glob
import os
import torch
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("/usr/share/fonts/truetype/freefont/FreeMono.ttf", 24 )
from torch.utils.data.dataset import Dataset
import numpy as np
from torch.utils.data import DataLoader
from scipy.io import loadmat
from PIL import... |
import socket
from notion_as_db.configured_notion import Notion
from .ncloud import NCloud
notion = Notion()
collection_dict = notion.get_collections_as_dict(notion.block_dict["cloud"])
def get_local_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 1))
return s.getsockna... |
"""Functors are functions that take typically one or more other PDF. Prominent examples are a sum, convolution etc.
A FunctorBase class is provided to make handling the models easier.
Their implementation is often non-trivial.
"""
# Copyright (c) 2021 zfit
import functools
import operator
from collections import Cou... |
"""This module manages the formal specification of reference file constraints
as a generic system.
The name TPN is a legacy term from the predecessor of CRDS, HST's CDBS. It's
the file extension for files used to describe the constraints for a specific
instrument and type.
TPN files are unique to each project/telesc... |
# 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... |
'''
Tests for nrg mapping procedures.
'''
from numpy import *
from numpy.testing import dec,assert_,assert_raises,assert_almost_equal,assert_allclose
from matplotlib.pyplot import *
from scipy import sparse as sps
from scipy.linalg import qr,eigvalsh,norm
import time,pdb,sys
from ..hybri_sc import *
from ..discretiza... |
import numpy as np
import math
import tensorflow as tf
from utils import read_xml_file
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
import pandas as pd
# model with pre-trained weights that are going to be transfered (transfer learning)
MODEL_PATH = 'model_bi_lstm_crf_... |
#!/usr/bin/python3
import feedparser
import time
import string
from time import strftime,localtime
from subprocess import check_output
import sys
import json
from bs4 import BeautifulSoup
from pprint import pprint
import configparser
import os
from os.path import expanduser
from appdirs import *
from pathlib import Pa... |
import discord
import os
from utils import permissions
from discord.ext import commands
import time
import asyncio
import sys
import cpuinfo
import math
import psutil
def propcheck(prop, d):
return d[prop] if d[prop] else "None"
class Core:
def __init__(self, bot):
self.bot = bot
self.color =... |
"""
Pymunk constraints demo. Showcase of all the constraints included in easymunk.
Adapted from the Chipmunk Joints demo:
https://github.com/slembcke/Chipmunk2D/blob/master/demo/Joints.c
"""
import inspect
import math
import pygame
import easymunk
import easymunk.pygame
from easymunk import Vec2d
pygame.init()
scr... |
##########################################################################
# Example : perform live fire detection in image/video/webcam using superpixel localisation
# and the superpixel trained version of the NasNet-A-OnFire,
# ShuffleNetV2-OnFire CNN models.
# Copyright (c) 2020/21 - <NAME> / <NAME> / Toby
# Breck... |
# -*- coding: utf-8 -*-
import glob
import os
from .lexer import lex
from .analyzer import analyze, enter_block_ctx
from .errors import NgxParserDirectiveError
# map of external / third-party directives to a parse function
EXTERNAL_PARSERS = {}
# TODO: raise special errors for invalid "if" args
def _prepare_if_args... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
from typing import Any, Union
from typing import Dict, Hashable
import numpy as np
from cumm import tensorview as tv
import json
from collections import abc
from functools import reduce
JSON_INDEX_KEY = "__cumm_io_json_index"
NPDTYPE_TO_JSONARRAY_MAP = {
np.dtype(np.uint64): tv.uint64,
np.dtype(np.uint32): t... |
import matplotlib.pyplot as pp
import numpy as np
import tensorflow as tf
import random
###################################
# Initialize Algorithm Parameters #
###################################
num_words = 10000
display_dataset_properties = True
display_training_performance = True
num_epochs = 40
learning_rate = 2e... |
# coding: utf-8
import datetime
import json
import os
import time
from logging import DEBUG, INFO, WARNING, basicConfig, getLogger
import requests
fmt = "[%(asctime)s][%(levelname)s] %(message)s"
basicConfig(level=DEBUG, format=fmt)
logger = getLogger(__name__)
getLogger("urllib3").setLevel(WARNING)
# LANG = "ja"
L... |
"""Edge effect only analysis.
Input:
base LULC
optimization mask
"new" forest mask
base biomass
Process:
Calculate biomass for new optimization mask
Mask new biomass against the "new" forest mask so it only shows old biomass
Subtract new biomass from old biomass (output this raster based o... |
# -*- coding: utf-8 -*-
import os
import requests
import subprocess
import tempfile
from dp_tornado.engine.cache import dpInValueModelConfig
from dp_tornado.engine.engine import Engine as dpEngine
class Compressor(dpEngine):
def __init__(self, handler):
self.handler = handler
self.provider = {
... |
# -*- coding: UTF-8 -*-
"""Reward function for processing a train child model
Reward function takes in trained model and validation data as input, returns reward
"""
# Author: ZZJ
# Initial date : Nov. 18, 2018
# Last update : Aug. 17, 2020
import numpy as np
import copy
from .commonOps import unpack_data
from ..ut... |
import os
from collections import OrderedDict
import yaml
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear, ReLU
from . import constants
"""Config schemas
This file loads config files and computes some extra stuff.
For example, ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
import os
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import copy
import argparse
from models.layers import *
class Generator(nn.Module):
def __init__(self, latent_dim, style_length=5, conte... |
#!/usr/bin/env python
# encoding: utf-8
"""
analyze_variants.py
Analyze the the variants in a vcf, the following will be printed:
- How many variants found
- How many mendelian violations
- How many variants where not covered in all individuals. (Default depth 7)
- How many variants did not satisf... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import networkx as nx
from network_stack import *
import plotly.graph_objs as go
import dash_table
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name_... |
# wiseodd/natural-gradients
import torch.nn.functional as F
import numpy as np
from numpy.linalg import inv
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset
from torch.distributions.multivariate_normal import MultivariateNormal
from torch.distributions.normal import Normal
from torch.dis... |
"""Sample program to train and validate with DeepAR iteratively"""
import sys
import torch
import torch.nn as nn
import argparse
import torch.nn.functional as F
import torch.utils.data as data_utils
import numpy as np
from os import path
from torch.autograd import Variable
from sklearn.preprocessing import StandardScal... |
def generateKeys(keyByte):
key = [0] * 56
keys = [0] * 16
for i in range(7):
for j in range(8):
key[i * 8 + j] = keyByte[8 * (7 - j) + i]
for i in range(16):
for j in range([1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1][i]):
key = key[1:28] + key[0:1] + key[29:5... |
# Copyright (c) 2019 by <NAME>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in... |
# coding: utf-8
from __future__ import unicode_literals
import pytest
from spacy.lang.en import English
from spacy.cli.converters import conllu2json, iob2json, conll_ner2json
from spacy.cli.pretrain import make_docs
def test_cli_converters_conllu2json():
# https://raw.githubusercontent.com/ohenrik/nb_news_ud_sm... |
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import time
import logging
import random
import googletrans
prefix = "$"
BOT_TOKEN = "<PASSWORD>"
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=prefix,... |
import io
import os
import json
import random
import numpy as np
import tensorflow as tf
from pathlib import Path
from common.kb import load_kb
from collections import defaultdict
from nltk import wordpunct_tokenize
from configs import configs as _config
from nltk.tokenize import RegexpTokenizer
def preprocess_senten... |
#!/usr/bin/env python
'''
Created January, 2012
@author: Dr. <NAME>
DriveToGoals.py - This ROS node reads a sequence of goals from a text file
and then commands a robot running the ROS navigation stack to navigate to the
goals in sequence.
Copyright (c) 2012 Dr. <NAME>. All right reserved.
Redistribution... |
import pytest
from src.graphs import BLACK
from src.graphs import clone_graph
from src.graphs import fill_surrounded_regions
from src.graphs import flip_color
from src.graphs import GraphNode
from src.graphs import is_minimally_connected
from src.graphs import search_maze
from src.graphs import WHITE
class TestSearc... |
# Calorie & Macro Tracker
# Libraries
import datetime
import calendar
import matplotlib.pyplot as plt
# Functions
def display_menu():
print("\n*-----Calorie & Macro Tracker-----*")
print("1. Set goals (daily)")
print("2. Calculate today's net calorie")
print("3. Enter today's macros")
print("4. ... |
from typing import List
import streamlit as st
import streamlit.components.v1 as components
from tgApi import run_interpretted_gsql
import datetime
import plotly.graph_objects as go
import json
import copy
import pandas as pd
import graphistry
st.set_page_config(layout='wide')
graphistry.register(api=3, protocol="http... |
import os
import time
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import numpy as np
from cmws import util
from cmws.examples.switching_ssm import util as switching_ssm_util
import ssm
from ssm.util import random_rotation, find_permutation
from cmws.examples.switching_ssm.data import SLDSDataset... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Multimeter class for the Voltcraft VC870
This multimeter uses its own protocol which is described here:
- https://asset.conrad.com/media10/add/160267/c1/-/en/000124603IN01/information-124603-voltcraft-vc870-hand-multimeter-digital-cat-iii-1000-v-cat-iv-600-v-a... |
# Purpose: support for the Ac1015 MTEXT entity
# Created: 24.05.2015
# Copyright (C) 2015, <NAME>
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <<EMAIL>>"
from contextlib import contextmanager
import math
from .graphics import none_subclass, entity_subclass, ModernGraphicEntity
... |
# pylint: disable=g-bad-file-header
# Copyright 2017 The Bazel 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
#... |
from dash import dcc, html, Input, Output, callback, dash_table
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
import numpy as np
import scipy.stats as stats
from pages.style import PADDING_STYLE
THRESHOLD = 0.5
TEXT_STYLE = {
'textAlign':'center',
'width': '70%',
'... |
import numpy as np
# Function to retrun the list of isotope index for an input element
def get_list_iso_index(specie, inst):
specie_list = []
for i_gl in range(0,len(inst.history.isotopes)):
if (specie+'-') in inst.history.isotopes[i_gl]:
specie_list.append(i_gl)
return specie_list
# L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.