text
stringlengths
3.07k
22.1k
#!/usr/bin/env python3 import argparse import subprocess import os import os.path as op import json import re from glob import glob # slurm-related paths. change these if your slurm is set up differently or you # use a different job submission system. see docs # https://sylabs.io/guides/3.7/user-guide/appendix.html#s...
# coding:utf-8 from __future__ import print_function import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim import os import sys import time def print_vars(tag, list): print("%s:%d" % (tag, len(list))) for var in list: print('\tname:{0} shape:{1}'.format(var.nam...
import time import pickle # to load data # import torch # from torchvision import datasets, transforms import numpy as np import matplotlib.pyplot as plt from principal_dbn_alpha import DBN ###################################################################### ######################### HELPER FUNCTIONS #########...
from openerp import netsvc from openerp import models, fields, api from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp from datetime import datetime from openerp.osv import osv import time class wizard_stock_internal_transfer(models.TransientModel): _name = 'wizard.stock.internal.trans...
# Copyright 2015 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 a...
import fire import imageio import matplotlib.pyplot as plt import scipy.misc as misc from .parsers import * from .utils import * # ========= FRAMEWORK =========== # class PaintRequestABC(object): def __init__(self, file, **kwargs): """ Args:: file : string filename of...
"""xml2bookshelf. This program converts ESIR XML to bookshelf for placement. Usage: xml2bookshelf.py -h | --help xml2bookshelf.py <XML> <PROJECT_NAME> -h --help Show this message. """ # This is the correct license for this particular file. Do not modify or remove this license. LICENCE = """ BS...
#!/usr/bin/python #Recipe Keeper try: import Tkinter as tk import tkFileDialog except: import tkinter as tk import tkinter.filedialog as tkFileDialog root = tk.Tk() root.title("Recipe Keeper") root.geometry("544x658") root.option_add("*Font", "TkDefaultFont 9") root.columnconfigure(0, weight=1) root...
# module msys.py # Requires Python 2.4 or better and win32api. """MSYS specifics for Msys terminal IO and for running shell scripts Configured for MSYS 1.0.17. exports msys_raw_input, MsysException, Msys Uses optional environment variable MSYS_ROOT_DIRECTORY. Set this to the full path of the MSYS home directory, 1....
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
from dataclasses import dataclass, field from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar, Union from envinorma.models.condition import Condition, LeafCondition, extract_leaf_conditions, load_condition from envinorma.models.parameter import Parameter from envinorma.models.structured_text imp...
# -*- coding: utf-8 -*- """ Indicator serializers - note that indicators.serializers_new directly supercedes these where they conflict currently - replacing without regressions is a longer term project """ from operator import attrgetter from rest_framework import serializers from django.utils import timezone, ...
from flax import linen as nn from jax import numpy as jnp class FeedForward(nn.Module): """Position-wise FeedForward with Gates Linear Units and GELU activation as in https://arxiv.org/pdf/2002.05202.pdf """ multiplicative: int = 4 # d_ff / d_model dropout_rate: float = 0. @nn.compact de...
from django.contrib.auth.forms import UserCreationForm from django.urls import reverse_lazy from django.views import generic from django.http import HttpResponse, request, response, HttpResponseRedirect, JsonResponse import pyodbc from django.shortcuts import render_to_response, render, redirect from django.contrib.aut...
from ..api.stravaApi import get_strava_client, strava_connected from ..api.ouraAPI import pull_oura_data from ..api.api_withings import pull_withings_data from ..api.fitbodAPI import pull_fitbod_data from ..api.pelotonApi import get_peloton_class_names from ..api.strydAPI import pull_stryd_data from ..api.sqlalchemy_de...
import numpy as np import sklearn.cluster from pip._vendor.pyparsing import Each import csv def cleaning(open, irregularList_training, len): with open("Clustering_children.csv", 'r') as f: with open("Clustering_children_new.csv", 'w') as f1: f.readline() # skip header line for line ...
"""Platform for climate integration.""" import logging from .magiqtouch import MagiQtouch_Driver import voluptuous as vol from typing import Any, Callable, Dict, List, Optional import homeassistant.helpers.config_validation as cv # Import the device class from the component that you want to support from homeassistan...
VERBOSE = False def winning_tx(tx1, tx2): return tx1 if tx1.tx_id < tx2.tx_id else tx2 def losing_tx(tx1, tx2): return tx1 if tx1.tx_id > tx2.tx_id else tx2 class Shard(object): def __init__(self, shard_id, parent_id, child_ids): super(Shard, self).__init__() self.shard_id = shard_id ...
# Copyright 2021 Huawei Technologies Co., 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 applicable law or agreed to...
from gpiozero import LED,Button,TrafficLights,Buzzer from gpiozero import PWMLED,LEDBoard,LEDBarGraph,RGBLED from gpiozero import TonalBuzzer,DistanceSensor from gpiozero import Motor,Robot,Servo,AngularServo from gpiozero import DigitalOutputDevice,DigitalInputDevice,MotionSensor from gpiozero import LightSensor,MCP30...
import os import logging import datetime import time import math import json import librosa import numpy as np from utils import normalize import tensorflow as tf from tensorflow.contrib import rnn from sklearn.preprocessing import normalize as sk_normalize from sklearn.cluster import KMeans from scipy.ndimage.filters...
from __future__ import division from __future__ import print_function import numpy import numpy as np import scipy.linalg import flydra_core.reconstruct as reconstruct import cgtypes # cgkit 1.x import os import flydra_core._reconstruct_utils as reconstruct_utils from flydra_analysis.analysis.flydra_analysis_generate...
#!/usr/bin/env python import sys import os import traceback import logging from notest.clients.request_client import get_client_class from notest.test_result import TestResult from email import message_from_string ESCAPE_DECODING = 'unicode_escape' sys.path.append(os.path.dirname(os.path.dirname( os.path.realpath...
# # 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...
import cv2 import PIL.Image, PIL.ImageTk import tkinter as tk import tkinter.font as font import tkinter.messagebox as messagebox from .aruco import ArucoFinder from .player_finder import PlayerFinder from .controller import Controller from .webcamera import Webcamera class Window: GRAY = "#2c2c2c" DARK = "...
"""Tests compile_po_files.py.""" from __future__ import absolute_import import os import intl.translate import kake.make from kake.lib import compile_rule from kake.lib import testutil class TestBase(testutil.KakeTestBase): def setUp(self, *args, **kwargs): super(TestBase, self).setUp(*args, **kwargs) ...
from SBaaS_base.postgresql_orm_base import * class data_stage02_physiology_graphData_shortestPathStats(Base): __tablename__ = 'data_stage02_physiology_graphData_shortestPathStats' id = Column(Integer, Sequence('data_stage02_physiology_graphData_shortestPathStats_id_seq'), primary_key=True) analysis_id = Col...
import eel import utils # import file exist and validating function from utils.check_file import is_file_valid # import process parameters to int or str function from utils.process_parameters import process_parameters # import data pre-processing functions from utils.data_preprocess_regression import regression_dataset...
from selenium import webdriver from time import sleep from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.options ...
""" " Collection of function to process prime numbers and divisors. """ import math import timer def sift_primes(n): """Sieve of eratosthenese. For all integers up to n, sifts out the non-primes and returns list of all primes up to n. """ if n < 2: print('Passed in integer is not larg...
import pynmea2 from datetime import datetime as dt import xarray as xr import numpy as np import zarr from xarray import coding from _echopype_version import version as ECHOPYPE_VERSION COMPRESSION_SETTINGS = { 'netcdf4': {'zlib': True, 'complevel': 4}, 'zarr': {'compressor': zarr.Blosc(cname='zstd', clevel=3,...
import os import sys import argparse import torch import torchvision import torchvision.transforms as transforms import numpy as np from simclr import SimCLR from simclr.modules import LinearModel, get_resnet from simclr.modules.transformations import TransformsSimCLR # CeleA from dataset import MyCelebA from utils ...
#!/usr/bin/env python import time import sys import argparse from Fred2.Core import Protein, Peptide, Allele, MutationSyntax, Variant from Fred2.Core.Variant import VariationType from Fred2.IO import read_lines, MartsAdapter, read_annovar_exonic from Fred2.EpitopePrediction import EpitopePredictorFactory from Fred2.Co...
import ipaddress import itertools import logging from collections import deque from ipaddress import IPv4Address, IPv6Address from typing import Dict, List, Optional, Union from h2.config import H2Configuration from h2.connection import H2Connection from h2.errors import ErrorCodes from h2.events import ( Event, C...
import time import numpy as np import constants as c import keras import tensorflow as tf import keras.backend as K from keras import layers from keras.models import Model,Sequential,load_model from keras.regularizers import l2 from keras.layers.merge import concatenate from keras.layers import Activation, Conv1D, Conv...
import math import numpy as np class Plane(): def __init__(self,atoms): # Stores a plane equation in the format # ax + bx + cz + d = 0 self.atoms = atoms xs = [atom.coordinates[0] for atom in atoms] ys = [atom.coordinates[1] for atom in atoms] zs = [atom.coordinates[...
from __future__ import absolute_import from graphql.language import ast from graphql.language.ast import NonNullType from graphql.language.parser import parse from ..utils import const from ..query import Node, Field, Link, merge class NodeVisitor(object): def visit(self, obj): if not isinstance(obj, a...
# -*- coding: utf-8 -*- """ Created on Sat May 2 18:35:34 2020 @author: Bosec """ ## some more experiments import pkgutil import config import numpy import os from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.ensemble import RandomForestClassifier from sklearn import svm from sklearn.datase...
# This code is modified from https://github.com/facebookresearch/low-shot-shrink-hallucinate import os import torch from PIL import Image import numpy as np import pandas as pd from torchvision import datasets, transforms from torch.utils.data import Dataset, ConcatDataset, DataLoader from abc import abstractmethod f...
import numpy as np from .amcl_helper import compute_constraints_with_loss, Brier_loss_linear, linear_combination_labeler from .amcl_helper import compute_constraints_with_loss2, Brier_Score_AMCL from .amcl_helper import cross_entropy_linear, resnet_transform, logistic_regression from .amcl_helper import projectToSimple...
import os import pandas as pd import numpy as np from itertools import product, combinations from graphpype.utils_stats import (compute_oneway_anova_fwe, compute_pairwise_ttest_fdr) from graphpype.utils_cor import return_corres_correl_mat def isInAlphabeticalOrder(word): ret...
import unittest from . import Move, Board, LocalBoard, GlobalBoard, Player, Game class MoveUnitTest(unittest.TestCase): def setUp(self): self.move1 = Move(Board.X, 0, 0, 0, 0) self.move2 = Move(Board.X, 1, 0, 0, 0) self.move3 = Move(Board.X, 2, 1, 2, 1) self.move4 = Move(Board.X, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Created by imoyao at 2020/1/12 10:12 import os import click import exceptions import settings from tiny_core import ShrinkImages def check_key(): """ check TINY_KEY 代码中查找;文件中查找,没有的话,click装饰器会去环境变量中查找,再没有的话,提示用户手动输入 :return:bool False:不需要用户输入;True:用户输入k...
""" Demo of using Memory Network for KG reasoning """ import glob import os import gzip import sys import pickle import argparse import numpy as np #from config import KgConfig from util_kg_reasoner import parse_kg_task, build_model, generate_next_story, load_all_data from memn2n.memory import MemoryL, MemoryBoW cl...
# Copyright 2018 <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 obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in ...
__doc__ = "Tests some core features of ``touketsu`` using the test classes." import pytest from random import Random import textwrap from .classes import (a_class, b_class, c_class, an_abc, abc_child_a, abc_child_b, almost_one) from .fixtures import _GLOBAL_SEED, global_random_state _module_ran...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import string from common.utility.util import * from common.erro.errno import Error from common.symbtable.table import SymbTable from common.file.fileHandler import FileHandler # Criar classe para lidar com os erros léxicos. Essa classe deve estender Erros class LexError(Erro...
# -*- coding: utf-8 -*- # This python package is implementing a very simple multiprocess framework # The point of it is to be able to fully tests the multiprocess behavior, # in pure python, without having to run a ROS system. from __future__ import absolute_import from __future__ import print_function import os i...
# To use this code, make sure you # # import json # # and then, to convert JSON from a string, do # # result = oauth_access_response_from_dict(json.loads(json_string)) from dataclasses import dataclass from typing import Optional, Any, List, TypeVar, Callable, Type, cast T = TypeVar("T") def from_str(x: An...
# -*- coding: utf-8 -*- # Copyright (c) 2018, <NAME>. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # vispy: gallery 2 """ Draw and Edit Shapes with Mouse =============================== Simple demonstration of drawing and editing shapes with the mouse This demo implements mouse picking on ...
# -*- coding: utf-8 -*- """ Created on Fri Apr 10 17:17:41 2020 This script is for generating synthetic data. You can use multi-class data to generate balance dataset. <NAME> <EMAIL> BME Bogazici University Istanbul / Uskudar @author: abas """ import numpy as np from sklearn import neighbors from skl...
import sys import pygame from threading import Timer from pygame.locals import * import time from gamestate import GameState, OutputBox, InputBox from renderer import render, renderStartScreen, TILEWIDTH, TILEHEIGHT, TILEFLOORHEIGHT from renderer import HALF_WINHEIGHT, HALF_WINWIDTH, DISPLAYSURF from renderer import ...
import logging log = logging.getLogger('simstate') from enforce_typing import enforce_types # type: ignore[import] from typing import Set from agents import MinterAgents from agents.BaseAgent import BaseAgent from agents.AgentDict import AgentDict from agents.GrantGivingAgent import GrantGivingAgent from agents.Grant...
""" Distance/Path Transform Wavefront Coverage Path Planner author: <NAME> paper: Planning paths of complete coverage of an unstructured environment by a mobile robot - Zelinsky et.al. link: http://pinkwink.kr/attachment/cfile3.uf@1354654A4E8945BD13FE77.pdf """ import os import sys import matplotlib.pyplot ...
import math import torch import torch.nn as nn from PoPnet_model import ChebyGCN_Direc import numpy as np class chebLSTMCell(nn.Module): def __init__(self, input_dim, hidden_dim, kernel_size, bias): """ Initialize ChebLSTM cell. Parameters ---------- input_di...
"""Utilities for hyperparameter optimization. This wrapper has an optional dependency on Oríon https://orion.readthedocs.io/en/stable/ https://github.com/Epistimio/orion Authors * <NAME> 2021 """ import importlib import logging import json import os import speechbrain as sb import sys from datetime import datetime ...
# uncompyle6 version 2.9.11 # Python bytecode 3.5 (3350) # Decompiled from: Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:53:06) # [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] # Embedded file name: /home/aakash/Code/StateOfTheMedia/src/webapp/server/server.py # Compiled at: 2017-05-23 04:46:02 # Size of ...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) Vortex NTNU. # 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 retain ...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
# coding: utf-8 # In[ ]: from flask import render_template, flash, redirect, session, url_for, request, g, jsonify from flask.ext.login import login_user, logout_user, current_user, login_required from flask.ext.sqlalchemy import get_debug_queries from flask.ext.babel import gettext from datetime import date...
import time import uuid from timeit import default_timer as timer import boto3 import loguru import spark_emr.bootstrap from spark_optimizer.optimizer import (calculate_spark_settings, load_emr_instance) from spark_emr.step import spark_step, spark_yarn_log_step from spark_emr....
import collections import functools import logging import threading import weakref from functools import partialmethod from remotelogin.devices.exceptions import (ConnectionInstanceOpenError, DuplicatedConnectionError, UnknownConnectionError, UnknownUserError) from remotelogin...
from app import app, db, lm from flask import render_template, flash, redirect, session, url_for, request, g from flask import request from flask_login import login_user, logout_user, current_user, login_required from .forms import LoginForm, MessageForm, PasswordForm, DeleteUser from .models import User, Message from...
#! /usr/bin/env python # import ros stuff import rospy # import ros message from geometry_msgs.msg import Point from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from tf import transformations from gazebo_msgs.msg import ModelState from gazebo_msgs.srv import SetModelState # import ros service fr...
from common.base_parser import BaseParser from common.constants import * import csv import io import logging import zipfile """ URL = 'https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/new_taxdump/' nodes.dmp file consists of taxonomy nodes. The description for each node includes the following fields: ta...
from datetime import datetime import Queue import re import StringIO import sys import threading import traceback import wx import koko from koko.struct import Struct from koko.fab.asdf import ASDF from koko.fab.tree import MathTree from koko.fab.fabvars import FabVars...
# ActivitySim # See full license in LICENSE.txt. import logging import numpy as np import pandas as pd from activitysim.core.util import quick_loc_series logger = logging.getLogger(__name__) class OffsetMapper(object): def __init__(self, offset_int=None): self.offset_series = None self.offse...
import calendar from datetime import datetime, timedelta import time from fastapi import APIRouter, Request, BackgroundTasks from loguru import logger from func.jd_web_hook.models import WebHookItem from conf import Settings from robak import Jdy, JdySerialize doc = ''' 触发表单 修改正式上班日期申请 修改 条件流程完成 人员档案 ...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # # 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 appl...
from collections import deque import numpy as np from datasketch.lsh import integrate, MinHashLSH def _false_positive_probability(threshold, b, r, xq): ''' Compute the false positive probability given the containment threshold. xq is the ratio of x/q. ''' _probability = lambda t : 1 - (1 - (t/(1 +...
import tensorflow_addons as tfa import tensorflow as tf import numpy as np tfk = tf.keras tfkl = tfk.layers def ws_reg(kernel): kernel_mean, kernel_std = tf.nn.moments( kernel, axes=[0, 1, 2], keepdims=True) kernel = (kernel - kernel_mean) / (kernel_std + 1e-5) def conv3x3(cout, stride=1, groups=1,...
import rdkit import molecule_utils from collections import Iterable import pandas as pd from src import setting degrees = [0, 1, 2, 3, 4, 5] def node_id(smiles, idx): return "/".join([smiles, str(idx)]) class Node(object): """ Class represent graph node. Args: ntype (string): Node type ...
# Copyright 2021 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distr...
#!/usr/bin/env python2.7 import psycopg2 import os import time import subprocess import logging import textwrap from . import credentials logger = logging.getLogger(__name__) headers = {} headers['papers'] = ('id','title','year','doi') headers['is_cited_by'] = ('id','incit_id') headers['cites'] = ('id','outcit_id') ...
"""The :class:`AtomicEnvironment` object stores information about the local environment of an atom. :class:`AtomicEnvironment` objects are inputs to the 2-, 3-, and 2+3-body kernels.""" import numpy as np from math import sqrt from numba import njit from flare.struc import Structure class AtomicEnvironment: """ ...
# -*- coding: utf-8 -*- # Time: 2021-06-29 17:45 # Copyright (c) 2021 # author: Euraxluo from datetime import datetime import typing from fastapi import APIRouter, Query, Body, Path import apscheduler.util # type:ignore from apscheduler.triggers.cron import CronTrigger # type:ignore from apscheduler.triggers.date...
import math import torch from functools import partial from .scalers import scale_amplification, scale_attenuation from .eigen_agg import get_adjacency_from_gradient_of_features EPS = 1e-5 # each aggregator is a function taking as input X (B x N x N x Din), adj (B x N x N), self_loop and device and # returning the ...
from time import time import base58 from common.chain import Chain from common import globall as G from god.conf import tune as T from common.crypto import Ecc, Hash def ack_god(ch_god, content, hash_src): T.LOGGER.debug('') type_c = G.ACK c = ( G.VER + b' ' + ...
#!/usr/bin/python import sys import random import argparse import libmsym as msym import numpy as np from numpy.linalg import norm def set_basis(element, name="1s"): basis_function = msym.RealSphericalHarmonic(element=element, name=name) element.basis_functions = [basis_function] return basis_function ...
from dateutil.parser import parse from django.conf import settings import logging import requests from requests.exceptions import HTTPError from tracking.models import DepartmentUser, FreshdeskTicket, FreshdeskConversation, FreshdeskContact HEADERS_JSON = {'Content-Type': 'application/json'} FRESHDESK_AUTH = (setting...
import math import numpy as np from sklearn.linear_model import LinearRegression # Timing offset to handle a beat tracker's consistent deviation. BEAT_TRACKING_TIMING_OFFSET = 0.039 # Window size used for filtering out start and end beats. EDGE_FILTER_WINDOW_SIZE = 4 # The fraction of closest onsets to use when fit...
from abc import abstractmethod # from scipy.spatial.distance import cdist, pdist import numpy as np from ..database.pysurf_db import PySurfDB from ..utils.osutils import exists_and_isfile # logger from ..logger import get_logger # from colt import Colt, Plugin from colt.obj import NoFurtherQuestions def internal(crd...
#! /usr/bin/env python # -*- coding:utf-8 -*- """ @author : MG @Time : 2018/6/19 10:47 @File : handler.py @contact : <EMAIL> @desc : """ import logging from huobitrade.handler import baseHandler from prodconpattern import ProducerConsumer from huobifeeder.utils import datetime_2_str, STR_FORMAT_DATETIME2 fro...
from __future__ import unicode_literals from mogwai._compat import string_types, PY2 from nose.plugins.attrib import attr from mogwai.tests import BaseMogwaiTestCase from mogwai.models import Vertex, Edge from mogwai import properties from mogwai.tools import ImportStringError, import_string, cached_property, LazyImpor...
#!/usr/bin/python import requests import praw import re import time import random import os ##################### # PART 1: THE SETUP # ##################### #List of words to match GTA Roleplay wordList = ['nopixel','gta rp', 'gta v rp', ' rp ', 'roleplay', ' family ', 'no pixel', ' np ', 'no-pixel', 'svrp', 'twitch...
import pygame as pg from time import time import sys import helpers from settings import screen import settings as s def pause_game(ship1, score, level): """displays a paused game screen showing information to the player""" t1 = time() # if game is still going, give option to save game ...
import argparse import logging import random import gym import numpy as np from datetime import datetime from os.path import join, basename, abspath from agent_score import agent_score from disagreement import save_disagreements, get_top_k_disagreements, disagreement, \ DisagreementTrace, State from merge_and_fade...
from . import Operation from copy import copy from sympy import symbols, Idx, Expr ARITHMETIC_LOOP_EVAL = """ """ class LoopTypes(object): LINEAR = 0 OFFSET = 1 SCALED = 2 class Loop(Operation): loop_ids = 0 def __init__(self, start, end=None, stride=1, ...
import os import os.path as ops import numpy as np import cv2 import json import random import torch from torch.utils.data import Dataset from torchvision import transforms from PIL import Image import torchvision.transforms.functional as F class LaneDataset(Dataset): def __init__(self, args, dataset_path, json_f...
from ..utils import * import torch from collections import defaultdict class Decoder: def __init__(self, args): self.label_map = args._r_labels self.part_map = args._r_parts self.anchor_name = args.anchor_name self.args = args self.down_ratio = args.down_ratio sel...
# -*- coding: utf-8 -*- from icemac.addressbook.interfaces import IPerson, IPostalAddress import decimal import pytest KEYWORD = u'keyword for test' # Fixtures to create objects: @pytest.fixture(scope='function') def UpdateablePersonFactory(FullPersonFactory): """Return a callable which creates a person object...
#!/usr/bin/env python3 """Compute a background mask for X-ray microscopy data. Functions --------- parse_args Parse command line arguments. initialize_cloudvolume Create a new CloudVolume archive. load_image Load an image from CloudVolume. create_bg_mask Create a mask of background regions in x-ray mic...
from __future__ import print_function, division import os import numpy as np import tensorflow as tf from tensorflow.contrib.rnn import GRUCell from tensorflow.python.ops.rnn import bidirectional_dynamic_rnn as bi_rnn from tqdm import tqdm from utils import batch_generator, get_max_len_info from data_prep_for_visualiza...
#! /usr/bin/env python # -*- coding: utf-8 -*- import curses import math import rospy import sys import dynamic_reconfigure.server from std_msgs.msg import String from std_msgs.msg import Empty from geometry_msgs.msg import Twist from demo_teleop.cfg import SafeDroneTeleopConfig cla...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma...
import argparse, time, torch, os, logging, warnings, sys import random import torch.nn.functional as F from torch.utils.data import DataLoader from torch.optim.lr_scheduler import StepLR from transformers import AdamW from models.sc_model import MultiTaskModel from samplers.pt_sampler import TaskSampler from learners...
from __future__ import print_function import os import sys import numpy as np import torch # import networkx as nx import random from torch.autograd import Variable from torch.nn.parameter import Parameter import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm from copy...
#!/usr/bin/env python # coding: utf-8 import copy, asohelper #This module contains all the optimization modules. #Each module takes a function (and some the config file), copies the function #and modifies the properties. #Modules can easily be combined. E.g. BranchModule(MemoryModule(function)) #====================...
import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import re import numpy as np nltk.download("stopwords", quiet=True) nltk.download("punkt", quiet=True) import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import re import numpy as np nltk.downloa...
import re import getopt import sys import datetime col_seq, att_seq, att_ass = '\t', ';', '=' att_transcript_name = "Parent" att_transcript_seq = ":" att_rank_key = 'rank' att_exon_key = 'exon_id' att_exon_alias = 'exon_id,Name' freature_gene_name = "gene,ncRNA_gene" freature_exon_name = "exon" replace_exon_key = "exo...