text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 13:23:40 2020
@author: <NAME>
"""
import os
import requests
import pandas as pd
import unicodedata as utf
from time import time
from bs4 import BeautifulSoup
from nltk.stem import SnowballStemmer
from nltk.corpus import stopwords
from nltk.tokenize ... |
"""
keccak
======
Fallback implementation of v52 of the keccak hash functions.
The Keccak sponge function was designed by <NAME>, <NAME>,
<NAME> and <NAME>. For more information, feedback or
questions, please refer to their website: http://keccak.noekeon.org/
Based on the implementation b... |
# -*- coding: utf-8 -*-
import logging
from os.path import join
import numpy as np
import utool as ut
from six.moves import range, zip
print, rrr, profile = ut.inject2(__name__)
logger = logging.getLogger()
def load_mnist_images(gz_fpath):
import gzip
# Read the inputs in Yann LeCun's binary format.
wit... |
# -*- coding: utf-8 -*-
import math
from typing import Tuple
import torch
from torch import Tensor
from .dawson_integration import fast_dawson_pytorch as dawson_module
from .global_config import mnn_config
class MnnCoreModule(torch.nn.Module):
__constants__ = ['L', 'vol_th', 'vol_rest', 'cut_off', 't_ref', 'bou... |
from pymongo import MongoClient
from pymongo import errors
from flask import request
from flask import jsonify
from shapely.geometry import Polygon
from shapely.geometry import Point
import fisb_restConfig as cfg
import utilities as util
import dateutil.parser
DEFAULT_LIMIT = 10000
DEFAULT_AFTER = "2004-01-01T00:00:0... |
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import argparse
from tqdm import tqdm
import os
import cv2
import pickle
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from t... |
#!/usr/bin/env python3
import argparse
import requests
import json
import math
from bitcoinx import (
PrivateKey, PublicKey, TxOutput, TxInput, Tx,
Script, SigHash, pack_byte, P2PKH_Address, Bitcoin,
TxInputContext, InterpreterLimits, MinerPolicy
)
import scryptlib
from scryptlib.type... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 <NAME> <<EMAIL>>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Python wrapper around Vowpal Wabbit's Latent Dirichlet Allocation (LDA)
implementation [1]_.
This uses Matt Hoffman's online algorithm, for LDA [2]_, i.e... |
"""functions useful for manipulating `Models-3 I/O API
<https://www.cmascenter.org/ioapi/documentation/3.1/html/>`_ data
files in python. Models-3 I/O API are built on `netCDF
<http://www.unidata.ucar.edu/software/netcdf/>`_, but I have found
that performing these tasks using Python's `netCDF4 module
... |
#!/usr/bin/env python2
"""Create 2D to 3D datasets from selected SMPL fits."""
# pylint: disable=invalid-name, wrong-import-order
import os
import os.path as path
import sys
import itertools
import logging
import csv
import cPickle as pickle
import numpy as np
import scipy
import scipy.io as sio
import cv2
import clic... |
'''
Copyright 2021 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Thu Dec 16 2021
File : report_data.py
'''
import logging
from collections import OrderedDict
import CodeInsight_RESTAPIs.project.get_child_projects
import CodeInsight_RESTAPIs.proj... |
# -*- coding: utf-8 -*-
"""
.. module:: conway_patterns
:platform: Unix, Windows
:synopsis: Various patterns for Conway's Game of Life
.. moduleauthor:: <NAME> <<EMAIL>>
Some patterns for the Game of Life. Some well-known patterns are listed here,
such as the hallmark tiny glider and "Gosper's glider gun". Thi... |
# coding=utf-8
import json
import luigi
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
import os
import pandas as pd
import seaborn as sns
import sys
sys.path.append("..")
import cfg
from constants import DANGEROUS_GROUPS
from collectio... |
import logging
import struct
import array
CRC_TABLE = (
0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,
0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,
0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,
0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,
... |
#!/usr/bin/env python3
"""
Data Cleaning and Utility functions for CICIDS 2017 data
"""
# Load the top modules that are used in multiple places
import numpy as np
import pandas as pd
# Some global variables to drive the script
# The indir should match the location of the data
# The outdir should be the desired locat... |
import hydra
import logging
import os
import sys
import torch
import torch.nn.functional as F
import asteroid
from omegaconf import OmegaConf
from parse import *
from pathlib import PurePath
from tqdm import tqdm
from torch import nn, optim
from torch.utils.data import DataLoader, random_split
from asteroid.data impor... |
import os
import sys
import pickle
import argparse
from PIL import Image
import cv2
import numpy as np
import scipy.ndimage
import onnxruntime as rt
from scipy.interpolate import griddata, interp1d
from sklearn.linear_model import LinearRegression
MODULE_PATH = os.path.abspath(os.path.dirname(__file__))
def resize... |
#!/usr/bin/env python3
from cmd import Cmd
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from datetime import timedelta
from enum import Enum
from threading import Lock
import argparse
import configparser
import lxml.html
import os
import json
import... |
import os
import glob
import math
from typing import Dict
import pandas as pd
import wfdb
from ecg_transformer.util import *
import ecg_transformer.util.ecg as ecg_util
from ecg_transformer.preprocess import get_ptbxl_splits
config_dict = {
'meta': dict(
path_base=PATH_BASE,
dir_proj=DIR_PROJ,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
ANFIS in torch: test cases form the Vignette paper:
"ANFIS vignette" by <NAME> and <NAME>,
http://www.bdmg.com.ar/?page_id=176, or CRAN package 'anfis'
@author: <NAME> <<EMAIL>> Apr 12 18:13:10 2019
'''
import sys
import torch
import anfis
fro... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 9 12:02:08 2021
@author: Mahmu
"""
import numpy
import random
import pylab
import imp
"""
Generate random coin flips and return a result list
"""
def generateCoinFlipData(numberOfCoins, numberOfFlips):
flippedCoinResults = []
for i in range(numberOfCoins):
... |
#!/usr/bin/env python3
# Physics Derivation Graph
# <NAME>, 2020
# https://creativecommons.org/licenses/by/4.0/
# Attribution 4.0 International (CC BY 4.0)
import sympy # type: ignore
from sympy import tan, atan, sin, asin, cos, acos
from sympy.vector import cross, dot
from sympy.vector.deloperator import Del
from ... |
# ATTENTION! File managed by Puppet. Changes will be overwritten.
from __future__ import print_function
import ConfigParser
import StringIO
import inspect
import itertools
import os
import re
import shlex
import shutil
import subprocess
import threading
import urllib
import saf
from saf.exceptions import *
from sa... |
import os
import sys
sys.path.append(os.getcwd())
import cv2
import numpy as np
import torch
from ..dataset.mot import MOTTracking, collate_fn, read_mot_file
from ..configs.config import load_config
from ..utils.log import log_or_print, get_logger
def voc_color_code(num_colors=100):
def to_binary(val, idx):
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# python standard imports
import re
from copy import copy
from pathlib import Path
# third-party imports
from yaml import safe_load, safe_dump
# internal imports
from .tokens import TokenType, StringBuilder
from .citation import Citation
from .regex_mods import process_pattern, match_regexes
_DEFAULT_CITATOR = None
... |
from pytools import testutil
import pysynphot as S
import numpy as N
from astropy.io import fits as pyfits
from pysynphot import etc
from pyraf import iraf
from iraf import stsdas,hst_calib,synphot
import os,time,re
from pysynphot.wavetable import wavetable as Wavecat
from pysynphot.observationmode import ObservationMo... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import model
from data_reader import load_data, DataReader, FasttextModel, DataReaderFastText, TestDataReader, load_test_data
import pandas as pd... |
# tests grabbed from:
# https://github.com/tidyverse/dplyr/blob/master/tests/testthat/test-slice.r
from pandas.testing import assert_frame_equal
from pipda.context import ContextError
import pytest
from datar.core.grouped import DataFrameRowwise
from datar.all import *
from datar.datasets import mtcars
from datar.dplyr... |
import numpy as np
import pytest
from pandas.compat import range, u, zip
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
import pandas.core.common as com
from pandas.core.indexing import IndexingError
from pandas.util import testing as tm
@pytest.fixture
def frame_random_data_integer_mul... |
from linlearn import MOMRegressor
from linlearn.robust_means import (
Holland_catoni_estimator,
estimate_sigma,
alg2,
gmom,
median_of_means,
)
from linlearn.strategy import median_of_means as mom_func
import numpy as np
import logging
import pickle
from datetime import datetime
from tqdm import tqdm... |
#!/usr/bin/env python3
"""Functional Python Programming
Chapter 7, Example Set 3
"""
#pylint: disable=wrong-import-order,wrong-import-position,reimported
import Chapter04.ch04_ex4
# Raw Data Parser
# from collections import namedtuple
# Pair = namedtuple("Pair", ("x", "y"))
from typing import NamedTuple
class Pair... |
import torch
from torch import nn, optim
import torch.nn.functional as F
from torchvision.transforms import Normalize
from torchvision.models import vgg16
import numpy as np
from itertools import chain
import os
def get_rays(H, W, focal, c2w):
"""Get ray origins, directions from a pinhole camera."""
device = c... |
# Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#************************************************************************
# --- Copyright (c) INRS 2016
# --- Institut National de la Recherche Scientifique (INRS)
# --- Copyright (c) <NAME> 2018
# ---
# --- Licensed under the Apache License, Version 2.0 (the "License");
# ... |
#---------------------------------------------------------------------------
# Copyright 2018 The Open Source Electronic Health Record Agent
#
# 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
#
... |
# -------------------------------------------------------------------------
# Legacy Procedures from Melody Extractor Core Functions
# author: <NAME>
# e-mail: <EMAIL>
# date: 23.07.2021
# -------------------------------------------------------------------------
# ----------------------------------------------------... |
"""
Author: <NAME>
BSD 3-Clause License
Copyright (c) 2019, The Regents of the University of Minnesota
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... |
# -*- coding: utf-8 -*-
import numpy as np
import numpy.matlib
import logging
from scipy import integrate
from .algos import replace_at_inf_or_nan, _min_neglect_idx
from .wavelets import Wavelet
logging.basicConfig(format='')
WARN = lambda msg: logging.warning("WARNING: %s" % msg)
NOTE = lambda msg: logging.info("NOT... |
import os
import sys
import pickle
import signal
import argparse
import traceback
import torch
import numpy as np
import embedding.factory as ebd
import classifier.factory as clf
import dataset.loader as loader
import train.factory as train_utils
def parse_args():
parser = argparse.ArgumentParser(
d... |
# Copyright 2018 The Wallaroo 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 applicable law or agreed ... |
from math import pi, sqrt, log
from numpy import exp as cexp
from numpy import ceil
# http://stackoverflow.com/questions/14132789/python-relative-imports-for-the-billionth-time
# Leaves me with only one choice ... :(
# Since I don't want to modify shell variables
import os
import sys
sys.path.append(
os.path.dirna... |
import z3
import copy
import collections
from . import util, mem, vm_isa
MemorySort = z3.ArraySort(z3.BitVecSort(256), z3.BitVecSort(8))
StorageSort = z3.ArraySort(z3.BitVecSort(256), z3.BitVecSort(256))
MemoryEmpty = z3.K(z3.BitVecSort(256), z3.BitVecVal(0, 8))
StorageEmpty = z3.K(z3.BitVecSort(256), z3.BitVecVal(0,... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2022 The NiPreps Developers <<EMAIL>>
#
# 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 ... |
import argparse
import os
import time
from multiprocessing import Event, Manager, Process, Queue
from operator import itemgetter
import geopandas as gpd
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from gerrychain import Graph, MarkovChain, Partitio... |
import json
import os
import numpy as np
import pandas as pd
import pytest
from skbio import DistanceMatrix
import qupid._exceptions as mexc
import qupid.casematch as mm
class TestErrors:
def test_match_by_single_sample_overlap(self):
s1 = pd.Series([1, 2, 3, 4])
s2 = pd.Series([5, 6, 7, 8])
... |
# -*- encoding: utf8 -*-
from __future__ import absolute_import, division, print_function
import collections
import json
import unittest
import hashedindex
def unordered_list_cmp(list1, list2):
# Check lengths first for slight improvement in performance
return len(list1) == len(list2) and sorted(list1) == s... |
"""아래 사이트에서 세계 데이터 수집
https://www.worldometers.info/coronavirus/
"""
import ast
import re
import requests
from bs4 import BeautifulSoup
from utils import write_data
URL = "https://www.worldometers.info/coronavirus/"
TOP_NUM = 5 # 수집할 상위 국가 수
SUB_URLS = [] # 수집할 상위 국가의 서브 페이지 url [[나라 이름1, url1], ...]
country_n... |
"""Test cases for pywebarchive."""
# Some things to consider when writing tests:
# - Unit tests are fully automated and must run non-interactively.
# (Earlier versions of pywebarchive did include interactive tests,
# but these have since been split into separate scripts.)
# - When using io.open() in text m... |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""sharesniffer.py - sniff out and find all smb/nfs shares
on the local network and try to mount them for crawling.
Requires python-nmap, netifaces modules, Nmap in PATH
and Nmap nse scripts.
See README.md or https://github.com/shirosaidev/sharesniffer
for more information.... |
from enum import Enum
from itertools import cycle, chain
import operator as op
import os
import random
class Side(Enum):
WHITE = 1
BLACK = 2
@property
def fg(self):
if self == Side.WHITE:
return '\x1b[37m'
if self == Side.BLACK:
return '\x1b[30m'
class BG:
... |
import logging
import math
import os
import sys
import astropy.io.fits
import astropy.io.fits as fits
import numpy as np
import vaex.dataset
from vaex.dataset_mmap import DatasetMemoryMapped
import vaex.export
logger = logging.getLogger("vaex.astro.fits")
class FitsBinTable(DatasetMemoryMapped):
def __init__(... |
import numpy as np
import PIL
import tensorflow as tf
import base64
import io
# from IPython.display import HTML, Image, clear_output, display
from tensorflow.keras.applications import densenet
from tensorflow.keras.applications import inception_resnet_v2
from tensorflow.keras.applications import inception_v3
from ten... |
# Utilities for generating multi-timestep splittings
import itertools
import numpy as np
# To-do: add utilities for estimating the total number of force terms
from simtk import openmm as mm
def generate_solvent_solute_splitting_string(base_integrator="VRORV", K_p=1, K_r=3):
"""Generate string representing sequen... |
# This script contains all functions that have directly to do with the
# MIRC-search.
import os
import numpy as np
import torch
from scipy.special import softmax
from PIL import Image
def get_size_in_original_px_space_list():
"""Create list of pixels in original pixel space when each
child is reduced to 80% ... |
#!user/bin/env/ python3
"""
Description: parsing arguments to the functions
Notes: multiprocessing is limited to one node
"""
__author__ = '<NAME>'
import argparse
# import cpickle as pickle
import os
import time
import logging
import multiprocessing as multp
from datetime import datetime
import json
import re
impo... |
"""
Support functions for the RTL-SDR using pyrtlsdr
Copyright (c) July 2017, <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:
1. Redistributions of source code must retain the above cop... |
from atm import reference
import numpy as np
from utils import geo
def calc_atm_loss(freq_hz, gas_path_len_m=0, rain_path_len_m=0, cloud_path_len_m=0, atmosphere=None, pol_angle=0,
el_angle=0):
"""
Ref:
ITU-R P.676-11(09/2016) Attenuation by atmospheric gases
ITU-R P.840-6 (09/... |
import asyncio
import logging
from datetime import timedelta
from functools import partial
try:
from typing import TYPE_CHECKING, Dict, Union, List, Callable, Optional, Set, Tuple, NoReturn
except ImportError:
from typing import TYPE_CHECKING, Dict, Union, List, Callable, Optional, Set, Tuple
NoReturn = No... |
"""Mini-numpyro
This is re-implementation of mini-pyro with JAX. This library is independent of the rest of NumPyro
without `nunpyro.distributions` module.
http://pyro.ai/examples/minipyro.html
"""
import collections
import weakref
from collections import namedtuple
from functools import partial
from typing import A... |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
from typing import List, Optional, Union
from openclean.function.token.base import Token, Tokens, TokenTr... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 CEA
# <NAME>
# Licensed under the terms of the CECILL License
# (see guiqwt/__init__.py for details)
# pylint: disable=C0103
"""
guiqwt.histogram
----------------
The `histogram` module provides histogram related objects:
* :py:class:`guiqwt.histogram.HistogramIt... |
import os
from musurgia.table.table import Table
from musurgia.fractaltree.fractalmusic import FractalMusic
from musurgia.fractaltree.fractaltree import FractalTreeException
from prettytable import PrettyTable
from quicktions import Fraction
class Module(FractalMusic):
def __init__(self, row_number=None, column_... |
"""
Functions and classes for instrument and sensor calibration of data
Calibration data should be given in the frequency domain and has a magnitude
and phase component (in radians). Calibration data is the impulse response for
an instrument or sensor and is usually deconvolved (division in frequency
domain) from the ... |
# 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 to in writing, ... |
import math
import os
import sys
import random
import numpy as np
from logging import getLogger
import zarr
from .dataset_loaders import ArrayLoader
from dask.array import from_zarr, Array
from zarr.storage import LRUStoreCache
from tensorflow.keras.utils import Sequence
from urllib.parse import urlparse, parse_qs
l... |
import argparse
import numpy as np
import coloredlogs
import tensorflow as tf
from datasources import Video, Webcam
from models import ELG
import cv2 as cv
import pandas as pd
import pygame
import ctypes
import time
import os
import util.gaze
import math
import IAMLTools
import imutils
import BlobProp... |
import os
import _pickle as pickle
from e2efold.common.config import process_config
from e2efold.common.utils import get_args
args = get_args()
config_file = args.config
config = process_config(config_file)
print("#####Stage 3#####")
print('Here is the configuration of this run: ')
print(config)
os.environ["CUDA_VI... |
# pylint: disable=no-member
import math
import os
import requests
from flask import Blueprint, abort, request, jsonify, current_app, Response
from flask_restful import Api, reqparse
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy import func, or_
from sqlalchemy.orm import aliased
from flask_simple_api ... |
from environment import *
forward_plain = False
@deadline(120)
def getPlan(forward_plain):
#######################################
######## Insert your code here ########
#######################################
objects = ['apple', 'orange', 'banana', 'table', 'table2', 'box', 'fridge', 'tray', 'tray2', 'cupboard... |
# ==============================================================================
__title__ = "csv to netcdf and maps"
__author__ = "<NAME>"
__version__ = "v1.0(23.06.2020)"
__email__ = "<EMAIL>"
# ==============================================================================
import os
import sys
# ====... |
# -*- coding: utf-8 -*-
from decimal import *
from django.db.models import Q
from django.db import IntegrityError
from django.contrib import messages
from django.core.cache import cache
from django.http import HttpResponse
from django.core.management import call_command
from django.utils.translation import ugettext ... |
import math
from typing import Callable
import matplotlib.pylab as plt
import numpy as np
import scipy.optimize
import torch
from scipy.special import roots_legendre
from torch import nn
# Functions fixed_quad and _cached_roots_legendre are adapted from scipy but adapted to pytorch, and the case of
# integration fro... |
import scrapy
import requests
import re
import json
import numpy as np
import string
from datetime import date
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium... |
import os
import struct as _struct
from typing import Iterator
from ._experimental_parser import Parser
# protobuf
from google.protobuf.message import Message as _Message
"""
NaoTH log file parsing implementation in python 3.
Open a NaoTH log file over the Reader class. For easy cleanup, the use of pythons "with" k... |
"""Module for startlist commands."""
from datetime import date, time, timedelta
from typing import Any, Dict, List, Tuple, Union
from race_service.adapters import (
ContestantsNotFoundException,
EventNotFoundException,
EventsAdapter,
FormatConfigurationNotFoundException,
RaceclassesNotFoundExceptio... |
from collections import namedtuple, OrderedDict
from deepnp.functions import *
import deepnp.initializers as init
class RNNCell:
def __init__(self, batch_size, input_dim, hidden_dim, Wx=None, Wh=None, bias=None):
N, D, H = batch_size, input_dim, hidden_dim
Wx = init.normal(D, H) if Wx is None els... |
# -*- coding: utf-8 -*-
"""Methods used in initialization of scanner."""
from collections import deque
from copy import deepcopy
from graphtransliterator import DirectedGraph
import re
def _constrained_parsers_of(constraints, long_parser, short_parser):
"""
Create a dict of parsers based on constraints.
... |
import argparse
import datetime
import functools
import json
import multiprocessing
import os
import queue
import random
import subprocess
import sys
import threading
import time
import typing
import cv2
import gdown
import numpy as np
import requests
import tensorflow as tf
import torch
import youtube_dl
from google.... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 12.5})
'''
Produce figures associated with Patterson et al. 2021 publication: hydrographs and metric overlaysfor three sites in the CA
western sierras, and a bar chart representing a trend analysis for functional ... |
import discord, pickle, random, time, os, dotenv, img2pdf, json, asyncio, atexit, sys, glob, winsound
from discord.ext import commands
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Web... |
import json
import glob
import pickle as pkl
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from sklearn import svm, tree
from sklearn.metrics import precision_recall_fscore_support
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.preprocessing import normalize, scale
from sc... |
import math
import os
import shutil
import essentia
from essentia.standard import MetadataReader
import numpy as np
import tensorflow as tf
from scipy.signal import argrelextrema
assert tf.__version__ == '0.12.1'
from onset_net import OnsetNet
from sym_net import SymNet
from util import apply_z_norm, make_onset_featu... |
from typing import Any, Tuple, Union
import numpy as np
from metagrad import cuda
from metagrad.cuda import get_array_module, ndarray
from metagrad.tensor import Tensor, NdArray
'''
ops.py保存所有运算操作相关的类
'''
class Function:
def __init__(self, *tensors: "Tensor") -> None:
# 该操作所依赖的所有输入
self.depends... |
# Code adapted from SMP. Add Scheduler
# Implement Logging
import sys
import os
import numpy as np
import torch
import datetime as dt
import matplotlib.pyplot as plt
import time
import torchvision
import random
import seaborn as sns
import pickle
from segmentation_models_pytorch.utils.metrics import IoU
from sklearn.m... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... |
"""Helper functions to create the datacards"""
import os
import tabulate as tab
import zdc.modules.dataframe as df_tools
import zdc.modules.shapes as shape_tools
import zdc.modules.draw as draw_tools
def create_datacard(
df_data, df_mc, systs, params, path, shapes, central_path, syst_path
):
df_data = df_data... |
import datetime as dt
from typing import Optional, Any, Tuple
import logging
from pycoshark.utils import create_mongodb_uri_string
from pycoshark.mongomodels import VCSSystem, Commit
from mongoengine import connect
from mongoengine import (
Document,
StringField,
DateTimeField,
IntField,
BooleanFi... |
"""Neo4j graph database interface.
comptox_ai/db/graph_db.py
Copyright (c) 2020 by <NAME>
"""
from numpy.lib.arraysetops import ediff1d
import os
import glob
import configparser
from pathlib import Path
from yaml import load, Loader
from dataclasses import dataclass
from typing import List, Dict
from neo4j import ... |
import math
from collections import defaultdict
from projex.lazymodule import lazy_import
from projex.locks import ReadWriteLock, ReadLocker, WriteLocker
orb = lazy_import('orb')
class CollectionIterator(object):
def __init__(self, collection, batch=1):
self.__collection = collection
self.__mod... |
from __future__ import absolute_import
from .argument import IntegerArgument
from .block import Block
from .error import HumbleError
class Instruction(object):
@staticmethod
def newInstruction(name):
if name == "ABS": return Instruction(name, 0x64, 0, ('getVAL',), True)
elif name == "ADD": retur... |
# Common Python library imports
# Pip package imports
from loguru import logger
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Internal package imports
from soccer_fw.utils import listify, fulltime_result_tags
DEFAULT_ENGINE_NAME = "default"
DEFAULT_ENGINE_VERSION = "v0_1"
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 12:11:36 2019
@author: keelin
"""
import numpy as np
import opencxr.utils
import skimage.feature
from opencxr.utils.resize_rescale import rescale_to_min_max
from scipy import ndimage
from scipy.ndimage import binary_dilation, find_objects
from skimage import measure
"... |
# -*- coding: utf-8 -*-
"""
NEURAL NETWORKS AND DEEP LEARNING
ICT FOR LIFE AND HEALTH - Department of Information Engineering
HOMEWORK 2
<NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import random
from sklearn.model_sele... |
import math
from io import BytesIO
from shutil import copyfile, rmtree
from tempfile import mkdtemp
from typing import Dict
from pathlib import Path
import numpy as np
from qcore import geo
def plot_site_vs30(
out_ffp: str,
site_lon: float,
site_lat: float,
station_lon: float,
station_lat: float... |
import argparse
import datetime
import itertools
import logging
import os
import sys
import neptune
import librosa
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from librosa.display import specshow
from torch.backends import cudnn
from tqdm import tqdm
event_labels = ['alarm', 'c... |
import math
import numpy as num
import sys
import PyQt5.QtGui as qg
import PyQt5.QtCore as qc
import PyQt5.QtWidgets as qw
_color_names = [
"butter1",
"butter2",
"butter3",
"chameleon1",
"chameleon2",
"chameleon3",
"orange1",
"orange2",
"orange3",
"skyblue1",
"skyblue2",
... |
from __future__ import division
from .similarity_try3 import *
from .review_processer import *
from textblob import TextBlob as tb
import nltk.classify.util
from nltk.classify import NaiveBayesClassifier
from nltk.corpus import movie_reviews
from nltk.corpus import stopwords
from nltk.tokenize import word_token... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.