text stringlengths 3.07k 22.1k |
|---|
"""
Copyright 2018 Johns Hopkins University (Author: <NAME>)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import numpy as np
import scipy.linalg as sla
import matplotlib.pyplot as plt
from .utils import pavx
def compute_roc(true_scores, false_scores):
"""Computes the (observed) miss/false_ala... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import map
import os
import glob
import fnmatch
from warnings import warn
import re
import zipfile
from io import BytesIO
import numpy as np
from pims.base_frames import FramesSequen... |
import random
import string
from os import makedirs
from threading import Event
from mega import (MegaApi, MegaListener, MegaRequest, MegaTransfer, MegaError)
from bot import LOGGER, MEGA_API_KEY, download_dict_lock, download_dict, MEGA_EMAIL_ID, MEGA_PASSWORD, MEGA_LIMIT, STOP_DUPLICATE, ZIP_UNZIP_LIMIT, STORAGE_THR... |
#BaseDados.inicializaRegras()
class BaseDeDados:
###
# METODO CONSTRUTOR DA CLASSE
###
#,
def __init__(self, ocorreciasSemProcessar, ocorreciasProcessadas) -> None:
self._ocorreciasSemProcessar = []
self._ocorreciasProcessadas = []
self._multas = []
self._regras... |
"""
Copyright BOOSTRY Co., Ltd.
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 distr... |
from grammar_parser.gparser import IndentationTerminal, Nonterminal
from incparser.astree import BOS, EOS, TextNode
Node = TextNode
class PythonIndent(object):
def __init__(self, incparser):
self.incparser = incparser
self.multimode = None
def incparse_init(self):
self.comment_tokens... |
import sys
import json
import io
import importlib
import queue
import math
from zipfile import ZipFile
from pprint import pprint
from queue import Queue
from threading import get_ident
from collections import namedtuple
import cairosvg
import pygame
from . import sb
from .vm import Parser
from .vm import VM
SCREEN_... |
from pathlib import Path
from tqdm import tqdm
import numpy as np
import torch
import matplotlib
import matplotlib.pyplot as plt
import code
from scipy.interpolate import griddata, LinearNDInterpolator
from scipy.stats import gaussian_kde
from torch.utils.data import DataLoader, Dataset
import torch
import torch.nn a... |
#!/usr/bin/python
''' Visual genome data analysis and preprocessing.'''
import json
import os
import operator
from visual_genome_python_driver import local as vg
from collections import Counter, defaultdict
import xml.etree.cElementTree as ET
from xml.dom import minidom
dataDir = './data/vg'
outDir = 'data/genome'... |
# Copyright (c) 2010-2013 OpenStack, 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 to ... |
#!/usr/bin/env python
"""
Provides client interface to Plans.
"""
import sys
if sys.version_info >= (3,3):
from urllib.parse import urlparse, parse_qsl
from http.cookiejar import LWPCookieJar
from html.parser import HTMLParser
elif sys.version_info < (3,):
from urlparse import urlparse, parse_qsl
... |
from __future__ import print_function
import os
import argparse
import torch
import torch.backends.cudnn as cudnn
import numpy as np
from data import cfg
from layers.functions.prior_box import PriorBox
from utils.nms_wrapper import nms
# from utils.nms.py_cpu_nms import py_cpu_nms
import cv2
from models.faceboxes impor... |
# -*- coding: utf-8 -*-
"""
Odim is a module for handling radar data files that follow OPERA ODIM data scheme
More information about the Odim data scheme can be found:
http://www.eumetnet.eu/sites/default/files/OPERA2014_O4_ODIM_H5-v2.2.pdf
"""
from .hiisi import HiisiHDF
import h5py
import numpy as np
import re
import... |
# --------------------------------------------------------
# Group R-CNN
# Copyright (c) OpenMMLab. All rights reserved.
# Written by <NAME>
# --------------------------------------------------------
import argparse
import copy
import os
import os.path as osp
import time
import warnings
import mmcv
import torch
from m... |
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
from .mpn import MPN
def compute_pairwise_distances(x, y):
"""
Computes the squared pairwise Euclidean distances between x and y.
:param x: a tensor of shape [num_x_samples, num_features]
:param y: a te... |
#!/usr/bin/env python
# coding: utf-8
# # Cifar10 Outlier Detection with NVIDIA Triton
# 
#
# In this example we will deploy an image classification model along with an outlier detector trained on the same dataset. For in depth details on creating an outlier detection model for your own dataset see... |
'''
Add info for a chain file to facilitate debugging
<NAME>
Johns Hopkins University
2021
'''
import argparse
import leviosam_utils
import pysam
import re
import sys
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'-c', '--chain', required=True,
help='Path to the inp... |
import argparse
import copy
import sys
import logging
import torch
from src.trainer import Trainer
from src.translator import Translator
from src.models import build_model, load_embeddings, print_summary
from src.word_by_word import WordByWordModel
from utils.vocabulary import collect_vocabularies
from src.serialize ... |
# -*- coding: utf-8 -*-
import six
import datetime
from flask import abort, current_app, render_template
from flask_login import current_user
from dmapiclient.audit import AuditTypes
from dmutils.email import send_email, EmailError
def get_brief(data_api_client, brief_id, allowed_statuses=None):
if allowed_sta... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2017 challenger.ai
#
# 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 a... |
import numpy as np
import torch
from sklearn.model_selection import GridSearchCV, KFold
from sklearn.model_selection import train_test_split
from sklearn.multioutput import MultiOutputClassifier
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from torch_geometric.data import ... |
from data.fashionmnist import *
from examples.simple_cnn.model import *
from hyper.container import HyperContainer
from base_step_optimizer import *
from base_trainer import *
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import numpy as np
import torch.nn as nn
import argparse
import sys
impor... |
# https://www.tradingview.com/wiki/Chaikin_Money_Flow_(CMF)
# Chaikin money flow
# Chaikin believed that buying and selling pressures could be determined by where a period closes in relation to its high/low range. If the period closes in the upper half of the range, then buying pressure is higher and if the period clos... |
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import plotly.express as px
import pandas as pd
from aletheia.settings import BASE_DIR
import json
import os
import statistics
import re
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.... |
# plot all rocs
import os
import matplotlib
import numpy as np
import seaborn as sns
import pandas as pd
from sklearn.metrics import roc_curve, roc_auc_score
from scipy.interpolate import interp1d
from helper_funcs import to_json, from_json
matplotlib.rcParams.update({'font.size': 32})
import matplotlib.pyplot as ... |
""" Classes to represent color maps and meta data from various sources in uniform way.
How to pick a good color map:
1) Select a map category depending on your data: sequenitial, diverging, cyclic
2) Select a good quality map.
3) Select a map for your domain and application. Geographical, ... |
from random import randint, random
import math
from typing import TypeVar
from Loss import Loss
from Log import Log
import Model
class Particle:
NEXT_ID = 0
# A a list of floats
RealV = TypeVar('RealV', list[float], list[int])
ValuePositionT = TypeVar('ValuePositionT', tuple[float, list[float]],... |
# Licensed under a 3-clause BSD style license - see PYDL_LICENSE.rst
# -*- coding: utf-8 -*-
# Also cite https://doi.org/10.5281/zenodo.1095150 when referencing PYDL
"""
Implements pure python support methods for
:class:`pypeit.bspline.bspline.bspline`.
.. include:: ../links.rst
"""
import warnings
from IPython impor... |
#main_beta.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.animation import FuncAnimation
from timeit import default_timer as timer
from numba import vectorize
@vectorize(['float32(float32, float32)'], target='cpu')
def mag_cpu(... |
#!/usr/bin/env python3
import torch
import torchvision
import torch.distributed as dist
import sys
from utils.zero_redundancy_optimizer import ZeroRedundancyOptimizer
class MultiGpuModel(torch.nn.Module):
"""Initialises model for multi gpu calculation.
"""
def __init__(self, rank, args):
"""Initi... |
import torch
from torch import nn
from torch.nn import Parameter
import torch.nn.functional as F
from .Linear_super import LinearSuper
from .qkv_super import qkv_super
from ..utils import trunc_normal_
def softmax(x, dim, onnx_trace=False):
if onnx_trace:
return F.softmax(x.float(), dim=dim)
else:
... |
#!/usr/bin/env python
import os
import sys
from time import time
import json
from psana.detector.Utils import info_dict, info_command_line, info_namespace
from psana.pyalgos.generic.NDArrUtils import info_ndarr
import psana.detector.UtilsEpix10ka as ue
from psana.detector.utils_psana import datasource_arguments, info... |
#!/usr/bin/env python
import unittest
import time
from random import randint
from bfd import *
from framework import *
from util import ppp
class BFDAPITestCase(VppTestCase):
"""Bidirectional Forwarding Detection (BFD) - API"""
@classmethod
def setUpClass(cls):
super(BFDAPITestCase, cls).setUpCl... |
import copy
import json
from pprint import pprint
import itertools
import sys
from vega import VegaLite
import data_utils
RELATION_TYPE = {
"view_facts": ["mark"],
"enc_facts": ["field_ty", "enc_ty", "channel", "aggr", "bin"]
}
META_VAR = {
"@CH": ["bar", "text", "line", "point", "x", "y", "color", "si... |
import numpy as np
import os
import pickle as pkl
import pandas as pd
import matplotlib.pyplot as plt
import time
from scipy.special import comb
from sympy import *
import cmath
from scipy.linalg import expm, sinm, cosm
from tqdm import tqdm
from scipy.integrate import quad
from scipy.stats import erlang
i... |
#!/usr/bin/env python
__author__ = "<NAME>"
__version__ = "1.1"
__description__ = "Strategies Implementation"
import sys, os, traceback, errno, time
from abc import ABCMeta, abstractmethod
from lib.Alpha import *
from lib.DataAPI import *
from multiprocessing import *
import pandas as pd
import numpy as np
import date... |
"""
.. _powerspectrum:
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
from time import time
def powerspectrum(*u, average=True, diagnostics=False,
kmin=None, kmax=None, npts=None,
compute_fft=True, compute_sqr=True,
use_pyfftw=False, bench=False, **k... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 20 18:43:11 2020
@author: Christian
"""
import os
import numpy as np
from .solutionClass import Individual, Generation, BasicGenePool
from .defaultFuncs import (initPopulation, defaultEnvironment,
defaultCrossover, defaultMutate, defaultFit... |
# Licensed under the MIT License - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
from glob import glob
import os, subprocess
from .analysis import MCMCResults
import numpy as np
from astropy.io import ascii
from scipy.optimize ... |
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves.urllib.parse import urlsplit
from contextlib import contextmanager
from django.db import transaction
from django.urls import resolve, Resolver404
from rest_framework import serializers
from rest_framewo... |
import argparse
import os
import torch
import yaml
from torch import nn
from torch.nn import functional as F
import torchgeometry as tgm
from PIL import Image
from data.test_datasets import VITONDataset, VITONDataLoader
from networks.generators import SegGenerator, GMM, ALIASGenerator
from models.seg_mode... |
import numpy as np
from PyEngine3D.Utilities import *
from PyEngine3D.App.GameBackend import Keyboard
from PyEngine3D.Common import logger, log_level, COMMAND
from PyEngine3D.Render import Spline3D, SkeletonActor
from GameClient.Constants import *
from GameClient.GameStates import ShipStateMachine, TankStateMachine
... |
# Lint as: python3
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import pandas as pd
from datascope.importance.shapley import ImportanceMethod
from enum import Enum
from pandas import DataFrame
from typing import Any, Optional, Dict
from .base import Scenario, attribute, result
from ..dataset import Dataset, DEFAULT_TRAINSIZE, DEFAULT_VALSIZE, DEFAULT_TESTSIZE
from ..pipelines imp... |
#!/usr/bin/python3
import selflib, argparse, sqlite3, os
from selflib import *
''' Every database that gets made for sqlite is assumed to have an ID column for it's own primary key. If this is not the case, just ignore it when getting results. '''
''' This program needs to be turned into a server w/ queue, or it need... |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 <NAME> and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
High-level access to HDF5 dataspace selecti... |
#! python3
# FanGraphs/selectors/leaders_sel.py
"""
CSS selectors for the classes in :py:mod:`FanGraphs.leaders`.
"""
class GameSpan:
"""
CSS selectors for :py:mod:`fangraphs.leaders.gamespan`.
"""
selections = {
"stat": [
".controls-stats > .fgButton:nth-child(1)",
".... |
import asyncio
import logging
from collections import deque
from contextlib import suppress
from datetime import datetime
from aiogram.dispatcher import FSMContext
from aiogram.types import CallbackQuery, Message, Update
from aiogram.types.chat import ChatActions
from aiogram.utils.exceptions import (BadRequest, BotBl... |
import os
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
import resqpy.lines
import resqpy.model as rq
import resqpy.organize
def test_lines(example_model_and_crs):
# Set up a Polyline
title = 'Nazca'
model, crs = example_model_and_crs
line = resqpy.lines.Polyl... |
from enum import Enum
import json
import re
import numpy
class Model(str, Enum):
"""
Type of model used to train the network.
"""
LAGRANGE = 'lagrange'
LATENT_EQUILIBRIUM = 'latent_equilibrium'
class BackendType(str, Enum):
"""
Type of computational backend to use for the lagrangian.
... |
import os
import sys
from itertools import islice
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
def rs232_checksum(the_bytes):
return b'%02X' % (sum(the_bytes) & 0xFF)
def stringify_address(address):
hexify = hex(address)
stringify = str(hexify).replace('0x', '')
prefix = '0'
while len(stringify) < ... |
#-------------------------------------------------------------------------------
# Format string syntax parser.
#
# In these Python/C APIs for argument parsing between Python and C/C++,
# format strings are used to tell the foreign function about the expected
# arguments.
#
# A format string consists of zero or more ... |
#!/usr/bin/env python3
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
"""
------------------------------------------------------------------------
Description:
Demonstration script for Hex Encoding/Decoding of DHCP Options
using the bloxone module
Requirements:
bloxone
yaml
Author: <NAME>
Date... |
import tkinter as tk
from tkinter import ttk
from tkinter import StringVar, font, IntVar
from ttkbootstrap import Style
from tkinter.constants import ACTIVE, ANCHOR, CENTER, DISABLED, E, END, GROOVE, HORIZONTAL, LEFT, N, RAISED, RIDGE, RIGHT, S, SUNKEN, W
import numpy
from database import Top_List
def CheckS... |
"""
geoutils.satimg provides a toolset for working with satellite data.
"""
import os
import re
import datetime as dt
import numpy as np
from geoutils.georaster import Raster
import collections
import rasterio as rio
lsat_sensor = {'C': 'OLI/TIRS', 'E': 'ETM+', 'T': 'TM', 'M': 'MSS', 'O': 'OLI', 'TI': 'TIRS'}
def par... |
import pandas as pd
from libs.utils import haversine, calcWindComponents, isaDiff, getPerf, loadBook
from configuration.units import runwayUnits
# definitions
def findTakeoff(flight): # returns the row of the takeoff point
garminGround = flight[flight["OnGrnd"] == 0].index.min() # Garmin Ground indicator
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... |
"""
================================================
:mod:`replacers` -- Survivor replacement methods
================================================
This module provides pre-defined replacers for evolutionary computations.
All replacer functions have the following arguments:
- *... |
""" The main content model """
import logging
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import AutoSlugFiel... |
import sys
import flask_api
from flask import request
from flask_api import status, exceptions
import pugsql
import uuid
from cassandra.cluster import Cluster
from flask_cassandra import CassandraCluster # pip3 install flask-cassandra
from flask import Flask
app = Flask(__name__)
cassandra = CassandraCluster()
app.co... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
import itertools
import copy
import logging
from collections import OrderedDict
import networkx
from wayfarer import (
LENGTH_FIELD,
NODEID_FROM_FIELD,
NODEID_TO_FIELD,
WITH_DIRECTION_FIELD,
Edge,
)
try:
from itertools import izip as zip
except ImportError: # will be 3.x series
pass
lo... |
import cgi
import logging
from http.server import BaseHTTPRequestHandler, HTTPServer
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_utils.database_setup import Base, Poll, Category, Choice
logging.basicConfig(level=logging.INFO)
LOGGER = logging.getLogger(name='http_server... |
#!/usr/bin/env python3
"""
Module to parse NCBI taxon ID database.
Can also be run as a stand-alone script to generate all child taxon IDs by
providing the taxdump directory and desired parent taxid as arguments.
Usage: python3 src/dataprep/taxonid.py data/raw/taxdump/ 10292 output-file
"""
import os
import sys
from... |
"""
python generate_imagematte_with_background_video.py \
--imagematte-dir ../matting-data/Distinctions/test \
--background-dir ../matting-data/BackgroundVideos_mp4/test \
--resolution 512 \
--out-dir ../matting-data/evaluation/distinction_motion_sd/ \
--random-seed 11
Seed:
10 - distinctio... |
from datetime import date
# pip3 install requests
import requests
def compare_dates(gh_date, d):
if gh_date is None or len(gh_date) < 1:
return False
gh_date = gh_date.split('T')[0].split('-')
year = int(gh_date[0])
month = int(gh_date[1])
day = int(gh_date[2])
return date(year, month,... |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render_to_response, redirect
from django.template import RequestContext
from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404, HttpResponse, HttpResponseForbidden, Http... |
import pickle
import os.path
from datetime import datetime
import pandas as pd
# from joblib import Memory
from agent.TradingAgent import TradingAgent
from util.order.LimitOrder import LimitOrder
from util.util import log_print
class RejectReplayAgent(TradingAgent):
def __init__(self, id, name, type, symbol, da... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
<NAME> <<EMAIL>>
Part of this module is based on the BioSTEAM package:
https://github.com/bioSTEAMDevelopmentGroup/biosteam
This module is under th... |
import sys
from convertdate import hebrew
from convertdate import islamic
from convertdate import julianday
from flask import Flask, request
from pyluach import hebrewcal
app = Flask(__name__)
def get_islamic(year, month, day):
return islamic.from_gregorian(year, month, day)
def get_hebrew(year, month, day):
... |
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import os.path as osp
from collections import defaultdict
from time import time
from jedi.api.classes import Completion
import parso
from pylsp import _utils, hookimpl, lsp
log = logging.getLogger... |
# functions that work with the tracking data ....
import pandas as pd
import numpy as np
import math
from scipy.signal import savgol_filter
from scipy.ndimage.filters import gaussian_filter1d
from scipy.stats import circmean,circvar
import cv2
import sys
def pos_make_df(data_pos,box_size_cm,timebase_pos,time_stamps_s... |
"""
Collection of functions for sending and decoding request to or from the slack API
"""
import cgi
import hmac
import json
import time
import base64
import hashlib
import logging
from . import HOOK_URL, ROOT_URL, events, methods, exceptions
LOG = logging.getLogger(__name__)
RECONNECT_EVENTS = ("team_migration_sta... |
import numpy
from generate_HWITW_stats import (
DAYS_PER_WEEK,
HOURS_PER_WEEK,
HALF_HOURS_IN_WEEK,
WEEKS_PER_YEAR,
HOURS_PER_YEAR,
MIN_VALID_HOURS,
K_to_C
)
from extra_data_settings import data_settings_internal
flat_functions = data_settings_internal['flat_functions']
####################... |
import numpy as np
import sys, os
import urllib.parse as urlparse
import requests
from bs4 import BeautifulSoup
from tqdm import trange
from astropy.io import fits
from astropy import units as u
from astropy.coordinates import SkyCoord
from astroquery.mast import Tesscut
from datetime import datetime
def listFD(url,... |
#!/usr/bin/env python3
import discord
from sqlalchemy import create_engine, String, Column, ForeignKey, Integer
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
rolemenu_db = create_engine("sqlite:///rolemenu.db", echo=True)
Base = declarative_base()
class... |
""" Implementation of the DriveReport tools and utilities
Started 2018-05-28 by <NAME>
Copyright (C) 2018 <NAME>
This class and the test code in the main() function at the bottom
are written to provide the ability to generate straightforward tabular
reports from the Google Drive metadata that the DriveFile class pro... |
import os, sys
abs_dir_path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(abs_dir_path, "..", "src"))
del os, sys
import re
from ply.lex import LexToken
from uC_lexer import UCLexer
###########################################################
## misc ###################################... |
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
import firebase_admin
from firebase_admin import credentials, firestore, storage
import json
from PIL import Image, ExifTags
from google.cloud import storage as storage2
import uuid
impo... |
import glob
import os
import pickle
import sys
import time
import warnings
import json
import numpy as np
import pandas as pd
import tensorflow as tf
from PIL import Image
import cv2
from dan import DAN
from tensorflow.keras.models import load_model
from Audioclean import downsample_mono, envelope
... |
"Utility functions and classes useful within the DDS."
####################################################################################################
# IMPORTS ################################################################################ IMPORTS #
##############################################################... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
########################################################################################################################
# Copyright © 2019 The George Washington University.
# All Rights Reserved.
#
# Contributors: <NAME> <<EMAIL>>
#
# Licensed under the B... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %% [ma... |
import sys
import os
sys.path.append("stylegan2-pytorch")
import argparse
import numpy as np
from numpy import inf
import torch
from torch import optim
from tqdm import tqdm
import lpips
from model import Generator
from PIL import Image
import matplotlib.pyplot as plt
import umap
def make_image(tensor):
... |
import re
import molgrid
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn import init
from torch import autograd
import wandb
import argparse
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.use(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Small library that extends python's built-in json library with various utilities
"""
import enum
from collections.abc import Mapping, Sequence
from json import *
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, SAJE project"
__license__ = "MIT"
__version__ = "0.2... |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... |
"""
EF21 with heavy ball acceleration
experiment for least squares function
"""
import numpy as np
import time
import sys
import os
import argparse
from numpy.random import normal, uniform
from sklearn.datasets import make_spd_matrix, make_sparse_spd_matrix, load_svmlight_file, dump_svmlight_file
from numpy.linalg imp... |
import asyncio
import aioschedule
import yaml
import time
import os
from copy import deepcopy
from datetime import datetime
from pathlib import Path
from pyrogram import Client
from pyrogram.types import InputMediaDocument
from pyrogram.raw import functions
from pyrogram.raw.types import InputMessagesFilterEmpty
L... |
#!/usr/bin/env python
"""
COOLR Intel Discrete GPU power management module
Requirements:
- Intel Discrete GPUs
- oneAPI runtime environment (level_zero.so)
- libapmidg.so
"""
from ctypes import *
import time
import keypress
class rtype_getpwrprops:
def __init__(self, onsubdev, subdevid, canctrl, deflim_mw, minl... |
#!/usr/bin/env python3
from flask import Flask, flash, render_template, request # jsonify, redirect,
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from config import Config
appname = "Shopmaker"
app = Flask(__name__)
myconfig = Config
app.config.fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import argparse
import six
from t4mon import logger
# from gooey import Gooey
TITLE = 'T4 collector and report generator script'
DESCRIPTION = """
Additional tools:
--config: dump the configuration defaults
--local: create repor... |
from dataviva.api.attrs.models import Ybs, Bra, Bs, Yb
from dataviva import db
from sqlalchemy import func
class All:
def __init__(self):
self._attrs_list_ybs = None
self._attrs_list_yb = None
self.max_year_query_ybs = db.session.query(
func.max(Ybs.year))
self.attrs... |
#!/usr/bin/env python3
#
# Author: <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... |
import json
import tempfile
import os
from typing import TYPE_CHECKING
from urllib.parse import parse_qs, urlparse
from tqdm import tqdm
from youtube_dl import YoutubeDL
from ytm import YouTubeMusic, YouTubeMusicDL # noqa
from ytm import utils as ytm_utils
from aiu import LOGGER
from aiu.parser import fetch_image
fro... |
'''
(c) University of Liverpool 2019
All rights reserved.
@author: neilswainston
'''
from collections import Counter
import itertools
from cobra.io import read_sbml_model, write_sbml_model
from subliminal import math_utils
from synbiochem.utils import chem_utils
def balance_sbml_model(in_filename, out_filename):
... |
import itertools
import os
import random
import statistics
from datetime import datetime
from itertools import groupby
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pywt
import ref
import tqdm
# from autofe.optuna_tuner.registry import MULTICLASS_CLASSIFICATION
# from autofe.optuna_tune... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import models.drn as drn
from models.DRNSeg import DRNSeg
from models.FCN32s import FCN32s
import data_transforms as transforms
import json
import math
import os
from os.path import exists, join, split
import threading
import time, datetime
import numpy as np
import shut... |
"""
consensus_by_xai_approach.py:
Makes a consensus of the interpretability on different ML models
"""
__author__ = "<NAME>"
__version__ = "1.0"
__maintainer__ = "Jorge"
__email__ = "<EMAIL>"
__status__ = "Production"
import argparse
from glob import glob
import json
import os
import pandas as pd
import matpl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.