text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
# Adapted from https://github.com/YavorPaunov/deepstreampy under MIT License
# Author: <NAME>, github.com/sapid
from __future__ import print_function
from twisted.internet import defer, task as twisted_task
from twisted.internet.protocol import Protocol, ClientFactory
from deepstreampy import cons... |
import functools
import logging
from dataclasses import dataclass
from typing import List, Optional, Tuple
from opentrons import types
from opentrons.hardware_control.types import CriticalPoint
from opentrons.hardware_control.util import plan_arc
from opentrons.motion_planning import (
DEFAULT_GENERAL_ARC_Z_MARGI... |
"""
Very simple pygame GUI solution
"""
import pygame
class Menu:
"""
Creates a Menu that contains various widgets\n
- screen: pygame display
- theme: Theme that is defaulty used for all widgets
- Menu.update() needs to be called every frame
"""
def __init__(self, screen, th... |
# original code: https://github.com/dyhan0920/PyramidNet-PyTorch/blob/master/train.py
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
impo... |
__all__ = ['k2w_es1d', 'k2w_es3d']
import numpy as np
import scipy.linalg
from scipy.special import ive
from .vlasov_utils import bzs, czs
import logging
def k2w_es1d(ks, species, params, J=8, sort='real'):
"""Compute dispersion relation for the unmagnetized 1d Vlasov-Poisson
system.
The basic algorit... |
#!/usr/bin/env python3
r"""
This module has functions to support various data structures such as the boot_table, valid_boot_list and
boot_results_table.
"""
import os
import tempfile
import json
import glob
from tally_sheet import *
from robot.libraries.BuiltIn import BuiltIn
try:
from robot.utils import DotDict... |
"""
HDF5 file read
"""
from __future__ import annotations
from pathlib import Path
import typing as T
import logging
from datetime import datetime, timedelta
import xarray
import numpy as np
import h5py
from gemini3d.utils import filename2datetime
from .. import find
from .. import WAVELEN
def simsize(path: Path)... |
import os
import torch
import numpy as np
import torch.nn as nn
import random
import string
from pathlib import Path
from core.models import MLP, ResNet18
from core.hessian_eigenthings import compute_hessian_eigenthings
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
def log_comet_metric(exp, name, val, step)... |
import torch
from rdkit import Chem
import argparse
import joblib
import os
import sys
import copy
from typing import Any
from seq_graph_retro.utils.parse import extract_leaving_groups
from seq_graph_retro.utils.chem import apply_edits_to_mol, get_mol
from seq_graph_retro.molgraph import BondEditsRxn, RxnElement, Mult... |
import json, gc, pickle, shutil
from glob import glob
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryDirectory
from typing import Any, Callable, Dict, List, NamedTuple, Type, Union
from typing_extensions import Protocol
import pytest
from hypothesis import given
from hypothesis.strategies i... |
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith plugin
# statconfs_plugin.py
# Coded by: WitcherGeralt (<EMAIL>)
# http://witcher-team.ucoz.ru/
STATCONFS_FILE = 'dynamic/statconfs.txt'
STATCONFS = {'joins': 0, 'confs': {}}
def handler_statconfs(conf, nick, afl, role, status, text):
if conf not in STATCONFS['c... |
# Author: <NAME>
# E-mail: <EMAIL>
# Author: <NAME>
# E-mail: <EMAIL>
# Author: <NAME>
# E-mail: <EMAIL>
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.preprocessing import OneHotEncoder
from torch.utils.data import Dataset
from sklearn.utils import resample
import matplotl... |
# BorBot.py, a bot for practicing python programming with the Discord API.
# Written by Boris
import os, random, json
import discord
from dotenv import load_dotenv
from discord.ext import commands, tasks
from PIL import Image, ImageDraw, ImageFont
from bs4 import BeautifulSoup
import urllib3
import asyncio
from RPGKit ... |
"""Data storage abstraction for local directories"""
from __future__ import annotations
import os, logging, asyncio, re, shutil, threading
from contextlib import asynccontextmanager
from glob import iglob
from pathlib import Path
from queue import Empty
from typing import Optional, AsyncIterator, Any, Callable, Tuple, ... |
#!flask/bin/python
import os
import json
import pyrebase
from flask import Flask, make_response, request, abort
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
config = {
"apiKey": os.environ['API_KEY'],
"authDomain": os.environ['AUTHDOMAIN'],
"databaseURL": os.environ['DBUTL'],
"storageBuc... |
import glfw
from OpenGL.GL import *
from OpenGL.GL.shaders import compileProgram, compileShader
import pyrr
from TextureLoader import load_texture
from ObjLoader import ObjLoader
import numpy as np
from camera import Camera
cam = Camera()
WIDTH, HEIGHT = 1280, 720
lastX, lastY = WIDTH / 2, HEIGHT / 2
first_mouse = Tr... |
# Django-Expenses
# Copyright © 2018-2021, <NAME>.
# All rights reserved.
# See /LICENSE for licensing information.
import datetime
from django.conf import settings
from django.dispatch import receiver
from django.urls import reverse
from django.utils.html import format_html
from django.utils.text import slugify, Tru... |
# coding=utf-8
"""
OpenVPN Management API for Python
(http://svn.openvpn.net/projects/openvpn/contrib/dazo/management/management-notes.txt)
"""
__author__ = "<NAME>"
__version__ = "0.1"
__all__ = ['manager']
import socket
CRLF = "\r\n"
PASSWORD_PROMPT = "ENTER PASSWORD:"
STATUS_SUCCESS = "SUCCESS: "
STATUS_ERROR = "E... |
import argparse
from args import get_default_ArgumentParser, process_common_arguments
from dataprun import GenerateWL, GenerateDomain2IP
import logging
#from DomainNameSimilarity import getDomainSimilarityCSR
from ip_to_ip import ip_to_ip
from time import time
from label import Label, LabelFiles
from domain2IP_matrix i... |
# -*- coding: utf-8 -*-
import re
from collections import deque
import inflect
import sys
from unidecode import unidecode as ud
from num2words import num2words
contractions = {
"aren't": "are not",
"can't": "cannot",
"can't've": "cannot have",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"co... |
import threading
import requests
import bs4
import json
from typing import List
base_url = "https://www.chefkoch.de"
class CategoryNotFoundError(Exception):
""" Thrown when a category is not valid """
pass
class EndOfRecipeError(Exception):
""" Raised when the end of the steps has been reached """
... |
# MIT License
#
# Copyright (c) 2020 <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
# to use, copy, modify, me... |
#!/usr/bin/env python3
""" This script generates training data for the object detector model. The output will be
images and the corresponding COCO metadata jsons. For most RetinaNet related training we
can train on images with _and without_ targets. Training on images without any targets
is valuable so the model sees t... |
# This program analyses the Iris data set
# Author: <NAME>
# imports libraries and aliases each library for ease of use
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
# reads in csv file with pandas, converts it to a DataFrame object & assigns it to variable '... |
from Prescient import db
from flask import (Blueprint, flash, redirect,
render_template, url_for, request)
from werkzeug.exceptions import abort
from flask_login import login_required, current_user
from Prescient.forms import WatchlistItemsForm, WatchlistGroupForm
from Prescient.models import (Watchl... |
from musicscore.basic_functions import dToX, xToD
from musicscore.musictree.midi import Midi
from musicscore.musictree.treechord import TreeChord
from musicscore.musictree.treeclef import TREBLE_CLEF, BASS_CLEF, LOW_BASS_CLEF, HIGH_TREBLE_CLEF
from musicscore.musictree.treemeasure import TreeMeasure
from musicscore.mus... |
import os
import six
import cwl_schema
CWL_VERSION_STRING = 'v1.0'
LOADING_OPTIONS = cwl_schema.LoadingOptions()
BASE_URI = cwl_schema.file_uri(os.getcwd())
def _is_list_of_strings(source_list):
if isinstance(source_list, list):
return all([isinstance(source, six.string_types) for source in source_list])... |
"""
Module with machine learning code
"""
import os
import tensorflow as tf
import numpy as np
import tqdm
import net.data
import net.utilities
class FullyConvolutionalNetwork:
"""
Fully Convolutional Network implementation based on VGG
"""
def __init__(self, categories_count):
"""
... |
import requests
import json
import os
from maskgen.software_loader import getFileName
from maskgen.maskgen_loader import MaskGenLoader
from maskgen.notifiers import MaskgenNotifer
import logging
def factory(loader):
"""
@type loader: MaskGenLoader
"""
return TrelloAPI(loader)
class TrelloAPI(MaskgenNo... |
from urllib.request import urlopen
from xml.etree import ElementTree
import datetime
import dateutil.parser
import re
BASE_URL = "https://aviationweather.gov/adds/dataserver_current/httpparam"
class AbstractMethodError(Exception):
def __init__(self, message=""):
Exception(message)
def _format(value):
... |
## GitHub: dark-teal-coder
import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup
from fpdf import FPDF
import datetime
import string
import os
## Get datetime information
current_datetime = datetime.datetime.now()
current_year = current_datetime.year
## Get the running script path
... |
import json
import srvdb
import re
import base58
import ipaddress
import subprocess
import time
import logging
import os
import psutil
from httputil import http200, http400, http403, http404, http500
# import flask web microframework
from flask import Flask
from flask import request
from flask import send_from_directo... |
import numpy as np
from pycompss.api.api import compss_wait_on
from pycompss.api.constraint import constraint
from pycompss.api.parameter import COLLECTION_IN, COLLECTION_OUT, \
Type, Depth
from pycompss.api.task import task
from scipy.sparse import issparse
from scipy.sparse import vstack as vstack_sparse
from skl... |
# CS Challenges - Day 1
################
## Exercise 1 ##
################
# 1. How many seconds are there in 21 minutes and 15 seconds?
seconds_in_minutes = lambda m, s=None: m * 60 if s == None else m * 60 + s
print(f"There are {seconds_in_minutes(1)} seconds in 1 minute.")
print(f"There are {seconds_in_minut... |
from django.utils.datastructures import SortedDict
from hyperadmin.endpoints import RootEndpoint
from hyperadmin.resources.directory import ResourceDirectory
from hyperadmin.resources.auth import AuthResource
from hyperadmin.throttle import Throttle
import collections
class Registry(dict):
def __init__(self, re... |
# something divine
# if you want your model works well
# please add "import lzc" to your code
# because there is only void before god
import lzc
import lzc.model
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import math
import lzc.config as config
import torch.nn... |
'''
Created on Jul 25, 2012
@author: mlovci
@author: gabrielp
Refactored on June 29, 2020
@author: algaebrown
'''
############################################################
####### This files contains many helper function ###########
############################################################
import os
import log... |
import numpy as np
from scipy.optimize import fsolve
"""Physical constants (https://physics.nist.gov/cuu/Constants/index.html)"""
HBARC = 197.3269788 # in MeV.fm
ALPHAFS = 7.2973525664e-3 # fine-structure constant
MEL = 0.5109989461 # electron mass energy equivalent in MeV
RMN = 939.5654133 # neutron mass energy equi... |
# Copyright 2014 Rackspace
# 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 app... |
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# 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,... |
# -*- coding: utf-8 -*-
from itertools import zip_longest
# from pydal.helpers.serializers import json as jsondumps
from pydal import geoPoint
from .pgcopy import BulkCopyer
from .base import BaseParser, BaseCopier, WTF
from overpy.exception import DataIncomplete
from overpy import RelationNode, RelationWay, Relation... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from formtools.wizard.views import SessionWizardView
from django.forms.fields import Field
from datetime import date
from django.core.exceptions import ValidationError
from django.utils.safestring... |
import numpy as np
import pandas as pd
from sklearn.exceptions import NotFittedError
from .base import Computer, MultiLevelComputer
class Sequence(Computer):
def __init__(self):
super().__init__()
self._acceptable_index_types = (
str,
list,
np.ndarray,
... |
import numpy as np
from scipy.fftpack import dst, idst
from core import block
from scipy.signal import savgol_filter
def hr_to_cr(bins, rho, data, radius, error=None, axis=1):
"""
This function takes h(r) and uses the OZ equation to find c(r) this is done via a 3D fourier transform
that is detailed in LAD... |
"""
Copyright (C) 2019-2021, Monash University, Geoscience Australia
Copyright (C) 2018, <NAME>
Bluecap is released under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LI... |
"""Handles which UI route to proceeded in submission workflows."""
from http import HTTPStatus as status
from functools import wraps
from typing import Optional, Callable, Union, Dict, Tuple
from typing_extensions import Literal
from flask import request, redirect, url_for, session, make_response
from flask import Re... |
"""
============
UCHII Fitter
============
Fit a free-free spectrum to an SED.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import pylab as pl
import numpy as np
try:
from scipy import optimize
except ImportError:
print("scipy not installed: UCHIIfitter may fail")
from pyspeckit import mpfit
from astropy import un... |
import json
from typing import List
from collections import OrderedDict
from ray.serve.deployment import Deployment
from ray.serve.deployment_graph import RayServeDAGHandle
from ray.serve.deployment_method_node import DeploymentMethodNode
from ray.serve.deployment_node import DeploymentNode
from ray.serve.deployment_f... |
import sys
from file_io import *
from progressbar import *
def find_and_build(root,path):
path = os.path.join(root, path)
if not os.path.exists(path):
os.makedirs(path,exist_ok=True)
return path
def merge(li:list,target:str):
if(os.path.exists(target)): return
res = None
for i in li:
... |
import logging
from copy import deepcopy
from traits.api import HasTraits, Trait
from openpnm.utils import PrintableDict
from auto_all import start_all, end_all
logger = logging.getLogger(__name__)
start_all()
class TypedMixin:
"""Brief explanation of 'TypedMixin'"""
def __init__(self, iterable=[], types=[]... |
# 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
# d... |
import tequila as tq
import qpfas
import numpy as np
from typing import List, Dict
######################################## General Workflow Functions ##################################################
def create_molecule(molecule_tag: str,
basis: str,
active_space,
... |
#!/usr/bin/env python
"""
This example illustrates how to obtain an MGE fit from a galaxy image
using the mge_fit_sectors package and how to verify the results.
V1.0.0: Translated NGC4342 example from the corresponding IDL version.
<NAME>, Aspen Airport, 8 February 2014
V1.0.1: Fixed incorrect... |
import cv2
import json
import numpy as np
from cv2 import aruco
import matplotlib.pyplot as plt
def extract_frame(vid_name, frame, frame_name):
vid = cv2.VideoCapture(vid_name)
vid.set(cv2.CAP_PROP_POS_FRAMES, frame)
ret, frame = vid.read()
if ret:
cv2.imwrite(frame_name, frame)
else:
... |
import os
import numpy as np
from sklearn.metrics import mutual_info_score
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import toml
import time
from multiprocessing import Pool
tau = 1
# xs.shape => (n, t)
# ys.shape => (n, t)
def transfer_entropy(xs, ys):
count_next_x_x_y = {}
c... |
import torch
import torch.nn as nn
from torchtext.legacy import data
import torch.optim as optim
import math
from prep_data import split_and_cut, tokenizer, convert_to_int
from model import BERTNLIModel
import time
from train_eval import train, evaluate
from utils import EarlyStopping, epoch_time
from opacus import Pri... |
# system
import sys
import re
from dataclasses import dataclass
from typing import Sequence, Mapping
from enum import Enum
# lib
import numpy as np
from keras.preprocessing.sequence import pad_sequences
# self
from general.tokenizer import Tokenizer
import data.ibc.treeUtil as treeUtil
sys.modules['treeUtil'] = treeU... |
"""
Code to compute <NAME>' tearing detection statistics.
See https://jira.slac.stanford.edu/browse/LSSTTD-1273.
"""
from __future__ import print_function
import os
from collections import namedtuple, OrderedDict
import numpy as np
import matplotlib.pyplot as plt
from .MaskedCCD import MaskedCCD
__all__ = ['TearingSt... |
import logging
from urlparse import urlparse
from datetime import datetime, timedelta
from django.db import models, transaction
from django.conf import settings
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse
from jsonfield import JSONField
from django.db.models.aggregat... |
import shutil
import numpy
import ilisa.calim
from ilisa.antennameta import calibrationtables as calibrationtables
from ilisa.monitorcontrol import data_io as dataIO, modeparms as modeparms
def applycaltab_cvc(cvcunc, caltab, sb=None):
"""Apply a caltable to CVC data.
Note
----
Formula used is:
... |
import re
import sqlite3
import sys
import time
import hashlib
import json
from datetime import datetime
from pprint import pprint
from urllib.parse import urlparse
def Conn(database):
if database:
print("[+] Inserting into Database: " + str(database))
conn = init(database)
if isinstance(c... |
import os
import sys
import random
import datetime
import shutil
import configparser
# Simulation.
CALENDAR_PATH = ""
OUTPUT_ROOT_DIR = "output"
SIMULATION_COUNT = 100
LESSON_TIME = 45
RANDOM_SEED = None
# Agent.
MASK = False
# Infection.
PULMONARY_VENTILATIION_RATE = 0.54
QUANTUM_GENERATION_RATE = 48
EXHALATION_FILTR... |
#!/usr/bin/env python3
from record_reader_classes import classificationWord, classificationRow, classificationRecordSet, taskActions
from record_aligner_class import recordAligner
from annotation_comparer import annotationComparer
from sandb_data_reader import sandbDataReader
from local_align import local_align, all_a... |
import os
import sys
import re
import time
import urllib
import feedparser
import random
from dateutil import parser
if sys.version_info[0] == 3:
from urllib.request import urlretrieve, urlopen
else:
from urllib import urlretrieve, urlopen
categories = ['cs.', 'stat.', 'q-bio.', 'nlin.', 'math.',
... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import argparse
import csv
from typing import List
import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import RegexpTokenizer
nltk.download('stopwords')
nltk.download('wordnet')
stop_words = set(stopwords.words('english'))
def tokenize_comments(ruddit: str) -> Li... |
# -*- coding: utf-8 -*-
# Pretty ~ Useful ~ Python
from bisect import bisect
from bisect import bisect_right
from collections.abc import MutableSequence
from itertools import count
from math import sqrt
from typing import Any
from typing import Iterable
from typing import Iterator
from typing import List
from typing im... |
import theano
import theano.tensor as T
from keras import activations, initializations
from keras.utils.theano_utils import shared_zeros, alloc_zeros_matrix
from keras.layers.core import Layer
import numpy as np
class Transform(Layer):
'''
This function is needed transform the dataset such that we can
... |
import json
import logging
import time
import uuid
from textwrap import wrap
import pymarc
from folioclient import FolioClient
from migration_tools.custom_exceptions import (
TransformationFieldMappingError,
TransformationProcessError,
TransformationRecordFailedError,
)
from migration_tools.helper import H... |
''' This script is to organise the dataset with only depth as the input.
This dataset is prepared separately as we do not have to account for the visibility map
Author: <NAME> (<EMAIL>)
Last updated: July 2020
'''
import os
import utils.io as io
import utils.csv_io as c_io
import utils.list_tool as lt
import utils.fi... |
#!/usr/bin/env python3
from enum import IntEnum, unique, auto
from collections.abc import Sequence
from pathlib import Path
from typing import Any
import argparse
import sys
STACK_MAX: int = 30000
@unique
class OPCODE(IntEnum):
INC=auto()
DEC=auto()
ADD=auto()
SUB=auto()
BLOOP=auto()
ELOOP=au... |
import argparse
import datetime
import hashlib
import io
import logging
import random
import re
import sys
import toml
import time
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import InlineQuery, ParseMode, message, \
InputTextMessageContent, InlineQueryResultPhoto
import matplotlib.font... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
# Loss classes
class Losses(nn.Module):
def __init__(self, samples_per_cls, num_classes, loss_opt):
super(Losses, self).__init__()
if loss_opt is N... |
"""
Functions for connecting to the One Codex server; these should be rolled out
into the onecodex python library at some point for use across CLI and GUI clients
"""
from __future__ import print_function, division
from collections import OrderedDict
from math import floor
from multiprocessing import Value
import os
i... |
"""
A client interface for Sentinel Hub Catalog API
"""
from .config import SHConfig
from .data_collections import DataCollection, OrbitDirection
from .geometry import Geometry, CRS
from .download.sentinelhub_client import SentinelHubDownloadClient
from .sh_utils import FeatureIterator, remove_undefined
from .time_util... |
#!/usr/bin/env python2
"""Forest training."""
# pylint: disable=wrong-import-order, redefined-outer-name, line-too-long, invalid-name
import os
import sys
import os.path as path
import h5py
import numpy as np
import sys
import logging
import click
from up_tools.model import landmarks_91
import joblib
import pyximport; ... |
"""Model definition for nondefaced-detector."""
import os
import tensorflow as tf
from tensorflow.keras import layers, models
def ConvBNrelu(x, filters=32, kernel=3, strides=1, padding="same"):
"""A layer block of one convolutional, one batch normalization,
and one non-linear activation sequence.
Para... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
compile trained model for C/C++ decoder
__author__ = 'Jamie (<EMAIL>)'
__copyright__ = 'Copyright (C) 2018-, Kakao Corp. All rights reserved.'
"""
###########
# imports #
###########
import argparse
from array import array
import json
import logging
import os
impor... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2022-present MagicStack Inc. and the EdgeDB 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... |
import argparse
import os
from pathlib import Path
from typing import List, Dict, Any
import apex
import numpy as np
import pytorch_lightning as pl
import torch
import yaml
from iglovikov_helper_functions.config_parsing.utils import object_from_dict
from iglovikov_helper_functions.metrics.map import recall_precision
f... |
# -*- coding: utf-8 -*-
"""
Copyright Netherlands eScience Center
Function : Bayesian Convolutional LSTM with Bernoulli approximation variational inference for one step prediction
Author : <NAME> (<EMAIL>) and <NAME>
First Built : 2020.06.19
Last Update : 2020.06.19
Description : This module... |
import argparse
import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
def get_args():
"""
Get arguments from command line with argparse.
"""
parser = argparse.ArgumentParser(
prog='RMA-class-join.py',
description="""Summarize read assignments obtained from ... |
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
pickle_file = 'notMNIST.pickle'
with open(pickle_file, 'rb') as f:
save = pickle.load(f)
train_dataset = save['train_dataset']
train_labels = save['train_labels']
valid_dataset = save['vali... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from hashlib import md5
import logging
import re
import string
import zlib
import unicodedata
# 3p
import requests
import simplejson as json
# project
from config import get_version
from utils.proxy im... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import json
import geopy.distance
import requests
# tile levels and corresponding width (degrees of longitudes)
# from OpenStreetMaps (https://wiki.openstreetmap.org/wiki/Zoom_levels)
tile_level_dict = {
0: 360,
1: 180,
2: 90... |
import numpy as np
import pandas as pd
conv_crit = 0.000001
alpha = 0.9
limit = 300
L = 1 # in m
Ni = 30
Nj = 30
n = Ni * Nj
dx = L/Ni # in m
dy = L/Nj # in m
mu = 0.01 # Viscosity in Pa.s
rho = 100 # Density in kg/m^3
Re = 200 # Reynolds Number
w = 0.8 # Under-relaxa... |
#!/usr/bin/env python
# ############################################################################ #
# NetJobsAgent - agent server for the NetJobs job synchronizer. #
# #
# Author: <NAME> (<EMAIL>) ... |
import os
import logging
import numpy as np
import pandas as pd
from typing import List, Optional, Dict, Tuple, Generator, Iterable
from itertools import islice
from django.db import transaction, connection, models
from vast_pipeline.image.main import SelavyImage
from vast_pipeline.pipeline.model_generator import (
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 16 12:37:01 2014
@author: JMBELDA
"""
from .FuzzyVars import *
from numpy import zeros, isnan
class FuzzyTree(object):
'''Creating a FuzzyTree Object:
Parameters
============
- theFuzzySet : A FuzzySet object containing the data in which building th... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import os
import shutil
import soma.subprocess
import sys
import errno
import warnings
import soma.test_utils
from six.moves import map
from six.moves import zip
class ImageFileComparison(object):
""" Class to ... |
#!/usr/bin/env python3
"""
Get realtime stop information for a specific public transport station in Oslo,
Norway. Data is requested from the EnTur JourneyPlanner API.
- API calls are cached to reduce load in `--server` mode
- Use `--help` for usage info.
"""
import argparse
import logging
import os
import socket
impo... |
"""
Writes the full sections of a MESS input file
"""
import os
from ioformat import build_mako_str
from ioformat import indent
from ioformat import remove_trail_whitespace
from mess_io.writer._sec import rxnchan_header_str
from mess_io.writer._mol_inf import core_rigidrotor
from mess_io.writer._spc import molecule
fr... |
import io
from typing import Optional
from structlog import get_logger
from ...extractors import Command
from ...file_utils import OffsetFile, decode_int, round_up, snull
from ...models import File, HexString, StructHandler, ValidChunk
logger = get_logger()
CPIO_TRAILER_NAME = b"TRAILER!!!"
MAX_LINUX_PATH_LENGTH = ... |
# -*- coding: UTF-8 -*-
"""
Base service stuff
"""
import time
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime
from inspect import getmodule
from typing import Dict, Optional, Tuple
from .._transport.http_transport import StandardHTTPTransport # type: ignore
from .... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
This file runs the KFP integration tests on KFP cluster. There's a number of
environme... |
import os
import pickle
import torch.utils.data as data
from utils.SE3 import *
import torch
class ThreeDLoader(data.Dataset):
def __init__(self,
root,
descriptor='fcgf',
inlier_threshold=0.10,
num_node=5000,
downsample=0.03,
... |
#!/usr/bin/env python
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# A library for reading Microsoft's OLE Compound Document format
# Copyright (c) 2014 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... |
# -*- coding: utf-8 -*-
import copy
import datetime
import io
import os.path
import subprocess
import arff
import bitarray
import mock
import yaml
from midas.compat import unittest
from midas.tests import TEST_DATA_PATH
from midas.tests.test_scripts import IntegrationTestCase
from midas.tests.test_scripts import MDC... |
from dataclasses import field
from typing import Any, Dict, List, Optional, Tuple
from loguru import logger
from plum import dispatch
import dubdub
from dubdub import KEYWORDS, Field, GenConfig, Token, TokenType, dataclass
@dataclass(config=GenConfig)
class Scanner:
source: str
tokens: List[Token] = field(d... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.