text stringlengths 6.04k 39.5k |
|---|
import base64
import os
from urllib.parse import quote as urlquote
from urllib.request import urlopen as uopen
import logging
from flask import Flask, send_from_directory
import dash
from ruamel import yaml
import dash_core_components as dcc
import dash_html_components as html
import dash_table
from dash.dependencies i... |
"""
Energy Calculators
==================
#. :class:`.MMFFEnergy`
#. :class:`.UFFEnergy`
#. :class:`.MacroModelEnergy`
#. :class:`.MOPACEnergy`
#. :class:`.FormationEnergy`
#. :class:`.XTBEnergy`
#. :class:`.XTBFreeEnergy`
Energy calculators are objects which calculate the energy of molecules.
Each :class:`.EnergyCa... |
"""
Module for chemical informatic tasks
TODO AllChem.Compute2DCoords(m) for png
"""
import os
from io import StringIO
import sys
import gzip
import numpy as np
import rdkit.Chem as Chem
import rdkit.Chem.AllChem as AllChem
import rdkit.Chem.Draw as Draw
import rdkit.Chem.ChemicalForceFields as ChemicalForceField... |
from datetime import datetime, timedelta
import requests
import requests_mock
from urllib.parse import urlparse, parse_qs
import string
import random
import time
from . import KubeHTTPClient, KubeHTTPException
from django.conf import settings
from django.core.cache import cache
import logging
logger = logging.getLog... |
""" Functions to create S111 data from other sources
"""
import logging
import os
import sys
import datetime
from glob import glob
import h5py
import numpy
from osgeo import gdal, osr
from ..s1xx import s1xx_sequence
from .api import S111File, FILLVALUE, S111Exception
def _get_S111File(output_file):
""" Small ... |
#!/usr/bin/env python3
"""
SENSE Azure Sonic Module, which is copied and called via Ansible from
SENSE Site-RM Resource Manager.
Main reasons for this script are the following:
1. Azure Sonic does not have Ansible module
2. Dell Sonic module depends on sonic-cli - and currently (140422) -
it is broken d... |
#
# This is a clone of libdrm/tests/modetest/modetest.c
#
# DRM based mode setting test program
# Copyright 2008 Tungsten Graphics
# <NAME> <<EMAIL>>
# Copyright 2008 Intel Corporation
# <NAME> <<EMAIL>>
import os, sys
import argparse
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),... |
"""
代码中有从网络上参考或者直接复制过来的内容,对原作者致以谢意!
但因时间有些久了,来源无法一一追溯,故没有列出来源。报以歉意!
"""
# simtext相似度:
# simtext可以计算两文档间四大文本相似性指标,分别为:
# Sim_Cosine cosine相似性
# Sim_Jaccard Jaccard相似性
# Sim_MinEdit 最小编辑距离
# Sim_Simple 微软Word中的track changes
import sys
import re
import string
from zhon.hanzi import punctuation as chinese_p... |
import os
from threading import Thread
from threading import Lock
import time
import subprocess
import json
from xml.dom.minidom import parse
import xml.dom.minidom
import multiprocessing
import psutil
import math
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
import ... |
import random
from enum import Enum
from typing import Dict, List
class ValueAxisType(Enum):
"""A class containing enumerations for ValueAxis and EvolveAxis variables"""
STRING = 0
INTEGER = 1
FLOAT = 2
FUNCTION = 3
VALUEAXIS = 4
UNSET = 5
class ValueAxis:
"""
Class that contains... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tool to capture playblasts
"""
from __future__ import print_function, division, absolute_import
__author__ = "<NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import os
import shutil
import inspect
import logging
from collections import Or... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Contains PartialParse implementations for use with Earley grammars.
Currently there are 2 implementations:
- EarleyPartialParse
- Lazily builds a trie of all utterances allowed by the grammar,
using `advance_only_nonterminals` and `adva... |
from handlers import host_post_start
from handlers import host_pre_stop
from handlers import _set_send_node_event_on_error_handler
from workflow import WfEvent
from workflow import build_wf_event
def _get_nodes_instances(ctx, node_id):
instances = []
for node in ctx.nodes:
for instance in node.instanc... |
#!/usr/bin/env python3
import csv
import logging
import os
import re
import warnings
import xml.etree.ElementTree as ET
from itertools import groupby
from operator import attrgetter
from typing import List
from collections.abc import MutableMapping, Sequence
import click
import pandas as pd
from tqdm import tqdm
ns ... |
# coding: utf-8
# # Prerequisites
#
# Welcome to class!
#
# The following tutorial was written by <NAME>, and can be seen as originally published at https://www.kaggle.com/gzuidhof/data-science-bowl-2017/full-preprocessing-tutorial/discussion. It is being rehosted at https://github.com/QTIM-Lab/qtim_tools/tree/mast... |
# -*- coding: utf-8 -*-
import pandas as pd
import os
from ete3 import Tree, NCBITaxa
import plotly.express as px
import plotly.figure_factory as ff
# import plotly.figure_factory as ff
# from plotly.subplots import make_subplots
import glob
from .utils import run_command, get_taxonomic_df, get_dataframe
from .Reconc... |
"""
### Usage: ctinit [projname] [-ru] [--plugins=P1|P2|P3] [--cantools_path=PATH] [--web_backend=BACKEND]
### Options:
-h, --help show this help message and exit
-p PLUGINS, --plugins=PLUGINS
which plugins would you like to use in your project?
-c CANTOOLS_PATH, --cant... |
__author__ = 'dmitrii'
import numpy as np
import sys
from random import randint
#TODO: make 3 tests: 11/13/15%; if exists r2 > 90% - take this result; else if: r2<0.85 - cancel; else: take highest possible out of three
#TODO: worst case: 374 runs = 0.39 from total
#TODO: reuse data from smaller subsets: 0.15 from tot... |
import base64
from io import BytesIO
import logging
from datetime import datetime
import shap
import streamlit as st
from pycaret.classification import *
from src.constants import GENRES, MODEL_NUMERICAL_FEATURES, MODEL_CATEGORICAL_FEATURES
from src.data_transformations import classify_success
from src.model import c... |
"""Simple sphinx extension that executes code in jupyter and inserts output."""
import os
from itertools import groupby, count
from operator import itemgetter
import json
from ast import literal_eval
from sphinx.util import logging
from sphinx.transforms import SphinxTransform
from sphinx.errors import ExtensionError... |
# Copyright (c) Gradient Institute. All rights reserved.
# Licensed under the Apache 2.0 License.
"""Tests for model_evaluation module."""
import functools
import logging
import operator
from typing import Callable
import hypothesis as hyp
import hypothesis.strategies as hst
import numpy as np
import pytest
from cins... |
from enum import Enum
from typing import Optional, List, Dict, Set, Type
from combo_e2e.config import config
from combo_e2e.helpers.exceptions import BaseTableException, TableElementNotFound, TableRowNotFound, \
TableColumnNotFound
from combo_e2e.pages import WebElementProxy
from combo_e2e.pages.uicomponents.helpe... |
import warnings
from datetime import datetime, timedelta
import elasticsearch
from django.conf import settings
import haystack
from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend, ElasticsearchSearchQuery
from haystack.backends import BaseEngine, log_query
from haystack.models import Sear... |
import torch
import numpy as np
def pad_to_max_length(t1, t2, dim, side='right'):
if t1.size(dim) < t2.size(dim):
t1 = pad_to_length(t1, t2.size(dim), dim, side)
elif t2.size(dim) < t1.size(dim):
t2 = pad_to_length(t2, t1.size(dim), dim, side)
return t1, t2
def pad_to_length(tensor, lengt... |
import numpy as np
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import TensorDataset
from torch.utils.data import Dataset, DataLoader
from torchvision.utils import save_image
from torch.nn import init
from torch.optim.optimizer import O... |
# base.py
"""
Created on Sun May 6 12:44:12 2018
@author: <NAME>
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict, Iterable
from itertools import islice
import operator
import torch as tc
from ..utils.helper import is_number, get_key_val
from .... |
import os
import numpy as np
import random
import seaborn as sns
from scipy import stats
import matplotlib.pyplot as plt
import math
from copy import deepcopy
from .settings import get_sarsa_settings
from sarsa_lambda.mountain_car import MountainCar_SARSA
import pickle
class SarsaLambdaAgent(object):
def __init__... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 29 19:34:42 2018
@author: Branson
"""
import argparse
from threading import Thread
import zmq
import BATrader as ba
import pandas as pd
from BATrader.market.MarketReader import market_time_keeper, market_time_hk_futures, currentTime, currentTimeSecond, is_stock
from BATr... |
import cog
import tempfile
from pathlib import Path
import sys
import os.path
import logging
import time
import argparse
from collections import OrderedDict
import numpy as np
import torch
import lpips
import glob
import shutil
import cv2
sys.path.insert(0, "codes")
import options.options as option
import utils.util ... |
import pygmsh
from pygmsh.common.polygon import Polygon
import gmsh
import numpy as np
import logging
from pygmsh.helpers import extract_to_meshio
import trimesh
import vg
import warnings
warnings.filterwarnings("ignore")
logger = logging.getLogger('PySimultanRadiation')
def mesh_planar_face(face, mesh_size=0.1):
... |
# 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
# distributed under t... |
import os
import time
import subprocess
import sys
import pytest
import pypipegraph2 as ppg
from pathlib import Path
from .shared import write, read, Dummy, counter
@pytest.mark.usefixtures("ppg2_per_test", "create_out_dir")
class TestResourceCoordinator:
def test_jobs_that_need_all_cores_are_spawned_one_by_one(s... |
import os
import sys
import shutil
import subprocess
import pyqtgraph as pg
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtWidgets import (QMainWindow, QStackedWidget, QWidget, QLabel, QBoxLayout, QVBoxLayout, QHBoxLayout, QGridLayout,
QComboBox, QMessageBox, QFileDialog, QRadioButton, QP... |
import math
from matplotlib.backend_bases import FigureCanvasBase, NavigationToolbar2, TimerBase
from js import document, window
class FigureCanvasWasm(FigureCanvasBase):
supports_blit = False
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._idle_scheduled = Fal... |
#!/usr/bin/env python
#
# Copyright 2007 <NAME>
# Portions Copyright 2007 Google Inc.
#
# 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
#
# U... |
from time import time
from collections import defaultdict
from weakref import WeakKeyDictionary
from octopus.dispatcher.model.enums import *
from octopus.dispatcher.model import Task
from . import models
import logging
LOGGER = logging.getLogger("main.dispatcher.dispatchtree")
class NoRenderNodeAvailable(BaseExcep... |
#!/usr/bin/env python3
'''
Copyright (C) 2013 <NAME> <<EMAIL>>
This file is part of cppreference-doc
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 Lice... |
#!/usr/bin/python
import subprocess, shutil, os, sqlite3, re, sys
import utils
def validate_email(email, mode=None):
# There are a lot of characters permitted in email addresses, but
# Dovecot's sqlite driver seems to get confused if there are any
# unusual characters in the address. Bah. Also note that since
# t... |
#!/usr/bin/env python
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'Apache'
__version__ = '0.1'
import os
import json
import urllib2
from httplib import BadStatusLine
from datetime import datetime, timedelta
import time
from socket import error as SocketError
from bus import Bus
from trajectory import Tr... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import six
import numpy as np
import utool as ut
import vtool as vt
print, rrr, profile = ut.inject2(__name__)
def estimate_threshold(curve, method=None):
"""
import plottool as pt
idx3 = vt.... |
import glob
import sys
import os
import shutil
import configparser
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from astropy.io import fits
from tqdm import tqdm
import pandas as pd
coords = []
bkg_coords = []
bkg_coords2 = []
def onclick(event):
global ix, iy
ix=ev... |
from dataactbroker.handlers.fileHandler import fabs_derivations
from tests.unit.dataactcore.factories.domain import (
CGACFactory, FRECFactory, SubTierAgencyFactory, StatesFactory, CountyCodeFactory, CFDAProgramFactory,
ZipCityFactory, ZipsFactory, CityCodeFactory, CountryCodeFactory)
from tests.unit.dataactc... |
"""
Utilities for coloring
Here, take this:
PYTHONMALLOC=malloc valgrind --tool=memcheck --error-limit=no python ...
"""
from numba import jit, int32, uint32, uint64, void, float64, boolean, prange
import numpy as np
import scipy.sparse as sps
@jit(
void(float64[:], int32[:], uint32[:]),
nopython=True
)
def... |
# Copyright (c) 2018 <NAME> <<EMAIL>>
# MIT License <https://choosealicense.com/licenses/mit/>
import re
import abc
from typing import Any, Dict, List, Tuple, Union, Generic, TypeVar, Generator
import attr
from attr.validators import instance_of
from construct import Construct, Container, GreedyBytes
from multidict i... |
import os
import itertools
import aql
#//===========================================================================//
class ErrorBatchBuildCustomExt( aql.AqlException ):
def __init__( self, node, ext ):
msg = "Custom extension '%s' is not supported for batch building of node: %s" % (ext, node.getBuildStr(... |
#!/usr/bin/python3
#
# ig-buffer-overflow.py
#
# Isabelle's generic buffer overflow tool
#
# https://github.com/isabellecda/cyber-scripts
#
import sys
import socket
import binascii
import os
import getopt
VERBOSE = False
# Script usage
def print_usage(scriptName):
print("Usages:")
print("")
print("test - Sends si... |
from __future__ import annotations
import builtins
import json
import logging
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, FrozenSet, List, Optional, Tuple, Any
from rich.logging import RichHandler
import cbor2
from there import print
from .config import ingest_... |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
"""Basic modules data state and store."""
from dataclasses import dataclass
from typing import Dict, List, NamedTuple, Optional, Sequence, Type, TypeVar, overload
from numpy import array, dot
from opentrons.hardware_control.modules import AbstractModule
from opentrons.hardware_control.modules.magdeck import (
enga... |
"""
Automatic tests for python-ldap's module ldapurl
See https://www.python-ldap.org/ for details.
"""
import os
import unittest
from urllib.parse import quote
# Switch off processing .ldaprc or ldap.conf before importing _ldap
os.environ['LDAPNOINIT'] = '1'
import ldapurl
from ldapurl import LDAPUrl
class MyLDAPU... |
#!/usr/bin/env python
# coding: utf-8
import dask
from dask import delayed
from dask.distributed import Client
import dask.dataframe as dd
import json
import numpy as np
import pandas as pd
import geopandas
from shapely.geometry import Point
import os
import sys
import joblib
dtype_list = {
# 'dropoff_d... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
from niftynet.io.misc_io import image3_axial
from niftynet.layer import layer_util
from niftynet.layer.affine_augmentation import AffineAugmentationLayer
from niftynet.layer.base_layer import TrainableLayer
from nif... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from numpy.fft import fft
from scipy.interpolate import interp1d
from scipy.linalg import norm, solve
from .common import mmul_weight
from .helper.modal_plotting import plot_frf, plot_stab
from .polynomial import multEdwdx, nl_terms, poly_deriv
from .s... |
from collections import defaultdict
import lzma
import tensorflow as tf
from voyager.utils import timefunction
class BenchmarkTrace:
'''
Benchmark trace parsing class
'''
def __init__(self, config):
self.config = config
self.pc_mapping = {'oov': 0}
self.page_mapping = {'oov':... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import threading
import numpy as np
import signal
import random
import math
import os
import sys
import time
import logging
from helper import logger_init, gene... |
###
### Multimodal registration with exhaustive search mutual information
### Author: Johan \"{O}fverstedt
###
from numpy.random.mtrand import random
import time
import torch
import torch.nn.functional
import numpy as np
import torch.nn.functional as F
import torch.fft
import torchvision.transforms.functional as TF
i... |
'''
'''
import os
import codecs
from types import SimpleNamespace
import numpy as np
import tensorflow as tf
from datetime import datetime
import time
import random
import pyemblib
import configlogger
from drgriffis.common import log
import dataset
import cross_validation
from model import CNNParams, CNNModel
def tra... |
from celery.result import AsyncResult
from core.decorators import (
unauthenticated_user,
allowed_users,
)
from core.forms import (
CreateUserForm,
UpdateUserForm,
UploadPackageFileForm,
)
from core.models import Event
from core.tasks import (
task_get_package_uri_by_pid,
task_ingress_packa... |
# -*- coding: utf-8 -*-
# @author: Elie
#%% ==========================================================
# Import libraries set library params
# ============================================================
import pandas as pd
import os
#plotting
from matplotlib import pyplot as plt
import seaborn as sns
import ... |
import enum
import typing
from energuide import bilingual
from energuide import element
from energuide.exceptions import InvalidEmbeddedDataTypeError, ElementGetValueError
class WaterHeaterType(enum.Enum):
NOT_APPLICABLE = enum.auto()
ELECTRICITY_CONVENTIONAL_TANK = enum.auto()
ELECTRICITY_CONSERVER_TANK ... |
from typing import Optional
from torch.nn import ModuleList, Module, Linear, Dropout, LayerNorm, ReLU
from torch import Tensor
import torch.functional as F
import torch
import copy
import math
from torch import nn
import numpy as np
def generate_pad_mask(data, pad_idx=0):
return data.data.eq(pad_idx).unsqueeze(1)... |
import os
import re
from itertools import islice
from collections import deque
from types import prepare_class
from lark.exceptions import UnexpectedToken
from core.log import log
CHAR_LIMIT = 1000
CONTINUE = "<continue>"
def pairs(iterator):
"s -> (s0,s1), (s2,s3), (s4, s5), ..."
a = islice(iterator, 0, N... |
# %%
from pandas.core.algorithms import value_counts
import streamlit as st
import numpy as np
import pandas as pd
import pydeck as pdk
from sklearn.neighbors import NearestNeighbors
from sklearn.preprocessing import StandardScaler
st.title('My fifth app')
### This is getting TOPOLOGICAL INFORMATION
# %%
# Data fr... |
#!/usr/bin/env python
# coding: utf-8
import rasterio
from rasterio.windows import from_bounds
import numpy as np
from functools import partial
from affine import Affine
from scipy.optimize import newton
from threading import Lock
import concurrent.futures
from numba import njit
import geopandas as gpd
from rasterio.m... |
"""
Redirect calls to open, etc. to a virtual file system.
Use this to mount a zip file as a file system, and then all subsequent calls
to chdir, open, etc. will reference files in the zip file instead of the disk.
This will only work for packages which do all their I/O in python, and not
those which use direct calls... |
import markdown, datetime, shutil
import copy
import json,os
import pymdownx
from markdown.extensions.sane_lists import SaneListExtension
from markdown.extensions.tables import TableExtension
from markdown.extensions.fenced_code import FencedCodeExtension
from markdown.extensions.nl2br import Nl2BrExtension
from markdo... |
from contextlib import contextmanager
from pathlib import Path
from typing import List, Optional, Tuple, Union
import h5py as h5
import numpy as np
from .h5utils import get_dataset_name, open_or_pass_file, open_or_pass_dataset
from .types import File, Dataset, Shape, DType
class ChunkBuffer:
"""
Hold a buff... |
# Copyright 2020 DeepMind Technologies Limited.
#
#
# 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 agre... |
import asyncio
from nextcord.ext import commands, tasks
import nextcord
import os, sys, json, datetime
from nextcord import Interaction, SlashOption, ChannelType
import traceback
from re import compile
sys.path.append('../')
from util import admin_check, n_fc, eh, database
# りまいんど
TIME_CHECK = compile(r"[0-9]{1,2}:[0... |
import numpy as np
import tvm
from tvm import te, topi, autotvm
import os
from tvm import te
import sys
sys.path.append('..')
print(os.getpid())
# The sizes of inputs and filters
batch = 1
in_channel = 256
out_channel = 512
in_size = 128
kernel = 1
pad = 0
stride = 1
open_image=1
ddtype='float32'
if open_image == 1:
... |
import logging
import csv
import re
import sys
import string
import datetime
import urllib2
import urlparse
import tempfile
import time
import json
import shutil
from urlparse import urljoin
from urllib import urlencode
from os.path import join
import requests
from lxml import etree
from bs4 import B... |
import tensorflow as tf
from time import time
import numpy as np
from random import shuffle
import os
from keras.applications.mobilenet_v2 import MobileNetV2
from keras.applications.inception_v3 import InceptionV3
from keras.applications.resnet50 import ResNet50
from keras.applications.vgg16 import VGG16
from keras_eff... |
# Copyright (c) 2017 Microsoft Corporation.
#
# 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, publis... |
# -*- coding: utf-8 -*-
# webpageclassifier.py
import math
import re
import numpy as np
import arrow
from wpc_utils import *
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.externals.joblib.parallel import cpu_count, Parallel, delayed
from sklearn.utils.validation import check_X_y, check_array,... |
##################################################################
####
#### OPC-UA iOPS simmulator for Windows
####
##################################################################
####
#### Auntor: <NAME>
#### Created: June, 2019
####
#######... |
# <NAME> 101013156
# <NAME> 101120534
# <NAME> - 101114546
# T20_MILESTONE2_JUNE 9th 2020
from T20_image_filters import *
from unit_testing import check_equal
from Cimpl import *
def test_two_tone(original: Image, test: Image, tone1: str, tone2: str ) -> None:
"""Returns testing of function two_tone... |
import torch
from ctcdecode import CTCBeamDecoder
from grad_cam import Sequential_GRAD_CAM
import matplotlib.pyplot as plt
from loss import calculate_loss
from pronouncing import generate_spaces_in_guess, pronunciation_model
from dataset_utils import spec_time_to_waveform_time, SPACE_TOKEN
from config import hparams
d... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... |
### REQUIRES SCIKIT-LEARN >= 24.0 FOR RIDGECV ALPHA_PER_TARGET=TRUE ###
import warnings
from sklearn.linear_model import Ridge, RidgeCV, LogisticRegressionCV
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.svm import SVC, LinearSVC
from scipy.stats ... |
import sys
import binascii
import datetime
import codecs
import json
import getpass
import ldap3
from ldap3.utils.conv import escape_filter_chars
from ldap3.protocol.microsoft import security_descriptor_control
from impacket.ldap import ldaptypes
from impacket.uuid import string_to_bin, bin_to_string
from impacket.ldap... |
import collections
import idautils
import ida_lines
# -----------------------------------------------------------------------
# This is an example illustrating how to use the user graphing functionality
# in Python
# (c) Hex-Rays
#
import ida_dbg
import ida_graph
import ida_kernwin
import ida_ida
import ida_name
from i... |
#! /usr/bin/env python3
# coding=utf-8
import scox.character as chc
import scox.export.cli as cli
import scox.export.serialize as srl
import scox.export.svg as svg
import scox.export.txt as txt
import os
import shutil
import json
import click
from colorama import Fore, Style
SCOX_HOME = os.path.join(os.path.expandus... |
from .fhog import *
from .yamlConfigHandling import load_config
# ffttools
def fftd(img, backwards=False):
# shape of img can be (m,n), (m,n,1) or (m,n,2)
# in my test, fft provided by numpy and scipy are slower than cv2.dft
return cv2.dft(np.float32(img), flags=(
(cv2.DFT_INVERSE | cv2.DFT_SCALE)... |
import numpy as np
import math
import heapq
import ReedsSheppPathPlanning as rs
from path_ipopt_smoother import IpoptSmoother
from Car import CarModel
from matplotlib import pyplot as plt
from scipy.spatial import cKDTree
class Node:
def __init__(self, x, y, yaw, x_index, y_index, yaw_index, direction, steer, par... |
import asyncio
import logging
import ora
import re
import sanic
import ujson
from urllib.parse import unquote
import websockets
from apsis.apsis import reschedule_runs
from apsis.lib.api import response_json, error, time_to_jso, to_bool
import apsis.lib.itr
from apsis.lib.timing import Timer
from ..jobs impo... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
import json
from collections import OrderedDict
import h5py
import numpy as np
from brainstorm.describable import create_from_description, get_description
from brainstorm.handlers import default_handler
from brains... |
#!/usr/bin/env python
"""Estimate allele lengths and find outliers at STR loci
"""
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore", FutureWarning)
import argparse
import sys
import glob
import os
import re
import numpy as np
import statsmodels.api as sm
... |
###########################################################################
#
# RiverRun.py - a script to help quantify how groundwater banking responds
# to an engineered discharge event into a dry wash as artificial recharge
#
###########################################################################
from ... |
import os
import re
from typing import List, Mapping, Optional, Tuple, Any
from hca.dss import DSSClient
from urllib3 import Timeout
Netloc = Tuple[str, int]
class Config:
"""
See `environment` for documentation of these settings.
"""
def _boolean(self, value: str) -> bool:
if value == "0":... |
#-*- coding: utf-8 -*-
# <EMAIL>
r"""针对 TDMA+LPW 的方式做一些仿真验证。
note -
1. TDMA 仅有上行、LPW 仅有下行,前者是可以按照 TDMA 时间槽的长度来步进的,而后者是更离散的 1ms 步进。
2. 鉴于第1点,我们使用两次timeline遍历,分别针对上行和下行的场景,得到运行数据,然后再联合起来给出仿真结果。
"""
# 功耗开销参数
# 电流
AMP_TX = 120 # mA
AMP_RX = 10
AMP_SLEEP = 0.005
# 时长
DURATION_UPLINK = 200 # ms - 发送一帧数据的时间
DURATION_DO... |
import numpy as np
import os
from data_cluster import load_cluster_labels, attach_cluster_id_arr_manual
from data_rowreduce import prune_rows
from data_settings import DATADIR, PIPELINES_VALID, CELLSTOCLUSTERS_2018SCMCA, NPZ_2018SCMCA_MEMS, NPZ_2018SCMCA_ORIG, \
NPZ_2018SCMCA_ORIG_WITHCLUSTER... |
import random
from tqdm import tqdm
win_lines = [[(0, 0), (1, 0), (2, 0), (3, 0)], [(1, 0), (2, 0), (3, 0), (4, 0)], [(2, 0), (3, 0), (4, 0), (5, 0)],
[(3, 0), (4, 0), (5, 0), (6, 0)], [(0, 1), (1, 1), (2, 1), (3, 1)], [(1, 1), (2, 1), (3, 1), (4, 1)],
[(2, 1), (3, 1), (4, 1), (5, 1)], [(3, 1), (4, 1), (5, 1... |
import pandas as pd
import streamlit as st
import altair as alt
import base64
import gc
import numpy as np
alt.data_transformers.disable_max_rows()
st.set_page_config(page_title="COVID Metro Areas Explorer",layout='centered')
def _max_width_():
max_width_str = f"max-width: 2000px;"
st.markdown(
f"""
... |
"""Components to build the parser instance for the CLI
This module must import (and run) really fast for a responsive CLI.
It is unconditionally imported by the main() entrypoint.
"""
# ATTN!
# All top-imports are limited to functionality that is necessary for the
# non-error case of constructing of a single target c... |
"""
"""
from collections import Counter
from datetime import datetime
import os.path
import sys
from time import time as time_time
from time import sleep
import warnings
import struct
try:
import tqdm.auto
except ModuleNotFoundError:
tqdm = None
from . import transforms
from .dataset import Dataset
from . i... |
from __future__ import print_function
import logging
import time
import os
from xml.etree.ElementTree import Element, SubElement, Comment
from xml.etree import ElementTree
from xml.dom import minidom
from elifetools import xmlio
from elifearticle import utils as eautils
from elifearticle.article import Article
from ejp... |
from collections import namedtuple
import random, string
import numpy as np
import uuid
######################################################################################
## Data model for an example DevOps application tracking resource utilization stats ##
## for hosts deployed in a service. The service is deploy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.