text stringlengths 3.07k 12.6k |
|---|
# CODE TO DISPLAY THE INTERACTIVE DASHBOARD
# CODE AUTHORED BY: <NAME>
# PROJECT: interactiveADELE
# GitHub: https://github.com/mi3nts/interactiveADELE
# INPUTS
# - None
# OUTPUTS
# - app - Plotly Dash app with interactive dashboard
# ADELE DEPENDENCIES
# - brain_visual3
# - Create_Slider_fn
# ... |
# import neopixel, board
from copy import deepcopy
try:
import board
import neopixel
except ModuleNotFoundError:
print("ModuleNotFoundError when importing board and/or neopixel")
except ImportError:
print("ImportError when importing board and/or neopixel")
from grid import Grid
class Controller:
... |
"""
Implements the parameter function parser
Parameter functions are entered as strings in the Framework file.
This module implements the function parser that converts the string into
an executable Python representation.
"""
import ast
import numpy as np
from functools import reduce
__all__ = ["parse_function"]
d... |
# -*- coding: utf-8 -*-
'''
Copyright 2015 The pyggcq Developers
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 ... |
from object_detection.protos.pipeline_pb2 import TrainEvalPipelineConfig
from object_detection.builders import model_builder
import os
import tarfile
import subprocess
from google.protobuf import text_format
import tensorflow as tf
from .graph_utils import convert_relu6, remove_op
input_name = 'input'
output_map =... |
import os.path
import argparse
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import models, transforms
from LFLSeg_dataset import LFLSegDataset
parser = argparse.ArgumentParser()
parser.add_argument("--gpu", type=str, def... |
import time, pytest, inspect
from utils import *
from PIL import Image
def test_adding_and_removing_sources_to_a_mix(run_brave, create_config_file):
set_up_two_sources(run_brave, create_config_file)
assert_api_returns_right_mixer_sources([{'id': 0, 'type': 'input', 'in_mix': True}, {'id': 1, 'type': 'input', '... |
import pygame;
import os;
import random;
import math;
from pygame.locals import *;
game_folder = os.path.dirname(__file__);
pygame.init();
pygame.font.init();
grey = (105,105,105);
length = 0;
points = 0;
win = pygame.display.set_mode((500,500));
pygame.display.set_caption("Snake");
font = pygame.font.SysFont('Sans... |
import math
import statistics
import warnings
import numpy as np
from hmmlearn.hmm import GaussianHMM
from sklearn.model_selection import KFold
from asl_utils import combine_sequences
class ModelSelector(object):
'''
base class for model selection (strategy design pattern)
'''
def __init__(self, all... |
"""
MIT License
Copyright (c) 2021 isaa-ctaylor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... |
import getpass
import imp
import json
import logging
import os
import pathlib
import shutil
import sys
import tempfile
from typing import (
Optional,
Tuple,
Dict,
NamedTuple,
Callable,
Collection,
List
)
from urllib import parse, request
import uuid
import zipfile
import... |
# Standard python library
import json
import logging
# The Fastapi web server
from fastapi import status, HTTPException, Body, Request, Depends
from fastapi import APIRouter
# For the data models
from typing import Dict, Optional, cast
from pydantic import BaseModel, BaseSettings
# The settings for the system
from s... |
from pymongo import MongoClient, IndexModel, ASCENDING, DESCENDING, UpdateOne
from pymongo.errors import BulkWriteError
from scratch import \
NoCriteria, BaseMapper, BaseMapping, QueryResult, BaseRepository, Query, \
SortOrder
from model import User, UserType, Sound, Annotation
from errors import DuplicateEntit... |
"""Online timetable classes.
This module contains the classes necessary to navigate and scrape events from the online timetable at `https://onlinetimetables.bham.ac.uk/Timetable/current_academic_year_2/`.
Classes
-------
Event
Stores details of an online timetable event.
Timetable
Navigates online timetable a... |
import numpy as np
import pygame as pg
class DoublePendulum:
"""Make an objects that is the simulation."""
def __init__(self, r1, r2, m1, m2, a1, a2):
self.x0, self.y0 = 300, 200
self.r1, self.r2 = r1, r2
self.m1, self.m2 = m1, m2
self.a1, self.a2 = a1, a2
self.a1_v, s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 7 11:07:48 2018
@author: Prodapt-<NAME>
"""
from data.WS_DataPreparation import Utility
from models.WS_Forecast import Forecast
from datetime import datetime
import pandas as pd
import configparser
import warnings
import logging
import os
def da... |
from __future__ import print_function
from bcc import BPF
from time import strftime, time
from ctypes import c_ulong
from qlat_text import *
libroscpp_path = "/opt/ros/noetic/lib/libroscpp.so"
ros_app_pids = dict()
ros_app_pids_delta = dict()
bpf_get_tid = BPF(text=bpf_text_get_tid)
nw = dict()
nw["send"] = list()... |
# ------------------------------------------------------------------------------------
# BaSSL
# Copyright (c) 2021 KakaoBrain. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------------------
import t... |
__author__ = 'robertsanders'
import airflow
from airflow import configuration
from airflow.plugins_manager import AirflowPlugin
from airflow.contrib.auth.backends.password_auth import PasswordUser
from airflow.settings import Session
from airflow.models import User
from flask_admin.babel import gettext
from flask_adm... |
'''
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, copy, modify, merge, publish, distribute, sublice... |
import keras
print(keras.__version__) # 2.2.4
# 6.2 RNN introduction
# RNN pseudo code
input_sequence = []
def f(_input, state):
new_state = _input + state # made up for def below
return new_state
def rnn_pseudo_code():
state_t = 0
for input_t in input_sequence:
output_t = f(input_t, st... |
# -*-coding:UTF-8 -*-
from transformers import BertTokenizer
import json
import random
import torch
from torch.utils.data import TensorDataset
import itertools
def LoadJson(filepath):
with open(filepath, 'r', encoding='utf-8') as f:
AllData = json.load(f)
return AllData
def convert_data_to_feature(fi... |
import pandas as pd
import numpy as np
from nastran.post.f06.common import extract_tabulated_data, parse_text_value, find_tabular_line_range, parse_label_subcase, F06Page
REALIGVAL_SUBCASE_LINE = 2
REALIGVAL_TABULAR_LINE = 7
REALEIGVAL_CHECK_AUGMENTATION_LINE = 5
REALEIGVAL_CHECK_AUGMENTATION_STR = 'AUGMENTATION OF R... |
# Convolution of spectra to a Instrument profile of resolution R.
#
# The spectra does not have to be equidistant in wavelength.
# Multiprocessing is used to improve speed of convolution.
# The addition of multiprocess was added by <NAME>
# If you do not want to use multiprocessing then see IP_Convolution.py
from __f... |
#!/usr/bin/env python3
"""
CS 445/545
Machine Learning
Winter 2017
Homework 4: Naive Bayes Classification and Logistic Regression
Due Thursday Feb. 23, 2017
In this homework you will use Gaussian Naïve Bayes and Logistic Regression to classify the Spambase data from
the UCI ML repository (the same dataset you worked ... |
from typing import Set, Dict, List, NamedTuple
import joblib
from transformers.tokenization_utils import PreTrainedTokenizer
from allennlp.data import Token
from allennlp.common import FromParams
from luke.utils.entity_vocab import EntityVocab, Entity
from luke.utils.interwiki_db import InterwikiDB
from .entity_db i... |
# -*- coding: utf-8 -*-
'''
yarding.py raet protocol estate classes
'''
# pylint: skip-file
# pylint: disable=W0611
# Import python libs
import socket
import os
import errno
import sys
if sys.version_info > (3,):
long = int
# Import ioflo libs
from ioflo.aid.odicting import odict
# Import raet libs
from ..abidin... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
# author: kuangdd
# date: 2019/11/23
"""
### audio_noise_remover
语音降噪,降低环境噪声。
"""
from pathlib import Path
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(Path(__file__).stem)
import numpy as np
import ctypes as ct
from .audio_io import lo... |
import os, re
import numpy as np
import tensorflow as tf
# ---------------------------------------------------------------------------- #
# decorator
# ---------------------------------------------------------------------------- #
def tf_scope(func):
""" decorator: automatically wrap a var scope """
def scopp... |
import sys
import os.path
import binascii
from pathlib import Path
from cryptography.hazmat.backends import default_backend
from cryptography import x509
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.hazmat.primitives.asymmetric import ec
from cryptoauthlib import *
from certs_hand... |
#!/usr/bin/env python
import battle
import jsonobject
import model
import ship
class ShipEntry(jsonobject.JSONSerializableObject):
ship_id = jsonobject.ReadonlyJSONProperty('ship_id', value_type=int)
"""Ship definition ID."""
level = jsonobject.ReadonlyJSONProperty('level', value_type=int)
"""Level.... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
def init_weight(self, gain=0.02):
for ly in self.children():
if isinstance(ly, nn.Conv2d):
nn.init.normal_(ly.weight.data, 0.0, gain)
if not ly.bias is None: nn.init.constant_(ly.bias, 0)
... |
# TCP handling
import socket
import sys
# file handling
import os
import subprocess
import time
from threading import Thread
# keyboard
from pynput.keyboard import Key, Controller
OPEN_FILE_RUNS_SCRIPT = False
keyboard = Controller()
def resource_path(relative_path):
""" Get absolute path to resource, works... |
import logging
from pathlib import Path
import pytest
"""
These tests invoke the scheduler service class directly (i.e. bypassing any ipc stuff).
"""
class TestJobExecution:
def test_job_function(self, caplog):
from pyrsched.server.service import job_function
# create log dir (on TravisCI, ther... |
# -*- coding:utf-8 -*-
import math
import networkx as nx
import numpy as np
from scipy import sparse
from tools import rw
def build_node_idx_map(graph) -> (dict, dict):
"""
建立图节点与标号之间的映射关系,方便采样。
:param graph:
:return:
"""
node2idx = {}
idx2node = {}
node_size = 0
for node in nx.n... |
#
# functions to identify external interactions for a given dataset
#
#
# Steps:
# 1. read a single file in a folder containing tweets
# 2. extract external interactions (retweet, reply, quoute). If the userID is absent, it refers to an
# external user (possibly not banned yet or msg still available)
# ... |
# Copyright (c) 2020 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
import pytest
import json
from bigfastapi.db import database
from fastapi.testclient import TestClient
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from bigfastapi.models import plan_models
from bigfastapi.schemas import plan_schemas, users_schemas
from bigfastapi.auth import is_authenti... |
import os
import json
from base64 import b64encode
from datetime import datetime, timedelta
from collections import namedtuple
from functools import partial
from cryptography.fernet import Fernet, InvalidToken
from flask import (
url_for, redirect, current_app, request, abort, render_template
)
from flask.views imp... |
#################################
# RAW-to-RGB Model architecture #
#################################
import tensorflow as tf
import time
import numpy as np
conv2d=tf.compat.v1.layers.conv2d
relu=tf.compat.v1.nn.relu
relu6=tf.compat.v1.nn.relu6
sigmoid=tf.nn.sigmoid
maxpool=tf.nn.max_pool
#avgpool2d=tf.compat.v1.nn.... |
import asyncio
import math
from typing import (
Awaitable,
Callable,
Iterable,
Optional,
Sized,
Tuple,
Any,
)
async def as_completed_return_exception(coros: [Iterable[Awaitable], Sized]):
"""
Wrapper for asyncio.as_completed. Equivalent return_exceptions=True from asyncio.gather.
... |
import numpy as np
import scipy as sp
import warnings
from sklearn.exceptions import DataConversionWarning
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.utils.validation import check_is_fitted
from sklearn.utils.extmath import safe_sparse_dot
from sklearn.utils import check_X_y, check_array
from... |
import numpy as np
import pandas as pd
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import GRU, LSTM, Dense
class RNN:
def __init__(self, model='big', input_len=69, min_val=0, max_val=2000):
weights_file = 'pre_train/rnn_weights.h5'
i... |
import copy
import brian2
import numpy as np
import matplotlib.pyplot as plt
P = {'c_m': 1 * brian2.uF / brian2.cm ** 2,
'g_L': 0.1 * brian2.mS / brian2.cm ** 2,
'e_L': -65 * brian2.mV,
'g_na': 35 * brian2.mS / brian2.cm ** 2,
'e_na': 55 * brian2.mV,
'phi': 5,
'g_k': 9 * brian2.mS / bri... |
from ..param import *
from .component import *
from . import generic
name_space(
"multiplayer",
name="Multiplayer",
description=(
"Multiplayer options pertaining to how the game is run, such as"
" friendly fire, buy-anywhere, team managment, etc."
)
)
@Component("autokick", "auto_ki... |
import RPi.GPIO as GPIO
from time import sleep
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import subprocess
# Raspberry Pi pin configuration:
RST = None # on the PiOLED this pin isnt used
# Note the following are only used wi... |
import numpy as np
from .utils import *
class QOperator(object):
def __init__(self, qubits, operator: np.ndarray):
self.qubits = np.array(qubits)
self.operator = np.array(operator, dtype=np.float64)
# def __mul__(self, other):
# op = self.operator * other
# return QOperator(sel... |
#!/usr/bin/env python3
"""
=============================================================================
>> Author: <NAME>
>> Email: <EMAIL>
>> Date: 07/28/2020
>> License: MIT License https://opensource.org/licenses/MIT
=============================================================================
Implement... |
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_almost_equal)
from pystruct.datasets import generate_blocks_multinomial
from pystruct.inference.linear_programming import lp_general_graph
from pystruct.inference import get_ins... |
# !/usr/bin/env python3
# ## ###############################################
#
# Autores:
# <NAME>
# <NAME>
# <NAME>
# License: MIT
#
# ## ###############################################
#
# webserver.py
# Inicia un servidor web personalizado y maneja todas las solicitudes.
#
## ## ######################... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
Utility helpers.
"""
import os
# Pylint disable settings:
# ------------------------
# ToDos, DocStrings:
# pylint: disable-msg=W0511,W0105
# Unused variable, argument:
# pylint: disable-msg=W0612,W0613
# Re-define built-in:
# pylint: disable-msg=W0622
DEFAULT_CHUNK_SIZE = 8192
"""Chunk size f... |
import tkinter as tk;
import PIL.Image as Image;
##import PIL.ImageTk as ImageTk;
filename = input("Enter map filename: ");
image = Image.open(filename);
print("Building map array.");
w, h = image.size;
print("Map is",w, "by",h,"dimensions.");
mapArray = [[0 for x in range(w)] for y in range(h)];
pathHints = [];
##... |
import cv2
from time import time
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
from src.slide import SlidesListLocalTrain, Slide, UnlabeledSlidesListLocalTrain
from src.tools import BBox
def test_slide_get_tissue():
slides = SlidesListLocalTrain()
missed_tissue_n = 0
found_tis... |
import argparse
import os
import random
from typing import Dict, List, NamedTuple, Tuple
import math
import numpy as np
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("--movie", default="./ml-10M100K/movies.dat")
parser.add_argument("--ratings", default="./ml-10M100K/ratings.dat")
parser... |
"""
All configuration flags, options, settings to fine-tune an operator.
All settings are grouped semantically just for convenience
(instead of a flat mega-object with all the values in it).
The individual groups or settings can eventually be moved or regrouped within
the root object, while keeping the legacy names f... |
#!/usr/bin/env python
#coding=utf-8
"""
Author:deepdeliver
"""
import tensorflow as tf
from datetime import date, timedelta
from sys import argv
import argparse
parser = argparse.ArgumentParser()
def init_cmd_args(args):
# Initialize cmd arguments
parser.add_argument("--dist_mode", type=int, default=0, help=... |
from time import time
from typing import Optional, List, Tuple, Union
import warnings
from dataclasses import dataclass, field
from tqdm.auto import tqdm, trange
from anndata import AnnData
import numpy as np
import pandas as pd
import gpflow
from gpflow.utilities import to_default_float
import tensorflow as tf
import... |
from datetime import datetime
from django.conf import settings
from django.shortcuts import render, redirect
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.views.gener... |
"""
This file contains the logic to preprocess charts that are from plotly.
"""
from svgpathtools import parse_path
from stages.logic.preprocess.chart_sources import plotly as attributes
from supported_chart_types import SupportedType
from math import inf
def check_plotly_axes(soup):
# from the dataset, it looks... |
# -*- coding: UTF-8 -*-
from Acquisition import aq_inner
from five import grok
from plone.app.contenttypes.interfaces import IDocument
from plone.app.contenttypes.interfaces import IFile
from plone.app.contenttypes.interfaces import IFolder
from plone.app.contenttypes.interfaces import ILink
from plone.app.contenttypes... |
import sys
import utils
import re
from collections import defaultdict,deque
#\eps will be #
msg_stt = "Chomskynator initiating. .."
msg_end = "Grammar (hopefully) chomskynated "
#don't use 'f' and only single char symbols allowed
terS = []#'a','b','c','d','e']
i_nTerS = []#'A','B','C','D','E','S']
o_nTer... |
from copy import copy, deepcopy
from scipy.optimize import minimize_scalar
import numpy as np
from deps.utils import Config, Function, Point
class Algorithm:
_config = None
_function = None
@property
def config(self):
return self._config
@config.setter
def config(self, config):
... |
# ====================================================
# Library
# ====================================================
import numpy as np
import random
import os
import torch
import matplotlib.pyplot as plt
import pickle
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from rdkit.Chem.Draw impo... |
"""Translate a dictionary explaining a labeling rule into a function
"""
import re
from wiser.rules import TaggingRule # A TaggingRule instance is defined for a tagging LF.
from snorkel.labeling import LabelingFunction
from synthesizer.gll import *
import numpy as np
def raw_stringify(s):
"""From a regex create a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from transitions.extensions import LockedMachine as Machine
import paho.mqtt.client as mqtt
import threading
import json
import time
import logging
import yaml
lock = threading.Lock()
logging.basicConfig(level=logging.DEBUG)
# Set transitions' log level to INFO; DEBUG me... |
import tensorflow as tf
from tensorflow_examples.models.pix2pix import pix2pix
from IPython.display import clear_output
from PIL import Image
import numpy as np
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing.image import load_img, img_to_array
from matplotlib imp... |
#! /usr/bin/env python3
# vim :setfiletype python3
''' Droxy Prototype
Proxy設定をssidごとに行うツールdroxyのプロトタイプ版です。プロトタイプ版なので
日本語が多いです。コメントもゆるふわです。ゆるしてね。
'''
import sys
import os
import configparser
from pathlib import Path
from subprocess import run, PIPE, DEVNULL
from typing import Callable, Sequence, Dict, Optional
xdg... |
from io import TextIOWrapper
import numpy as np
from matplotlib import pyplot as plt
def sequential_access(file: TextIOWrapper, *items):
curLine = file.readline().strip("\n")
vars = []
for requestedItem in items:
if curLine[0 : len(requestedItem)] == requestedItem:
vars.append(float(cu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*
# Example call:
# python train.py data_dir
# python train.py data_dir --save_dir out --arch "vgg13" --epochs 10 --gpu
##
import torch
from torch import nn, optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from time import mon... |
import os
import torch
import torch.utils.data as data
from PIL import Image
import numpy as np
import pandas as pd
from .utility import download_url, check_integrity
IMG_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm', '.tif']
def pil_loader(path):
# open path as file to avoid ResourceWarning (ht... |
import torch
from timeit import default_timer as timer
from utils.heap_queue import HeapQueue
def process_layer(layer, layer_prefix, sgrad: dict, coeff, dtp) -> (float, float, list, torch.Tensor):
w_name = "{}.weight".format(layer_prefix)
b_name = "{}.bias".format(layer_prefix)
sqg = sgrad[w_nam... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo.exceptions import ValidationError, UserError
class HrLoan(models.Model):
_name = 'hr.loan'
_inherit = ['mail.thread', 'mail.activity.mixin']
_descriptio... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import re
import glob
import os
import codecs
institution_long = {'PRD':'Purdue University', 'UA':'University of Arizona'}
output_dir = 'output'
csv_filename = "instructors_Arizona.csv"
def get_unique_names(list):
new_list = [] # create new em... |
import textrazor
import numpy
def convertToTR(to_analyze):
textrazor.api_key = "3aabf0ff52c0a10edf94a5d8bc713d9d5564ee4c32e752a39eca0e99"
# textrazor.api_key = "55b2da9fa0fe9274aaa55e302687c0348a430f40ecf19255be505f06"
client = textrazor.TextRazor(extractors=["entities", "words", "phrases","dependency-trees",\
... |
import six
import json
import torch
import numpy as np
from functools import partial
from torchtext.data import RawField, Pipeline
from torchtext.data.utils import get_tokenizer
from onmt.inputters.datareader_base import DataReaderBase
class GrhDataReader(DataReaderBase):
def read(self, sequences, s... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
from __future__ import annotations
import aiohttp
import asyncio
from dataclasses import dataclass
from datetime import timedelta
from enum import Enum, unique
import logging
from typing import Any, Optional, Tuple
from siobrultech_protocols.gem.api import (
ApiCall,
call_api,
)
from siobrultech_protocols.gem.... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from architectures.ResNet import resnet18 as resnet
from architectures.SPADE import SPADEResnetBlock, AttentionTransferLayer, BaseNetwork
def printTensorList(data):
if isinstance(data, dict):
print('Dictionary Containing: ')
print(... |
import itertools as it
import os
from random import randint, random, sample
from time import sleep, time
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from numpy.core.fromnumeric import reshape
from skimage import color
from skimage.io import imsave
from sk... |
import logging
from copy import copy
from datetime import datetime
from decimal import Decimal, getcontext
getcontext().prec = 10
# logger = logging.getLogger('LUNO_ORDERBOOK')
# logger.setLevel(logging.INFO)
# ch = logging.StreamHandler()
# formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - ... |
import pandas as pd
import os
from sklearn import preprocessing
from collections import deque
import random
import numpy as np
import time
#Deep learning imports
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM, BatchNormalization
from ten... |
"""
what arg
base object:
feed can have the value of the collection;
required kernel keywords;
make module
can add repeated argument;
hash individual;
"""
from dag_pipe.helpers.collections.argument import ValueCollection, Arguments, DefaultArguments, \
inspect_function_default_arguments
from dag_pipe.compartme... |
from datetime import datetime
import os.path
from freezegun import freeze_time
from notesdir.models import FileQuery, FileInfoReq, LinkInfo, FileQuerySort, FileQuerySortField, FileInfo
def test_referent_skips_invalid_urls():
assert LinkInfo('foo', 'file://no[').referent() is None
def test_referent_skips_non_fi... |
#!/usr/bin/env python3
""" Cronjob to archive novogene runs
"""
# standard library imports
import logging
import sys
import os
import argparse
import shutil
# project specific imports
#
# add lib dir for this pipeline installation to PYTHONPATH
LIB_PATH = os.path.abspath(
os.path.join(os.path.dirname(os.path.realp... |
import random
from datetime import date, datetime, timedelta
from typing import List, Optional
import factory
import factory.fuzzy
import pytz
from faker import Faker
from shared.common.tests.factories import UserFactory
from applications.enums import (
ApplicationStatus,
ATTACHMENT_CONTENT_TYPE_CHOICES,
... |
#!/usr/bin/env python
import os
import mmap
import time
import numpy
import struct
from gnuradio import gr, blocks
class source(gr.sync_block):
'''Red Pitaya Embedded Source'''
rates = {24000:2500, 48000:1250, 96000:625}
def __init__(self, freq, rate, corr):
gr.sync_block.__init__(
self,
name ... |
# -*- coding: utf-8 -*-
import base64
import os
from pathlib import Path
import werkzeug
from flask import Flask, current_app
from flask_cors import CORS
from flask.json import jsonify
from polylogyx.blueprints.v1.external_api import blueprint as external_api_v1
from polylogyx.blueprints.external_api import blueprint... |
from django.db import models
from django.forms import formset_factory
from django.utils.translation import gettext_lazy as _
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core import blocks
from wagtail.core.fields import RichTextField, StreamField
from wagtail.core.models import Pag... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from binascii import hexlify, unhexlify
import struct
from ethereum.abi import encode_abi
from ethereum.utils import sha3
import sys
import subprocess
import json
#sudo -H pip3 install --user --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
#sudo -H pip3 install e... |
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision.utils import save_image
import matplotlib.pyplot as plt
plt.style.use('seaborn')
import pandas as pd
from tqdm import tqdm
from dataset import restore
class MNISTModel(nn.Module):
def __init__(self):
super().__ini... |
import asyncio
import psutil
import logging as log
import time
from typing import Dict, Iterable
from dataclasses import dataclass
from collections import defaultdict
@dataclass
class WatchedApp:
id: str
dir: str
is_game: bool = True
def __eq__(self, other):
if isinstance(other, WatchedApp):
... |
# Copyright 2017 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... |
#############################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF lice... |
#!/usr/bin/env python
# adaptor_a.py
# Copyright (C) ContinuumBridge Limited, 2014 - All Rights Reserved
# Written by <NAME>
#
ModuleName = "zwave.me_key_ring"
BATTERY_CHECK_INTERVAL = 21600 # How often to check battery (secs) = 6 hours
import sys
import time
import os
from pprint import pprint
from... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision
from torchvision.models.squeezenet import SqueezeNet, Fire
from torchvision.models.resnet import ResNet, BasicBlock
import sys
sys.path.append("../")
from layers import *
from data import v_resnet,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Functions for I/O of ATLAS DB.
Author: <NAME>
Date Created: 02 Oct 2018
"""
import os
import pandas as pd
from ercollect import DB_functions
from ercollect import rxn_syst
from ercollect.molecule import (
molecu... |
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, redirect, render
from .forms import CommentForm, PostForm
from .models import Comment, Follow, Group, Post, User
def check_follows(user, author):
""""Подписан ли u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.