text
stringlengths
6.04k
39.5k
import numpy as np import glob import os import sys #BASE_DIR = os.path.dirname(os.path.abspath(__file__)) #ROOT_DIR = os.path.dirname(BASE_DIR) #sys.path.append(BASE_DIR) # ----------------------------------------------------------------------------- # CONSTANTS # -----------------------------------------------------...
# ============================================================================ # Copyright (c) 2007 <NAME> <<EMAIL>> # # 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, inc...
import os import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) from suppose.pose_extractor import PoseExtractor from suppose.proto import * from suppose import suppose_pb2 from suppose.camera import load_calibration from math import fabs import tempfile...
# Copyright (c) 2020 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. # # SPDX-License-Identifier: MIT """ This module adds the functionality of storing and retrieving :class:`~aas.model.base...
# -*- coding: utf-8 -*- import re import types from typing import List, Tuple, Any, Optional from util import translate from util.log import Logger from util.math import proper_str, is_num from . import nodes class ValueType: """Types of values""" STRING, NUMBER, BOOLEAN, LIST, FUNCTION = range(5) @sta...
from Lib import Vector,Img from Game import Registry,Research from Engine import Items from collections import Counter from pygame import draw,Rect tfont= Img.fload("cool", 64) sel=Img.imgx("GUISelect") arrow=Img.imgx("Arrow") error=Img.sndget("error") class MUI(object): bcol=(210,)*3 size=Vector.zero def _...
import random from itertools import cycle import sys import pygame from pygame.locals import * from game import flappy_bird_utils FPS = 30 SCREENWIDTH = 288 SCREENHEIGHT = 512 pygame.init() FPSCLOCK = pygame.time.Clock() SCREEN = pygame.display.set_mode((SCREENWIDTH*2, SCREENHEIGHT)) pygame.display.set_caption('Flapp...
#! /usr/bin/python """ Author: <NAME> Make UML diagrams based on protocol buffers-described schemas. Outputs a .dot file to be used with GraphViz's dot program. Instead of parsing the original schema .proto files, this program takes a FileDescriptorSet as input. A FileDescriptorSet is itself a protobuf-serialized m...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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 ap...
import torch from contextnet.utils.losses import GaussianFocalLoss, MixedLoss from tqdm import tqdm from nucleidet.detectors.heatmap import KeypointsExtractor from torchvision.utils import save_image from contextnet.eval.metrics import calculate_avg_precisions from contextnet.utils.utils import KPSimilarity from torch...
from datetime import datetime from logging import getLogger from typing import TYPE_CHECKING from sqlalchemy import Boolean from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import Text from sqlal...
#!/usr/bin/env python3 """ Auto-formats our tutorials, saving manual formatting work: - Converts space-based indentations to tabs in code blocks. - Fills GDScript code comments as paragraphs. - Wraps symbols and numeric values in code. - Wraps other capitalized names, pascal case values into italics (we assume they're...
import argparse import glob from pathlib import Path import laspy try: import open3d from visual_utils import open3d_vis_utils as V OPEN3D_FLAG = True except: import mayavi.mlab as mlab from visual_utils import visualize_utils as V OPEN3D_FLAG = False import numpy as np import torch import os ...
# -*- coding: utf-8 -*- import sys import pytest from boltons.dictutils import OMD, OneToOne, ManyToMany, FrozenDict, subdict, FrozenHashError _ITEMSETS = [[], [('a', 1), ('b', 2), ('c', 3)], [('A', 'One'), ('A', 'One'), ('A', 'One')], [('Z', -1), ('Y', -2), ('Y', -2)], ...
import os import os.path as osp import numpy as np import pickle from PIL import Image import glob import yaml import torch from torch.utils.data import Dataset from torch.utils.data.dataloader import DataLoader import open3d as o3d import xmuda.data.semantic_kitti.io_data as SemanticKittiIO from xmuda.data.semantic_k...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch.nn.functional as F import torch import torch.nn as nn import util.util as util from util.Selfpatch import Selfpatch # SE MODEL class SELayer(nn.Module): def __init__(self, channel, reduction=1...
# from: https://kornia.readthedocs.io/en/latest/_modules/kornia/losses/ssim.html from typing import Tuple, List import torch import torch.nn as nn import torch.nn.functional as F def ssim(img1: torch.Tensor, img2: torch.Tensor, window_size: int = 5, max_val: float = 1.0, eps: float = 1e-12) -> torch.Tensor...
"""Abstraction layer over PyCUDA. It implements the abstract interfaces defined in :mod:`katsdpsigproc.abc`. """ from typing import List, Tuple, Sequence, Optional, Type, TypeVar, Union, Any from types import TracebackType import numpy as np try: from numpy.typing import DTypeLike except ImportError: DTypeLi...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import math, copy, time from torch.autograd import Variable import matplotlib.pyplot as plt from Customized_S3DG import S3DG from C3D_model import C3D ''' class C3D(nn.Module): def __init__(self, d_model, device, drop...
from ..common import * class AdminCreateSimpleDialog(wx.Dialog): def __init__(self, parent): wx.Dialog.__init__(self, parent, id = wx.ID_ANY, title = '站点注册(简单配置)', size=(600, 400)) self.font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False) self._init_UI() def _init_UI(self): ...
### # Copyright (c) 2014, spline # All rights reserved. # # ### # my libs import json import cPickle as pickle from collections import defaultdict import base64 import ipaddr # supybot libs import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins import supybot.ircutils as ircutils...
#!/usr/bin/python ##################################### ### CIS SLOT FILLING SYSTEM #### ### 2014-2015 #### ### Author: <NAME> #### ##################################### ##### # Description: Implementation of network layers # Date: 2015-2016 # # References: # Code for HiddenLayer and...
#!/usr/bin/python blank_datafile = '/home/kyleb/Dropbox/UCSF/cas9/FCS/150916-3.1/kyleb/150916-rfp-cas9/96 Well - Flat bottom_002/Specimen_001_F1_F01_046.fcs' script_output_dir = 'script_output' sample_directory = '/home/kyleb/Dropbox/UCSF/cas9/FCS/150916-3.1/kyleb/150916-rfp-cas9/96 Well - Flat bottom_002' rows_in_pl...
import sys import math from collections import OrderedDict import os from os.path import isfile, join, abspath, basename, dirname, getctime, getmtime, splitext, realpath from subprocess import check_output from ngs_utils.call_process import run from ngs_utils import call_process from ngs_utils.file_utils import interm...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. and Epidemico Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You ma...
import numpy as np import matplotlib import pandas as pd import random from scipy import stats from scipy.stats import binom from scipy import special as sps from tabulate import tabulate from matplotlib import pyplot as plt matplotlib.use('TkAgg') # df = pd.DataFrame({'name': ['Dan', 'Joann', 'Pedro', 'R...
import numpy as np from numpy import pi from numpy.lib.function_base import delete from scipy.optimize import least_squares from six import exec_ from dearpygui.core import * from dearpygui.simple import * from lmfit import Model, Parameters def HNP_callback(sender, data): # Track of current panel si = get_dat...
import plotly.graph_objects as go import matplotlib.pyplot as plt import networkx as nx from networkx.drawing.nx_agraph import graphviz_layout import numpy as np import warnings import os import re class RuleBase: def __init__(self): self.outcome = None self.next_step = None self.desc = "...
"""Utils for the TensorFlow model.""" """ This model on based on the work of <NAME> Source: https://github.com/carrotflakes/seqgan-text-tensorflow """ from collections import OrderedDict import warnings import numpy as np import tensorflow as tf from tensorflow.python.layers import core as core_layers import utils #...
import pygame import sys from board import Board from network import Network from button import Button from AI2 import * fps = 30 boardWidth = 640 boardHeight = 640 numDivision = 16 numPoint = numDivision - 1 cellSize = boardWidth // numDivision chessSize = boardWidth // 40 # R G B white ...
import os import re #import json import simplejson as json import datetime import geopy.distance import numpy as np import pandas as pd from pathlib import Path from . import course from . import games from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for, json, current_app ) from we...
############################################################################### # __ _ ___ ____ # # / _| ___ _ __ _ __ ___ (_) ___|_ _| _ \ # # | |_ / _ \| '__| '_ ` _ \| |/ __|| || | | | # ...
""" Fixer for complicated imports """ from lib2to3 import fixer_base from lib2to3.fixer_util import Name, String, FromImport, Newline, Comma from ..fixer_util import token, syms, Leaf, Node, Star, indentation, ImportAsName TK_BASE_NAMES = ('ACTIVE', 'ALL', 'ANCHOR', 'ARC','BASELINE', 'BEVEL', 'BOTH', ...
from datetime import datetime, timedelta from copy import copy, deepcopy from constants import * import utils import random from exceptions import (NotEnoughBallotClaimTickets, UnrecognizedNode, UnknownVoter, UsedBallotClaimTicket, InvalidBallot) import logging from cryptography.exceptions import InvalidSignature ...
""" :created: 2017-09 :author: <NAME> <<EMAIL>> """ from PySide2 import QtWidgets, QtCore, QtGui from pymel import core as pmc from auri.auri_lib import AuriScriptView, AuriScriptController, AuriScriptModel, is_checked, grpbox from auri.scripts.Maya_Scripts import rig_lib from auri.scripts.Maya_Scripts.rig_lib import...
''' Generate topology database for link state protocol. The topology database can then be used to generate network diagram. Pre-requisites: - Link type should be point-to-point links - For juniper equipment JunOS 11.4R9 or later is required NB: If pre-requisites are not met diagram data will still be u...
import datetime import os import numpy import torch from .abstract_game import AbstractGame class MuZeroConfig: def __init__(self): # More information is available here: https://github.com/werner-duvaud/muzero-general/wiki/Hyperparameter-Optimization self.seed = 0 # Seed for numpy, torch and t...
from __future__ import absolute_import import operator import re from collections import OrderedDict, Counter from math import exp, log, sqrt from sys import float_info from brainpy.mass_dict import nist_mass from brainpy.composition import ( PyComposition, parse_formula, calculate_mass, _make_isotop...
# -*- coding: utf-8 -*- """ Analyses of deflex. SPDX-FileCopyrightText: 2016-2021 <NAME> <<EMAIL>> SPDX-License-Identifier: MIT """ __copyright__ = "<NAME> <<EMAIL>>" __license__ = "MIT" import pandas as pd from oemof import solph from pandas.testing import assert_frame_equal def merit_order_from_scenario( sc...
import unittest import sys from SimPEG import * class TestCyl2DMesh(unittest.TestCase): def setUp(self): hx = np.r_[1,1,0.5] hz = np.r_[2,1] self.mesh = Mesh.CylMesh([hx, 1,hz]) def test_dim(self): self.assertTrue(self.mesh.dim == 3) def test_nC(self): self.asser...
# -*- coding: utf-8 -*- import numpy as np import plotly.graph_objects as go from plotly.offline import plot import ccp from ccp import Q_ from scipy.optimize import root_scalar, newton, toms748, ridder, bisect import plotly.express as px import pandas as pd def offset_to_tdc(array,tdc): while tdc < 0: ...