text stringlengths 3.07k 22.1k |
|---|
import pylab as plt; import numpy as np
import lmfit; import tellurium as te
import time; import copy; import random; import sys
import emcee
import time
import pandas as pd
# Call loadIntoPandas (toFit, pSamples)
def loadIntoPandas (parameters, sample):
df = pd.DataFrame (columns=parameters)
for i in range... |
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from ..utils import folder_check, Logger, save_ckpt_dir
import src.gpt_mnist.pipeline as pp
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def do_finetune(args):
print('Finetuning from finetune... |
#!/usr/bin/env python
import sys, glob, re, logging, json, os
from optparse import OptionParser
from collections import deque
from pbsuite.utils.setupLogging import *
from pbsuite.jelly.Support import AlignmentConnector, SUPPORTFLAGS
subreadGrab = re.compile(".*/(\d+)_(\d+)$")
def natural_sort(l):
"""
how u... |
import numpy as np
import cv2
import math
import obstacle_map
import time
from queue import PriorityQueue
import argparse
import imageio
def load_map(fname = None):
if fname is not None :
map_ = cv2.imread(fname)
return map_
world= 255*np.ones((200,300,3))
rc=0
obstacle_map.obstacle_cir... |
'''
Handles the summarization functionality of Refinery
'''
import os
from refinery import app, db
from refinery.webapp.pubsub import msgServer
from refinery.data.models import Experiment, Folder, tokenize_sentence, Document
from flask import request, render_template, jsonify
from refinery import celery
from math im... |
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
import json
from app.models import Lugar, Usuario
import app.config as config
from app.modules.Lugar.CheckLugar import CheckLugar
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer,... |
#!/usr/bin/python
import sys
from operator import itemgetter, attrgetter
import bisect
import re
TSS_THRESHOLD = 0.99
OVERLAP_THRESHOLD = 0.0
### parse_tss_file
##################
def parse_tss_file(tss_file):
tss_dict = {}
for line in tss_file:
fields = line.split()
rname = fiel... |
from hippy import rpath
from hippy.objects.resources.file_resource import W_FileResource
from hippy.objects.base import W_Root
from hippy.builtin import (
wrap, Optional, FileResourceArg, StreamContextArg)
from hippy.objects.resources.socket_resource import W_SocketResource
from hippy.module.url import urlsplit
d... |
import warnings
from datetime import datetime
import optunity.metrics
import toolkit as tk
from PrepareCSV import prepare_data
from backtrader_plotting import Bokeh
import quantstats
import math
import backtrader as bt
from strategies.BBKCReverse import BBKCReverse
class CommInfoFractional(bt.CommissionInfo):
def... |
import gym
import collections
import numpy as np
import cv2
import os
import datetime
import wandb
from pathlib import Path
import utils
import models
from parallelActorCritic import train
import torch
import torch.nn as nn
from nes_py.wrappers import JoypadSpace
import gym_super_mario_bros
from gym_super_mario_bros... |
"""
Module transform
=============
This module supplies two functions (radec_to_altaz and altaz_to_radec)
to transform between coordinates systems.
"""
import numpy as np
from datetime import datetime
from collections.abc import Iterable
import re
def _time(t):
if isinstance(t, datetime):
return t
elif... |
from typing import Text, Any, Dict, List, Union, Optional
import abc
from sagas.conf.conf import cf
from sagas.nlu.constants import non_spaces
from sagas.nlu.intf import cla_meta_intf
class Chunk(object):
def __init__(self, key, children):
self.key=key
self.children=children
def __str__(self)... |
# Adapted from https://github.com/ZijunDeng/pytorch-semantic-segmentation/blob/master/utils/joint_transforms.py
import torch
import math
import numbers
import random
import numpy as np
import torchvision.transforms.functional as tf
from PIL import Image, ImageOps, ImageFilter
class Compose(object):
def __init__(... |
#!/usr/bin/env python
#
# MIT License
#
# Copyright (c) 2019, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Permission is hereby granted, free of charge, to any person... |
if __name__ == '__main__': # Warn if trying to run this as a script
print("\n*********************************************")
print(" This is where the functions live")
print(" Run log-to-data.py or live-telem.py instead")
print("*********************************************\n")
quit()
import ... |
from importlib import import_module
import pkgutil
from django.utils.module_loading import module_has_submodule
import os
import threading
import re
import hashlib
import inspect
import base64
import pickle
from django.http.request import HttpRequest
from django.utils.encoding import force_bytes
from django.utils impor... |
from ...system import event_ids
from ...system import target_ids
from ...system.component import Component, Identifiable
from ...arch.windows import windows_constants
from ...arch.windows.funcs import (
window__create_display_window,
window__create_borderless_window,
window__client_rectangle,
window__s... |
from keras.models import Model
from keras.optimizers import SGD
from keras.layers import Add, Input, MaxPooling2D, Conv2D, \
Activation, Dense, AveragePooling2D, GlobalAveragePooling2D, Dropout, Flatten, BatchNormalization
from keras.utils import plot_model
from keras import callbacks
from keras.regularizers import... |
from ferromtm.models.coupled2D import *
from ferromtm.visualization.plots import *
from matplotlib.ticker import MaxNLocator
import sys
# mpl.rcParams["axes.xmargin"] = "0.1"
mpl.rcParams["axes.ymargin"] = "0.1"
if len(sys.argv) > 1:
percase = sys.argv[1]
else:
percase = "per"
n_bulk = tunability(epsilonr_... |
from collections import defaultdict
from datetime import timedelta
import pandas as pd
from django.http import HttpResponse
from pandas import DataFrame
from rest_framework import viewsets
from rest_framework.decorators import action
from iaso.models import *
from plugins.polio.helpers import get_url_content
from plu... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
# Sat 2 Nov 10:05:23 2013
"""Tests for bob.core.random
"""
from __future__ import division
from . import random
from .version import externals
import numpy
import nose.tools
import nose.plugins.skip
from distutils.version import LooseVersion
im... |
# Copyright 2018 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 l... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2022 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pickle
import pandas as pd
from flytekit.sdk.tasks import python_task, outputs, inputs
from flytekit.sdk.types import Types
from flytekit.sdk.workflow import workflow_class, Output, Input
from sklearn.me... |
##
# The MIT License (MIT)
#
# Copyright (c) 2015 Frankly Inc.
#
# 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, m... |
import numpy as np
import glob
import os
import pickle
import matplotlib.pyplot as plt
import pandas as pd
from mpl_toolkits.axes_grid1 import make_axes_locatable
from sklearn.preprocessing import normalize
from count_heatMap import *
from start_end_pts import *
"""
The following dictionary has data associated with th... |
# encoding = utf-8
import os
import sys
import time
import datetime
import requests
import hashlib
import json
from akamai.edgegrid import EdgeGridAuth # from https://github.com/akamai/AkamaiOPEN-edgegrid-python
'''
IMPORTANT
Edit only the validate_input and collect_events functions.
Do not edit any oth... |
"""
This module contains functions to create and display network graphs of the
sensitivity analysis results. It is included as an independent module in
this package because graph-tools is an uncommon package that is slightly
more involved to install than normal conda- or pip-accessible packages. All
the other visuali... |
#!/usr/bin/env python3
###############################
## FLAGS
###############################
VERBOSE = False
###############################
def usage():
print("===================================================================================================")
print(" For a given EPU Atlas directory, a... |
import numpy as np
import scipy.sparse as sp
import hetu as ht
from hetu.communicator.mpi_nccl_comm import ncclDataType_t, ncclRedOp_t
import math
import time
import argparse
'''
Usage example: (in Dir Hetu/)
Original graph data:
Single GPU:
mpirun -quiet --allow-run-as-root -np 1 python tests/... |
# ------------------------------------------------------------
# TermPlay is licensed under the Apache License, Version 2.0.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# A copy of the "License" is also provided with the source
# of this project. Unless required by applic... |
#!/usr/bin/env python3
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import sys
import argparse
from decimal import Decimal, InvalidOperat... |
import pkgutil
import pandas as pd
from io import BytesIO
import pysam
import pandas as pd
import string
import random
gene_df = pd.read_table(BytesIO(
pkgutil.get_data(__name__, "resources/gene_table.tsv")))
snp_df = pd.read_table(BytesIO(
pkgutil.get_data(__name__, "resources/snp_table.tsv")))
star_df = pd... |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... |
""" Code to fune-tuning the language models parameters
"""
import argparse
import logging
import os
from itertools import product
from timeit import default_timer
import tqdm
import pandas as pd
import torch
from torch.multiprocessing import Pool, cpu_count
from asr import samplers, models
from asr.utils.exp_utils im... |
"""
A Marketplace only reindexing that indexes only apps.
This avoids a lot of complexity for now. We might want an all encompassing
reindex command that has args for AMO and MKT.
"""
import datetime
import logging
import os
import sys
import time
from optparse import make_option
import pyelasticsearch
from celery ... |
#!/usr/bin/env python2.7
""" Reads network interface info from SolarWinds NPM into BIND DNS entries """
from datetime import datetime
from itertools import islice
import re
import getpass
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from jinja2 import Environment, FileSystemLoader
import or... |
import mmcv
import numpy as np
from numpy import random
from mmseg.datasets.builder import PIPELINES
from mmcv.utils import deprecated_api_warning
@PIPELINES.register_module()
class RandomCrop_Semi(object):
def __init__(self, crop_size, cat_max_ratio=1.0, ignore_index=255):
assert crop_size[0] > 0 and cro... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\mixins.py
# Compiled at: 2020-10-09 22:38:14
# Size of source mod 2**32: 18034 bytes
from _c... |
import os
import numpy as np
import pybiomart
import pickle
import MI
import pandas as pd
import scipy.sparse as sparse
def change_accessions(ids, input_format, output_format, species, tmp): # refseq->ensemble->entrez;
if input_format != output_format:
mart_file = 'biomart_%s_%s_%s.ipage.pickle' % (speci... |
# modu
# Copyright (c) 2006-2010 <NAME>
# http://modu.bubblehouse.org
#
#
# See LICENSE for details
import Cookie, time, re, random, os
import cPickle, thread, threading
from modu.web import user
from modu.persist import sql
"""
The change to WSGI support meant I needed to find a substitute for
mod_python.util.Sessi... |
# 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
# distrib... |
import requests, zipfile, io
import pandas as pd
import os
import numpy as np
def get_csv_zip_url(table_id)->str:
"""
Returns the url for a table_id to extract raw data from Stats Canada.
Parameters
--------
table_id : int
Statistics Canada Table ID
Returns
--------
str
... |
import tensorflow as tf
import numpy as np
import os
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.contrib.layers import flatten
from sklearn.utils import shuffle
from collections import namedtuple
CHECKPOINT_DIR = os.path.join(os.getcwd(), 'pretrained_model')
def load_data(dataset_name):... |
import abc
import copy
import logging
import typing as tp
import math
import re
from enum import Enum
import attr
from benchbuild.settings import CFG
LOG = logging.getLogger(__name__)
RequirementSubType = tp.TypeVar("RequirementSubType", bound='Requirement')
@attr.s
class Requirement:
"""
Base class for r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2018-present mundialis GmbH & Co. KG
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
... |
# -*- coding: utf-8 -*-
"""
libfb2.sb
~~~~~~~~~
Reads frostbite2 sb and toc files. Thanks to gibbed for the original
analysis of the XOR trick for the obfuscation.
:copyright: (c) Copyright 2011 by <NAME>, <NAME>, Pilate.
:license: BSD, see LICENSE for more details.
"""
import os
import shuti... |
"""
Example 5-2, pg 186 - Modeling Handwritten Images Using CNNs.
The training dataset that we'll use is the MNIST handwritten image dataset
(http://yann.lecun.com/exdb/mnist/)
All code is written to run on Tensorflow 2 using the embedded Keras API.
"""
####################################################... |
#!/usr/bin/env python3
import vizdoom as vzd
from vizdoom import *
import numpy as np
import imageio
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from random import randint
import os
import cv2
from tqdm import tqdm
def get_random_color():
return np.random.randint(0, 255, 3, dtype=np.int32)... |
from collections import OrderedDict
from datetime import datetime
from flask import g
from ..utils.defs import JOB_STATES, TIME_PERIODS
STATE_TO_TIMESTAMP = {
JOB_STATES.available: 'added_timestamp',
JOB_STATES.claimed: 'claimed_timestamp',
JOB_STATES.finished: 'finished_timestamp',
JOB_STATES.failed... |
# Copyright 2019 Google 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 writing,... |
from collections import deque
from contextlib import contextmanager
import time
import tensorflow as tf
import numpy as np
from baselines.common import explained_variance, zipsame, dataset
import baselines.common.tf_util as U
from baselines.common import colorize
from baselines.common.mpi_adam import MpiAdam
from bas... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import enum
import pytest
from mock import Mock
from stopwatch import (
format_report,
TraceAnnotation,
StopWatch,
)
class MyBuckets(enum.Enum):
BUCKET_A = 1
BUCKET_B = 2
def add_timers(... |
# Contains command classes that are used for various steps in running:
# - StageDataCommand - downloads workflow, writes job order, downloads input files
# - RunWorkflowCommand - runs workflow saving results
# - OrganizeOutputCommand - creates output project folder structure and various files
# - SaveOutputCommand - up... |
import decimal
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import timezone
from threepio import logger
from uuid import uuid4
class AllocationSource(models.Model):
uuid = models.UUIDField(default=uuid4, unique=True, editable... |
#!/usr/bin/env python
import argparse
import time
import random
import operator
from collections import namedtuple, deque
import signal
import logging
from strip import Strip
from led import MAX_RGB
logger = logging.getLogger(__name__)
def init_logging(log_level):
logging.basicConfig(level=log_level)
# catch ... |
# Copyright 2018 Flight Lab 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 w... |
import torch as t
import numpy as np
import mmd
from torch import nn
t.cuda.set_device(3)
# device = t.device("cuda" if t.cuda.is_available() else "cpu")
device = t.device("cpu")
t.manual_seed(13)
def mmd_loss(x_src, x_tar):
return mmd.mix_rbf_mmd2(x_src, x_tar, [GAMMA])
def l2_regularize(array):
loss = t.s... |
#! /usr/bin/python3
# -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals
import gym
import numpy as np
import random
from collections import deque
import theano
from theano import shared, function
import theano.tensor as T
from config import Config, ParamConfig
__author__ = 'fyabc'
r""... |
seedNum=10
import random, statistics
random.seed(seedNum)
import numpy
numpy.random.seed(seedNum)
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
tf.random.set_seed(seedNum)
import sklearn, numpy, sys
from sklearn import preprocessing, decomposition,... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 1 22:15:48 2015
@author: ajaver
"""
import os
import numpy as np
import pandas as pd
import tables
from scipy.interpolate import RectBivariateSpline
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter
from tierpsy.analysis.ske_create.helperIt... |
# 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
# distributed under the... |
"""
Serializers logic.
"""
from collections import Mapping
from datetime import datetime
from restic.exceptions import BadRequest
class ValidationError(Exception):
"""
Field validation error.
Should be raised by ``to_internal_value`` method of fields
if the user input is not valid for this field.
... |
import json
import os
import sys
import tempfile
import interfaces
from typing import Dict, List
from datetime import datetime
from inspect import getframeinfo, stack, getmembers, isfunction
# Classes
class Property:
def __init__(self, name, default=None):
self.name = name
self.value = None
... |
import cherrypy
import os
import tangelo
import tangelo.util
from tangelo.server import analyze_url
from tangelo.server import Content
import autobahn.websocket as ab_websocket
import autobahn.wamp as wamp
import twisted.internet.reactor
import subprocess
import threading
import ws4py
import sys
import time
vtkpython ... |
import os
import re
from trame.widgets.trame import ListBrowser
from paraview import simple
class ParaViewPathResolver:
def __init__(
self,
basePath,
name,
excludeRegex=r"^\.|~$|^\$",
groupRegex=r"[0-9]+\.",
**kwargs,
):
"""
Configure the way t... |
from scripts.util import get_account, encode_function_data, update_proxy_contract
from brownie import Contract, Leaderboard
from scripts.deploy_contract import *
import time
def test_create():
deploy_leaderboard()
id = create_leaderboard()
assert (id == 0)
def test_configure():
id = create_leaderbo... |
# encoding=utf8
import csv
import logging
import re
from collections import defaultdict
CSV_EXT = '.csv'
WEEKLY_SCHEDULE_FILENAME = 'config/weekly_schedule.tsv'
PICKUP_LOCATIONS_FILENAME = 'config/pickup_locations.csv'
BRANCHES = ['Edmonds', 'Redmond']
BRANCH_ERRORS = ['unknown_city', 'not_scheduled']
TIP_ITEM_NAM... |
# Created by zhouwang on 2018/5/31.
from .base import BaseRequestHandler, permission
import datetime
import re
import logging
logger = logging.getLogger()
def argements_valid(handler, pk=None):
error = {}
logfile_id = handler.get_argument('logfile_id', '')
search_pattern = handler.get_argument('search_p... |
import pyarrow.parquet as pq
import pandas as pd
import numpy as np
import json
from typing import List, Callable, Iterator, Union, Optional
from sportsdataverse.errors import SeasonNotFoundError
from sportsdataverse.dl_utils import download
def espn_mbb_schedule(dates=None, groups=None, season_type=None, limit=500) -... |
"""
Script which predicts on a set of data and saves the results to disk.
Comparable to bin/evaluate.py except ground truth data is not needed as
evaluation is not performed.
Can also be used to predict on (a) individual file(s) outside of the datasets
originally described in the hyperparameter files.
"""
import os
im... |
from ipdb import set_trace as st
import os
import yaml
import torch
import random
import itertools
import subprocess
import numpy as np
from loguru import logger
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
def init_exp(config, config_update, run_name):
'''
- git hashの取得
- ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import time
import copy
from collections import deque
import cv2 as cv
import numpy as np
import tensorflow as tf
from utils import CvFpsCalc
from utils import CvDrawText
def get_args():
parser = argparse.ArgumentParser()
parser.add_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class ResearchElementDefinition(domainresource.DomainResource):
""" A population, inter... |
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras.layers.core import Activation
from keras.layers.merge import Concatenate
from keras.models import Model
from keras.regularizers import l2
from ..utils.net_uti... |
from src.modules import Lstm, Attention, CRF
from src.utils import load_embedding_from_npy
from src.ner.datareader import ENTITY_PAD
import torch
from torch import nn
from torch.nn import functional as F
class LstmBasedSlotPredictor(nn.Module):
def __init__(self, params):
super(LstmBasedSlotPredictor, sel... |
# Training
import shutil
import os
import sys
import time
import pickle
from collections import defaultdict
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib.colors import ListedColormap, BoundaryNorm
import matplotlib.animatio... |
import numpy as np
from numpy import random
SMALL_VALUE = 0.00001
def calculate_stds(data, means):
# calculate stds for k-means result
data_groups = [[] for i in range(len(means))]
for ioi in data:
data_groups[np.argmin(abs(np.array(means) - ioi))].append(ioi)
stds = []
for group in data_groups:
if len(group... |
"""BDD100K segmentation tracking evaluation with CLEAR MOT metrics."""
import argparse
import json
import time
from functools import partial
from multiprocessing import Pool
from typing import Callable, Dict, List, Optional, Tuple, Union
import motmetrics as mm
import numpy as np
from pycocotools.mask import iou # ty... |
from __future__ import division, print_function, unicode_literals
import os
import re
from DateTime import DateTime
from HTMLParser import HTMLParser
def seperate_metadata_and_content(s):
"""
Given a string the metadata is seperated from the content. The string must be in the following format:
metada... |
from zope.interface import Interface, implements, directlyProvides
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from axiom import store, item, attributes
from imaginary import iimaginary, plugins, creation
from imaginary.creation import createCreator
from imaginary.plugins impo... |
#!/usr/bin/env python
import math
import random
import sys
import thread
import time
import glob
import os
import sys
import time
import argparse
import logging
import numpy as np
from datetime import datetime
import time
from nav_msgs.msg import Path
try:
sys.path.append(glob.glob('./PythonAPI/carla/dist/carl... |
# coding: utf-8
__author__ = '<NAME>'
__version__ = '0.3'
__email__ = '<EMAIL>'
__status__ = 'Development'
import re
import ssl
import idna
import logging
import requests
import urllib3
from socket import socket
from enum import Enum
from OpenSSL import SSL
from datetime import datetime
from oscrypto import tls
fr... |
import scipy.misc
import numpy as np
import os
from glob import glob
import tensorflow as tf
import tensorflow.contrib.slim as slim
from keras.datasets import cifar10, mnist
class ImageData:
def __init__(self, load_size, channels, custom_dataset):
self.load_size = load_size
self.channels = channe... |
###################################
# Created on Jul 29, 2015
#
# @author: <NAME>
#
###################################
from Tkconstants import LEFT, END, RIGHT
import tkMessageBox
from Tkinter import Toplevel, Entry, Button, BOTH, Frame, \
Label, TOP, X, OptionMenu, StringVar
import constants
from tools.to... |
import os
import platform
import shlex
import subprocess
import codecs
import tempfile
import threading
import sys
import locale
import struct
from Crypto.Cipher import AES
from backup.core.archive import ArchiveManager, ArchivePackage
class Encryptor:
"""'Abstract' base class for all encryption related tasks... |
'''
Example taken from Balaji et al.
Paper: https://arxiv.org/abs/1911.10641
GitHub: https://github.com/awslabs/or-rl-benchmarks
'''
import numpy as np
import gym
from gym import spaces, logger
from gym.utils import seeding
from or_gym.utils import assign_env_config
import copy
BIG_NEG_REWARD = -100
BIG_POS_REWARD = 1... |
#!/usr/bin/env python
import sympy as sym
import sympy.physics.mechanics as me
from opty.utils import state_derivatives
def n_link_pendulum_on_cart(n, cart_force=True, joint_torques=False,
spring_damper=False):
"""Returns the the symbolic first order equations of motion for a 2D
n... |
from simupy.block_diagram import BlockDiagram
from simupy import systems
import simupy_flight
import pandas as pd
import numpy as np
import os
import glob
from scipy import optimize
from nesc_testcase_helper import plot_nesc_comparisons, nesc_options, int_opts, benchmark
from nesc_testcase_helper import ft_per_m, kg_p... |
# #################################################################
# Deep Reinforcement Learning for Online Offloading in Wireless Powered Mobile-Edge Computing Networks
#
# This file contains a demo evaluating the performance of DROO by randomly turning on/off some WDs. It loads the training samples from ./data/dat... |
#!/usr/bin/env python3
import os
import unittest
from unittest.mock import patch
import securedrop.client as client
from securedrop.client import LIST_CONTACTS_TEST_FILENAME
from securedrop.server import ServerDriver, Server, DEFAULT_filename, AESWrapper
import json
import time
import contextlib
from multiprocessing... |
'''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import copy
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class SemGCNClassifier(nn.Module):
def __init__(self, embedding_matrix, opt):
super().... |
# !/usr/bin/env python3
# ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from Sparse-RCNN(github: https://github.com/PeizeSun/SparseR-CNN) created by <N... |
# -*- coding: utf-8 -*-
""" """
import datetime as dt
from varsomdata import getobservations as go
from varsomdata import getforecastapi as gfa
from varsomdata import varsomclasses as vc
from utilities import makelogs as ml
import setenvironment as env
__author__ = 'raek'
def _map_eval1_to_problem(evaluations_1):
... |
"""Variational Gaussian Process multiclass Decoder."""
import logging
import math
from typing import Any, Tuple
import numpy as np
import sklearn.base
import sklearn.utils.multiclass
import sklearn.utils.validation
import torch
import torch.distributions as dist
import torch.nn as nn
import torch.nn.functional as F
im... |
"""
Module for handling color lookup tables.
"""
import json
import numpy as np
import math
class LookupTable:
'''
Color table container.
- self.lut : Actual color LUT.
- self.x : Vector containing the value bins.
- self.adjustedBins : Vector containing the value bins
Wher... |
import uuid
import walrus
from spyne.application import Application
from spyne.service import ServiceBase
from spyne.model.primitive import Integer, Unicode
from spyne.model.complex import Iterable, ComplexModel, Array
from spyne.decorator import srpc
from spyne.protocol.soap import Soap11
import time
from lxml import ... |
# Copyright 2019 <NAME>
#
# 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, sof... |
# Author: <NAME> and <NAME> (based on the framework of <NAME>)
# License: BSD 3-clause
# Copyright (c) 2017, ELTE
from ehcmodel.common.kdl_template import *
from ehcmodel.common.data_preproc import *
from ehcmodel.common.exp_preproc import exp_preprocess
from pprint import pprint
import inspect
import theano.tensor a... |
import torch
import numpy as np
from itertools import groupby
np.seterr(divide="ignore")
def ctc_greedy_decode(outputBatch, inputLenBatch, eosIx, blank=0):
"""
Greedy search technique for CTC decoding.
This decoding method selects the most probable character at each time step. This is followed by the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.