text
stringlengths
8.04k
46.5k
#!/usr/bin/env python2.7 from time import sleep from collections import namedtuple from smbus2 import SMBus import argparse #addr = 0x28 # I2C Address of the chip #bus = SMBus(1) # Raspi I2C bus # BCM-GPIO04 is on pin 7 of the header #reset_pin = 4 #gpio.setmode(gpio.BCM) #gpio.setup(reset_pin, gpio.OUT) #def hard_re...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import torch import torch.nn as nn from torch.nn import functional as F import torch.distributions as dist device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') def weights_init(m): if isinstance(m, nn.Conv2d): nn.init.kaiming_uni...
import sys import os import re import binascii import time from threading import Thread from PyQt5.QtCore import QFile, QFileInfo, QSettings, Qt, QTextStream, QTimer, QThread, QRegExp, QElapsedTimer,QEvent, pyqtSignal from PyQt5.QtWidgets import QStyleFactory,QSizePolicy, QMainWindow, QTextEdit, QAction, QApplication,...
import os import json import copy import time import torch import numpy as np import argparse from tqdm import tqdm import meshio import scipy.optimize import matplotlib.pyplot as plt from multiprocessing import Pool from amortized_synthesis.utils import add_args, load_from_file, resample from torch.utils.data import D...
import tensorflow as tf import numpy as np import os import numpy as np from datetime import datetime from tqdm import tqdm from core.log import * from core.utils import * from core.capsLayer import CapsLayer # An alternative to tf.nn.rnn_cell._linear function, which has been removed in Tensorfow 1.0.1 # The highwa...
# loss tracking nov 2020 import warnings from copy import deepcopy import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator from matplotlib.markers import MarkerStyle def calc_adam_bias_corrector(tmax=None, beta1=0.9, beta2=0.999, resets=[], times=None): ...
"""Plot adaptation cost ranges (provincial results) """ import sys import os import ast import matplotlib as mpl import matplotlib.patches as mpatches import matplotlib.pyplot as plt import numpy as np import pandas as pd import copy from matplotlib import cm from vtra.utils import * mpl.style.use('ggplot') mpl.rcPara...
# Copyright 2014 Google 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 # # Unless required by applicable law or agre...
#--------------------------------------------------------------------------- # Copyright 2012 The Open Source Electronic Health Record Agent # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
"""Shared utilities for writing communication links. Communication links implement passing of data between two different endpoints. """ # Builtins import logging import struct from collections import Counter, OrderedDict # Packages from bidict import bidict from phylline.links.events import ( DataEventLink, E...
from sklearn.externals import joblib import rouge.rouge_score as r import nltk nltk.download('punkt') import re from xml.etree import ElementTree from nltk import sent_tokenize,word_tokenize import os import pandas as pd import numpy as np import json from numpy import dot from numpy.linalg import norm from tika import...
# Modifications Copyright 2016-2017 Reddit, Inc. # # Copyright 2013-2016 DataStax, 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 # # Unle...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # Copyright 2016 Rackspace 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://w...
"""This file contains decomposition functions as objects. The decompositions can additionally include a state object that the agent keeps track of and returns for the next decomposition (ie location of the construction paper for increments).""" import copy import numpy as np import stimuli.subgoal_tree as sgt import i...
""" MIT License Copyright (c) 2020 Node Sharer Devs 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, merg...
import re import rdkit from rdkit import Chem from rdchiral.template_extractor import extract_from_reaction, get_changed_atoms, mols_from_smiles_list, \ replace_deuterated import pickle import torch import numpy as np BONDTYPES = ['NONE', 'AROMATIC', 'DOUBLE', 'SINGLE', 'TRIPLE'] BONDTOI = {bond: i for i, bond in...
"""SoCo-CLI interactive mode handler.""" import logging import subprocess import sys # Readline is only available on Unix try: import readline RL = True UNIX = True WINDOWS = False except ImportError: RL = False WINDOWS = True UNIX = False from os import chdir from shlex import split as...
#!/usr/bin/env python3 import sys import logging import argparse import unittest __author__ = '<NAME>' __license__ = 'BSD-3-Clause' __version__ = '0.0.1-dev' __email__ = '<EMAIL>' usage = """%(prog)s -i INPUT_ALIGN -g GENE_TABLE -o OUTPUT_PROFILE [options]""" description = """examples: %(prog)s -i read_map.txt -g...
## Copyright (c) 2001-2019, <NAME> ## January 2009 # (converted from IDL) ## August 2009 ## May 2010 (renamed *Data_Prefix to *Site_Prefix) #------------------------------------------------------------------- # Functions: # # TF_Use_CCA() # TF_Set_Test_Info() # (6/23/10) # TF_Test_Directory() ...
#!/usr/bin/env python #-*- coding:utf-8 -*- # Test platforms: # + macOS # - release: macOS 10.15.5 (Catalina) # - python: Python 3.10.1 # - require: (None) # + Windows # - release: Windows 7 Ultimate (SP1) # - python: Python 2.7.18 # - require: (None) # + Linux # - release: RHEL ...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Needs freetype-py>=1.0 # Implements multi-pass solution to setting an exact font height # Some code adapted from <NAME>'s work at the following URL # https://dbader.org/blog/monochrome-font-rendering-with-freetype-and-python # With thanks to <NAME> @ironss for various...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ------------------------------------------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Standard Import Libraries import re import os import sys import time import datetime import requests import json import threading import traceback import queue # import uuid # To be used eventually import base64 # Slack, Flask, and mysql.connector Import Libraries fro...
""" Code adapted from https://github.com/dmlc/dgl/tree/master/examples/pytorch/dgmg """ from functools import partial import dgl import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Bernoulli, Categorical import torch.nn.init as init def weights_init(m): ''' Code...
from urllib.parse import quote from django.db.models import Q from django.http import JsonResponse, FileResponse from django.shortcuts import render, redirect from common import rds from common.excel_operation import excel_to_pro, export_purchase_list # Create your views here. from common.file_operation import purch...
import os import re from typing import AnyStr, Iterable, Optional, Dict from easysnmp import EasySNMPTimeoutError from pexpect import TIMEOUT from transliterate import translit from django.utils.translation import gettext_lazy as _, gettext from django.conf import settings from djing.lib import RuTimedelta, safe_int, ...
# # # This example shows the diffraction by a Si 111 crystal calculated in its simplest implementation: # # # - calculate_simple_diffraction() # Uses a crystal setup and calculates the complex transmitivity and reflectivity # # import numpy from crystalpy.diffraction.GeometryType import BraggDiffraction, Brag...
# 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 appli...
"""""" import time import logging from typing import Any, Generator, Iterable, List, Optional, Tuple import tweepy from tweepy.models import User import sqlalchemy as sqla from sqlalchemy.orm import Session from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.decl_api import DeclarativeMeta L...
from __future__ import print_function import os from collections import defaultdict import gzip import pandas as pd import psycopg2 import re import pdb from energyPATHWAYS.error import * pd.set_option('display.width', 200) def mkdirs(newdir, mode=0o770): """ Try to create the full path `newdir` and ignore ...
import string import threading import socket import re import os import gc as garbage_collector import sys import random if sys.platform == "linux": import resource import time import json from argparse import Namespace from resotolib.logging import log from functools import wraps from pprint import pformat from t...
from __future__ import division from textwrap import dedent import colorsys import numpy as np from scipy import stats import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt import matplotlib.collections as clt...
import itertools from collections import Counter from typing import Callable, Dict, Iterable, List, Tuple import pandas as pd from vivarium.framework.engine import Builder from vivarium.framework.event import Event from vivarium.framework.population import SimulantData from vivarium_public_health.metrics import Mort...
# -*- coding: utf-8 -*- import collections import gzip import itertools import io import logging import math import re import sys import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt plt.switch_backend('agg') import numpy as np import seaborn as sns from .amino_acids import _SUBSTITUTION_MATRICES...
# Python import re # Genie from genie.metaparser import MetaParser from genie.metaparser.util.schemaengine import Schema, Optional class ShowSslproxyStatusSchema(MetaParser): ''' Schema for show sslproxy status''' schema = { 'configuration': { Optional('ca_cert_bundle'): str, '...
import torch import numpy as np from torch import nn from base import PDE def gauss_pt_eval(tensor, N, nsd=2, stride=1): if nsd == 2: conv_gp = nn.functional.conv2d elif nsd == 3: conv_gp = nn.functional.conv3d result_list = [] for i in range(len(N)): result_list.append(conv_gp...
# -*- coding: utf-8 -*- # pylint: disable=invalid-name, protected-acess, bare-except """\ CML Simulation -------------- This module defines :class:`CMLSimulation` that provides a pythonic interface to detail with a CML case directory. In addition to implementing methods to perform actions, it also tracks the state of...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import fmt_money, formatdate, format_time, now_datetime, \ get_url_to_form, get_url_to_list, flt f...
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 <NAME> (<EMAIL>), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # ...
''' Example of API usage on how to work with this library Tests almost everything. ''' from sclrecommender.mask import MaskGenerator from sclrecommender.mask import RandomMaskGenerator from sclrecommender.mask import LegalMoveMaskGenerator from sclrecommender.matrix import RatingMatrix from sclrecommender.matrix impor...
#!/usr/bin/env python """ json2z3.py Copyright (c) Seoul National University Licensed under the MIT license. Author: <NAME> Encode json-formatted constraints to z3 formula, solve it, and return constraint conditions. """ from z3 import * from enum import Enum from functools import reduce from pathlib import Path imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015-2016 France-IOI, MIT license # # http://opensource.org/licenses/MIT # This script starts a server, fetching jobs from the graderqueue and sending # them to the taskgrader. # See https://github.com/France-ioi/graderqueue . import argparse, io, json,...
""" Copyright (c) 2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
import sys import pygame from pygame.locals import * import random import math try: from OpenGL.GL import * from OpenGL.GLU import * except: print ('The GLCUBE example requires PyOpenGL') raise SystemExit #BitBot Shape bit_bot_vertices = ( (-0.25, -0.25, 0.0),#p0: bottom front left (-0.25, 0.2...
# Procedurally generated duel cog for Red-DiscordBot # Copyright (c) 2016 <NAME> # Idea and rule system courtesy of Axas # Additional moves suggested by OrdinatorStouff import asyncio import discord from functools import partial import math import os import random from redbot.core import checks, commands, Config, ban...
import sys from typing import Set import pyautogui, pyaudio, audioop, threading, time, win32api, configparser, mss, mss.tools, cv2, numpy from dearpygui.core import * from dearpygui.simple import * import random, os from datetime import datetime # Loads Settings parser = configparser.ConfigParser() try: ...
import pandas as pd from scipy import sparse import numpy as np from os.path import join class doctor: ''' Class of all doctors of one speciality. Contains info on number of patients, maximum capacity, municipality, district and federal state, and during the patient displacements also number...
"""Tests for the Aetherling 1D Line Buffer.""" import sys import random from itertools import chain from magma.simulator.coreir_simulator import CoreIRSimulator from magma.backend.coreir_ import CoreIRBackend from magma.frontend.coreir_ import GetCoreIRModule, GetCoreIRBackend from magma import * from magma.bitutils ...
#!/usr/bin/env python3 import numpy as np import copy as cp import os import pickle import sys import warnings import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from lib import regression as reg from lib import metrics from lib import bootstrap as bs from lib import cross_valida...
# -*- coding: utf-8 -*- ############################################################################### # This file is part of metalibm (https://github.com/kalray/metalibm) ############################################################################### # MIT License # # Copyright (c) 2018 Kalray # # Permission is here...
import datetime import random from time import sleep from time import time import shortuuid from sqlalchemy import text from sqlalchemy import orm from sqlalchemy import exc from sqlalchemy.orm import selectinload from sqlalchemy import insert from sqlalchemy import delete from collections import defaultdict import arg...
#!/usr/bin/env python # # Copyright (C) 2013-2014 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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 a...
""" functions and objects used to detect peaks. """ import numpy as np from scipy.signal import _peak_finding from scipy.signal import find_peaks from scipy.signal import argrelmax from scipy.signal.wavelets import ricker, cwt from scipy.integrate import trapz from scipy.interpolate import interp1d from scipy.stats im...
""" This script generates a self-contained installation of the EBCLI. Prerequisites: 1. Python + pip (preferably Python 3.7, although Python 2.7, 3.4, 3.5, 3.6, and 3.7 are supported) 2. virtualenv 3. Bash/Zsh on Linux/MacOS ; PowerShell/CMD Prompt on Windows Usage: To execute script: ...
# Copyright 2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 __future__ import print_function, division import unittest import os class ModSuiteSanity(unittest.TestCase): def setUp(self): pass def tearDown(self): # Clean up example output from KeplerEllipseModel example if os.path.isfile("kemExample.tmp"): os.remove("kemExampl...
# -*- coding: utf-8 -*- """Device class module for Hekr API""" import asyncio import logging from json import dumps, loads from typing import Optional, Any, TYPE_CHECKING, Dict, Set, Callable, Union from aiohttp import ClientSession, WSMsgType, client_exceptions from .aioudp import open_remote_endpoint from .command ...
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. # See file LICENSE for terms. import array import asyncio import gc import logging import os import struct import weakref from functools import partial from os import close as close_fd from random import randint import psutil from . import comm from...
# Copyright (c) 2013 Rackspace, Inc. # Copyright 2014 Catalyst IT 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 # # Unless required by...
"""Command line interface to bridge-sim. Run './scripts/cli.sh' from the root directory of the cloned 'bridge_sim' repository. """ import os import pdb import sys import traceback import click from bridge_sim.configs import opensees_default from bridge_sim.internal.validate import _truck1_x_pos from bridge_sim.int...
import numpy as np import astropy.io.ascii from scipy import optimize import scipy.linalg from desimeter.match_positioners import match import scipy.spatial # accommodate both use in online system and in datasystems environment # use online system logging when available try: import DOSLib.logger as log log.wa...
""" """ import sys from abc import ABC, abstractmethod from typing import Any, Sequence, Dict, List, Optional, Callable from copy import copy,deepcopy from logging import INFO, DEBUG, ERROR from datetime import datetime from vnpy.event import Event, EventEngine from .event import ( EVENT_TICK, EVENT_BAR, ...
#!/usr/bin/env python3 # Copyright (c) 2021 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. from functools import partial from http.server import BaseHTTPRequestHandler, HTTPServer from io import BytesIO from test_framework.test_framework import BitcoinTestFram...
import logging import os import threading import traceback import time import shutil import uuid from collections import namedtuple from contextlib import closing from datetime import timedelta from typing import Dict, Set, Union, List import codalab.worker.pyjson from .bundle_service_client import BundleServiceClient...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 <NAME> <<EMAIL>> # # This code is distributed under the terms and conditions # from the MIT License (MIT). """ Utilities for streaming from several file-like data storages: S3 / HDFS / standard filesystem / compressed files..., using a single, Pytho...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Check for stylistic and formal issues in .rst and .py # files included in the documentation. # # 01/2009, <NAME> # TODO: - wrong versions in versionadded/changed # - wrong markup after versionchanged directive """Sphinx rst linter. """ __version__ = "0.1" impo...
from __future__ import print_function import re, sys, os, time, glob, errno, tempfile, binascii, subprocess, shutil from lxml import etree from optparse import OptionParser import textwrap import string VERSION = '0.1' __all__ = ['DoxyGen2RST'] LINE_BREAKER = "\n" MAX_COLUMN = 80 def is_valid_uuid(uuid_string): u...
import logging import os import warnings from pathlib import Path from typing import Dict, Iterable, Union import nibabel as nib import numpy as np import pandas as pd import tqdm from nilearn.image import resample_to_img from nipype.interfaces.ants import ApplyTransforms from nipype.interfaces.freesurfer import ( ...
# coding=utf-8 # Copyright (...) and The HuggingFace Inc. team. # # 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 appli...
# coding=utf-8 """Vertices and indices for a variety of simple shapes""" import math import numpy as np import sys import os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from grafica.assets_path import getAssetPath __author__ = "<NAME>" __license__ = "MIT" # A simple class conta...
from __future__ import division from __future__ import print_function from __future__ import absolute_import import math import numpy from tvtk.api import tvtk from . import conditions from . import stimulus_positions import flydra_core.geom as geom def draw_cubic_solid(origin, size): actors = [] x = numpy.ar...
import torch from torch.autograd import Function, Variable from torch.nn import Module from torch.nn.parameter import Parameter import numpy as np import numpy.random as npr from collections import namedtuple from enum import Enum import sys from . import util from .pnqp import pnqp from .lqr_step import LQRStep f...
"""Sony-TAu Realistic Spatial Soundscapes (STARSS) 2022 Dataset Loader .. admonition:: Dataset Info :class: dropdown *Sony-TAu Realistic Spatial Soundscapes: sound scenes in various rooms and environments, together with temporal and spatial annotations of prominent events belonging to a set of target classes....
# mmpdb - matched molecular pair database generation and analysis # # Copyright (c) 2015-2017, <NAME> Ltd. # Copyright (c) 2019, <NAME> Scientific, AB # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
from datetime import datetime from pathlib import Path from typing import Any, Callable, Dict, List, Optional # noinspection PyUnreachableCode if False: # noinspection PyUnresolvedReferences from _stubs import * from _stubs.PopDialogExt import PopDialogExt from .components.SettingsExt import UserSettings from .co...
#!/usr/bin/python3 # Copyright (c) 2021, Ciena Corporation. All rights reserved. # Copyright (c) 2021, AT&T Intellectual Property. All rights reserved. # # SPDX-License-Identifier: LGPL-2.1-only """ Support for the ublox GNSS device in the S9500 30XS platform. """ from enum import Enum, unique import argparse impor...
import numpy as np import theano import theano.tensor as tensor import gzip, pickle import socket, time def floatX(arr): """Converts data to a numpy array of dtype ``theano.config.floatX``. Parameters ---------- arr : array_like The data to be converted. Returns ------- numpy nda...
""" This module will guide the forcing engine in defining parameters in all input forcing products. These parameters include things such as file types, grid definitions (including initializing ESMF grids and regrid objects), etc """ import numpy as np from core import time_handling from core import regrid from core im...
from __future__ import print_function from __future__ import absolute_import from past.builtins import basestring import moby2 import numpy as np from .pcg_filters import PCG_filter_list from .pol_map import IQUMap def ravel_dot(a, b): # Where a and b have the same, multiple, dimensions. return (a*b).sum() c...
#!/usr/bin/env python3 import argparse import atexit from contextlib import ExitStack from json import dump from os import makedirs, path import random import signal import sys from time import time import joblib import numpy as np import rpyc import tensorflow as tf # for some reason "import tensorflow.python.debug"...
""" GT Check for Updates - This script compares your current GT Tools version with the latest release. @<NAME> - <EMAIL> - 2020-11-10 - github.com/TrevisanGMW 1.1 - 2020-11-11 Fixed a few issues with the color of the UI. Updated link to show only latest release. The "Update" button now is disabled after ...
#!/usr/bin/python3 import argparse import copy import itertools import math import numpy as np import operator import os import random import sys from collections import namedtuple import vi.ea.adult_selection import vi.ea.fixed_int_vector import vi.ea.parent_selection import vi.ea.reproduction import vi.ea.system ...
# coding=utf-8 # Copyright 2019 The SEED Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
import logging import os import shutil from itertools import islice from typing import Any, Dict, List, Optional, Set, cast import more_itertools import torch import torch.distributed as dist from more_itertools import chunked from torch.utils.data import DistributedSampler from tango.common.dataset_dict import Datas...
#!/usr/bin/python # _____________________________________________________________________________ # Modified Author implementation # Twin Delayed Deep Deterministic Policy Gradients (TD3) # Paper: https://arxiv.org/abs/1802.09477 # ---------------- # import libraries # ---------------- # standard libraries # ----- i...
#!/usr/bin/env python3 import sys import cv2 import glob import logging import numpy as np import tkinter as tk import tkinter.messagebox as pop_msg import os from tkinter import ttk import tkinter.filedialog as filedialog from PIL import Image, ImageTk import threading as td import subprocess from threading import RL...
# # Copyright 2014-2015 University of Southern California # Distributed under the (new) BSD License. See LICENSE.txt for more info. # """Volume rendering support. A stateful VolumeRenderer implementing the canonical two-pass ray-casting algorithm, with optional clipping and slicing tools and a near-clipping plane fo...
""" _init() is invoked at startup: If authority is "file" or "file-strict": This may invoke _read(), but only if the file exists (if cell is non-empty and is different, a warning is printed) ("file-strict": the file must exist) If not, this may invoke _write(), but only if the cell is non-empty If authority...
import sys import time import colorsys from PIL import Image, ImageQt import numpy as np from keras import backend as K from keras.models import load_model from keras.layers import Input from PIL import Image, ImageFont, ImageDraw from yolo3.model import yolo_eval, yolo_body, tiny_yolo_body, yolo_eval_mine...
import sys import discord from discord.ext import commands from mods.cog import Cog from utils import checks from utils.funcs import query_prefix from utils.paginator import CannotPaginate, Pages class Commands(Cog): def __init__(self, bot): super().__init__(bot) self.truncate = bot.funcs.truncate self.find_...
# %% import math import multiprocessing as mp import numpy as np import pandas as pd import pickle import string from sklearn.dummy import DummyClassifier from sklearn.calibration import CalibratedClassifierCV from sklearn.ensemble import RandomForestClassifier, VotingClassifier from sklearn.linear_model import Logist...
import logging as _logging import numpy as _np import pandas as _pd from gn_lib.gn_const import J2000_ORIGIN as _J2000_ORIGIN, C_LIGHT as _C_LIGHT, SISRE_COEF_DF as _SISRE_COEF_DF from gn_lib.gn_io.common import path2bytes as _path2bytes from gn_lib.gn_io.sp3 import diff_sp3_rac as _diff_sp3_rac, read_sp3 as _read_sp...
import collections import operator import django.utils.timezone from django import forms from django.apps import apps from django.conf import settings from django.core import validators from django.db import models, transaction, IntegrityError from django.db.models.signals import post_save from django.dispatch import ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 Kyoto University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Transformer encoder.""" import copy import logging import math import numpy as np import random import torch import torch.nn as nn from neural_sp.models.modules.i...
''' Author : ZHP Date : 2021-11-13 10:57:27 LastEditors : ZHP FilePath : /models/pointnet/pointNet2_Ops.py Description : PointNet++ 中的Ops Copyright : ZHP ''' import torch import torch.nn as nn import torch.nn.functional as F import numpy as np # from .pointNetUtils import TNetkd from torchsummary...
#!/usr/bin/python #-*-encoding:utf-8-*- from __future__ import print_function import os, sys, shutil, subprocess, logging, time, re, platform, traceback from datetime import datetime from copy import copy class ASimpleNameSpace(object): def __str__(self): d = {} attrs = dir(self) for a in ...
from __future__ import absolute_import import functools from . import blocks from . import legos from . import pedrpc from . import primitives from . import sex from .blocks.request import Request from .blocks.block import Block from .blocks.checksum import Checksum from .blocks.repeat import Repeat from .blocks.size...
import discord from discord_slash import SlashCommand, SlashContext import os from keep_alive import keep_alive import re import time import requests import glob, random from dotenv import load_dotenv load_dotenv() # emoji info https://gist.github.com/scragly/b8d20aece2d058c8c601b44a689a47a0 # discord.py docs https:/...
''' Created on Apr 23, 2013 @author: <NAME>, 2nd Look Consulting http://www.2ndlookconsulting.com/ Copyright (c) 2013, <NAME>, Argonne National Laboratory All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following c...