text
stringlengths
6.04k
39.5k
""" Coded by <NAME> @ 2017 https://github.com/AchiPapakon/two-way_ANOVA MSc Thesis for University of Thessaly, School of Medicine Postgraduate Programme "Research Methodology in Biomedicine, Biostatistics and Clinical Bioinformatics" http://biomath.med.uth.gr/ """ from __future__ import division # ...
# Copyright 2014 Rackspace, 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 # # Unless required by applicable law or agreed to in writin...
import json import shutil import sys import zipfile as zf from contextlib import contextmanager from datetime import date, datetime, timedelta from pathlib import Path from typing import Optional, Tuple, Union, Generator, Callable, List, Set, NamedTuple, Iterator, Dict import orjson import weather.errors as err from ...
import os import argparse import numpy as np import random import pickle from collections import defaultdict import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import pytorch_lightning as pl from pytorch_lightning import Trainer from pytorch_lightning.loggers import WandbLogge...
import asyncio import configparser import importlib.util import inspect import json import os import re import shutil import sys from pathlib import Path from typing import Union, cast, Any, Dict, Set import click from conans.model.requires import ConanFileReference from . import _jenv, _get_logger, get_conan from ....
# python3 train.py --lr_g 1e-4 --lr_d 5e-5 --gan_type wasserstein --n_epochs 250 --weight_decay 1e-4 --lamda3 0.5 --lamda1 1 # python3 train.py --lr_g 1e-4 --lr_d 5e-5 --gan_type wasserstein --n_epochs 250 --weight_decay 0 --lamda3 0.5 --lamda1 1 --lr_c 5e-4 from __future__ import print_function, absolute_import, divis...
from pynet.core import Base from pynet.datasets.core import ArrayDataset, DataItem import torch from torch.utils.data import SequentialSampler from pynet.augmentation import * from pynet.transforms import Crop import bisect import random import copy import numpy as np from tqdm import tqdm try: # SciPy >= 0.19 fr...
from django.contrib.messages.views import SuccessMessageMixin from django.views.generic import DetailView, ListView, UpdateView, CreateView,DeleteView from django.views.generic.dates import YearArchiveView,MonthArchiveView,WeekArchiveView from django.urls import reverse,reverse_lazy from django.http import HttpResponse...
import numpy as np import pyautogui import time import win32gui from winelf import global_settings import win32con __all__ = ['WindowElf'] def blockWrapper(block=True, timeout=5): def wrapper1(func): def wrapper2(*args, **kwargs): # 堵塞 if not block: return func(*ar...
#!/usr/bin/env python """ Key '0' - To select areas of sure background Key '1' - To select areas of sure foreground Key '2' - To select areas of probable background Key '3' - To select areas of probable foreground Key 'l' - go to next image Key 'k' - go to previous iamge Key 'n' - To update the segmentation Key 'r' -...
from typing import Optional, Union, List import torch.nn as nn import timm from timm.models.layers import ConvBnAct, get_act_layer, create_attn, create_conv2d from timm.models.cspnet import _create_cspnet import segmentation_models_pytorch as smp # from .hardnet import HarDNet from ..acti.acon import AconC, Me...
import sys import os import numpy import pandas from collections import OrderedDict import matplotlib.pyplot as plt import seaborn as sns import copy from IPython.display import display import warnings import re import shutil from matplotlib import gridspec from .._toolboxPath import toolboxPath from ..objects import M...
import logging import regex from typing import Iterator, List, Dict import pysbd from common.parse_tex import DEFAULT_CONTEXT_SIZE, EntityExtractor, check_for_reserved_characters, plaintext_and_offset from .types import Sentence # These are 'reserved characters' by the pysbd module and can potentially # cause issue...
import subprocess from functools import partial from typing import List import trio import trio_asyncio from hypercorn.config import Config from hypercorn.trio import serve from quart import request, websocket, jsonify from quart_trio import QuartTrio from trio import MemoryReceiveChannel from twilio.twiml.voice_respo...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import logging # Define a class to receive the characteristics of each line detection class Line(): def __init__(self): # was the line detected in the last iteration? self.detected = False # x v...
import numpy as np import shutil from cascade_at.fit_strategies.init_no_ode import system, setup_db, FitNoODE from cascade_at.fit_strategies.init_no_ode import init_ode_command, fit_ode_command, fit_students_command from cascade_at.fit_strategies.init_no_ode import _dismod_cmd_, _fit_ihme_py_, _max_iters_ from cascade_...
import sys import os import argparse import logging import time import multiprocessing as mp from typing import List from numpy.typing import NDArray import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from dataclasses import dataclass, field from itertools import count from ..num_opt_ga import...
import numpy as np import torch import os from scipy.ndimage import distance_transform_edt from torch.utils.data import DataLoader, SequentialSampler from Models.FDU3D import * from tqdm import tqdm import argparse from era5dataset.FrontDataset import * # ERA Extractors from era5dataset.EraExtractors import * from...
import numpy as np from matplotlib import pyplot as plt import matplotlib.cm as cm import starry from scipy import optimize import jax.numpy as jnp from jax import random import numpyro import numpyro.distributions as dist from numpyro.infer import * from matplotlib import colors import matplotlib.gridspec as gridsp...
import argparse import os import sqlite3 from enum import Enum CREATE_TABLE_FOLDERS = """ CREATE TABLE IF NOT EXISTS Folders (id integer PRIMARY KEY AUTOINCREMENT, foldername text NOT NULL UNIQUE)""" CREATE_TABLE_FOLDERS_HIERACHY = """ CREATE TABLE IF NOT EXISTS FoldersTree (parent_id integer NOT NULL, child_id in...
import jax import jax.numpy as jnp import jax.random as random import numpy as np from jax import vmap, jit import sys # Find jVMC package sys.path.append(sys.path[0] + "/..") import jVMC.mpi_wrapper as mpi from functools import partial import time import jVMC.global_defs as global_defs def propose_spin_flip(key...
#Zbiór bibliotek import pydicom from bazadanych2aa import Catalog, Study, Status import time import argparse import os import shutil import time import datetime #Klasa kontroler modalnosci class controller(): #Funkcja wykonuje C-FIND, która wyszukuje liste plikow spelniajacych kryterium def find_study(pat_name...
from pathlib import Path from logging import getLogger from typing import List, Optional, Dict, Tuple, Union, Any import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torch import Tensor # from apex import amp from deeppavlov.core.commands.utils import expand_path from transforme...
# -*- coding: utf-8 -*- """ CentralReport - Server module Manages internal web server https://github.com/miniche/CentralReport/ """ import cherrypy import cr.utils.date as crUtilsDate import cr.utils.text as crUtilsText import datetime import os import routes import threading from cr.threads import C...
import tensorflow as tf import six import math import numpy as np def create_initializer(initializer_range=0.02): """Creates a `truncated_normal_initializer` with the given range.""" return tf.truncated_normal_initializer(stddev=initializer_range) def get_shape_list(tensor, expected_rank=None, name=None): ...
""" API for running simulations. """ import os import json from json import JSONDecodeError import itertools from typing import List, Dict, Callable, Union, Any, Optional, Tuple import datetime import numpy as np from panqec.codes import StabilizerCode from panqec.decoders import BaseDecoder from panqec.error_models im...
#!/usr/bin/env python3 #------------------------------------------------------------------------------- # Copyright 2016-2020 <NAME> # https://github.com/dominiksalvet/pathfinding-robots #------------------------------------------------------------------------------- from enum import Enum from time import sleep from ...
from .base import BaseVideoFilter from ...util import cached, llist, applyState import numpy from itertools import chain, islice, count from copy import deepcopy from more_itertools import peekable class Zone(object): from copy import deepcopy as copy def __init__(self, src_start, prev=None, next=None, paren...
import os from pathlib import Path from typing import Union, Dict import wx from srctools.logger import get_logger import aboutWindow import config import logWindow import utilities from panel.ItemPanel import ItemPanel # managers from packageManager import manager as PackageManager from templateManager import manage...
import os import json import random import pickle import logging import argparse import torch import torch.nn as nn import numpy as np from tqdm import tqdm from sklearn.metrics import precision_recall_fscore_support from torch.utils.tensorboard import SummaryWriter """ A very basic BiLSTM for token classification. I...
import math import torch import torch.nn as nn from lambda_networks import LambdaLayer from torch.nn import init, Conv2d, MSELoss, ZeroPad2d import torch.nn.functional as F from tqdm import tqdm import torch.distributed as dist from trainer.losses import ConfigurableLoss def SwitchedConvRoutingNormal(input, selecto...
import argparse import builtins as __builtin__ import datetime import math import os import sys import time import numpy as np import torch from compressai.zoo.pretrained import load_pretrained from torch import distributed as dist from torch import nn from torch.backends import cudnn from torch.nn.parallel import Dis...
""" Camera pipeline utilities. """ import os from fractions import Fraction import cv2 import numpy as np import exifread # from exifread import Ratio from exifread.utils import Ratio import rawpy from scipy.io import loadmat from raw_prc_pipeline.exif_utils import parse_exif, get_tag_values_from_ifds from raw_prc_pi...
# -*- coding: utf-8 -*- from features3D import dssp_parse as ds from collections import Counter from glob import glob,glob1 import prody import tempfile import shutil import subprocess import os import sys import numpy as np import re AA = ["ALA","CYS","ASP","GLU","PHE","GLY","HIS","ILE","LYS","LEU","MET","ASN","PRO"...
"""Script to plot histogram of xyz coords AG, August 13, 2012""" import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from functionshistogram import read_coor from .functionsdiffusion import fit_sqrt_vs_time, plot_vs_time def plotsettings(): plt.rc(('xtick','ytick','axes'),...
from compile_utils import * class ipfw_configuration: def __init__(self): self.nat_spec = "" self.nat_count = 0 self.rule_spec = "ipfw -q add 0000 check-state\n" self.rule_count = 1 def add_snat_rule(self, rule): # case1: We want to change only the sourceIp of the pac...
# Script was tested using WinPython 3.5.1.3. # Script written by <NAME>. email: <EMAIL> # Last modified: 2017 12 04 (YYYY MM DD) #------------------------------------------------------------------------------ # Start of script. Avoid modifying anything below unless User has experience with Python programming...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ All functions are stored here """ import os, json, requests, keyring, csv, random from time import sleep logging = True # toggles verbosity (False = no messages at all) IGNORE_LIST = [ # proposals to forever ignore 'Qmdpr5nfFdHVsMQskUaEX8TqT54PrA...
import os import trimesh import numpy as np import random from tqdm import tqdm import sys sys.path.append('.') from src.utils.libmesh import check_mesh_contains from scipy.spatial.transform import Rotation as R # fix random seed np.random.seed(0) random.seed(0) # Build ShapeNet dataset, follow https://github.com/...
import sys import shutil import json import os import numpy as np import pickle from tqdm import tqdm import cv2 from tabulate import tabulate from torchvision.transforms import ToTensor import imgaug.augmenters as iaa from imgaug.augmenters import Resize from imgaug.augmentables.lines import LineString, LineStringsOnI...
# -*- coding: utf-8 -*- from datetime import datetime from django import forms from django.conf.urls import patterns, url from django.contrib import admin from django.core.urlresolvers import reverse from django.db import models from django.db.models import Count from django.forms import Textarea from django.http impor...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import astropy.units as u from astropy.io import fits from astropy.table import Table from astropy.visualization import quantity_support from gammapy.maps import MapAxis, MapAxes, RegionGeom, RegionNDMap from gammapy.utils.scripts import...
import json import logging import os import time from contextlib import suppress from dataclasses import dataclass from datetime import date, timedelta from enum import Enum from pathlib import Path from typing import List, Callable, Union, Iterable, Optional, Any from googleapiclient import discovery from googleapicli...
"""Annotations for asserting the presence of a value""" __all__ = ["Value", "Attribute"] import dill import numbers import numpy as np import pandas as pd from collections.abc import Iterable, Sized from copy import copy from itertools import chain from typing import Any, Callable, Dict, List, Optional, Tuple, Union...
#!/usr/bin/env python # ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - <NAME> <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import math import numpy as np from scipy.misc import imread, imsave, imresize import cv2 import tensorflow as tf tf.flags.DEFINE_enum( 'model', 'inception-v3', ['inception-v3', 'vg...
import math def near_pirates(game,location): on_island={"enemies:":0,"allies:":0} count=0 num=4 nlocation=location[1]-1 for i in xrange((location[0] -3),(location[0]+4)): for j in xrange(nlocation,(location[1]-1)+num): if(game.get_pirate_on((i,j)) is not None): i...
# MIT License # # Copyright (c) 2020 <NAME> (Talendar) # # 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, m...
# coding=UTF-8 # ex:ts=4:sw=4:et=on # # Copyright (c) 2013, <NAME> # All rights reserved. # Complete license can be found in the LICENSE file. import types from functools import partial import gi gi.require_version('Gtk', '3.0') # @UndefinedVariable from gi.repository import Gtk # @UnresolvedImport from mvc.models...
#!/usr/bin/env python3 import ply.lex as lex from parser_types import * import sys if len(sys.argv) < 2: print("Usage: %s [c source file]" % sys.argv[0]) exit(1) VERBOSE = False # List of keywords keywords = { 'if' : 'IF', 'else' : 'ELSE', 'while' : 'WHILE', 'for' : ...
import random def one_breeding_cycle(male_sapiens, male_neanders, females, pool_size): '''Executes one breeding cycle, given a population of mixed species Each of the population parameters is a list of floating point numbers, representing the genetic mix, where 0.0 is fully neanderthal and 1.0 ...
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- """ :summary: Background script to control an amplifier and LCD character display from a Raspberry Pi. The script listens for activity on the sound driver and powers the amp when playing sound from shairport or mpd. The amplifier and LCD will be turned off after a preset t...
import logging import os import sys from datetime import datetime import requests from typing import Tuple, NamedTuple, Sequence import kamyroll.utils as utils from kamyroll.config import KamyrollConf log = logging.getLogger(__name__) class Metadata(NamedTuple): metadata: list[str] = [] cover: str = "" th...
import random import requests import json import discord from discord.ext import commands from bs4 import BeautifulSoup import http.client TOKEN = "<KEY>" bot = commands.Bot(command_prefix='!') @bot.event async def on_ready(): print("Bot is on") @bot.command() async def song(ctx): songs = {1:'hax suggested: h...
import torch from .base_model import BaseModel from . import networks import matplotlib.pyplot as plt import numpy as np import numpy import itertools from util.image_pool import ImagePool from torchvision import transforms import cv2 import kornia class CyclePix2PixLabModel(BaseModel): @staticmetho...
from pymates.sizes import Margin, Padding, Alignment from pymates.fonts import Font #def ptToPx(pt, dpi): # return pt/72*dpi #def pxToPt(px, dpi): # return px*72/dpi #def mmToPt(mm): # return mm * 2.8346456693 colors = {} def color(r, g ,b): name = f"{r},{g},{b}" if name in colors: return ...
import pkg_resources try: pkg_resources.get_distribution('numpy') except pkg_resources.DistributionNotFound: numpyPresent = False print("Error: Numpy package not available.") else: numpyPresent = True import numpy as np try: pkg_resources.get_distribution('pandas') except pkg_resources.Distri...
from aiida.engine import WorkChain, ToContext, if_ from aiida import orm from aiida_siesta.workflows.simplex_basis import SimplexBasisOptimization from aiida_siesta.workflows.base import SiestaBaseWorkChain from aiida_siesta.workflows.iterate import SiestaIterator from aiida_siesta.utils.tkdict import FDFDict def set...
#!/usr/bin/env python3 import copy import random from enum import IntEnum from typing import Dict, List, Tuple from uuid import UUID, uuid4 import cython import numpy as np import torch from engine.game_interface import GameInterface class PlayerState: __slots__ = [ "propertyCards", "dollarCard...
# coding=utf-8 from __future__ import absolute_import, division, print_function import sys import logging import os import ntpath import time import re import tempfile import shutil import tokenize import io import dbf import antlr4 import autopep8 from .VisualFoxpro9Lexer import VisualFoxpro9Lexer from .VisualFox...
from __future__ import print_function, division from os.path import join import numpy as np import pandas as pd import re from copy import deepcopy # noinspection PyPackageRequirements,PyPep8Naming from Bio.SeqUtils import MeltingTemp as mt from . import lib_utils, lib_blast class ROI: def __init__(self, chrom=N...
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. import numpy as np import pytest import popart import pprint import json import platform import itertools import torch import onnx from onnx import numpy_helper # 'import test_util' requires adding to sys.path import sys from pathlib import Path from _ast impor...
import logging import time import pandas as pd import torch import torch.nn.functional from tqdm import tqdm logger = logging.getLogger("DEFP") class TrainingDataCollection: """Collect training data (both constant data and data for each epoch) and convert it to a pandas dataframe.""" def __init__(self): ...
# coding=utf-8 # We often have one-arg-per column, so these checks aren't so useful. # pylint: disable=too-many-arguments,too-many-public-methods # SQLAlchemy queries require "column == None", not "column is None" due to operator overloading: # pylint: disable=singleton-comparison """ Lower-level database access. ""...
""" Some codes from https://github.com/Newmu/dcgan_code """ import math import os import zipfile import tarfile import errno import requests import json import random import pprint import scipy.misc import scipy.stats as stats import numpy as np from time import gmtime, strftime from tqdm import tqdm import tensorflow ...
# -*- coding: utf-8 -*- import json import os import time import urllib import requests from helpers.log import log from order.webtrader import NotLoginError from order.webtrader import WebTrader from configs import * import urllib2 class TraderError(Exception): def __init__(self, result=None): super(T...
#! python # -*- coding: utf-8 -*- """Jeol Lens/Deflector system types Author: <NAME> <<EMAIL>> """ import sys from mwx.controls import LParam from . import c4mdl as cmdl LITERAL_TYPE = str if sys.version_info >= (3,0) else (str,unicode) Command = cmdl.Command class LensParam(LParam): """Base class of lens/defl...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from eager.optimizers_eager import CEMOptimizer from eager.dynamics_models_eager import HalfCheetahModel class Controller: def __init__(self, *args, **kwargs): ...
"""Interfaces for ArcObjects.""" try: from contextlib import ContextDecorator except ImportError: # Py2. from contextlib2 import ContextDecorator import datetime import logging import uuid import arcpy from arcproc import geometry from arcproc.helpers import unique_name, unique_path LOG = logging.getLog...
from copy import deepcopy import numpy as np import matplotlib.pylab as plt import itertools from IPython.display import display from ipywidgets import widgets import pandas as pd from QCbaselinePY import qcbaseline colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] get_color_cycler = lambda: itertools.cycle...
import sys import os import random import time from pathlib import Path from autodmax.ad_functions import * root = Path(".") # Initialize the class in ad_data with variables. var = Loop_state() trigger = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # List of trigger values. # "0" = not triggered and they change to 1 as...
#! /usr/bin/env # _*_ coding:utf-8 _*_ #__author__ = '<NAME>' import os,sys,time,json,random, getopt import common_utils import wmts_utils ##-----------------------enter port------------------------------ # main entry for receive input args to determine execute which patten def main(argv=None): opts, args = geto...
# Copyright (C) 2021 <NAME>, ETH Zürich, Information Security Group # Licensed under BSD 3-Clause License, see included LICENSE file """ This script stores common classes and functions used for both types of crawler. - Class CrawlState defines the different success/error states that can result from a crawl. - Class Coo...
#!/usr/bin/python # -*- coding: UTF-8 -*- import numpy as np import pandas as pd import re from collections import defaultdict def file_reader(file_path): utterance = list() label = list() goal_type = list() goal_entity = list() bot_flag = list() with open(file_path, "r") as f: utt = l...
""" Ignoring non run activities None in results of club_activities represents an error in activity. For example - ActivityNotExist """ import logging import re import asyncio from typing import NoReturn, List from contextlib import asynccontextmanager from sys import stdout from datetime import datetime, timezone im...
"""Code for calling UniversalGP""" import sys from pathlib import Path from subprocess import call from tempfile import TemporaryDirectory import json import numpy as np # TODO: find a better way to specify the path UGP_PATH = "/home/ubuntu/code/UniversalGP/gaussian_process.py" # UGP_PATH = "/its/home/tk324/PycharmPro...
import pygame import time import random pygame.init() white = (255,255,255) black = (0,0,0) red = (155, 0, 0) green = (45, 168, 55) blue = (30, 3, 183) teal = (117, 218, 255) yellow = (255, 204, 50) orange = (255, 155, 49) dark_grey = (81, 81, 81) dark_green = (35, 130, 42) dark_purple = (123, 0, 175) apple_gain = ...
import abc import asyncio as aio import logging import struct import time import uuid from dataclasses import dataclass from enum import Enum, IntEnum from ..devices.base import BaseDevice from ..utils import format_binary from .base import BaseCommand, BLEQueueMixin, SendAndWaitReplyMixin _LOGGER = logging.getLogger...
#!/usr/bin/env python # -*- encoding:utf8 -*- # protoc-gen-luabind # # Copyright (C) 2013, https://github.com/wubenqi. All rights reserved # # Distributable under the terms of either the Apache License (Version 2.0) or # the GNU Lesser General Public License, as specified in the COPYING file. # # Author: wubenqi<<EMAI...
# ------------------------------------------------------------------------ # QAHOI # Copyright (c) 2021 <NAME>. All Rights Reserved. # Licensed under the Apache License, Version 2.0 [see LICENSE for details] # ------------------------------------------------------------------------ # Copyright (c) Hitachi, Ltd. All Rig...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: machinist.test.test_fsm -*- """ Implementation details for machinist's public interface. """ from zope.interface import Attribute, Interface, implementer, provider from zope.interface.exceptions import DoesNotImplement from eliot impo...
""" Array class of the Field type that implements the interface to the numpy array functions """ # pylint: disable=C0103,C0303,C0330,W0221 __all__ = [ "ArrayField", "NumpyBackend", ] from collections import defaultdict from functools import wraps import numpy as np from tuneit import ( TunableClass, t...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import ephem import ephem.cities import simplejson as json import pytz import tzlocal from tzwhere import tzwhere from datetime import datetime, timedelta import dateutil.parser import dateut...
# Password Generator from tkinter import * import secrets import pyperclip from win10toast import ToastNotifier import mysql.connector notifier = ToastNotifier() # DB mydb = mysql.connector.connect( host="localhost", user="root", password="<PASSWORD>" ) dbcursor = mydb.cursor() # Create a DB if not...
#!/usr/bin/python # <NAME> (<EMAIL>), University of Granada, 2021 from mininet.net import Mininet from mininet.cli import CLI from mininet.node import Controller, Switch, OVSKernelSwitch, RemoteController, OVSSwitch from mininet.log import setLogLevel, info, error from mininet.link import Intf, TCLink from mininet.ut...
import json import requests import time import sys #Sample seed phrase #Use create_wallet to generate new phrase phrase = 'annual isolate sea quit pelican inside whale grant during zoo glimpse issue' data = None #Object holds sample data for API requests data = { 'create_wallet' : { 'request_id' : 'creat...
import re import logging from pprint import pprint import sqlparse from datadog import statsd import cleanflux.utils.influx.date_manipulation as influx_date_manipulation # https://github.com/andialbrecht/sqlparse/blob/master/examples/extract_table_names.py # Example 10 in https://www.programcreek.com/python/example...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import AutoMinorLocator from sklearn.metrics import r2_score import seaborn as sns import json plt.rcParams.update({'font.size': 16}) # %% fig_dir = r'figures/Classics/' # %% class CONSTANTS(): def __in...
import vectorian.core as core import multiprocessing import multiprocessing.pool import time import numpy as np import bisect import json import yaml import collections import contextlib import logging import functools import os from cached_property import cached_property from collections import namedtuple from pathli...
# Author: <NAME> # Email: <EMAIL> # Date: import torch.nn as nn from torch.nn import Parameter import torch from torch import Tensor import torch.nn.functional as F import math # 此处参考: # 1. torch.nn.Transformer # 2. https://arxiv.org/abs/1706.03762 # 3. http://nlp.seas.harvard.edu/2018/04/03/attention.html # 为了避免与t...
__author__ = 'Ceegan' import random letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] #possible_positions = [] class BattleshipGame(): def __init__(self): self.userBoard = [[' ' for x in range(10)] for x in range(10)] self.computerBoard = [[' ' for x in range(10)] for x in rang...
import pni_rm3100 import time import smbus2 """ Writes CCR(Cycle Count Register) values assigned to parameters in 'pni3100_object' Inputs: i2cbus - object of class 'SMBus' that has been set to a specific I2C line pni3100_object - object of class 'pni_rm3100' This functio...
#!/apps/well/python/2.7.8/bin/python import argparse import numpy as np from pysnptools.snpreader import Bed, Pheno from scipy.stats import chi2, zscore from sibreg import sibreg ####### Output functions ########## def neglog10pval(x,df): return -np.log10(np.e)*chi2.logsf(x,df) def vector_out(alpha_mle,n_X,digits...
# -*- coding: utf-8 -*- # 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 import frappe.defaults import re from frappe.utils import nowdate, cstr, flt, cint, now, getdate from frappe.modu...
#!python import argparse import copy import itertools import os import pickle import shutil import traceback from datetime import datetime from math import ceil from multiprocessing import Pool from pathlib import Path import numpy as np import pandas as pd import yaml from classifiers import Classifiers from config...
from __future__ import absolute_import from collections.abc import Iterable import copy import numpy as np import dama as dm from dama import translations from dama.utils.formatter import format_table import dama.plotting __license__ = '''Copyright 2019 <NAME> Licensed under the Apache License, Version 2.0 (the "Lice...
""" Helper functions for working with the Lie groups SO(3) and SE(3) """ import functools import numpy as np # # Log map for SO(3). Returns a 3-vector of so(3) exponential coordinates # # Actually, this does vee(SO3_log(R)), also denoted Log(R) in a few conventions # # Not to be confused with log(R), which simply re...
#!/usr/bin/env python ######################################### # Imports ######################################### # - Logging import logging # - Multithreading from twisted.internet import reactor # - World Simulator import sys, random, time import pygame from pygame.locals import * from pygam...
import os.path as osp from collections import defaultdict import numpy as np import torch import torch.distributed as dist import torch.optim as optim import utils from datasets import define_dataset from models import define_D, define_G from models.loss import GANLoss from torch.nn.parallel import DistributedDataPara...
import numpy as np import pandas as pd import altair as alt from tqdm import tqdm import os def create_invert_map(lst): return {v: i for i, v in enumerate(lst)} class BlackJack: """ Approximately solves BlackJack using epsilon-greedy, constant-alpha Monte Carlo Control. Example use: bj = BlackJa...