text
stringlengths
8.04k
46.5k
""" This module contains test cases for the module collatz.commons. """ # Imports from math import log2 import pytest import numpy as np from collatz import commons as com def test_collatz_sequence(): """ Test case for the method collatz_sequence. :return: None """ # Test different sequences ...
"""============== Motif pipeline ============== The motif pipeline runs a set of motif discovery and enrichment analysis on a set of intervals. * Motif discovery using MEME * Motif detection using MAST * requires a set of known motifs Usage ===== See :ref:`PipelineSettingUp` and :ref:`PipelineRunning`...
import torch import torch.nn.functional as F from torch import logsumexp from torch import Tensor import torch.nn as nn import math import numbers import time class HigherOrderActivation(nn.Module): actfun = None p = None k = None g = None shuffle_maps = None def __init__(self, inplace=Fals...
#!/usr/bin/env python ## Program: PypeS ## Module: $RCSfile: pypescript.py,v $ ## Language: Python ## Date: $Date: 2006/05/26 12:36:30 $ ## Version: $Revision: 1.18 $ ## Copyright (c) <NAME>, <NAME>. All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHOUT A...
import subprocess import os import shutil import re import warnings from schrodinger import structure from template.chargeHandler import ChargeHandler from itertools import groupby try: from PlopRotTemp.PlopRotTemp import preproces_file_lines, find_bonds_in_mae, find_resnames_in_mae, find_names_in_mae, xyz2int exc...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import sys import rospy import re import time import numpy import argparse import math import underworlds import tf2_ros import message_filters from collections import deque from underworlds.helpers.geometry import get_world_transform from underworlds.tools.loader import M...
#Reader for the coco panoptic data set for pointer based image segmentation import numpy as np import os import scipy.misc as misc import random import cv2 import json import threading ############################################################################################################ def rgb2id(color): # Conv...
# # csg.py # pycsg # # Created by <NAME> (billy1380) on 6 Dec 2014. # Copyright © 2014 SPACEHOPPER STUDIOS Ltd. All rights reserved. # import math # # License # # Copyright (c) 2011 <NAME> (http://madebyevan.com/), under the MIT license. # class Csg: """ Constructive Solid Geometry (CSG) is a modeling technique ...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: menu.py # Purpose: # # Author: wukan # # Created: 2019-01-16 # Copyright: (c) wukan 2019 # Licence: GPL-3.0 #------------------------------------------------------------------...
""" Generally useful mixins for view tests (integration tests) of any project. """ import sys from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.contrib.messages.storage.fallback import FallbackStorage from django.contrib.sessions.middleware import SessionMiddleware fro...
from collections import defaultdict import math import numpy as np import pandas as pd import re def get_gene_id(row): if "gene_name" in row["attribute"]: return row["attribute"].split("gene_name")[-1].split('"')[1] elif ";gene=" in row["attribute"]: return row["attribute"].split(";gene=")[-1].split(";")[...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2010, <NAME>, 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: # # * Redistributions of source code must r...
''' Feature Extraction and Image Processing <NAME> & <NAME> http://www.southampton.ac.uk/~msn/book/ ImageRegionUtilities: Helper module to process regions and line segments ''' # Images from ImageUtilities import imageReadL, createImageF, createImageL, showImageL, createVectorF from ImageOperatorsUtilities import ap...
import sys import numpy as np import SimpleITK as sitk from skimage import filters, measure from scipy.stats import truncnorm, uniform import random from math import pi from .utils import get_study_uid, one_hot_encode class Compose(object): def __init__(self, transformers): self.transformers = transform...
''' Commands to aggregate the frames to MP4: for high resolution: ffmpeg -r 48 -i frames/primaryschool/%05d.png -vcodec libx264 -pix_fmt yuv420p -strict -2 -acodec aac clips/primaryschool.mp4 for twitter: ffmpeg -i frames/primaryschool2/%05d.png -pix_fmt yuv420p -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -ac...
""" Import as: import oms.process_forecasts as oprofore """ import asyncio import collections import datetime import logging import os from typing import Any, Dict, List, Optional import numpy as np import pandas as pd from tqdm.autonotebook import tqdm import core.config as cconfig import helpers.hdbg as hdbg impo...
#!/usr/bin/env python """ TODO: 1) Get rid of unused functions 2) Possibly move the cmap lookup to tool_utils. """ import matplotlib as mpl mpl.use('Agg') from .sentinel_map import SentinelMap,SentinelNorm import glob #import matplotlib.numerix.ma as ma from . import md_analysis_utils import sys import pylab,matplot...
# # General Electricity sector Decarbonization Model (GEDM) # Copyright (C) 2020 <NAME>. # Licensed under the MIT License (see LICENSE file). # # Module note: # Functions for import settings at zone level # from copy import deepcopy from numpy import genfromtxt, zeros, roll import cls_process import impt_country de...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from .constants import constant_atomlabel, constant_aminoacid_code, constant_aminoacid_code_reverse from .utils import sort_dict_by_key from difflib import ndiff ''' The program extracts atomic information from a truncated pdb file that is exported...
############################## Import Libraries ############################### ## Math Library import numpy as np ## Library used to fit a 2d function import scipy.optimize as opt ############################## Local Definitions ############################## def background_stats(data): # Reshapes and reorganiz...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import os import queue import sys import time from .model import DeepSpeechReconstructionModel, get_variable_by_name LOG_LEVEL_INDEX = sys.argv.index('--log_level') + 1 if '--log_level' in sys.a...
""" Original code from <NAME> for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by <NAME> and <NAME> Adapted for CS294-112 Fall 2018 by <NAME> and <NAME> """ import numpy as np import tensorflow as tf import torch.nn as nn import torch import gym import logz import os import time import ...
# -*- coding: utf-8 -*- import asyncio import aioredis import sys, base64 import logging import ujson import time import websockets from gmqtt import Client as MQTTClient import uvloop from ..caller import Caller asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) STOP = asyncio.Event() ClientS = set() loop = asyn...
#!/usr/bin/python3 # Author: GMFTBY # Time: 2020.2.7 ''' Seq2Seq in Transformer, implemented by Pytorch's nn.Transformer ''' import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init import math import random import numpy as np import pickle import ipdb import sys import types im...
#encoding: utf-8 from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import str from builtins import range from past.builtins import basestring from builtins import obje...
# /cmakeast/ast.py # # Tokenizes a CMake file and turn it into an AST # # See /LICENCE.md for Copyright information """Parse a CMake file to an abstract syntax tree with the following BNF. Word - (One) Type [type: Variable | Number | String | CompoundLite...
# 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...
# -*- coding: utf-8 -*- """ .. module:: geek :platform: Unix, Windows :synopsis: GEneralised Elementary Kinetics .. moduleauthor:: geek team [---------] Copyright 2018 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the Apac...
import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import gridspec import parmap import numpy as np import pandas as pd import os import shutil import cv2 import scipy.io as sio import scipy.signal from Specgram.Specgram import Specgram import glob2 f...
# Copyright 2021 MIT Probabilistic Computing Project # Apache License, Version 2.0, refer to LICENSE.txt import itertools import math import random from scipy.special import betaln from scipy.special import gammaln from .util_math import log_choices from .util_math import log_linspace from .util_math import logsumex...
# -*- coding: utf-8 -*- ################################################################################ # playlist.py - Teil von Kodi-Addon-ARDundZDF # Verwaltung der PLAYLIST # Kontextmenü s. addDir (Modul util) ################################################################################ # <nr>0</nr> ...
__author__ = 'yang.xu' import os import time import math import numpy as np import numpy.ma as ma import random import re import torch import torch.nn.functional as F import torch.nn as nn from torch.utils.data import TensorDataset, DataLoader from training_module import datasets # <--Tool functions font1 = {'colo...
# Copyright 2020-present, 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 applicable law o...
"""Quaternions and unit-quaternion splines.""" import math as _math import numpy as _np from . import _check_param class Quaternion: """A very simple quaternion class. This is the base class for the more relevant `UnitQuaternion` class. See the `notebook about quaternions`__. __ ../rotation/quater...
import datetime import os import struct from sys import version_info import spats_shape_seq from spats_shape_seq.mask import match_mask_optimized, Mask # not currently used in spats, but potentially useful for tools class FastqRecord(object): def __init__(self): self.recordNumber = 0 self.reset...
""" Evaluation Metrics for Object Detection. """ import os import math import warnings import numpy as np import mxnet as mx from collections import defaultdict __all__ = ['CocoDetMApMetric', 'VOC07MApMetric', 'WiderfaceDetMetric'] class CocoDetMApMetric(mx.metric.EvalMetric): """ Detection metric for COCO ...
"""Building blocks for various Neural Network architectures. Author: <NAME> Contact: <EMAIL> Date: May 2018 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import itertools import numpy as np import tensorflow as tf from . import _globa...
# -*- coding: utf-8 -*- """ Simple Data Protocol Date: 9.11.2017 @author: <NAME> @source http://damogranlabs.com/, https://github.com/damogranlabs """ import sys import threading import time as systime import crcmod import serial __version__ = 1.1 ################################################################## #...
import logging import numbers import os import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import qutip import scipy import sympy import theano import theano.tensor as T import theano.tensor.slinalg import seaborn as sns from .QubitNetwork import QubitNetwork from .theano_qutils impor...
#!/usr/bin/env python ############################################################################# # Copyright (C) 2018 OpenEye Scientific Software, Inc. ############################################################################# # # TERMS FOR USE OF SAMPLE CODE The software below ("Sample Code") is # provided to cu...
from itertools import count import numpy as np from constants import * from validations import helperFunctions from utils import * import math import services from datetime import timedelta, datetime import json from bson import ObjectId def calc_cummulative_pnl(df): dim = df.shape data = {} res = {} ...
#!/usr/bin/env python3 # # Copyright (c) 2004-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same direct...
# Copyright (c) 2018-2019 <NAME> and contributors. # bibmanager is open-source software under the MIT license (see LICENSE). __all__ = [ 'Bib', 'display_bibs', 'remove_duplicates', 'filter_field', 'loadfile', 'save', 'load', 'export', 'merge', 'init', 'add_entries', 'edi...
""" The Notebook is the entire RHS of the screen. It contains multiple Code Editors. The below code does these things: - All of the buttons in the top row. - Switching between Code Editors. - The Tooltips give little pop-ups when looking at widgets. """ import random import tkinter as tk from tkinter import ttk fro...
#!/usr/bin/python2.7 ''' DownloadHygeine - Fetch software and other media safely and easily. TODO: multiple git repos mostly non-interactive command line operations gpg - ugh, no one uses consistent means of signing stuff. back-burner! :'( once gpg is supported,allow per-source authenticators test mirrors least...
""" Functions for setting/updating lane events, route events, and code for changing lanes. """ from havsim.simulation import vehicle_orders def update_veh_after_lc(lc_actions, veh, timeind): """When a vehicle changes lanes, this function does all the necessary updates. When a vehicle changes lanes, we need ...
import os import time import json import urllib.parse import elist.elist as elel from kukibanshee import rfc6265 from kukibanshee import drone from kukibanshee import nozdormu from kukibanshee.Resources import public_suffixes as pub #pub.PUBLICSUFFIXES # class originException(Exception): pass # SETCKREJECTLOG = ...
''' Create an unified test_stub to share test operations @author: Mirabel ''' import os import time import zstacklib.utils.ssh as ssh import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_util as test_util import zstacklib.utils.shell as shell import zstacklib.utils.xmlobject as xmlobject import z...
""" Procedures needed for variable importance estimation. Created on Thu Dec 8 09:11:57 2020. @author: MLechner # -*- coding: utf-8 -*- """ from concurrent import futures import math import numpy as np import ray from mcf import mcf_forest_functions as mcf_forest from mcf import mcf_data_functions as mcf_data from m...
'''This class offers basic plot Functions for generating nice heatmaps. ''' from scipy.spatial.distance import pdist from scipy.cluster.hierarchy import linkage, dendrogram, cut_tree import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import pandas as pnd ################## #...
import re import logging from datetime import datetime from sqlalchemy import func, or_, DATE from dataactcore.models.domainModels import Zips, CityCode, ZipCity, DUNS from dataactcore.models.stagingModels import PublishedAwardFinancialAssistance from dataactcore.models.lookups import (ACTION_TYPE_DICT, ASSISTANCE_TY...
import json import re import sys import copy import types import inspect import keyword __all__ = ['configclass', 'field', 'Field', 'FrozenInstanceError', 'InitVar', 'MISSING', # Helper functions. 'fields', 'asdict', 'a...
""" PyColourChooser Copyright (C) 2002 <NAME> <<EMAIL>> This file is part of PyColourChooser. This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the i...
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portio...
from random import choice from random import uniform numerical_player_strengh = ["hp", "mp", "sp", "ep"] current_numerical_player_strength = ["current_hp", "current_mp", "current_sp", "current_ep"] current_maximum_player_strength = ["current_max_hp", "current_max_mp", "current_max_sp", "current_max_ep"] non_numerical...
#!/usr/bin/env python3 import sqlite3 import os import sys import glob import re import shutil import logging import json import tarfile import tempfile import argparse import urllib.parse import urllib import time import collections import requests from requests.adapters import HTTPAdapter from r...
"""Process Sentinel-1 data into interferograms using GAMMA""" import argparse import glob import logging import os import re import shutil import sys from datetime import datetime, timezone from pathlib import Path from secrets import token_hex from hyp3lib import GranuleError from hyp3lib.SLC_copy_S1_fullSW import S...
import codecs import logging import logging.config import os import shutil import subprocess from pathlib import Path from ctd_processing import former_cnv from ctd_processing import cnv_column_info from ctd_processing import exceptions from ctd_processing import former_seabird as seabird from ctd_processing import ps...
""" Utilities for isgm Best to keep these separate from the Class modules """ from __future__ import print_function, absolute_import, division, unicode_literals # Python 2 & 3 compatibility try: basestring except NameError: basestring = str import pdb import numpy as np import warnings from astropy import c...
import json import numpy as np import pandas as pd from scipy.optimize import linear_sum_assignment from scipy.spatial import KDTree, distance_matrix from tqdm import tqdm import sys sys.path.insert(1, '/home/xview3/src') # use an appropriate path if not in the docker volume from xview3.processing.constants import P...
""" Author: <NAME> <<EMAIL>> Copyright (c) 2016-2017 University of Oxford, <NAME> """ from __future__ import division, unicode_literals, absolute_import, print_function import sys import os import time import traceback import re import tempfile from PySide2 import QtGui, QtCore, QtWidgets from quantiphyse.gui.optio...
""" utils """ import shutil import torch import os import numpy as np from datetime import datetime import time import pandas as pd from .losses import * from .datasets import * import bisect from tqdm import tqdm import re def save_checkpoint(state, is_best, filename, dir): new_filename = os.path.join(dir, filena...
import torch.nn as nn import torch.nn.functional as F from .position_encoding import * from typing import Optional from torch import Tensor import copy def aligned_bilinear(tensor, factor): assert tensor.dim() == 4 assert factor >= 1 assert int(factor) == factor if factor == 1: return tensor ...
"""defines a Tensor Network, which is the class that holds most of our genome information""" import copy import itertools import json import time import random import tensorflow as tf import networkx as nx from matplotlib import pyplot as plt from tensorEvolution import tensor_encoder, evo_config from tensorEvolution.n...
import pytest import sqlparse from typing import Tuple, List, Optional from unittest.mock import patch, MagicMock from sql_translate.engine import global_translation from sql_translate import utils GHTP = global_translation.GlobalHiveToPresto() def test_create_parent() -> None: _GlobalHiveToPresto = global_trans...
""" Test our tools for recovering metadata from the data pool """ import json import logging import os import time import traceback from io import BytesIO from collections import namedtuple, defaultdict from textwrap import dedent from teuthology.orchestra.run import CommandFailedError from tasks.cephfs.cephfs_test...
""" Module defining data collections """ import re import warnings from enum import Enum, EnumMeta from typing import Tuple from dataclasses import dataclass, asdict, field from aenum import extend_enum from .config import SHConfig from .constants import ServiceUrl from .exceptions import SHDeprecationWarning class...
from gym_hls.envs import getcycle from gym_hls.envs import getfeatures import os import datetime import glob import shutil import numpy as np import gym from gym.spaces import Discrete, Box, Tuple import sys from IPython import embed import math import pickle class HLSEnv(gym.Env): """ Attributes: pass_len...
# Copyright 2018 the pycolab 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function import os import six.moves.tkinter as Tk import six.moves.cPickle as pickle import sys import argparse import numpy as np import matplotlib matplotlib.use('TkAgg') from matplotlib.backends.backen...
import math import numpy as np from pymatgen.core.structure import Structure from pymatgen.core.lattice import Lattice from pymatgen.core.sites import PeriodicSite try: from pymatgen.util.coord import lattice_points_in_supercell except ImportError: from pymatgen.util.coord_utils import lattice_points_in_superc...
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Database interface for all calls from Chromite. BuildStore will be the interface which communicates between CIDB, Buildbucket ...
import abc import logging import random from abc import abstractmethod, ABCMeta from collections import deque, namedtuple, defaultdict from contextlib import contextmanager import threading import time from itertools import combinations from numbers import Number from threading import Thread, Condition from typing impo...
"""Client classes to query data from a perfsonar MA.""" import calendar import copy import datetime import json import pprint import warnings import requests from ..util import add_apikey_header import urllib3 urllib3.disable_warnings() #disable warnings when ssl verification disabled # URI prefix segment - to cha...
#!/usr/bin/python3 # tkinter modules from tkinter import Frame, Label, SUNKEN, PhotoImage, ttk, messagebox # Built-In modules import os from os.path import join, isfile, isdir import datetime # Custom function modules from timescan_plot import timescanplot from depletion_plot import depletionPlot from just_plot impo...
# Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO # 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 ...
import os import sys import time import tkinter as tk import threading import socket import pyaudio from tkinter import Button, PhotoImage, ttk import selectors from threading import Thread import struct from PIL import ImageTk, Image LARGE_FONT= ("Verdana", 12) logo_png = os.path.dirname(os.path.realpath(__file__))+'...
# -*- coding: utf-8 -*- from decimal import Decimal, localcontext, ROUND_HALF_EVEN import datetime import re from django.conf import settings from django.contrib.auth.models import User from django.core.validators import RegexValidator from django.db import models from django.utils.translation import ugettext_lazy as ...
# This file is Copyright (c) 2013-2014 <NAME> <<EMAIL>> # This file is Copyright (c) 2014-2019 <NAME> <<EMAIL>> # This file is Copyright (c) 2018 Dolu1990 <<EMAIL>> # This file is Copyright (c) 2019 <NAME> <<EMAIL>> # This file is Copyright (c) 2019 <NAME> <<EMAIL>> # This file is Copyright (c) 2018 <NAME> <<EMAIL>> # ...
""" Power Flow Analysis: Support Functions Created By: <NAME> <NAME> """ import numpy as np from numpy.linalg import inv import pandas as pd """ Imports Bus and line data from excel sheets Takes in an array containing ['File Location', 'Sheet Name'] Returns two panda data frames for the bus ...
# -*- coding: utf-8 -*- # Copyright © 2014-2018 GWHAT Project Contributors # https://github.com/jnsebgosselin/gwhat # # This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox). # Licensed under the terms of the GNU General Public License. # ---- Standard Library imports import os import os.path as osp ...
r""" Tensor Algebras AUTHORS: - <NAME> (2014-01-24): Initial version .. TODO:: - Coerce to/from free algebra. """ #***************************************************************************** # Copyright (C) 2014 <NAME> <tscrim at ucdavis.edu> # # Distributed under the terms of the GNU General Public Licens...
import json import string import uuid from collections import defaultdict from copy import copy from datetime import datetime from django.apps import apps from django.conf import settings from django.db import models from django.utils import timezone from django.utils.functional import cached_property from django.uti...
"""Utilities for testing the Everflow feature in SONiC.""" import os import logging import random import time import ipaddr import binascii import pytest import yaml import ptf.testutils as testutils import ptf.packet as packet from abc import abstractmethod from ptf.mask import Mask from tests.common.helpers.asserti...
"""Contains base classes for UI elements that deal with lists of entries, that can be scrolled through using arrow keys. Best example of such an element is a Menu element - it has menu entries you can scroll through, which execute a callback when you click on them. """ from copy import copy from time import sleep fro...
# -*- coding: utf-8 -*- ''' Code to execute and evaluate fragmenting molecules into molecular subgroups MIT License Copyright (C) 2019, <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 ...
import itertools import json import linecache import math import os import pickle import socket from logging import getLogger from pathlib import Path from typing import Callable, Dict, Iterable, List, Tuple, Union import git import numpy as np import torch import torch.distributed as dist from rouge_score import roug...
""" auralib module containing plotting functions and related stuff... Author: <NAME> Created: 20-Jan-2017 Last Mod: 20-Aug-2016 """ import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.widgets import MultiCursor import numpy as np def t2xy(d1, d2, d3, norm=True)...
from pytorch_pretrained_bert.modeling import ( BertPreTrainedModel as PreTrainedBertModel, # The name was changed in the new versions of pytorch_pretrained_bert BertModel, BertLayerNorm, gelu, BertEncoder, BertPooler, BertEmbeddings ) import torch from torch import nn from utils import ( ...
import sys import time import traceback import pygame.mixer from pygame.locals import * import bullet import enemyplan import myplan import supply from enemyplan import * # 初始化 pygame.init() pygame.mixer.init() # 帧数对象创建 clock = pygame.time.Clock() # 设置屏幕大小 size = width, height = 512, 900 screen = pygame.display.se...
import time __author__ = '<NAME>' import os import struct import array import struct from socket import htons, ntohs from powscan_common.networking_helper import * import abc class Packet(object): __metaclass__ = abc.ABCMeta def _checksum(self, msg): s = 0 if len(msg) % 2 != 0: ...
#!/usr/bin/env python # Copyright 2012 <NAME> and Canonical Inc # Copyright 2014 SoftLayer Technologies, 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 ...
import os import numpy as np import pybullet as p from surrol.gym.surrol_goalenv import SurRoLGoalEnv from surrol.robots.psm import Psm1, Psm2 from surrol.utils.pybullet_utils import ( get_link_pose, wrap_angle, reset_camera ) from surrol.utils.robotics import ( get_euler_from_matrix, get_matrix_fro...
# 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, Version 2.0 (the # "License"); you may not u...
import sublime import sublime_plugin import re import os from OrgExtended.orgparse.sublimenode import * import OrgExtended.orgutil.util as util from OrgExtended.orgutil.util import * import logging import OrgExtended.orgdb as db import OrgExtended.asettings as sets import OrgExtended.orgextension as ext from collect...
import asyncio import importlib import json import logging import os import warnings from copy import deepcopy from inspect import isclass from typing import Any, Coroutine, Dict, List, Optional, Tuple, Type, Union, cast from pypika import Table from tortoise.backends.base.client import BaseDBAsyncClient from tortois...
import atexit from monopyly import * from collections import Counter import random from .utils import * # don't deal with winners # keep a list of possible deals - reconstruct after each deal, auction, bankruptcy, etc. and at start of game # keep a track of offers made and refused # keep a track of the behaviour o...
# 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, Version 2.0 # (the "License"); you may not use ...
#!/usr/bin/env python # # mergetrees.py: routines that create merge scenarios # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # # ==================================================================== # Licensed to the Apache Software Foundation (ASF) under o...
# -*- coding: utf-8 -*- """ Created on Tue May 12 17:22:43 2015 @author: Brian """ import hardio as fw import utilities as general_utilities import numba as nb import numpy as np import copy import chemistry import geometry import mechanics from hardio import BASIC_INFO, DYNAMICS_INFO, VOL_EX_INFO, DETAILED_VOL_EX_IN...