text stringlengths 8.04k 46.5k |
|---|
# coding: utf-8
# Import libraries
import pandas as pd
import numpy as np
import datetime as dt
from sklearn.preprocessing import StandardScaler # Demean and rescale numerical columns
from sklearn.impute import SimpleImputer # Impute missing values for single columns
# For saving and loading FullEncoder object
i... |
import os,sys
from ensembldb3 import HostAccount, Compara
# compara = Compara(['human', 'chimp', 'macaque'], release=75)
offset = int(sys.argv[1])
offset = offset + 1 # account for 1bp difference btwn annotations? this is needed to make a 25bp offset w/ 52bp len produce 25X26
length = int(sys.argv[2])
alleles_file... |
'''
Created on 06 May 2010
@author: EWillemse
'''
import routes_neighbours_IF_all as RN
import time
import transformSolution
import reduceNumberTrips_IF as RED
import refitIFs
import testSolutions
import gen_neighbours_beta1
from copy import deepcopy
#================================================... |
# Libary that supplies numerical integration routines for higher dimensional
#spaces
import math
import sys
from NevInterp import NevilleEvenRound
if sys.version_info[0] >= 3:
from functools import reduce
xrange = range
class BugError(Exception):
def __init__(self, value):
self.value = value
def... |
from cgitb import Hook
import logging
import math
import archinfo
from angr import SimProcedure, SimValueError, SimUnsatError
from pwn import *
from .symTracing import PropagationHandler
from .stateManager import StateManager
from capstone.x86_const import X86_REG_GS, X86_REG_CS, X86_REG_SS, X86_REG_DS, X86_REG_ES, X8... |
"""
原始实现:
1. 图像特征的加载实现,能够适应不同类型的特征文件的读取和加载
2. 图像特征的加载实现,能够实现in-memory读取模式
3. 数据集实例实现,包含对信息和映射表的读取
4. 数据集实例实现,包含对图像划分的整理(传统划分,训练+验证+测试)
5. 数据集实例实现,包含对图像及其caption样本的读取和batch处理
6. 数据加载器实现,根据需要初始化各个数据自己的数据集实例
7. 数据加载器实现,封装batch处理和状态信息加载
8. 采样器实例实现,处理训练数据集的跨轮次无界batch构造
9. 采样器实例实现,状态信息加载
新... |
#!/usr/bin/env python3
#
# Launcher.py
"""
Provides the main window class, and its background worker thread.
"""
#
# Copyright © 2014-2021 <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... |
from __future__ import print_function
import fivepseq
"""
The fivepseq entry point.
"""
# PORT
# argparse was written for argparse in Python 3.
# A few details are different in 2.x, especially some exception messages, which were improved in 3.x.
import argparse
import glob
import logging
import os
import sys
import t... |
import sys, os, cv2, time, heapq, argparse
import numpy as np, math
try:
from armv7l.openvino.inference_engine import IENetwork, IEPlugin
except:
from openvino.inference_engine import IENetwork, IEPlugin
import multiprocessing as mp
from time import sleep
import threading
yolo_scale_13 = 13
yolo_scale_26 = 26
... |
#!/usr/bin/python
# Python 2.7
"""Minecraft MCPI query performance
This program is to test the performance of various techniques to
query large numbers (hundreds or thousands) of Minecraft blocks.
This applies only to the Minecraft Pi edition.
"""
from __future__ import absolute_import, division, print_function
#fr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 12 16:11:08 2019
Analyze performance of multi sensor localization algorithms
@author: anantgupta
"""
import numpy as np
import matplotlib.pyplot as plt
import multiprocessing as mp
import pickle
# from IPython import get_ipython
from functools import... |
import sys
import click
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow_probability as tfp
import statsmodels.api as sm
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.svm import SVR
from sklearn.neighbors import KernelDensity
from sklearn.pipeline import make_pi... |
import ctypes
import functools
import traceback
import sqlite3
import datetime
import io
import re
import subprocess
import tarfile
import os
from collections import defaultdict
import bleach
import charset_normalizer
import magic
import mistune
import flask
import flask_minify
import flask_discord
from flask_discord ... |
import logging
import os
import numpy as np
from das_framework.driver import AbstractDASErrorMetrics
import programs.metrics.error_metrics_node as em
import programs.metrics.metric_group as mgmod
import sys
import time
from pyspark.sql import Row
import ast
import json
import pickle
CONFIG_DELIM = ", "
BLANK = ""
NATI... |
# Copyright 2018/2019 The RLgraph 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... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
#Kernal Regression from Steimetz et al. (2019)
#
#Feb 6th 2022
#<NAME>
"""
frequency_array still needs testing.
Ignore the unexpected indent in spyder, it just doesnt like stein.calldata
Description of Kernel Regression Implementation:
We need to first reun CCA to generate B then we want to... |
"""
A drop-in replacement for Google Cloud STT Python Client Library.
The speech_mod9 module provides a subset of Google Cloud STT
functionality, with additional Mod9-exclusive features, such as phrase
alternatives, and uses subclassed Google objects directly. Input in
Google-type objects (or Google-style dict) is con... |
"""
Base classes and developper tools
---------------------------------
"""
import warnings
from inspect import signature
from types import FunctionType
from typing import Callable, Mapping, Optional, Sequence, Set, Union
import dask.array as dsk
import jsonpickle
import numpy as np
import xarray as xr
from boltons.fu... |
import time
import copy
import sys
import argparse
import os
class NodParcurgere:
gr = None # ma ajuta la testarea timpului de timeout
def __init__(self, info, parinte, cost=0, h=0, infoDrum=[]):
"""
Constructor
:param info: lista de forma [[id, capacitate, cantitate, cul... |
"""
@file gazebo/model.py
Defines a model of the gazebo simulator aircraft
and provides functionality to linearize about
steady level and steady turning flight conditions.
"""
import numpy as np
from casadi import *
import sys
# Vehicle parameters
M = 1.5 # kg
IX = 0.19756 # kg m^2
IY = 0.14589 # kg m... |
#!/usr/bin/env python3
"""
tytable.py:
DO NOT START NEW PROJECTS WITH THIS! USE TYDOC INSTEAD
Module for typesetting tables in ASCII, LaTeX, and HTML. Perhaps even CSV!
Also creates LaTeX variables.
<NAME>, 2010-
This is really bad python. Let me clean it up before you copy it.
ttable is the main typesetting class... |
#! /usr/bin/env python
# Copyright (c) 2009, <NAME>, Inc.
# 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, t... |
import argparse
import csv
import glob
import json
import logging
import os
import shutil
import re
import timeit
from urllib.error import HTTPError
import functools
import requests
import sys
import time
import pandas
from pandas.errors import EmptyDataError
from blackduck.HubRestApi import HubInstance
parser = ar... |
import ctypes
class smart_stream_type(ctypes.Structure):
# typedef unsigned short rs_bool;
# typedef signed char int8;
# typedef unsigned char uns8;
# typedef short int16;
# typedef unsigned short uns16;
# typedef int int32;
# typedef unsigned int uns32;
# typedef float ... |
# python 3.7
"""
Reads in xls of location data, cleans it and writes to a new file.
Computes time and distance matrices for all nodes and vehicles and writes
to file.
"""
import os
import datetime
import pathlib
import math
import pandas as pd
import numpy as np
from itertools import combinations
import copy
import pi... |
import asyncio
import json
import sys
import logging
import shutil
import socket
import os
from datetime import datetime
import zmq
from zmq.asyncio import Context
from qcg.pilotjob.config import Config
from qcg.pilotjob.logger import top_logger
_logger = logging.getLogger(__name__)
class Launcher:
"""The lau... |
#!/usr/bin/python3
from argparse import ArgumentParser
from copy import deepcopy
from enum import Enum, IntEnum
from datetime import datetime
import os
import subprocess
import sys
from tempfile import mkdtemp
from threading import Timer
import time
from kubernetes import client as kclient, config as kconfig, watch as... |
# -*- coding: utf-8 -*-
"""
@author: %(<NAME>)s
@email: %(<EMAIL>)
@institution: %(Dpto. de Inteligencia Artificial, Universidad Nacional de Educación a Distancia (UNED))
@DOI: 10.5281/zenodo.3759306
"""
from numpy.fft import fft
from numpy.linalg import svd
import numpy as np
# Entropía de onda
def wavelet_entropy ... |
"""
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublic... |
# coding=utf-8
# Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# PyTorch
import torch
from torch import mean
import torchvision.transforms as transforms
from adabound import AdaBound
# For plotting
import seaborn as sn
import matplotlib.pyplot as plt
# Sklearn metrics
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from sklearn.metrics imp... |
"""Tune Model.
- Author: <NAME>, <NAME>
- Contact: <EMAIL>, <EMAIL>
"""
import optuna
import wandb
import torch
import torch.nn as nn
import torch.optim as optim
from src.dataloader import create_dataloader
from src.model import Model
from src.utils.torch_utils import model_info, check_runtime
from src.trai... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... |
# Based on <NAME>'s CLIP guided diffusion notebook
# (https://colab.research.google.com/drive/12a_Wrfi2_gwwAuN3VvMTwVMz9TfqctNj)
# including a port of https://github.com/crowsonkb/guided-diffusion to jax.
import math
import io
import sys
import time
import os
import functools
from functools import partial
from PIL im... |
import os
import itertools
import dill as pickle
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
from datetime import datetime
import matplotlib as mpl
from matplotlib import pyplot as plt
import matplotlib.transforms
from scipy.signal import gaussian, find_peaks, find_peaks_cwt
from scipy.... |
#!python
# -*- coding: utf-8 -*-
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed by the CeCILL license version 2 under
# French law and abiding b... |
import torch
import os
import dill
from pathlib import Path
from torchtext.data import Field, TabularDataset, BucketIterator, Iterator, Dataset, Pipeline, RawField, LabelField
import torch.nn as nn
from transformers import BertTokenizer, BertForSequenceClassification, BertModel
from transformers import RobertaTokenize... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 20 09:55:31 2019
A simple flowsheet model for the simulation of a methane-fueled MB fuel
reactor.
@author: <NAME> (aostace)
"""
from __future__ import division
from __future__ import print_function
__author__ = "<NAME> and <NAME>"
__version__ = ... |
# -*- coding: utf-8 -*-
"""
```
"""
# import standard libraries
import os
from itertools import product
# import third-party libraries
import numpy as np
from colour.utilities.array import tstack
from colour import XYZ_to_RGB, xy_to_XYZ, RGB_COLOURSPACES
# import my libraries
import plot_utility as pu
import color_... |
import os
import inspect
import multiprocessing
import Spartacus.Database
from .import custom_exceptions
from .import utils
def compare_tables_data(p_database_1=None, p_database_2=None, p_block_size=None, p_schema=None, p_table=None, p_key=None, p_queue=None, p_is_sending_data_array=None, p_worker_index=None):
"... |
# -*- coding: utf-8 -*-
#
# vim: expandtab shiftwidth=4 softtabstop=4
#
"""ownCloud client module
Makes it possible to access files on a remote ownCloud instance,
share them or access application attributes.
"""
import datetime
import time
import urllib
import urlparse
import requests
import xml.etree.ElementTree as ... |
from typing import List, Tuple, TypedDict, Optional
from pathlib import Path
from itertools import chain
from bokeh.document.locking import UnlockedDocumentProxy
from bokeh.models.renderers import GraphRenderer, GlyphRenderer
import networkx as nx
from bokeh.io import output_file, save, curdoc
from bokeh.document impo... |
import pandas as pd
import numpy as np
from pandas.api.types import CategoricalDtype
import os
modulepath = os.path.dirname(__file__)
def interest_columns_for_year(year):
year = str(year)
list_columns = pd.read_csv(os.path.join(modulepath, 'columns_to_load_each_year.csv'), sep=';')[year].dropna().val... |
"""Analytics, transformation, and rendering for visualization of morphology and network embedding
Functions:
get_files -> array
filter_files -> array
get_edgelist -> dataframe
generate_graph -> NetworkX graph object
convert_to_edgelist -> dataframe
simplifyGraph -> NetworkX graph object
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 c... |
from bplib.bp import G1Elem
from bplib.bp import G2Elem
from bplib.bp import GTElem
from petlib.bn import Bn
from gsproof import GSProof
from bsps import BSPS
from usps import USPS
from cca2_cs import CSEnc
def proof_usps_hidesigandsigner(gsp, pk, M, sig):
"""" creates GS proof that a USPS signature verifies
w... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# python demos/face-labeler.py --directory='/net/projects/scratch/summer/valid_until_31_January_2022/krumnack/childface/clean4/UnifiedFunneled2' --debug __main__
# FIXME[todo]:
# - move face-label out auf demos/ split in separate files ...
# - read in original metadata (... |
import torch
import cv2
import numpy as np
import random
from utilities.constants import *
from utilities.bboxes import correct_boxes, crop_boxes
from utilities.rando import rand_scale
from utilities.images import image_float_to_uint8, image_uint8_to_float
from utilities.image_info import ImageInfo
##### AUGMENTATION... |
import os
import re
import time
import socket
import struct
import logging
import binascii
import tempfile
import threading
import PE
import envi
import vtrace
import envi.bits as e_bits
import envi.registers as e_registers
import vtrace.platforms.base as v_base
import envi.symstore.resolver as e_resolv
'''
VMWare ... |
'''
Basic numpy style operations on arrays.
These include --
* Array creation routines: (`rand`, `randn`, `zeros`, `ones`, `arange`)
* Reductions: (`sum`, `argmin`, `argmax`, `mean`)
* Shape/type casting: (`reshape`, `ravel`, `astype`, `shape`, `size`)
* Other: (`dot`).
'''
import sys
import numpy as np
import scipy... |
import json
import logging
import os
import random
import magic
from datetime import datetime
from functools import wraps
from urllib.parse import urlsplit, parse_qs, unquote, quote
from http import cookies
import flask
import gevent
import requests
import sqlalchemy as sa
import re
from flask_sockets import Sockets
f... |
#! /usr/bin/python3
import re
import os
import sys
import operator
import collections
import itertools
###########################################################################################################################
#Add path object
path=os.getcwd()
Stop=os.listdir(path)
p=re.compile('(\d+-[a-z]+... |
#
# AutoDock | Raccoon2
#
# Copyright 2013, <NAME>
# Molecular Graphics Lab
#
# The Scripps Research Institute
# _
# (,) T h e
# _/
# (.) S c r i p p s
# \_
# (,) R e s e a r c h
# ./
# ( ) I n s t ... |
from __future__ import print_function
import mxnet as mx
import logging
import os
import time
def _get_lr_scheduler(args, adv=False):
lr = args.lr
if adv:
lr *= args.adv_lr_scale
if 'lr_factor' not in args or args.lr_factor >= 1:
return (lr, None)
epoch_size = args.num_examples // args.... |
"""sun earth simulation"""
import io
import csv
import math
import types
import random
import argparse
import operator
import tqdm
import colour
import pygame
# Force = collections.namedtuple("Force", ("x", "y"))
# Position = collections.namedtuple("Position", ("x", "y"))
# Direction = collections.namedtuple("Directi... |
# ----------------------------------------------------------------------
# This module holds:
#
# RTInterface: the real-time socket interface, for receiving data
# from the real-time plugin to afni over a TCP port.
#
# SerialInterface: interface for writing to a serial port.
# ----------------------------... |
#!/usr/bin/python3
import sys
import os
import pathlib
import re
import argparse
import fileinput
import csv
import operator
import collections
from typing import List, Dict, Tuple, Set, Optional
suffix_sets = [
[ 'ate', 'ates', 'ating', 'ated', 'ation' ],
[ '', 's', 'es', 'ing', 'ed' ],
[ 'y', 'ily', 'ier', 'iest... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
"""Модуль для работы с манипулятором Rooky."""
__author__ = "Promobot"
__license__ = "Apache License, Version 2.0"
__status__ = "Production"
__url__ = "https://git.promo-bot.ru"
__version__ = "0.1.0"
import bus_handler
import time
import Servo
import Servo_ppm
impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import GEOparse
import vis
"""
Created on Thu Jun 20 12:10:43 2019
@author: <NAME> and <NAME>
"""
import mygene
import pandas as pd
import numpy as np
from sklearn import preprocessing
import scipy.io as spio
import os
from scipy.stats.stats import pearsonr
import matplo... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# This isn't a full WebIDL parser by a long shot. It's just designed
# to grok the tiny subset which BinAST's spec use... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as mplcm
import matplotlib.colors as colors
import os, sys
import pandas
from Bio import Phylo
import utility_functions_beast as beast_utils
import utility_functions_simulated_data as sim_utils
from plot_defaults import *
def read_treetime_resul... |
"""Tileset and font related functions.
Tilesets can be loaded as a whole from tile-sheets or True-Type fonts, or they
can be put together from multiple tile images by loading them separately
using :any:`Tileset.set_tile`.
A major restriction with libtcod is that all tiles must be the same size and
tiles can't overlap... |
from valorant_api.gear import Gear
from valorant_api.events import Event
from valorant_api.contracts import Contract
from .competitive import Competitive
from .competitivetiers import CompetitiveTier
from .sprays import Spray
from .sprays import Level as SprayLevel
from .agents import Agent
from .base_list import BaseL... |
import collections
import dataclasses
import functools
import itertools
import json
import logging
import time
import timeit
import warnings
from enum import Enum
from typing import (
Any, Collection, Hashable, Iterable, List, Mapping, MutableMapping,
Optional, Sequence, Set, Tuple, Type, Union
)
import numpy ... |
import numpy as np
import os.path
from time import time
from multiprocessing import Pool
import warnings
import itertools
import sys
import mmap
def _fromstring(buff,sep=' ',ID=None):
to_return = np.fromstring(buff,sep=sep)
if ID is None: return to_return
else: return to_return, ID
def _frombuffer(buff,chu... |
#!/usr/bin/env python3
#
# Script to visualize the contents of a Docker Registry v2 using the API with PyCurl
#
# Additional support for AWS EC2 Container Registry with Boto3 (pip install boto3)
# See https://github.com/boto/boto3 for configuration details
#
# Reference: https://github.com/docker/distribution/blob/mast... |
# train_n_est.py train a DeepFit model
# Author:<NAME> <EMAIL>zikbs[at]gmail.com
# If you use this code,see LICENSE.txt file and cite our work
from __future__ import print_function
import argparse
import os
import sys
import random
import math
import shutil
import torch
import torch.nn.parallel
import torch.optim as ... |
from urllib.request import urlopen, Request
from urllib.error import HTTPError
from urllib.error import URLError
import csv
import json
import logging
import os
import re
import math
from pathlib import PurePath
from bs4 import BeautifulSoup
from detect_delimiter import detect
import argparse
import xml.etree.cElementT... |
#!/usr/bin/env python3
import sys
import re
import traceback
from PyQt5.QtGui import QPainter, QPixmap, QIcon, QStandardItemModel, QStandardItem, QColor
from PyQt5 import QtCore
from PyQt5.QtCore import QRect, QSize, Qt, QObject, QTimer, pyqtSignal, QSettings, QModelIndex, QVariant, QAbstractItemModel, QSortFilterPro... |
from itertools import islice
from tqdm import tqdm
import numpy as np
import pandas as pd
import torch
from model_repair.cache42.cached_42 import cache_42
import tools.pudb_hook
from tools.utils import write_json, write_json_np_ok, read_json
from model_repair.override_for_release import get_interface
# @cache_42(i... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright <NAME>, 2021
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Licens... |
import time
import copy
import inspect
import numpy as np
import scipy
#from matplotlib import gridspec, font_manager
from astropy import stats
from pypeit import msgs
from pypeit.core import pydl
from pypeit import utils
from pypeit.core import pixels
from pypeit import ginga
from matplotlib import pyplot as plt
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from porth_globals import *
from typing import *
from porth_error import generate_error, check_errors
#to manage list of comments types and not only one type of comment
def split(txt: str, seps:List) -> List:
default_sep = seps[0]
# we skip seps[0] because that's th... |
import tensorflow as tf
import os
import cv2
import numpy as np
from tqdm import tqdm
from utils import compute_iou
import json
import random
from utils import processed_image, convert_to_square
@tf.function
def random_flip_images(image, offset, label):
# negative image have no offset annotation
if label != 1... |
# author: <NAME>
import os
import _thread
import pathlib
import pygame
import pygame.midi
import tkinter as tk
from tkinter import *
from tkinter import Tk, RIGHT
from tkinter import filedialog, messagebox
from tkinter import ttk
from tkinter.ttk import *
from tkinter.ttk import Button
from magenta.models.coconet.coc... |
# Copyright 2019-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# HPCTools Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import json
import cxxfilt
import reframe as rfm
import reframe.utility.sanity as sn
from reframe.core.deferrable i... |
from bombman import *
class Positionable(object):
# ----------------------------------------------------------------------------
def __init__(self):
self.position = (0.0, 0.0)
# ----------------------------------------------------------------------------
def set_position(self, position):
... |
import torch
import torch.nn.functional as F
from transformers import *
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
import random
from torch import nn
class Example(object):
def __init__(self, text, label=None):
self.text = text
... |
#!/usr/bin/env python
# FILE: computeLocalCutoffs.py
# AUTHOR: <NAME>
# CREATE DATE: 07 June 2021
import sys
if sys.version_info[0] >= 3:
unicode = str
import os, argparse
#from sklearn.metrics import precision_recall_fscore_support
#from sklearn.metrics import cohen_kappa_score
#from sklearn.metrics import matthews_c... |
#!/usr/bin/python3
#
# Average bandwidth monitoring script. Run periodically via NM db.sync to
# enforce a soft limit on daily bandwidth usage for each slice. If a
# slice is found to have transmitted 80% of its daily byte limit usage,
# its instantaneous rate will be capped at the bytes remaning in the limit
# over th... |
import os
import tensorflow as tf
import diffvg
import pydiffvg_tensorflow as pydiffvg
import time
from enum import IntEnum
import warnings
print_timing = False
__EMPTY_TENSOR = tf.constant([])
def is_empty_tensor(tensor):
return tf.equal(tf.size(tensor), 0)
def set_print_timing(val):
global print_timing
... |
import numpy as np
import torch
from torch.optim import Adam
import gym
from gym.spaces import Box, Discrete
import time
import spinup.algos.pytorch.ppo.core as core
from spinup.utils.logx import EpochLogger
from spinup.utils.mpi_pytorch import setup_pytorch_for_mpi, sync_params, mpi_avg_grads
from spinup.utils.mpi_too... |
# -*- coding: utf-8 -*-
"""
# Author : Camey
# DateTime : 2022/2/12 11:02 上午
# Description :
"""
import copy
import math
from collections import OrderedDict
import numpy as np
from ding.envs import BaseEnv, BaseEnvTimestep, BaseEnvInfo
from ding.envs.common.env_element import EnvElement, EnvElementInfo
from d... |
'''
This is the homework for SJTU IE308 Image Processing by Prof. <NAME>
Copy right by <NAME>, Dec 2019; ID: 517021910796
HW No.2 BM3D Denoising Implement & False Color Transfer
If you have any question, feel free to contact me at <EMAIL>
'''
import cv2
import numpy
import math
import numpy.matlib
cv2.setUseOp... |
import logging
from registration.models import RegistrationProfile
from bluebottle.accounts.models import BlueBottleUser
from apps.projects.models import Project, ProjectBudgetLine, ProjectCampaign, ProjectPitch, ProjectPlan, \
ProjectPhases, ProjectAmbassador
from apps.organizations.models import Organization, Org... |
#!/usr/bin/python3
"""
########################################################################
# Auxiliary methods used in USP AI course #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the... |
#!/usr/bin/env python3
import time
import math
import numpy as np
import rospy
from std_msgs.msg import Bool, Float32, Float32MultiArray
from robot3_18c1054.msg import HandClose
from robot3_18c1054.srv import GetHandState, GetHandStateResponse, GetInitTime, GetInitTimeResponse
class ArmControllerNode():
DELTA_TIME =... |
#!/usr/bin/env python3
import argparse
import os
import random
import shutil
import time
import warnings
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.multiprocessing as mp
import torch.utils.data
import ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 8 18:24:07 2014
@author: Dan
Common tasks in processing data and models, likely to be called as part of the pipeline.
"""
from sys import argv
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifi... |
"""
nbkode.core
~~~~~~~~~~~
Definition for Solver base class.
:copyright: 2020 by nbkode Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import annotations
import warnings
from abc import ABC, ABCMeta, abstractmethod
from numbers import R... |
# u-msgpack-python v2.4.1 - v at sergeev.io
# https://github.com/vsergeev/u-msgpack-python
#
# u-msgpack-python is a lightweight MessagePack serializer and deserializer
# module, compatible with both Python 2 and 3, as well CPython and PyPy
# implementations of Python. u-msgpack-python is fully compliant with the
# lat... |
# import importlib
# import sys,os
import json
import requests
import hmac
import hashlib
import time
from requests import Request, session
from credentials import *
# credentials
# account_id_3commas = '' #a
# api_key_3commas = '' #b
# api_secret_3commas = '' #c
# api_key_ftx = '' #d
# api_secret_ftx = '' #e
# ####... |
'''
(c) Copyright 2021
All rights reserved
Programs written by <NAME>
Department of Computer Science
New Jersey Institute of Technology
University Heights, Newark, NJ 07102, USA
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby grante... |
import math
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.linear_model import Lasso
from sklearn.linear_model import Ridge
from sklearn.linear_model import LinearRegression
from sklearn.feature_selection import RFE
from sklearn.model_selection import train_test_split
from sklearn.e... |
# -*- coding: utf-8 -*-
# This module is part of the pyCSAMT utils package,
# which is released under a LGPL- licence.
# @author: KouaoLaurent alias @Daniel03
"""
.. _module-Infos::`csamtpy.etc.infos`
:synopsis: Module contains various parameters of files handling and
glossary of some technical words.
... |
import six
import os
import tensorflow as tf
from deeplab.datasets import data_generator
from deeplab.utils import get_dataset_colormap
flags = tf.app.flags
FLAGS = flags.FLAGS
# When fine_tune_batch_norm=True, use at least batch size larger than 12
# (batch size more than 16 is better). Otherwise, one could use sma... |
import sys
import logging
import copy
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
from sklearn import metrics
from collections import defaultdict
from mllp.utils import UnionFind
THRESHOLD = 0.5
class RandomlyBinarize(torch.autograd.Function):
"""... |
import json
import sys
import os
import io
import copy
from collections import OrderedDict
import warnings
from typing import Optional
import numpy as np
import tiledb
from tiledb import TileDBError
# from tiledb.tests.common import xprint
if sys.version_info >= (3, 3):
unicode_type = str
else:
unicode_type... |
#!/usr/bin/python
##Antenna pointing analysis to get pointing model
# Stolen from interactive fit_pointing_model.py by Ludwig
#
# Revision History:
# * (Ruby) This fits a pointing model to a given data CSV file and produce a new model CSV and report
import optparse, os, time
import numpy as np
from matplotlib.backends... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.