text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/python3
'''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for field.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# stdlib imports
import unittest
import warnings
from zope.component import eventtesting
from zope.interface.common import interfaces ... |
#!/usr/bin/python3
from flask import Flask, render_template, request, redirect, send_file
import pandas as pd
import geopandas as gpd
import numpy as np
from shapely.geometry import Point
import os
from bokeh.resources import CDN
from bokeh.embed import components
from bokeh.io import show, output_file, output_notebo... |
"""
Edge Examples
"""
__version__ = "$Revision: 1.13 $"
import sys, os
thisPath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath(os.path.join(thisPath,"..")))
from ExampleBuilders.ExampleBuilder import ExampleBuilder
from Core.IdSet import IdSet
import Core.ExampleUtils as ExampleUtils
from... |
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for various parts of L{twisted.web}.
"""
from cStringIO import StringIO
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.internet import rea... |
"""Dataset creation and transformations."""
import numpy as np
import tensorflow as tf
from opennmt.utils import compat
from opennmt.utils import misc
def make_datasets(dataset_cls, filenames):
"""Creates instances of :obj:`dataset_cls`.
Args:
dataset_cls: A class inheriting from ``tf.data.Dataset``.... |
#!/usr/bin/env python
from __future__ import print_function
import cx_Oracle
import datetime
import calendar
import sys
import logging
import CondCore.Utilities.conddb_serialization_metadata as sm
import CondCore.Utilities.credentials as auth
import CondCore.Utilities.conddb_time as conddb_time
import os
authPathEnvV... |
from .conf import *
from gym_electric_motor.physical_systems import *
from gym_electric_motor.utils import make_module, set_state_array
from gym_electric_motor import ReferenceGenerator, RewardFunction, PhysicalSystem, ElectricMotorVisualization, \
ConstraintMonitor
from gym_electric_motor.physical_systems import P... |
#!/usr/bin/python
import json
import os
import sys
import socket
import datetime
import subprocess
import platform
import shlex
from decimal import Decimal
import argparse
import operator
from math import sqrt
from functools import reduce
# Colorful constants
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
NOC... |
from __future__ import absolute_import
from collections import defaultdict
from itertools import chain
import logging
import os
from pip._vendor import pkg_resources
from pip._vendor import requests
from pip.compat import expanduser
from pip.download import (is_file_url, is_dir_url, is_vcs_url, url_to_path,
... |
import argparse
import copy
import os
import random
import sys
from collections import namedtuple, defaultdict
import torch
from torch import nn
import numpy as np
import pandas as pd
from scipy import stats
import dill
from os.path import abspath, dirname, join
# this monstrosity produces the module directory in ... |
#!/usr/bin/env python3
# coding: utf-8
################################################################################
# UDPで受信したIoTセンサ機器の値を棒グラフで表示します。
# (Webブラウザで http://127.0.0.1:8080 にアクセスするとグラフ表示されます)
#
# Copyright (c) 2021 <NAME>
#####################################... |
import json
import os
import torch
from pathlib import Path
import pickle
import logging
import collections
from io import open
import shutil
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from torch.utils.data.distributed import DistributedSampler
from transformers.tokenizat... |
# VMware vCloud Python SDK
# Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Imports
import random
import sys
import numpy as np
import time
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import torch.nn as nn
import torch.optim as optim
import torchvision.utils as vutils
import matplotlib.animation as animation
fro... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
@data: 2020
"""
import torch
import cv2
import numpy as np
from numpy.linalg import LinAlgError
from pycocotools.coco import COCO
import matplotlib.pyplot as plt
import ipdb;pdb=ipdb.set_trace
heatmap_w = 64
heatmap_h = 64
WIDTH = 224
HEIGHT = 224
cmap = plt.get_cmap('rainbo... |
from abc import abstractmethod, ABC
from enum import Enum
import os
from queue import Queue
import select
import time
from alsa_midi import SND_SEQ_OPEN_OUTPUT, SND_SEQ_OPEN_INPUT
from amidi import PortInfo, Sequencer
from midi import AllSoundOff, ControlChange, Event as MIDIEvent, NoteOn, \
NoteOff, Piece, Pitch... |
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['image.cmap'] = 'gray'
from skimage import io, color, img_as_float, filters
from skimage.feature import hog
import cv2
import mahotas
def extraccion(image):
##PRE PROCESAMIENTO
#image = cv2.resize(image, (60, 55)) #Convertir la ... |
# Copyright (c) 2013-2021 khal contributors
#
# 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, publi... |
import h5py
import numpy as np
import os
from tqdm import tqdm
from typing import List
import random
import gzip
__all__ = ['mtx_to_h5', 'csv_to_h5', 'merge_h5', 'extract_cells_from_h5']
tqdm_bar = '{l_bar} {remaining}'
def fix_dup_names(names):
"""
:param names:
:return:
"""
from collections ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
A package of data models describing the properties of spectral filters
and other devices whose transmission or efficiency varies with wavelength.
:Reference:
The STScI jwst.datamodels documentation.
https://jwst-pipeline.readthedocs.io/en/latest/jwst/datamodels/index... |
# -*- coding: utf-8 -*-
# Copyright (c) 2003, <NAME>. All Rights Reserved.
# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Founda... |
"""
NeuronBuild | <NAME> | 2013 | <EMAIL>
version date: January 26, 2020
A script to import swc files downloaded from neuromorpho.org, and create accurate
spline-based models of neuronal structure. The original swc file format is detailed here:
<NAME>, <NAME>, Pyapali, G.K, <NAME>. An on-line archive of reconstructed
h... |
import copy
import csv
import logging
import os
import re
import pickle
import tempfile
from abc import ABCMeta, abstractmethod, ABC
from collections import ValuesView
from io import BytesIO
from typing import Any, List, Union, Type, TextIO, Iterable, Tuple, KeysView, ItemsView
import json
from .._requests import reque... |
"""
_SetupCMSSWPset_
Create a CMSSW PSet suitable for running a WMAgent job.
"""
from __future__ import print_function
from builtins import next, object
import json
import logging
import os
import pickle
import socket
from PSetTweaks.PSetTweak import PSetTweak
from PSetTweaks.WMTweak import makeJobTweak, makeOutpu... |
import json
import multiprocessing
import os
import shutil
import time
from multiprocessing import Event, Process, Queue
from multiprocessing.synchronize import Event as Event_
from pathlib import Path
from pprint import pprint # pylint: disable=unused-import
from queue import Empty, Full
from queue import Queue as Qu... |
import hdf5plugin # required to access LZ4-encoded HDF5 data sets
import dask.array as da
from diffractem import io, tools, proc2d, compute, nexus, proc_peaks
from diffractem.dataset import Dataset
from diffractem.stream_parser import StreamParser
import numpy as np
from tifffile import imread
import os
from time impor... |
from __future__ import absolute_import, division, print_function
import collections
import inspect
from enum import Flag, auto
from numbers import Number
from typing import Callable, List, Optional, Text, Union, Sequence
import numpy as np
import tensorflow as tf
from odin.bay import distributions as obd
from odin.ut... |
#!/usr/bin/env python
"""Filestore aff4:/files abstraction layer.
Filestore allows for multiple different filestore modules to register URNs
under aff4:/files to handle new file hash and new file creations.
"""
import hashlib
import logging
from grr.lib import fingerprint
from grr.lib import rdfvalue
from grr.lib i... |
# Copyright (c) 2011-2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
#!/usr/bin/env python
"""Filestore aff4:/files abstraction layer.
Filestore allows for multiple different filestore modules to register URNs
under aff4:/files to handle new file hash and new file creations.
"""
import hashlib
import logging
from grr.parsers import fingerprint
from grr.lib import access_control
from... |
"""
Tools to generate build pipelines.
The utilities here take a pipeline specification and convert
them into a list of tasks to execute.
"""
from . import runtime
from . import exc
from . import constants
from . import kvstore
from .jobs import AWSBatchSimpleJob
from .version import __version__
from .graph impor... |
# -*- coding: utf-8 -*-
import re
import sys
import glob
import os
import subprocess
import argparse
import time
import pickle
TEST = 1
APP_NAME = 'PDF Parser 1.1'
VERSION = '1.0.1 e r0'
HELP_MSG = ['Creating output folder . . .','','','Tasks complete !']
outF = 'out'
_APP = 'pdftotext'
_EXT = 'pdf'
_TXT = 'txt'
_EO... |
"""
redpatch
A module for segmenting diseased leaf images to find healthy regions, lesion associated regions and lesion centres.
Workflow Overview
-----------------
1. Set scale sliders to find HSV values that segment whole leaves from background
2. Segment image into leaf sub-images
3. Set scale sliders to find HS... |
import discord
from discord.ext import commands, tasks
from discord.ext.commands import clean_content
from discord.ext.tasks import loop
import traceback
import collections
import datetime
from random import choice, randint
from disputils import BotEmbedPaginator, BotMultipleChoice
import time
from ago import human
imp... |
import sys
import argparse
import numpy as np
import pandas as pd
from seekr import fasta
from seekr import graph
from seekr import pearson
from seekr.kmer_counts import BasicCounter, Log2
# TODO (Dan) fix names
from seekr.pwm import CountsWeighter
DOWNLOAD_GENCODE_DOC = """
Description
-----------
Download fasta fi... |
import ast
import copy
import enum
import itertools
import functools
import random
import time
import threading
import traceback
from dataclasses import dataclass
from typing import *
import z3 # type: ignore
from crosshair import dynamic_typing
from crosshair.util import debug
from crosshair.util import in_debug
fr... |
from collections import OrderedDict
import torch
import torch.nn.functional as F
from torch import nn
from pynet.losses import SSIM
from pynet.utils import tensor2im
from torch.nn import Parameter
import numpy as np
from pynet.metrics import Sobel3D
class SchizNet(nn.Module):
def __init__(self, in_channels, inpu... |
#!/usr/bin/env python
# coding: utf-8
# ***********************************************************************
#
# V2W-BERT: A Python library for vulnerability classification
# <NAME> (<EMAIL>) : Purdue University
# <NAME> (<EMAIL>): Pacific Northwest National Laboratory
#
#... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Modelagem em tempo real | COVID-19 no Brasil
--------------------------------------------
Ideias e modelagens desenvolvidas pela trinca:
. <NAME>
. <NAME>
. <NAME>
Esta modelagem possui as seguintes características:
a) NÃO seguimos modelos paramétricos => Não existem dur... |
from PIL import Image
import collections
import shutil
import traceback
from functools import partial
import pprint
import logging
import argparse
import os
import numpy as np
import math
from tqdm import tqdm
import copy
from einops import repeat, rearrange
import torch
import torch.distributed as dist
import torch.m... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, <NAME>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lic... |
import os
import logging
import requests
import json
class NewsArticle(object):
def __init__(self):
self.title = None
self.description = None
self.publishedAt = None
self.author = None
self.url = None
self.urlToImage = None
def _get_json_attribute(self, data, ... |
# python3
# 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... |
from __future__ import annotations
from collections import deque
from itertools import count
from typing import get_type_hints, Any, Callable, Iterable, Iterator, Optional, Sequence, Type, TypeVar, Union
from numpy.typing import ArrayLike
import numpy as np
class Momentum:
"""
Provides an unbiased momentum i.... |
from enum import Enum
import geopandas as gpd
from itertools import product
import numpy as np
import pandas as pd
from pathlib import Path
import pkg_resources
from typing import Union
from balsa.routines import distance_matrix, read_mdf
from balsa.logging import get_model_logger
from cheval import LinkedDataFrame
f... |
"""
A simple generic data bunch to hold model parameters in a single object.
Author: <NAME> (https://github.com/paulocv)
devnote - Things that could further improve CPU (or RAM) performance:
* Calculation of (1 - q) instead of q
* Calculation of q can be incorporated on the main iteration loop (using the "gat... |
from pyhcl import *
from .sirv_gnrl_pipe_stage import sirv_gnrl_pipe_stage
from .sirv_gnrl_fifo import sirv_gnrl_fifo
def carray(el, len):
ary = []
for i in range(len):
ary.append(el)
return ary
def sirv_gnrl_icb_splt(ALLOW_DIFF = 1,
ALLOW_0CYCL_RSP: int = 1... |
import sys
from typing import List
import numpy as np
import math
#from memory_profiler import profile
#from pypcd import pypcd
from pypcd import pypcd
from config import CAMERA_ICL, PM, MAP_IP
import cv2
import read_office
import evaluate_ate
import evaluate_rpe
from plane_extraction import *
import open3d as o3d
... |
import argparse
import collections
import datetime
import os
import shutil
import time
import dataset
import mlconfig
import toolbox
import torch
import util
import madrys
import numpy as np
from evaluator import Evaluator
from tqdm import tqdm
from trainer import Trainer
mlconfig.register(madrys.MadrysLoss)
# General... |
# -*- coding:UTF-8 -*-
from copy import deepcopy
from getpass import getuser as GETPASSgetuser
from cdms2 import open as CDMS2open
from inspect import stack as INSPECTstack
import json
from numpy import array as NUMPYarray
from os import environ as OSenviron
from os.path import join as OSpath__join
from sys import exi... |
"""
Note: this code is a Theano translation of the linesearch implemented in
scipy.optimize.linesearch
See :
https://github.com/scipy/scipy/blob/master/scipy/optimize/linesearch.py
"""
import theano
import theano.tensor as TT
from theano.ifelse import ifelse
from theano import scan
import numpy
one = TT.constant... |
#!/usr/local/bin/python3.4
"""
## Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO [, ANY ADDITIONAL AFFILIATION]
## ALL RIGHTS RESERVED.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## ... |
# -*- coding: utf-8 -*-
'''
Created on Mon Sep 28 16:26:09 2015
@author: r4dat
'''
# ICD9 procs from NHSN definition.
# Diabetes diagnoses from AHRQ version 5 SAS program, CMBFQI32.TXT
# sample string generator print((','.join(map(str, [str(x) for x in range(25040,25094)]))).replace(',','","'))
#
# "25000"-"250... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 18 10:18:52 2019
@author: <NAME>
"""
from __future__ import print_function
import os, sys
import cv2
import numpy as np
import imutils
from copy import copy, deepcopy
import math
from skimage.feature import peak_local_max
import rotular
# Retorna o valor de retangularid... |
from typing import Dict, Generator, List, Set, Union
from collections import defaultdict
import json
import copy
import re
from fuzzy_search.fuzzy_phrase import Phrase
def as_phrase_object(phrase: Union[str, dict, Phrase], ngram_size: int = 2, skip_size: int = 2) -> Phrase:
if isinstance(phrase, Phrase):
... |
#!/usr/bin/env python3
import os.path
import warnings
import pandas as pd
from configargparse import Namespace, ArgParser
from typing import List, TypeVar
from pydpiper.minc.containers import XfmHandler
from pydpiper.core.arguments import (lsq6_parser, lsq12_parser, nlin_parser, stats_parser, CompoundParser,
... |
# Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
# -*- coding: utf-8 -*-
import babel.dates
from dateutil.relativedelta import relativedelta
import itertools
import json
from odoo import fields, _, models
from odoo.tools import float_round
from odoo.tools.misc import get_lang
from odoo.addons.web.controllers.main import clean_action
DEFAULT_MONTH_RANGE = 3
class... |
#!/usr/bin/env python
# coding: utf-8
import csv
import re
from tqdm import tqdm
import os
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
import re
import numpy as np
import pandas.errors
import regex
from string import punctuation
# os.chdir(os.path.dirname(__file__)) # changes path to curr... |
import glob
import os
import utils_box as box
import tensorflow as tf
import numpy
import json
from collections import namedtuple
import model_layers as layer
from tensorflow.python.platform import tf_logging as logging
import numpy as np
import imgdbg as imgdbg
import math
import settings
default="6384c3e78.jpg"
d... |
'''
out.861848
'''
import numpy as np
import pandas as pd
import sys
import os
import matplotlib.pyplot as plt
sys.path.insert(1, '/home/orram/Documents/GitHub/imagewalker')
sys.path.insert(1, '/home/labs/ahissarlab/orra/imagewalker')
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoad... |
import os
import re
import sys
import json
import random
from textworld import Agent
import alfworld.gen.constants as constants
class HandCodedAgentTimeout(NameError):
pass
class HandCodedAgentFailed(NameError):
pass
class BasePolicy(object):
# Object and affordance priors
OBJECTS = constants.OBJEC... |
from Danim.Contry import *
from Danim.Distribution import LogscaleNumberLine
hair_svg_dir = "Danim\\video1\\file\\T_hair.svg"
#坐标轴设置settings
population_per_circle_area = 1/1.4*1.2 # default: 1.4 billion people is a 1.2unit area circle
xmin = 0
xmax = 10
ymin = 0
ymax = 100
proportion_to_left = 0.9 #default x axis move... |
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm, ListedColormap,BoundaryNorm
import numpy as np
import datetime as dt
import sys, os, pickle, time
from scipy.ndimage.filters import gaussian_filter
import pandas as pd
from mpl_toolkits.... |
import PIL
from PIL import Image, ImageDraw, ImageFont, ImageFilter, ImageOps, ImageMath
import json
import random
import datetime
import time
import discord
from discord import File
from discord.ext import commands
from discord.ext.commands import BucketType, cooldown, MissingRequiredArgument
import os
... |
import re
import os
import math
import discord
import lavalink
from discord.ext import commands, pages
from discord.commands import slash_command, Option
from musicbot.utils.language import get_lan
from musicbot.utils.volumeicon import volumeicon
from musicbot.utils.get_chart import *
from musicbot.utils.play_list im... |
#author <NAME>
from os.path import isfile, dirname, realpath
import gi, json, datetime, math
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, Pango, GLib
class Window(Gtk.Window):
def __init__(self):
super().__init__(title="Prilog V1 by <NAME>")
self.connect("destroy", Gtk.main... |
import sys
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
import numpy as np
import torch.nn.functional as F
import normal_estimation_utils
import ThreeDmFVNet
def fit_Wjet(points, weights, order=2, compute_neighbor_normals=False):
"""
Fit a "n-jet" (n-order truncated Tayl... |
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation
import copy
from Handover_Library import Camera, ImagePoint
from Handover_Fusion import fusion
from Handover_Tracking import output_object_tracking
from project_2d_position import ground_... |
#!/usr/bin/env python
# PyRadmon - Python Radiance Monitoring Tool
# Copyright 2014 <NAME>.
#
# 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
... |
from struct import pack, unpack
from os import urandom
import hashlib
import hmac
import sys
import traceback
#electrum
from electrum_ltc import mnemonic
#from electrum_ltc import bitcoin
from electrum_ltc import constants
from electrum_ltc.bitcoin import TYPE_ADDRESS, int_to_hex, var_int
from electrum_ltc.i18n import... |
from djitellopy import Tello
import cv2
import socket
import numpy as np
import time
import datetime
import imutils
def rescale_frame(frame, percent=75):
width = int(frame.shape[1] * percent/ 100)
height = int(frame.shape[0] * percent/ 100)
dim = (width, height)
return cv2.resize(frame, dim, interpola... |
from configparser import ConfigParser
import functools , json , os , pathlib
from random import randint
from PyQt5.QtCore import QObject, QParallelAnimationGroup, QPoint, QRect, QSize, QThread, QTimer, pyqtSignal, pyqtSlot
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog, QHBoxLayout, QLabel, QMainWindow... |
import math
import random
import numpy as np
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from transformers import *
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
p... |
# docking.py
#import necessary modules.
import krpc
import time
import numpy as np
def acquire_target(conn,vessel,target):
# conn is a krpc.connect() object, vessel is a vessel object, target is a string.
# vessel_list is a list of all vessels currently in use.
vessel_list = conn.space_center.vesse... |
import os, math, ctypes
import numpy as np
from OpenGL import GL
from art import VERT_LENGTH
from palette import MAX_COLORS
# inactive layer alphas
LAYER_VIS_FULL = 1
LAYER_VIS_DIM = 0.25
LAYER_VIS_NONE = 0
class TileRenderable:
"""
3D visual representation of an Art. Each layer is rendered as grids of
r... |
"""
Created on May 14, 2016
@author: tjoneslo
"""
import logging
import os
from pypdflite import PDFLite, PDFCursor
from pypdflite.pdfobjects.pdfellipse import PDFEllipse
from pypdflite.pdfobjects.pdfline import PDFLine
from pypdflite.pdfobjects.pdftext import PDFText
from PIL import Image, ImageDraw, ImageColor, Ima... |
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from morgana import utils
from tts_data_tools import file_io
from tts_data_tools.utils import get_file_ids
TO_TORCH_DTYPE = {
np.dtype('float16'): torch.float16,
np.dtype('float32'): torch.float32,
np.dtype('floa... |
import copy
import frozendict
import networkx as nx
import uuid
from rdkit import Chem
from rdkit.Chem import MolFromSmiles, AddHs, MolToSmiles, RemoveHs, Kekulize, BondType
import pickle
from functools import lru_cache
from collections import OrderedDict
strict_validation = False
bond_types =[]
# each edge is a Fr... |
import io
import os
import platform
import subprocess
import zipfile
import pandas as pd
import requests
from powersimdata.network.usa_tamu.constants.zones import abv2state
def download_demand_data(
es=None, ta=None, fpath="", sz_path="C:/Program Files/7-Zip/7z.exe"
):
"""Downloads the NREL EFS base demand d... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
# functions shared across workflows ##########################################
##############################################################################
import subprocess
import os
import re
import yaml
import glob
import sys
import shutil
from fuzzywuzzy import fuzz
import smtplib
from emai... |
import logging, datetime, os, time
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
from helpers import (
d,
d2,
di... |
import logging
from cobra.core.dictlist import DictList
from cobrakbase.core.kbaseobject import KBaseObjectBase, KBaseObject
from cobrakbase.core.utils import seed_coefficients_to_string
from cobrakbase.core.utils import get_str, get_int, get_id_from_ref
logger = logging.getLogger(__name__)
class KBaseFBASolution(... |
# Copyright (c) 2017 VisualDL 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... |
#!/usr/bin/env python
from __future__ import division
import argparse
import glob
import os
import sys
import time
import random
import re
from datetime import datetime
import torch
import torch.nn as nn
from torch import cuda
import onmt
import onmt.io
import onmt.Models
import onmt.ModelConstructor
import onmt.mo... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import os
import math
import copy
import torch
import torch.nn.functional as F
from fairseq import options, utils, metrics,... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import cv2
import torch
import numpy as np
import argparse
import torchvision
from PIL import Image
from tqdm import tqdm
from pathli... |
# -*- coding: utf-8 -*-
"""
FEA.fea
Utilities module for finite element analysis (pychrono backend)
Author: <NAME>
"""
import numpy as np
import nrrd
# meshing
from skimage import measure
import tetgen # tetrahedralization
import trimesh # general mesh ops
import pyvista as pv
# finite element library
import py... |
aubiodefvalue = {
# we have some clean up to do
'buf_size': 'Py_default_vector_length',
'win_s': 'Py_default_vector_length',
'size': 'Py_default_vector_length',
# and here too
'hop_size': 'Py_default_vector_length / 2',
'hop_s': 'Py_default_vector_length / 2',
# these should be alright
... |
params = [
{ "start": 34.77, "attr": "Ra", "low": 5.0, "high": 100.0, "lists": ["all"] },
{ "start": 2.706, "attr": "cm", "low": 0.1, "high": 4.0, "lists": ["all"] },
{ "start": 49.95, "attr": "ena", "low": 40.0, "high": 50.0, "lists": ["all"] },
{ "start": -70.03, "attr": "... |
import cvxopt
import cvxopt
from cvxopt import solvers
import random
import matplotlib.pyplot as plt
import torch
from autograd import grad
from autograd import jacobian
import autograd.numpy as np
import autograd.numpy as jnp
import scipy.optimize as optim
from scipy.optimize import minimize, Bounds,LinearConstraint
f... |
import random
import glob
import paddle
import numpy as np
import xml.etree.ElementTree as ET
def iou(bbox, priors):
"""
计算一个真实框与 k个先验框(priors) 的交并比(IOU)值。
bbox: 真实框的宽高,数据为(宽,高),其中宽与高都是归一化后的相对值。
priors: 生成的先验框,数据形状为(k,2),其中k是先验框priors的个数
"""
x = np.minimum(priors[:, 0], bbox[0])... |
from pathlib import Path
import os
import matplotlib as mpl
if os.environ.get('DISPLAY') is None: # NOQA
mpl.use('Agg') # NOQA
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
import itertools
import numpy as np
# from pylab import rcParams
# rcParams['figure.figsize'] = (12, ... |
# ------------------------------------------------------------
# PATCH NOTES
# ------------------------------------------------------------
# The changes in this version are as follows:
# * New grid
# * Don't use trap
# ! If digging on potential trap, nobody must be around this trap
# ! When moving, avoid havin... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
# Copyright (c) 2003-2019 by <NAME>
#
# TreeCorr is free software: 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 copyright notice, this
# list of conditions... |
from collections import defaultdict
from django.conf import settings
from datetime import timedelta
from stats.models import Sortie, KillboardPvP, LogEntry, Mission, Tour
from .variant_utils import decide_adjusted_cls
from .models import SortieAugmentation, FilteredPlayerMission, FilteredPlayerAircraft, FilteredVLife, ... |
# Copyright 2019, Futurewei Technologies
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, V... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.