text stringlengths 6.04k 39.5k |
|---|
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import palettable
import itertools
from functools import partial
from scipy.spatial.distance import squareform
from matplotlib.gridspec import GridSpec
from matplotlib import cm
import scipy.cluster.hierarchy as sch
from c... |
from collections import deque
from typing import List, Mapping, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from lib.models.decode import _nms, _topk
from lib.models.utils import _tranpose_and_gather_feat
def print_meta(out):
if isinstance(out, torch.Tensor):
retur... |
import sys, os
cur_file_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(cur_file_path, '..'))
import argparse
import importlib, time
import glob
import json
import numpy as np
from plyfile import PlyData
import torch
import torch.nn.functional as F
from torch.utils.data import DataL... |
from typing import Union, Tuple
import numpy as np
import cmasher as cmr
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from lasif.utils import elliptic_to_geocentric_latitude
from matplotlib import gridspec
from obspy.geodetics import locations2degrees
from salvus.mesh.un... |
import numpy as np
np.set_printoptions(edgeitems=25, linewidth=10000, precision=4, suppress=True)
import collections
import re
import argparse
import sys
import os
import tensorflow as tf
from model import MtadGat, get_shape_list
from evaluate import calculate_metrics
FLAGS = None
def make_input_fn(filename, is_tr... |
import time
from collections import Counter, defaultdict, namedtuple, Sequence
from itertools import count
from pddlstream.algorithms.downward import make_preconditions, make_parameters
from pddlstream.language.constants import AND, get_prefix, get_args, is_parameter
from pddlstream.language.conversion import list_fro... |
import re
import json
from pyparsing import (
CaselessKeyword,
ParseException,
ParserElement,
QuotedString,
ZeroOrMore,
StringEnd,
OneOrMore,
Suppress,
Optional,
Literal,
SkipTo,
Group,
Word,
originalTextFor,
delimitedList,
quotedString,
printables,
... |
import mxnet as mx
from mxnet.gluon import loss
from models.loss import pairwise_distance
def unique(F, data):
"""
Returns the unique elements of a 1D array
:param F:
:param data:
:return:
"""
sdata = F.reshape(data, (-1,))
sdata = F.sort(sdata, axis=-1)
mask = F.concat(F.ones(1, ... |
# -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division, absolute_import
import logging
from bitstring import BitArray, Bits
from .. import utils
from . import crc8
from .eep import EEP
from .constants import PACKET, RORG, PARSE_RESULT, DB0, DB2, DB3, DB4, DB6
class Packet(object)... |
# -*- coding: utf-8
# 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 and the following disclaimer.
# 2. Redistribut... |
"""Set up a plug-in architecture for Midgard
Description:
------------
In order to be able to add models, parsers, data sources etc without needing to
hardcode names, but rather pick them from configuration files, we use a simple
plug-in architecture. The plug-in mechanism is based on the different plug-ins
registeri... |
import sys
import os
import time
import signal
import argparse
import traceback
from .. import playback, cwipc_proxy, cwipc_synthetic, cwipc_downsample, cwipc_remove_outliers
from ..net import source_netclient
from ..net import source_decoder
from ..net import source_passthrough
from ..net import source_sub
try:
... |
# Copyright 2016-2022 The FEAGI 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 applic... |
'''Evaluate Linguistics metrics for a language model given its predictions on valid seen and valid unseen data'''
import os
import json
import pprint
import numpy as np
from collections import defaultdict
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
from nltk.translate.bleu_score import sentenc... |
"""
Filename: Scanner.py
Tested with Python 3.5.1
<NAME>
CS 6110
Prof. Reiter
Winter 2017
CSU East Bay
Scanner Assignment
Due 1/27/17
This file implements a scanner, using the most direct translation of a DFA into
code as I could make. In an effort to decouple the code from the design of
the language, and to make t... |
"""
Functions for building tensorflow computational graph models. RNN models,
and tensorflow loss functions will be added to this module.
"""
import tensorflow as tf
import math
from np_ops import fan_scale
def batch_normalize(tensor_in, epsilon=1e-5, decay=0.999):
"""
Batch Normalization:
`Batch Normaliz... |
#!/usr/bin/env python
'''
Read the NeXus NXDL class specification and describe it.
Write a restructured text (.rst) document for use in the NeXus manual in
the NeXus NXDL Classes chapter.
'''
# testing: see file dev_nxdl2rst.py
from collections import OrderedDict
from html import parser as HTMLParser
import lxml.et... |
#-*- coding: utf-8 -*-
'''
Created on 2017. 02. 16
Updated on 2017. 02. 16
To run this program, you need to do following setps.
- preparing each techniques
- download Git reporitory :: use launcher_GitInflator.py
- make bug repository :: use launcher_repoMaker.py
- make summary information files :: use Exec... |
import asyncio
import dataclasses
import datetime
import io
import keyword
import sys
from dataclasses import MISSING, Field, dataclass
from typing import Any, Dict, List, Optional, TextIO, Tuple, TypeVar
from . import async_database
from .async_database import ConnectionParameters, DatabaseClient
from .base import Da... |
import os
#__MAYAVI__ = False
#try:
# os.environ["QT_API"] = "pyqt"
# from mayavi import mlab
# __MAYAVI__ = True
#except:
# try:
# os.environ["QT_API"] = "pyside"
# from mayavi import mlab
# __MAYAVI__ = True
# except:
# print("Unable to import mayavi")
from ... |
import sys
import os
import decimal
import string
import logger
# template configuration: in theory this stuff could be
# modified at runtime, though in practice that seems unlikely
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_DIR = os.path.abspath(THIS_DIR + '/templates')
TEMPLATES = [ '01_header.c_... |
import math
import pybullet as p
import numpy as np
import copy
import sys
sys.path.append("../")
#sys.path.append("/HPS/Shimada/work/rbdl37/rbdl/build/python")
import rbdl
from scipy.spatial.transform import Rotation as Rot
from scipy.spatial.transform import Slerp
class KinematicUtil():
def motio... |
from PIL import Image,ImageDraw
import random
from PIL import ImageFilter
import math
import seaborn as sns
PATTREN_HEXAGON_1 = "hex1"
PATTREN_HEXAGON_2 = "hex2"
PATTREN_CUBES = "cubes"
PATTREN_RHOMBUS = "rhombus"
class Config:
WIDTH = 1920
HEIGHT = 1080
PATTERN = PATTREN_HEXAGON_1
NAME = "r... |
from math import pi, cos, sin
import torch
from torch.autograd import Variable
import shapely
from shapely.geometry import Polygon, MultiPoint
import numpy as np
from mmdet.ops import box_iou_rotated_differentiable
import matplotlib.pyplot as plt
class Vector:
def __init__(self, x, y):
self.x = x
s... |
import numpy as np
import pandas as pd
import ray
import matplotlib.pyplot as plt
import tensortrade.env.default as default
import ta
import tensorflow as tf
import ray.rllib.agents.impala as impala
import ray.rllib.agents.ppo as ppo
import ray.rllib.agents.ppo.appo as appo
import ray.rllib.agents.dqn as dqn
import ra... |
import re
import os
import numpy as np
import tensorflow as tf
import json
from tqdm import *
from math import sqrt
from PIL import Image
from time import sleep
from keras import backend as K
from keras.preprocessing.image import Iterator
from keras.preprocessing.image import ImageDataGenerator
from keras.utils.generi... |
import speech_recognition as sr
import pyttsx3
from tkinter import *
from tkinter.font import Font,Font
from tkinter.ttk import Combobox
from tkinter import messagebox,filedialog
from PIL import Image,ImageTk
import os
root = Tk()
root.geometry("750x450")
root.title("Ultitled.txt -Notepade".center... |
import dask
import datetime
import logging
import time
import numpy as np
from ml4chem.utils import convert_elapsed_time, get_chunks
from collections import OrderedDict
from scipy.linalg import cholesky
logger = logging.getLogger()
class KernelRidge(object):
"""Kernel Ridge Regression
Parameters
-------... |
from functools import wraps
from typing import Union, Tuple, Any, Optional
import PIL.Image
import numpy as np
from PIL.Image import Image as PILImage
def replace_at_index(tup: tuple, idx: int, value) -> tuple:
assert 0 <= idx < len(tup)
return tup[:idx] + (value,) + tup[idx + 1:]
def remove_at_index(tup: ... |
import random
import torch
import cv2
import numpy as np
def bbox_iou(box1, box2, x1y1x2y2=True):
"""
Returns the IoU of two bounding boxes
"""
if not x1y1x2y2:
# Transform from center and width to exact coordinates
b1_x1, b1_x2 = box1[:, 0] - box1[:, 2] / 2, box1[:, 0] + box1[:, 2] / 2... |
#!/usr/bin/env python3
'''Library for representing Git objects
[1] https://www.dulwich.io/docs/tutorial/file-format.html#the-blob
[2] https://www.dulwich.io/docs/tutorial/file-format.html#the-commit
[3] https://www.dulwich.io/docs/tutorial/file-format.html#the-tree
'''
import sys
import binascii
import os
from colle... |
"""
Utility functions for QS files.
"""
import traceback
import re
import math
import sys
import threading
import os
from PyQt6 import QtCore
from pineboolib.application import types, qsadictmodules
from pineboolib.core.utils import utils_base, logging
from pineboolib import application
from typing import (
Any... |
from PIL import Image
import requests
import json
import os
from IPython.display import HTML, Markdown
import json
import re
small_scale = 0.59
large_scale = 1.58
def nb_search(
term = '', creator = '',
number = 50,
page = 0,
mediatype = 'bøker',
lang = "nob",
period = (18000101, 20401231... |
'''
This script handling the training process.
'''
import argparse
from argparse import Namespace
import math
import time
import sys, os
import os.path
import numpy as np
from subprocess import Popen
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
i... |
import numpy as np
import os
import sys
import time
import torch
import torch.nn.functional as torch_F
import collections
from easydict import EasyDict as edict
from ipdb import set_trace
import util
from util import log, debug
class Pose():
"""
A class of operations on camera poses (PyTorch tensors with sha... |
# Copyright 2017 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... |
from ophyd import ( Component as Cpt, ADComponent, Signal,
EpicsSignal, EpicsSignalRO, EpicsSignalWithRBV,
ROIPlugin, StatsPlugin, ImagePlugin,
SingleTrigger, PilatusDetector, Device)
from ophyd.areadetector.filestore_mixins import FileStoreBase,FileStoreHDF5... |
import Tkinter
import collections
import random
import sys
import math
import heapq
class World:
"""container for many GameObject instances and some global parameters"""
def __init__(self, width, height):
self.width = width
self.height = height
self.all_objects = []
self.objects_by_class = collec... |
import math
import numpy as np
from scipy.signal import convolve2d
from scipy.optimize import least_squares
import scipy.ndimage as scimg
import skimage.measure as skimsr
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
# Adapted version inspired by agpy gaussfitter
def gauss2d(x, y, h, a, x0,... |
#!/usr/bin/env python3
import os
import shutil
import getpass
import stat
from optparse import OptionParser
from subprocess import check_call
class DebBuilderError(Exception):
pass
class UIO(object):
"""@brief Responsible for user output"""
def info(self, line):
"""@breif Show an info level mes... |
import time
import numpy as np
import rnn_fxpts as rfx
import fxpt_experiments as fe
import matplotlib.pyplot as plt
import plotter as ptr
def local_trial(W, timeout = .1):
"""
Run a solver trial using only repeated local search
W is the rnn weight matrix
timeout is the number of seconds to continue re... |
import os.path
from os import path
import pwrcommon as pc
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from statistics import mean
def readData(dataPathP100):
freqs = [544, 556, 569, 582, 594, 607, 620, 632, 645, 658, 670, 683, 696, 708, 721, 734, 746, 759, 772, 784, 797, 810, 822, 835,... |
import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
from tensorDLT import solve_DLT
from tf_spatial_transform import transform
from tensorflow.contrib.layers import conv2d
import tf_spatial_transform_local
import constant
grid_w = constant.GRID_W
grid_h = constant.GRID_H
#C... |
import csv
import logging
import os
import platform
import tarfile
from time import strftime
import korbinian
import korbinian.utils as utils
import pandas as pd
import sys
# import debugging tools
from korbinian.utils import pr, pc, pn, aaa
def download_homologues_from_simap(pathdict, s, logging):
"""From the lis... |
import flask
import psycopg2
import json
import werkzeug.exceptions
from ..authenticated_blueprint_preparator import AuthenticatedBlueprintPreparator
from .user_action import add_user_action
from .util import parse_evidence, parse_geoloc
from .decorators import rest_endpoint
name = 'evidence'
app = AuthenticatedBluep... |
from beam import Beam
import torch
from torch import optim
import torch.nn as nn
import torch.nn.functional as F
from global_variables import SOS_IDX, SOS_TOKEN, EOS_IDX, EOS_TOKEN, UNK_IDX, UNK_TOKEN, PAD_IDX, PAD_TOKEN, SEP_IDX, SEP_TOKEN, device, NEAR_INF
from torch.optim.lr_scheduler import ReduceLROnPlateau
from t... |
#!/usr/bin/python
import os
import re
import sys
import pywikibot
import mwparserfromhell
import MySQLdb
import viutil # @User:VICbot/source/viutil.py
from loguru import logger
# Pre-compiled REs
link2RE = re.compile('\[\[(?:[^\|\]]+\|){0,1}([^\|\]]+)\]\]')
link3RE = re.compile('\{\{\w\|([^\|\}]+)\}\}')
quotesR... |
from __future__ import print_function
import bz2
from ftplib import FTP
import gzip
import hashlib
import logging
import os
import pickle
import re
from subprocess import Popen, STDOUT, PIPE
import sys
import time
import urllib
import yaml
class MirrorException(Exception):
def __init__(self, val):
self.val... |
#
# Copyright (c) 2009-2021, <NAME>
#
# Started from "model_tests.py" on 3/14/13 to create
# a BMI-compliant version for a hands-on example.
#
# Show how to inherit BMI functions from BMI_base.py.
# Previous version info.
# July 5-7, 2008
# Modified: July 23, 2008 (<NAME>)
# v = sqrt(2 * g * d))
... |
#!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import sys, os
import inspect
import traceback
import time
import types
from remotepython im... |
from chiscore import davies_pvalue, optimal_davies_pvalue
class StructLMM:
r"""
Structured linear mixed model that accounts for genotype-environment interactions.
Let n be the number of samples.
StructLMM [1] extends the conventional linear mixed model by including an
additional per-individual ef... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 11 18:07:06 2020
@author: Raj
"""
import pyUSID as usid
import ffta
from ffta.pixel import Pixel
from ffta.pixel_utils import badpixels
import os
import numpy as np
from ffta.load import get_utils
from pyUSID.processing.comp_utils import parallel_compute
from pyUSID.io.w... |
""" Session defined for the IDGAN system. Includes the training process, a quick evaluation method that
uses sampled test items, and a more comprehensive evaluation on the entirety of the test set. Significant
cross-over with SAE session, as the evaluated system component is the IDGAN generator, instantiated as an SAE.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 3 13:50:18 2021
Script for computating the annual and seasonal probabilities of the WTs.
It will also calculate the occurence prob. of the WTs in respect to:
1) Southern Annular Mode indeces
2) El-Niño Southern Oscilation indeces
3) Ma... |
#!/usr/bin/env python
import argparse
import logging
import logging.config
import os
import random
import signal
from dataclasses import asdict, dataclass
from typing import Dict, NamedTuple
import gym
import numpy as np
import torch
import torch.nn as nn
import wandb
from gym_gridverse.rng import reset_gv_rng
from a... |
import numpy as np
import torch
from cuquant import QDQ
import math
from estim.dist import TruncNorm, CondNormalTruncHist
EPS = 1e-7
def get_quantile_levels(bits, grad_dist):
"""quantile levels """
num_levels = 2 << bits - 1
cdf_points = np.linspace(0, 1, num=num_levels)
levels = [grad_dist.ppf(level... |
import collections as cs, hashlib as hl, pathlib as pl
import ctypes as ct, functools as ft, urllib.parse as up
import os, sys, asyncio, re, enum, struct, errno, zlib, fcntl, termios
class LogtailConf:
state_dir = '/tmp/kelp-logtail' # one file for each "last position" in a path
read_size = 1 * 2**20 # chunk to re... |
#!/usr/bin/python3
import argparse
import os
import importlib
import io
import json
import re
import sys
opcode2data = {
'true': '$push(True)',
'false': '$push(False)',
'pop': '$pop(0)',
'none': '$push(None)',
'ret': 'return $pop(0)',
'st.name': ... |
#!/usr/bin/env python
def get_atom_mass(atom_name):
'''
get_atom_mass: get atom number and mass.
Args:
atom_name: string or 1-d string list
atom_name is atom name. Example : 'O'/['O','H']
Returns:
atom_num: int or 1-d int list
atom_num is atom number. Example : 6/[6,1]
atom_mass: floa... |
import inspect
import operator
from functools import wraps
from typing import (
Any,
Callable,
List,
Mapping,
NamedTuple,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
T = TypeVar("T")
OT = TypeVar("OT", bound="Op")
class _Constant:
__slots__ = ("name",)
def __init__(s... |
import math
import numpy as np
import torch
from torch import nn
from inspect import signature
from torch.nn import functional
from TTS.tts.utils.generic_utils import sequence_mask
from TTS.tts.utils.ssim import ssim
# pylint: disable=abstract-method Method
# relates https://github.com/pytorch/pytorch/issues/42305
cl... |
from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from train_steering_wheel.train import (
MODEL_HEIGHT as CNN_MODEL_HEIGHT,
MODEL_HEIGHT as CNN_MODEL_WIDTH,
ANGLE_BIN_SIZE as CNN_ANGLE_BIN_SIZE,
extract_steering_wheel_i... |
# Distributed under the Apache License, Version 2.0.
# See accompanying NOTICE file for details.
import numpy as np
import subprocess
# WGS84 constants
_a = 6378137
_f = 1/(298257223563/1000000000)
_e2 = _f*(2-_f)
_e2m = np.square(1-_f)
_e2a = abs(_e2)
_e4a = np.square(_e2)
epsilon = np.finfo(float).eps
_maxrad = 2 *... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Detection Training Script.
This scripts reads a given config file and runs the training or evaluation.
It is an entry point that is made to train standard models in detectron2.
In order to let one script support training of many models,
this s... |
import geopandas
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import cm
import matplotlib.ticker ... |
import collections
import datetime
import json
import re
from django.apps import apps
from django.core import mail
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.db.models import Q
from django.db.models.fields import Field
from d... |
from django.db.models import F
from app import models
from pprint import pprint
MAP_CAPITOLE = {
'identificare': models.IdentificarePage,
'istoric': models.IstoricPage,
'descriere': models.DescrierePage,
'componenta_artistica': models.ComponentaArtisticaPage,
'conservare': models.ConservarePage,
... |
import cmd
from enum import Enum
from functools import wraps
from tqdm import tqdm
from fund import Fund
from google_services import GoogleServices
from network_test import network_test
from text_extractor import HTMLTextExtractor
from utils import *
try:
from logger import logger
except FileNotFoundError:
pr... |
"""{Test the affect of changing SMF parameters by a certain percentage on SHMR}"""
from halotools.empirical_models import PrebuiltSubhaloModelFactory
from cosmo_utils.utils.stats_funcs import Stats_one_arr
from halotools.sim_manager import CachedHaloCatalog
from cosmo_utils.utils import work_paths as cwpaths
import m... |
import argparse
import copy
import datetime
import arcade
import serial
# TODO faire une interface graphique pour choisir le port COM
# TODO mettre la grille dans une classe à part, ne mettre à jour la grille que si on change de tour, pour limiter les calculs
SCREEN_WIDTH = 1024
SCREEN_HEIGHT = 768
SCREEN_TITLE = "C... |
"""Side functions that are not bound to classes.
Can be used on any data."""
import astropy.coordinates as co
import numpy as np
import astropy.units as u
import pandas as pd
import wrdists.bayesian_functions as bc
import matplotlib.pyplot as plt
def from_decimal(ra, dec):
"""
Wrapper function to convert r... |
#/!usr/bin/env python
# encoding: utf-8
import os
import sys
import time
import threading
import numpy
import datetime
from pathlib import Path
import hfo_game
import ddpg
from hfo import *
import random
import logging
from absl import app
from absl import flags
import ddpg
from robocup_agent import RoboCupAgen... |
from pytissueoptics import *
class Geometry:
def __init__(self, material=None, stats=None, label=""):
self.material = material
self.origin = Vector(0, 0, 0)
self.stats = stats
self.surfaces = []
self.label = label
self.inputWeight = 0
self.epsilon = 1e-5
... |
import imageio
import os
import pygame
import random
import matplotlib.pyplot as plt
from Box2D import (b2Distance, b2PolygonShape, b2Transform, b2World)
from helpers import *
from math import isclose
"""Display variables."""
SCREEN_WIDTH, SCREEN_HEIGHT = 720, 720
PPM = 60.0 # pixels per meter
WHITE = (255, 255, 255... |
import torch
import numpy as np
import torch.nn.functional as F
from copy import deepcopy
def normalized_columns_initializer(weights, std=1.0):
out = torch.randn(weights.size())
out *= std / torch.sqrt(out.pow(2).sum(1, keepdim=True))
return out
def sigmoid(value):
value = value.double()
sigmoid_v... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Ce script cree un fichier .foldrec
Il part d'un fichier d'alignement des profils (query vs template)
Il lit les scores et trie les alignements selon ces scores (ordre croissant)
Il lance un psi-pred sur la query entiere qui ensuite sera decoupee selon l'alignement
et... |
import torch
import torch.nn as nn
from collections import OrderedDict
import os
import numpy as np
import utils as utils
import torch.nn.functional as F
def get_batch_params(x):
batch_size = x.shape[0]
bessel = (batch_size - 1) / batch_size
mean = torch.mean(x, 0)
std = torch.sqrt(torch.var(x, 0) * b... |
# coding:utf-8
from __future__ import print_function
import face_recognition
import pickle
import cv2
import time
import json
import io
import os
import re
import random
import shutil
import subprocess
from tqdm import tqdm
command_snap_shot="ffmpeg -ss {} -i {} -frames:v 1 {}"
#参数依次为:开始时间、输入视频文件名、截图名
command_video_cu... |
# Copyright 2021 NREL
# 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
# distri... |
"""
Based on PointsformerE, change the configure of pre/pos_blocks
Bsed on PointsformerB, add more layers and the global context
Based on PointsformerA, changed GELU to RELU
Model21+Pointnet part segment
"""
"""
Instance 2
Best accuracy is: 0.94441
Best class avg mIOU is: 0.82887
Best inctance avg mIOU is: 0.85721
Epo... |
# Copyright 2017 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
# Copyright 2014-2019 The PySCF Developers. 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... |
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# File: transformer.py
import inspect
import numpy as np
import pprint
import sys
from abc import ABCMeta, abstractmethod
from fvcore.transforms.transform import (
BlendTransform,
CropTransform,
HFlipTransform,
... |
# -*- coding: utf-8 -*-
import pygame
import random
import os
import numpy as np
WHITE = (0xff, 0xff, 0xff)
BLACK = (0, 0, 0)
GREEN = (0, 0xff, 0)
RED = (0xff, 0, 0)
BLUE = (0, 0, 0xff)
LINE_COLOR = (0x00, 0x00, 0x00)
FPS = 30
HARD_LEVEL = list(range(4, FPS // 2, 2))
hardness = HARD_LEVEL[0]
D_LEFT, D_RIGHT, D_UP,... |
# -*- coding: utf-8 -*-
"""
utils
~~~~~
Implements utils
:author: Feei <<EMAIL>>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
import hashlib
import os
import random
import re
im... |
import json
import os
import random
import time
import uuid
from datetime import datetime
import requests
from cement import Controller, ex, shell
from troposphere import Template
from hydra.core.exc import HydraError
NAME_ARG = (
['--name'],
{
'help': 'the name of the network to run on',
'ac... |
from rllab.misc import ext
from rllab.misc import logger
from rllab.core.serializable import Serializable
import theano.tensor as TT
import theano
import numpy as np
import multiprocessing as mp
from rllab.misc.ext import sliced_fun
from sandbox.ex2.parallel_trpo.simple_container import SimpleContainer
import sandbox.... |
#!/usr/bin/python
# ---------------------------------------------------------------------------
# File: qpcdual.py
# Version 12.8.0
# ---------------------------------------------------------------------------
# Licensed Materials - Property of IBM
# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
# Copy... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An implementation of
U{Python Web Server Gateway Interface v1.0.1<http://www.python.org/dev/peps/pep-3333/>}.
"""
from collections.abc import Sequence
from sys import exc_info
from warnings import warn
from zope.interface import implementer
... |
import traceback
import numpy as np
import litenn as nn
import litenn.core as nc
from litenn.core import CLKernelHelper as ph
class ElementWiseOpKernel:
"""
Base class for kernels to use in element_wise_op()
"""
def get_forward_kernel_text(self):
"""
return kernel C code block for forwa... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
"""The tests for the DirecTV Media player platform."""
from unittest.mock import call, patch
from datetime import datetime, timedelta
import requests
import pytest
from homeassistant.components.media_player.const import (
ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, MEDIA_TYPE_TVSHOW,
ATTR_MEDIA_ENQUEUE, A... |
"""The Shelly integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from typing import Any, Final, cast
import aioshelly
from aioshelly.block_device import BlockDevice
from aioshelly.rpc_device import RpcDevice
import async_timeout
import voluptuous as vol
fr... |
# coding=utf-8
# Copyright 2021 The TensorFlow GAN 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 applicabl... |
# Copyright (c) 2020 PaddlePaddle 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 app... |
"""
Install solc
"""
import argparse
import logging
import os
import re
import shutil
import stat
import subprocess
import sys
import tarfile
import tempfile
import warnings
import zipfile
from base64 import b64encode
from io import BytesIO
from pathlib import Path
from typing import Dict, List, Optional, Union
import... |
# 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
#
# Unless required by applicable law or agreed to in wr... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
import os
import tqdm
from scipy import interpolate
from mouse_detection.tracker import EuclideanDistTracker
def savitzky_golay(y, window_size, order, deriv=0, rate=1):
r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter.
... |
# -*- coding: utf-8 -*-
# Copyright 2017-2020 CERN
#
# 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 a... |
""" YES, oor no? """
from __future__ import print_function # python3
import datetime
DEBUG = False
def yesorno(team, teamdates, date2=None):
"""
Input: team/city/etc, teamdates and date
Returns: True/False
"""
yesterday = datetime.datetime.now() - datetime.timedelta(days=1)
yesterday = yes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.