text stringlengths 3.07k 22.1k |
|---|
from stdnet.exceptions import *
from structures import pipelines, Structure
novalue = object()
try:
import cPickle as pickle
except ImportError:
import pickle
#default_pickler = jsonPickler()
default_pickler = pickle
class NoPickle(object):
def loads(self, s):
return s
... |
__doc__ = """
Script to use jellyfish to get kmer information
Input: fasta/fastq file
Output: kmer information, one of:
1. hash: binary hash of counts
2. stats: summary stats
3. dump: profile (kmer seq - count)
4. histo: histogram (count - abundance)
5. histo ranked: count, abundance, count*abundance, reverse... |
# coding=utf-8
from django import test
from django.shortcuts import resolve_url
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from django_opt_out.models import OptOut
from django_opt_out.plugins.sparkpost import send_email, signals
from .test_views import Captu... |
import dataiku
import pandas as pd
import numpy as np
import logging
from dku_model_accessor import get_model_handler, ModelAccessor
from dku_model_fairness_report import ModelFairnessMetricReport, ModelFairnessMetric
from dku_model_fairness_report.constants import DkuFairnessConstants
from dku_webapp.constants import ... |
from typing import List, Optional, Union
import pyinflect # noqa: F401
import spacy
from nltk.tokenize.treebank import TreebankWordDetokenizer
from spacy.symbols import AUX, NOUN, PRON, PROPN, VERB, aux, cc, nsubj
from spacy.tokens import Span, Token
from spacy.tokens.doc import Doc
from initialize import spacy_nlp
... |
import curses
import os
from multiprocessing import Process
from typing import Any
from initload import initialize
from play_sounds import play_file as playsound
from utils.palettes import palettes
# Curses setup
screen = curses.initscr()
curses.noecho()
# curses.cbreak()
curses.start_color()
curses.can_change_color(... |
import numpy
import math
import sys
import numpy
from scipy import signal
from scipy import ndimage
from skimage import io
import sys
import re
import math
import sys
import numpy
from scipy import signal
from scipy import ndimage
# import gauss
import matplotlib.pyplot as plt
#!/usr/bin/env python
"""Module providin... |
from .models import MovieNightEvent, Movie, UserAttendence, LocationPermission
from rest_framework import serializers
from django.utils import timezone
from django.contrib.auth.models import User
from .utils import badgify
import pytz
def strfdelta(tdelta, fmt):
d = {"days": abs(tdelta.days)}
d["hours"], re... |
import os, csv, json, shutil
from data_tools.coco_tools import read_json
from PIL import Image
def reduce_data(oidata, catmid2name, keep_classes=[]):
"""
Reduce the amount of data by only keeping images that are in the classes we want.
:param oidata: oidata, as outputted by parse_open_images
:param ca... |
from htm.bindings.algorithms import TemporalMemory
from htm.bindings.sdr import SDR
from htm.encoders.rdse import RDSE, RDSE_Parameters
import argparse
import itertools
import numpy as np
import random
import time
default_parameters = {
'num_cells': 2000,
'local_sparsity': .02,
'apical_denrites': {
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import getpass
import os
import pwd
import pipeline_io
class Environment:
PROJECT_ENV = 'MEDIA_PROJECT_DIR'
PIPELINE_FILENAME = '.project'
PROJECT_NAME = 'name'
PRODUCTION_DIR = 'production_dir'
ASSETS_DIR = 'assets_dir'
SHOTS_DIR = 'shots_dir'
T... |
from analyzer import StockAnalyzer
from stock import Stock
from bs4 import BeautifulSoup
import pandas as panda
import yfinance as yf
import requests
import re
import datetime
import os
import openpyxl
import argparse
class StockScanner:
def __init__(self):
self.winner_stock_list = list()
self.... |
import numpy as np
import os
from annoy import AnnoyIndex
import trimesh as trm
from scipy.spatial import distance
from scipy.stats import wasserstein_distance
from shape import Shape
from utils import flatten_features_array, read_off
from settings import Settings
# from src.utils import flatten_features_array, read_o... |
import pytest
import time
import random
from endpoints.stores import ReadStoreError
from services import service_factories
from tools import tools
from endpoints.tests.emulators import (
DSMR_Emulator,
Fronius_Emulator
)
from services.strategies.basic import Log_Strategy
from services.events import Periodic... |
# -*- coding: utf-8 -*-
"""
Author: <NAME>
created within the scope of Lifewatch - INBO
"""
import sys
import argparse
import requests
# urllib is used to escape spaces, ampersands.
# for strings, use: urllib.parse.quote_plus(string)
# for tuples of parameters, use: urllib.parse.urlencode(parameters)
import urllib.p... |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
# =============================================================================
class S3MainMenu(default.S3MainMenu):
""" Custom Applica... |
#!/usr/bin/env python3
'''
Created on Monday, May 15 2017
Last Updated Friday, Oct 20 2017
Computes molecule size and stdev (for error bounds of molecule size)
Columns: Rname Start End Size BX MI Reads Mapq_median AS_median NM_median
Version 0.0.1
@author: cjustin
'''
from optparse import OptionParser
import pysam... |
import scipy.signal as s
import numpy as np
import matplotlib.pyplot as plt
import pyabf
from patch_clamp import database as db
QUERY = """SELECT metadata.fname,
metadata.cell_side,
metadata.cell_n,
metadata.mouse_id,
metadata.treatment_group AS treatment,
peaks... |
"""ImportChains."""
from collections import defaultdict
from typing import Callable
import attr
import toolz
from bs4 import BeautifulSoup
from kivy.factory import Factory
from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.filemanager import MDFileManager
from pony.orm import db_session
from .... |
# Copyright 2012 VPAC, http://www.vpac.org
# Copyright 2013-2016 <NAME> <<EMAIL>>
#
# This file is part of Patchman.
#
# Patchman 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, version 3 only.
#
# Patchman is... |
# -*- coding:utf-8 -*-
import os
import random
import cv2
import argparse
def mkdir_if_not_exist(path):
if not os.path.exists(os.path.join(*path)):
os.makedirs(os.path.join(*path))
class CasiaSurf(object):
def __init__(self):
self.color_list = []
self.depth_list = []
self.ir_... |
import numpy
from oasys.util.oasys_util import get_fwhm
from wofry.propagator.wavefront1D.generic_wavefront import GenericWavefront1D
from srxraylib.plot.gol import set_qt, plot_table, plot, plot_image
from score import Score
# see also https://people.inf.ethz.ch/gander/papers/qrneu.pdf
def get_coherent_fraction_exa... |
import re
from itertools import chain
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
from buildpg import Empty, Func, V, funcs
from em2.utils.core import message_simplify
from em2.utils.db import Connections
if TYPE_CHECKING: # pragma: no cover
from .core import Action, File # noqa: F401
__all_... |
import requests
import re
import random
import configparser
from bs4 import BeautifulSoup
from flask import Flask, request, abort
from imgurpython import ImgurClient
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import *
app = F... |
from abc import abstractmethod
from io import StringIO
from typing import *
import numpy as np
import torch
from torch.utils.data import DataLoader
# The Protocol type does not exist until Python 3.7.
# TODO: Remove the try-except when Python 3.6 support is dropped.
try:
from typing import Protocol
except Impor... |
from __future__ import print_function
import os
import sys
import multiprocessing
import time
import json
import uuid
import functools
import gzip
import vcr
import vcr.cassette
import vcr.errors
import vcr.serialize
import vcr.request
from flowy import restart
from flowy import wait
from flowy import TaskError
from ... |
# class placeholders
class Container:
pass
class NativeArray:
pass
class NativeVariable:
pass
class Array:
pass
class Variable:
pass
class Framework:
pass
class Device:
pass
class Node:
pass
class Dtype:
pass
# global constants
_MIN_DENOMINATOR = 1e-12
_MIN_BASE = ... |
"""
Copyright 2019 Secure, Reliable, and Intelligent Systems Lab, ETH Zurich
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... |
"""
Auxiliary functionality used by other modules of the pymetacode package.
To avoid circular dependencies, this module does *not* depend on any other
modules of the pymetacode package, but it can be imported into every other
module.
As naturally, a utils module tends to be a bit messy, the different tools
available... |
import os
import sys
import pwd
import getopt, sys
import pkg_resources
import time
import trio
import client as cli
from client import close, error, bpwait, bpresume, sent, stop, rmv
udb = {}
def get_udb (keys):
return cli.get_db(udb, keys)
def update_udb (keys, val):
cli.update_db(udb, keys, val)
dsdict ... |
import logging
from realmusicbot.keyboards import keyboards
from realmusicbot.get import get
from threading import Thread
from random import choice
from time import sleep
import mpd
from realmusicbot.settings import *
import telebot
telebot.apihelper.READ_TIMEOUT = TIMEOUT
if RADIO_ON:
from .get_radio import get_... |
import torch
import os
from utils import *
import numpy as np
def prune(model, compress_rate, criterion, optimizer, train_loader, test_loader, arch, save_dir, epochs,
layer_begin, layer_end, layer_inter, skip_downsample, learning_rate, lr_adjust, print_freq):
best_prec1 = 0
filename = os.path.join(save_dir, 'c... |
import pytest
import numpy as np
from paminco.net.network import Network
from paminco.algo.efa import EFA
from paminco.net._data_examples import (NET_ELECTRICAL_BRAESS,
NET_ELECTRICAL_PIECEWISE,
NET_DISCONTINUOUS_COST)
from paminco.callback ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Interpolation of Amplitude and Phase using the interpolant derived by <NAME>.
For details see - https://doi.org/10.1007/s10236-017-1122-8
TODO:
* Add a wrapper class
* Add type and error check
* Add case for missing value
Author: khan
"""
import numpy as n... |
"""The main abstractions in the project."""
import logging
import random
from enum import Enum
from typing import (Any, Dict, Iterable, Iterator, List, Optional, Sequence,
Set, Tuple, Union)
import numpy as np
import torch
from torch import device as t_device
from torch import set_num_threads
from ... |
"""
Parse public_api.h and generates various stubs around
"""
import attr
import re
import py
from copy import deepcopy
import pycparser
from pycparser import c_ast
from pycparser.c_generator import CGenerator
from packaging import version
if version.parse(pycparser.__version__) < version.parse('2.20'):
raise Impo... |
'''
BSD 3-Clause License
Copyright (c) 2019, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of condition... |
import numpy as np
import tvm
from tvm import relay
from tvm.relay.testing import annotate_exact_matches, check_compiler_call
def relay_lstm_cell(batch_size, input_size, hidden_size):
state_tensor_type = relay.TensorType((batch_size, hidden_size))
state_tuple_type = relay.TupleType([state_tensor_type, state_te... |
from collections import OrderedDict
from onegov.ballot.constants import election_day_i18n_used_locales
from onegov.ballot.models.election.candidate import Candidate
from onegov.ballot.models.election.candidate_result import CandidateResult
from onegov.ballot.models.election.election import Election
from onegov.ballot.m... |
import tensorflow as tf
def get_matched_features(features_a, features_b, sinkhorn_lambda, nr_sinkhorn_iter):
n = features_a.get_shape().as_list()[1]
fa_batch1, fa_batch2 = tf.split(features_a, 2, axis=0)
fb_batch1, fb_batch2 = tf.split(features_b, 2, axis=0)
# calculate all distances
dist_a1_a2 ... |
"""
This file implements following paper:
Video Segmentation by Non-Local Consensus Voting
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# from __future__ import unicode_literals
import sys
import time
from PIL import Image
import numpy as np
from scip... |
# Copyright (c) 2020 Cognitive & Perceptual Developmental Lab
# Washington University School of Medicine
# 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 restrictio... |
#!/usr/bin/env python
# @formatter:off
#
# ,,
# db
# \
# _\,, `7MM `7MM `7MMpMMMb. `7MM ,p6"bo ,pW"Wq.`7Mb,od8 `7MMpMMMb.
# "-=\~ _ MM MM MM MM MM 6M' OO 6W' `Wb MM' "' MM MM
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 31 16:46:12 2020
@author: skyjones
"""
import os
import re
import shutil
import sys
import pandas as pd
from glob import glob
import nibabel as nib
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from sklearn.ensemble im... |
import torch
import numpy as np
class TorchKNN():
def __init__(self, n_classes, dimension=512, cells_allocate=5_000, verbose=0):
"""
This instantiates a TorchKNN object and allocates the index/labels
arrays for future use. It also determines the device if cuda is available.
Inputs... |
import numpy as np
from sirius import inner, l2norm, CoefficientArray, Logger, diag
import h5py
from copy import deepcopy
from scipy.constants import physical_constants
from mpi4py import MPI
from .free_energy import FreeEnergy, s
logger = Logger()
def _constraint34(u, tau, T, pe, vkw):
"""
Keywoard Argumen... |
from os.path import basename
from pathlib import Path, PurePath
from typing import Optional, List
VERBOSE = 'VERBOSE'
DEBUG = 'DEBUG'
WARN = 'WARN'
ERROR = 'ERROR'
LEVELS = {
VERBOSE: {
'level': 0,
'marker': 'V'
},
DEBUG: {
'level': 1,
'marker': 'D'
},
WARN: {
... |
from revelation.isa import decode
from revelation.instruction import Instruction
import opcode_factory
import pytest
@pytest.mark.parametrize('name,instr',
[('add32', opcode_factory.add32(rd=0, rn=0, rm=0)),
('add16', opcode_factory.add16(rd=0, rn=0, rm=... |
# Copyright (c) 2018-2020 ISciences, LLC.
# All rights reserved.
#
# WSIM is 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/python3
#--------------------------------------------------------------------------#
# Made by Harvey298 #
# Simple AUR Helper | 25 Jan 2021 #
# ... |
from collections import namedtuple
import tensorflow as tf
import numpy as np
from mvc.action_output import ActionOutput
from mvc.models.networks.base_network import BaseNetwork
from mvc.models.networks.ddpg import initializer, build_target_update
from mvc.models.networks.ddpg import build_optim
from mvc.parametric_f... |
# Libreria per ML
import numpy as np
import geopandas as gpd
import pandas as pd
# funzioni di sk-learn
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.neighbors import KNeighborsRegressor
from sklearn.linear_model import LogisticRegression
... |
'''
Database Unit used to create database and calendar.
Model Operations Processing System. Copyright <NAME> 2009-2010. Licenced under the EUPL.
You may not use this work except in compliance with the Licence. You may obtain a copy of the
Licence at http://ec.europa.eu/idabc/eupl or as attached with this a... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
import csv
from argparse import ArgumentParser
from collections import defaultdict
from itertools import product
from pathlib import Path
from typing import Set, Optional, Sequence
import librosa.display
import matplotlib.ticker as tckr
import matplotlib.pyplot as plt
import mir_eval
import numpy as np
from numpy impo... |
r"""
Prototype for object model backend for the libNeuroML project
"""
import numpy as np
import neuroml
class ArrayMorphology(neuroml.Morphology):
"""Core of the array-based object model backend.
Provides the core arrays - vertices,connectivity etc.
node_types.
The connectivity array is a list of ... |
# Copyright 2016-2022 The FEAGI 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 applic... |
from console.routes.utils import *
from console.db import Database
import logging
from flask import Flask, render_template, request, flash, redirect, session, url_for
import datetime
import calendar
import sys
############################################################################################################... |
import numpy as np
import numpy.linalg as linalg
import cv2 as cv
import scipy.optimize as opt
import functools
import json
import math
from .common.camera import Camera, Permutation
from .common.linear import solve_dlt
from .common.math import euclidean, homogeneous
from .common.matrix import matrix_intrinsic, matr... |
import sys
from math import log
import subprocess as sp
import random
import time
from statistics import median
from random import randint
import argparse
import os
from functools import partial
import signal
from decomposeIter import Decomposer
from MSSdecompose import MSSDecomposer
from pysat.card import *
import glo... |
import os
import torch
import torch.nn.functional as F
import numpy as np
from PIL import Image
from skimage import io
import cv2
def create_anchors_3d_stride(grid_size,
voxel_size=[0.16, 0.16, 0.5],
coordinates_offsets=[0, -19.84, -2.5],
... |
import asyncio
import secrets
import math
import datetime
import discord
from discord.ext import commands, pages
from discord.commands import slash_command, Option
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.triggers.cron import CronTrigger
from database import DatabasePersonality, Da... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric
from torch.nn import Sequential as Seq, Linear as Lin, ReLU
from torch_scatter import scatter_mean
class GNNLSTMRecgnition(nn.Module):
def __init__(self, hidden_size=16, latent_size=2):
super().__init__()
## G... |
from tectle.db import get_connection_non_flask
from tectle.config import load_config_non_flask
import requests
def upgrade(conn, cur, config):
version = get_version(cur)
new_version = version
try:
if version < 1:
query = """
CREATE TABLE db_version (
... |
from copy import copy
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import brewer2mpl as b2mpl
from tqdm import tqdm
import seaborn.apionly as sns
from .FS_colorLUT import get_lut
from seaborn.utils import set_hls_values
def electrode_grid(gridx=16, gridy=16, elects_to_plot=None, anatomy... |
import datetime
import logging
import os
import time
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel
import cv2
from PIL import Image
from ssd.engine.inference import do_evaluation
from ssd.utils import distributed_util
def reduce_loss_dict(loss_dict):
"""
R... |
# -*- coding: utf-8 -*-
from PIL import Image
import os
import shutil
import urllib
import random
global g_iconWidth
g_iconWidth = 36
#========================================================
# @brief 计算一小块区域的平均颜色值
# @params dataList 正张图的数据
# col, row 起始位置,多少列,多少行
# width,height 整张图的宽... |
# -*- coding: utf-8 -*-
import numpy
class Dummy():
def __init__(self):
'''nothing to do here'''
def calc_pm1(self, exp_vars):
return self.__sum_exp_vars(exp_vars)
def calc_pm2(self, exp_vars):
return self.__sum_exp_vars(exp_vars) * 2
def calc_pm10(self, exp_vars):
... |
import logging
import os
from abc import ABC
from dataclasses import dataclass
from typing import List
import numpy as np
import onnx
import pyeddl.eddl as eddl
import stringcase
from pyeddl.tensor import Tensor
from slaid.commons.base import ImageInfo
from slaid.models import Factory as BaseFactory
from slaid.models... |
#!/usr/bin/env python
import json
import argparse
import logging
import sys
from datetime import date
from datetime import time
from datetime import datetime
import pprint
import pyowm
class CalDB(argparse.Namespace):
def default_day_record(self, msg = '', wth = {}):
return {
'msg': msg,
... |
from flask import request, render_template, jsonify
from flask_jwt_extended import jwt_required, create_access_token, get_jwt_identity, get_raw_jwt
from app import app, db, jwt
from app.models import User, Asset
from sqlalchemy.exc import IntegrityError
from assets import stocks, cryptocurrency, fiat, stocks_options, c... |
"""Module providing custom image handling classes implementations to GUI."""
import logging
from typing import Optional, Tuple
from wiki_music.gui_lib.qt_importer import (
QBuffer, QByteArray, QEvent, QImage, QIODevice, QLabel, QPixmap, QPoint,
QRect, QRubberBand, QSize, QSizePolicy, QStyleFactory, Qt, Signal... |
#!/home/apollo/anaconda3/bin/python3
#-*- coding: utf-8 -*-
#******************************************************************************
# Author : jtx
# Last modified: 2020-04-29 16:09
# Filename : patent_clean.py
# Description : res_kb_patent企业专利信息清洗,主要是值的清洗和字段按新schema数据格式组织重新插入
#***********************... |
"""Implementation of sample attack."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
from cleverhans.attacks import MultiModelIterativeMethod
import numpy as np
from PIL import Image
import tensorflow as tf
from tensorflow.contrib.... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap, BoundaryNorm
from collections import OrderedDict
from matplotlib.animation import FuncAnimation
from gym import utils
import sys
from six import StringIO, b
from IPython.display import HTML
COLORS = OrderedDict([
(b"W... |
# !/usr/bin/env python3
# -×- coding: utf-8 -*-
import requests
from lxml import etree
import re
import os
import multiprocessing
import asyncio
from concurrent import futures
import argparse
import configparser
import shlex
import time
HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/... |
from flask import request
from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, RadioField, SubmitField, RadioField, SelectField, TextAreaField, DecimalField
from wtforms.validators import ValidationError, DataRequired, Length
from flask_babel import _, lazy_gettext as _l
from app.models import... |
import urllib.request
from urllib.error import HTTPError
from bs4 import BeautifulSoup
import requests
import csv
import math
import re
from threading import Thread
cook='ant_stream_59df58828c697=1521631012/3280484770; bow_stream_59df58828c697=13; _gscu_1601713973=21602093xhf89o98; _gscbrs_1601713973=1; _gscs... |
# -*- coding:utf-8 -*-
from django.shortcuts import render, redirect, reverse, get_object_or_404
from django.urls import reverse_lazy
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic import TemplateView
from django.views.generic import ListView
from django.views.gen... |
#
# Copyright (c) 2017, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT... |
#
#*******************************************************************************
# Copyright 2014-2020 Intel 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.a... |
"""
Functions that setup and run the modified DDASAC solver. This is the ODE
solver used by the Pfaendtner group to solve this model - users from other
institutions may need to configure their own solvers (or use ODE solvers in
python, for example from scipy.integrate). All the paths and files
referenced in this modu... |
import asyncio
import inspect
import logging
import random
import sys
import weakref
from abc import ABC, abstractmethod, abstractproperty
from contextlib import suppress
import dask
from ..metrics import time
from ..protocol import pickle
from ..protocol.compression import get_default_compression
from ..utils import... |
import torch, pdb, os, json
from shared import _cat_
import numpy as np
from model import OptionInfer, Scorer
from collections import defaultdict
def get_model(path, cuda=True):
opt = OptionInfer(cuda)
if path.endswith('.yaml') or path.endswith('.yml'):
from model import JointScorer
model = Jo... |
from bootstrapvz.base import Task
from bootstrapvz.common import phases
from bootstrapvz.common.tasks import workspace
from bootstrapvz.common.tools import rel_path
import os
import shutil
import json
assets = rel_path(__file__, 'assets')
class CheckBoxPath(Task):
description = 'Checking if the vagrant box file ... |
import logging
from babel import Locale
from functools import lru_cache
from flask import Blueprint, request, current_app
from flask_babel import gettext, get_locale
from elasticsearch import TransportError
from followthemoney import model
from followthemoney.exc import InvalidData
from jwt import ExpiredSignatureError... |
#!/usr/bin/env python3
#===============================================================================
# smsExtractor.py | Version 1.3 | FreeBSD License | 2022-06-21
# <NAME> | <EMAIL>
#
# Description:
# Simple script that extracts SMS and MMS messages from previously
# generate... |
import argparse
import serrant
def main():
# Parse command line args
args = parse_args()
print("Loading resources...")
# Load Errant
annotator = serrant.load("en")
# Open output M2 file
out_m2 = open(args.out, "w")
print("Processing M2 file...")
# Open the m2 file and ... |
import json
import logging
import inspect
from .decorators import pipeline_functions, register_pipeline
from indra.statements import get_statement_by_name, Statement
logger = logging.getLogger(__name__)
class AssemblyPipeline():
"""An assembly pipeline that runs the specified steps on a given set of
statem... |
# 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... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder API toolbar widgets.
"""
# Standard library imports
from collections import OrderedDict
import os
import sys
from typing import Union, Optional, Tuple, Li... |
# This code is modified from https://github.com/facebookresearch/low-shot-shrink-hallucinate
import torch
from PIL import Image
import numpy as np
import pandas as pd
import torchvision.transforms as transforms
import datasets.additional_transforms as add_transforms
from torch.utils.data import Dataset, DataLoader
fro... |
import asyncio
from tt_web import postgresql as db
from . import objects
def impact_from_row(row):
return objects.Impact(transaction=row['transaction'],
actor=objects.Object(row['actor_type'], row['actor']),
target=objects.Object(row['target_type'], row['targ... |
#!/usr/bin/env python3
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import functools
import json
import os
import random
import subprocess
import sys
from multiprocessing import Pool
... |
# encoding: utf-8
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import config
from base_model import resnet50
from seg_opr.seg_oprs import ConvBnRelu
from seg_opr.loss_opr import AntimagnetLoss
class CPNet(nn.Module):... |
"""
Basic uniform mesh refinement functions.
"""
import numpy as nm
from sfepy.discrete.fem import Mesh
def refine_2_3(mesh_in):
"""
Refines mesh out of triangles by cutting cutting each edge in half
and making 4 new finer triangles out of one coarser one.
"""
cmesh = mesh_in.cmesh
# Unique e... |
import os
from cStringIO \
import \
StringIO
from bento.core \
import \
PackageDescription, PackageOptions
from bento.core.pkg_objects \
import \
Extension, CompiledLibrary
from bento.core.package \
import \
raw_parse, raw_to_pkg_kw, build_ast_from_raw_dict, PackageDesc... |
from typing import Callable, Dict, Optional, Sequence, Tuple
from functools import partial
import numpy as np
import torch
from torch import Tensor
from torch.nn import functional as F
# @TODO:
# after full classification metrics re-implementation, make a reference to
# https://github.com/scikit-learn/scikit-learn/b... |
"""
SFU CMPT 756
Sample application---database service.
"""
# Standard library modules
import base64
import logging
import os
import sys
import urllib.parse
import uuid
# Installed packages
import boto3
from boto3.dynamodb.conditions import Key
from flask import Blueprint
from flask import Flask
from flask import r... |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.