text
stringlengths
6.04k
39.5k
""" @author: <NAME>, <NAME> @contact: <EMAIL>, <EMAIL> """ import math import os import random import time import warnings import sys import argparse import shutil import numpy as np from tqdm import tqdm import torch.backends.cudnn as cudnn from torch.optim import SGD from torch.utils.data import DataLoader import to...
#!/usr/bin/env python import codecs import io import os import subprocess import sys import textwrap import mock import py import pytest from click.testing import CliRunner from esss_fix_format import cli @pytest.fixture def sort_cfg_to_tmpdir(tmpdir): import shutil shutil.copyfile( os.path.join(os....
""" Distillation-prediction, where a distribution of policies is distilled through behavior cloning into a single model with memory for predicting the next action given past actions. This could be considered a meta-learned prediction model, or a prediction model for a POMDP where the unobservable state is the human pol...
import datetime import logging import time from google.appengine.api import memcache from google.appengine.api import users from google.appengine.ext import db #from google.appengine.ext.db import djangoforms #from django.forms import ModelForm from collections import OrderedDict from django import forms import sett...
import json, os from tqdm import tqdm import numpy as np import logging, pickle from ttt.utils import add_filehandler_for_logger logging.basicConfig( format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO ) logger = logging.get...
""" Author: <NAME> Data Transformation for building classification models """ from sklearn.base import TransformerMixin, BaseEstimator import random import pandas as pd import numpy as np from collections import defaultdict from sklearn.preprocessing import LabelEncoder, OneHotEncoder from sklearn.prepr...
import scipy.sparse import scipy.io import sparse import os import glob import numpy import cv2 # NEEDS TO BE COMMENTED OUT FOR LANKA # import matplotlib.pyplot as plt # Get the path to the directory holding random tensors. Error out # if this isn't set. TENSOR_PATH = os.environ['TACO_TENSOR_PATH'] # Get the validati...
""" This module contains the main command line interface for project creation, testing and handling """ from __future__ import absolute_import, division, generators, print_function, nested_scopes, with_statement import json import os import click import cobra from gsmodutils.exceptions import ProjectNotFound, Valida...
""" Synthetic Data Generation using a Bayesian Network Based on following paper <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. PrivBayes: Private Data Release via Bayesian Networks. (2017) """ import numpy as np import pandas as pd from pyhere import here from sklearn.base import BaseEstimator, TransformerMixin from sklear...
"""Rattr analyser context and utilities. A context holds a symbol table for a given scope (file, function, class, etc) within a given file. All contexts for a file for a tree with unidirectional references from child context to parent context. The root context of a file contains, amongst other things, the Python buil...
## code seems to be working for categorical features ## https://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm import math from collections import defaultdict from collections import Counter import numpy as np ############## For Classifier Tree ############## def entropy(Y): counts_per_class = Counte...
# selectedPoints.py copyright (c) 2003 <NAME> <<EMAIL>> # $Id$ # from module_kits.misc_kit.mixins import SubjectMixin from modules.viewers.slice3dVWRmodules.shared import s3dcGridMixin import operator import vtk import wx # ------------------------------------------------------------------------- class outputSelect...
""" bases: base classes for a chrisjen project <NAME> <<EMAIL>> Copyright 2020-2021, <NAME> License: Apache-2.0 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...
''' Written by <NAME> <<EMAIL>> First version Nov 9, 2016 Restructured Feb 4, 2018 - get data Restructured Sep 19, 2018 - DNN training Restructured Oct 13, 2018 - DNN training Restructured Feb 18, 2020 - UTI to STFT Restructured March 2, 2020 - improvements by <NAME> <<EMAIL>> - swish, scaling to [-1,1], network struc...
import numpy as np import itertools import numba as nb from .matrices import dict_from_matrix, parasail_aa_alphabet, identity_nb_distance_matrix, tcr_nb_distance_matrix __all__ = ['nb_hamming_distance', 'nb_vector_hamming_distance', 'nb_editdistance', 'nb_vector_editdistance', ...
''' 要处理的数据,类似于以下的情况 csv1 = [ "harden|james|curry", "wrestbrook|harden|durant", "paul|towns", ] csv2 = [ "curry", "wrestbrook|harden|durant", "paul|towns", ] csv3 = [ "harden|james|curry", "durant", "paul|towns", ] csv_s= [csv1,csv2,csv3] csv1 csv2 csv3 代表三个样本,csv_s代表一个bathc中的数据 csvi中的每一个元素,用逗号间隔的,代表一个特征...
from flask import Flask from threading import Thread from flask import send_file, send_from_directory, safe_join, abort, g, session, redirect, request, url_for, jsonify, render_template import os import random import requests import json import string app = Flask('') import discord from replit import db import logg...
import datetime from collections import OrderedDict import pandas as pd from google.cloud import bigquery CLIENT = None PROJECT_ID = None def insert_date_range(sql, date_range): start, end = date_range if start is None and end is None: return sql if start is None: return sql + ' WHERE `date` <= ...
"""Helpers to construct a transformation pipeline A transformer is, broadly speaking, a function that takes a DataFrame as it's only argument and returns a new DataFrame. Using this fairly simple definition we can compose together multiple transformations into new transformations, and we can parameterize the transform...
import logging import os # import sys # import datetime # import csv import time from ast import literal_eval import traceback # import json from timeit import default_timer as timer # import numpy as np import pandas as pd from tsfresh.feature_extraction import ( extract_features, ReasonableFeatureExtractionSett...
import curses, sys, random, time, threading import numpy as np from methods.menus import * import main_menu import leaderboard """ add winning row line """ # infinity INF = float("inf") #grid size size = 3 m_menu = ['1 player', '2 player', 'Return home'] botmenu = ['Easy', 'Medium', 'Hard'] s_me...
# -*- coding: utf-8 -*- import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.utils as vutils import numpy as np import matplotli...
import csv import os import json import re import bs4 from lxml import etree import subprocess from collections import defaultdict with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.json')) as infile: CONFIG = json.load(infile) CONFIG['utils_dir'] = os.path.dirname(os.path.realpath(__...
import numpy as np import brl_util as util import adfq_fun import pdb from scipy.stats import norm import matplotlib.pyplot as plt GAMMA = 0.9 ALPHA = 0.2 def rsme(N): alpha = 1.0 gamma = 0.9 TH = 15000 init_q = 20.0 init_var = 100.0 scene = 'simple' #test_names = ['ql-random', 'ql-egreed...
import os import logging import numpy as np import cv2.cv2 as cv2 import pandas as pd import random import json from PIL import Image, ImageFont from skimage.util import random_noise from bbox import BBox2D, XYXY from logger import log from ImageGenerator import ImageGenerator from ImageFunctions import ImageFuncti...
# # # 0=================================0 # | Kernel Point Convolutions | # 0=================================0 # # # ---------------------------------------------------------------------------------------------------------------------- # # Callable script to start a training on Model...
#! /usr/bin/env python3 import sys import argparse import os import re import shutil from pathlib import Path WSCRIPT_TEMPLATE = '''# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # def options(opt): # pass # def configure(conf): # conf.check_nonfatal(header_name='stdint.h...
# Copyright 2022, <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...
# TODO: es muy importante especificar la distincion de que una expression # puede dar como resultado: # - un valor entero en memoria. # - una referencia a un objeto. # Por tanto assign puede guardar en la direccion de memoria apuntada por # destiny tanto un numero entero como una referencia a un objeto. # ...
""" Workflow from computing the band structures """ from copy import deepcopy import aiida.orm as orm from aiida.common.extendeddicts import AttributeDict from aiida.engine import WorkChain, calcfunction, if_ from aiida.plugins import WorkflowFactory from aiida.tools import get_explicit_kpoints_path from ..common imp...
from islplot.support import * from islpy import * import unittest from test import support class TestGetVertexCoordinates(unittest.TestCase): def setUp(self): return def tearDown(self): return def test_2d_set_a(self): bset = BasicSet("{[i,j]: 0 <= i <= 10 and j = 0}") c =...
from loader import data_loader import os import json from entities import JiraTicket import re from utils import print_line_seperator from nltk.tokenize import word_tokenize from nltk.stem import PorterStemmer from nltk.corpus import stopwords import data_preprocessor import utils from sklearn.feature_extraction.text i...
import itertools import json import logging import operator import os import shutil import time from collections import Counter from datetime import datetime, timedelta from pathlib import Path from typing import List, Optional import arrow import jinja2 import pygit2 from botocore import hooks, xform_name from botoco...
# Copyright 2021 Toyota Research Institute. All rights reserved. import json import os from collections import OrderedDict, defaultdict from typing import Dict import cv2 import numpy as np import torch from detectron2.data import DatasetCatalog, MetadataCatalog from detectron2.data import detection_utils as d2_util...
import os from pathlib import Path from unittest.mock import MagicMock, Mock import pytest from click import FileError, NoSuchOption from robotidy.cli import read_config, validate_regex from robotidy.files import find_project_root, read_pyproject_config, get_paths, DEFAULT_EXCLUDES from robotidy.transformers import l...
# pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.models.programdb.similar_item.similar_item_unit_test.py is part of The # RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Test class for testing Similar Ite...
import string import random from pygments import highlight, token, lexer, styles from pygments.formatters import get_formatter_by_name from functools import partial import panel as pn class MlirLexer(lexer.RegexLexer): # This definition comes from a go clone of pygments # https://github.com/alecthomas/chroma/...
import math from itertools import cycle, islice from typing import List, Union, Tuple, Dict, Callable import numpy as np from trescope import DisplayOutputManager, DisplayOutputDesc, FileOutputManager, FileOutputDesc, Trescope from trescope.config import (Mesh3DConfig, Wireframe3DConfig) def __displayOutput(rows: i...
# -*- coding: utf-8 -*- # Python version: 2.7 # # Dependency Tree class # Simon Fraser University # <NAME> # # This module contains is used for loading # penn treebank format sentences with dependency information # 2 examples are provided in sampleDepTree.txt # from __future__ import absolute_import import os import sy...
import json import math import random import time from pathlib import Path from statistics import mean, stdev from typing import Callable, Dict, List, Optional, Tuple import pandas as pd from jenga.corruptions.generic import MissingValues from jenga.tasks.openml import OpenMLTask from jenga.utils import BINARY_CLASSIF...
# -*- encoding: utf-8 -*- """ Copyright (c) 2019 - present AppSeed.us """ from django.contrib.auth.decorators import login_required from django.shortcuts import render, get_object_or_404, redirect from django.template import loader from django.http import HttpResponse, request from django import template from app.mode...
# -*- coding: utf-8 eval: (yapf-mode 1) -*- # # February 19 2015, <NAME> <<EMAIL>> # # Copyright (c) 2015, Deutsche Telekom AG # # 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.a...
''' [1] https://github.com/bearpaw/pytorch-classification ''' from __future__ import print_function import argparse import os import shutil import time import random import numpy as np import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim impo...
import numpy as np import matplotlib.pyplot as plt import pickle from pathlib import Path import torch from google.protobuf import text_format from second.utils import simplevis from second.pytorch.train import build_network from second.protos import pipeline_pb2 from second.utils import config_tool import time import ...
import torch import torch.nn as nn import torch.nn.functional as F from torchvision.models.resnet import resnet18, resnet34, resnet50 import math import utils import argparse from torch.utils.data import DataLoader import torch.optim as optim from tqdm import tqdm import pandas as pd # ## Utility Functions class Lam...
from functools import wraps import math from packaging import version import warnings import weakref import torch from torch.optim.optimizer import Optimizer # For torch versions older than 1.4.0 use the UserDefined _LRScheduler (_LRScheduler of older versions) as base class. if version.parse(torch.__version__) >= v...
#!/usr/bin/env python import os, sys, re, copy import numpy as np try: import indigo except: pass import aqml.cheminfo as co import aqml.cheminfo.graph as cg import networkx as nx import aqml.cheminfo.molecule.geometry as cmg from aqml.cheminfo.molecule.elements import Elements #__all__ = [ 'rawmol_indigo' ] T,F...
import os import tempfile import unittest from LemonGraph import Graph, Serializer, dirlist, Query node = lambda i: dict((k, Nodes[i][k]) for k in ('type', 'value')) edge = lambda i: dict((k, Edges[i][k]) for k in ('type', 'value', 'src', 'tgt')) Nodes = [ {'type': 'foo', 'value': 'bar', 'properties': {'np1k': '...
# Copyright 2019–2020 Leibniz Institute for Psychology # # 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, ...
__all__ = ( 'Pseudowire', 'PseudowireIPv4Neighbor', 'PseudowireIPv6Neighbor', 'PseudowireEviNeighbor', 'PseudowireClass', # Abstract classes: 'PseudowireNeighbor', 'PseudowireIPNeighbor', ) import functools import weakref import ipaddress from enum import Enum from pyats.datastructure...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os import threading import sys import shellenv import sublime if sys.version_info < (3,): str_cls = unicode # noqa py2 = True else: str_cls = str py2 = False __version__ = '0.9.0' __version_inf...
import json import numpy as np import os from PIL import Image import pyautogui as ag import six import time import win32gui as wg def _load_image(image_dir, name): image = Image.open(os.path.join(image_dir, '{}.png'.format(name))) image = (np.asarray(image) > 100).astype(np.int32) image = image[:,:,0] * ...
import os import numpy as np from torch.optim import Adam from collections import deque import torch import torch.nn as nn from torch.nn import functional as F from torch.distributions import Categorical def initialize_weights_he(m): if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d): torch.nn.init....
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : visualize-dataset.py # Author : <NAME> # Email : <EMAIL> # Date : 11/18/2018 # # This file is part of NSCL-PyTorch. # Distributed under terms of the MIT license. import os.path as osp from PIL import Image import torch.backends.cudnn as cudnn import matpl...
from app.core.consts import WebsocketProtocol as protocol from app.rabbitmq import rabbit_handler from app.redis.connection import redis_connector from app.websockets.connection_manager import manager from datetime import datetime from loguru import logger import asyncio async def join_player(world_id: str, user_id: ...
import torch,os,random,time from torch.utils.data import Dataset, DataLoader from PIL import Image import numpy as np import matplotlib.pyplot as plt def test_generate_img(): N = 256 X = np.arange(-3,3,6/N) Y = np.arange(-3,3,6/N) X,Y=np.meshgrid(X,Y) unwraped = [] wrapped = [] ''' ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################## # # Project: pyMetalink # URL: https://github.com/metalink-dev/pymetalink # E-mail: <EMAIL> # # Copyright: (C) 2011, <NAME> # License: MIT # # Permission is hereby granted, free of charge, ...
""" Copyright (c) 2018, Sandia National Labs, SunSpec Alliance and CanmetENERGY(Natural Resources Canada) 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 the a...
from datetime import date, timedelta import random import easygui import math import re from flexible_logger import log from decorators import pre_process_inputs from machine_learning_lib import random_round # ---------------------------------- REVIEW SCHEDULE STRINGS -------------------------------------- def _g...
# # Copyright (c) 2016, 2020, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, # as published by the Free Software Foundation. # # This program is also distributed with certain software (including ...
""" Tektronix RSA_API .h file Python Conversion Author: <NAME> Date created: 5/17 Date edited: 5/17 Windows 7 64-bit RSA API version 3.9.0029 Python 3.6.0 64-bit (Anaconda 4.3.0) Download Anaconda: http://continuum.io/downloads Anaconda includes NumPy and MatPlotLib Download the RSA_API: http://www.tek.com/model/rsa306...
import gym import gym.wrappers import numpy as np from scipy.integrate import solve_ivp import torch from torchdiffeq import odeint from experiment_single_embed.data import get_dataset from symplectic.nn_models import PSD, MLP from symplectic.symoden import SymODEN_T from symplectic.utils import from_pickle def get_...
""" Variational Inference algorithm for multivariate Hawkes processes, according to Linderman, <NAME>., and Adams, <NAME>. Scalable Bayesian Inference for Excitatory Point Process Networks. arXiv preprint arXiv:1507.03228, 2015. NOTE: Implementation not finished. Running into numerical issues and/or bugs. FI...
# Author: <NAME> # see https://www.metaculus.com/tournament/realtimepandemic/ import matplotlib.pyplot as plt import matplotlib.dates as mdates import numpy as np import datetime as dt import pandas as pd from statsmodels.tsa.stattools import adfuller from statsmodels.graphics.tsaplots import plot_acf, plot_pacf import...
from argparse import ArgumentParser import random import string import sys import time from typing import Dict, List, Tuple, Sequence, Optional, Union, Set, TypeVar from PIL import Image, ImageDraw, ImageFont import keras from keras.layers import Dense from keras.models import Sequential import numpy as np from wildc...
import uuid from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse from django.conf import settings from django.db.models import Q from django.core.files import File from projects.models import Project, ProjectLog, Environment from reports.models import Report, ...
#!/usr/bin/python #from array import * #from numpy import * #from pylab import * import numpy as np G = 6.67384e-11 pi = np.pi twopi = 2.0 * pi piby2 = .50 * pi AU_m = 149597870700.00000 ################################################################################################################## ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # flake8: noqa import sys import os from pfb import set_threads import pyscilog pyscilog.init('pfb') log = pyscilog.get_logger('PFB') def main(): _main(dest=log) def _main(dest=sys.stdout): from pfb.parser import create_parser args = create_parser().parse_a...
# -*- coding: utf-8 -*- # File: eval.py import tqdm import os from collections import namedtuple import numpy as np import cv2 from tensorpack.utils.utils import get_tqdm_kwargs import config from utils import * def post_processing(pred1, temp_weight): struct = ndimage.generate_binary_structure(3, 2) margin ...
''' # Xs and Os and Deep Reinforcement Learning ### Deep Q-Learning using an Open AI Gym-like Environment Concise working example of Deep Q-learning applied to an environment similar to gym/envs/toy_text/ in ai gym #### References - OpenAI gym: https://github.com/openai/gym/ - Keras-RL: https://github.com/keras-rl/...
#!/usr/bin/python # Parse outputs generated for solution to Brent equations # and solutions found at: # http://www.algebra.uni-linz.ac.at/research/matrix-multiplication/ import os.path import os import sys import re import getopt import circuit import brent import glob def usage(name): print("Usage: %s [-h] [-x...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import torch from torch.utils.data import Dataset import torchvision.transforms as transforms import torchvision import h5py import numpy as np import os import cv2 import skimage.transform import random import matplotlib #from utils import d3_41_colors_rgb class BaseDataset(Dataset): def __init__(self, ...
import datetime import multiprocessing import os import sys import time import traceback import numpy as np save_dir = os.path.join('checkpoints', 'auto-cifar10') assert os.path.exists(save_dir) real_stdout = sys.stdout real_stderr = sys.stderr epoch_max_time = 5 # 5 sec per train epoch, typically around 1 sec on ...
""" This script was made by soeque1 at 28/07/20. To implement code of your network using operation from ops.py. """ import logging from logging import getLogger from typing import List import torch from numpy.core.multiarray import concatenate from torch import nn, tensor from transformers import GPT2Tokenize...
import io import os import glob import warnings from datetime import datetime from pprint import pprint from copy import deepcopy from typing import Any, Optional, Union import pandas as pd from .game_map import GameMap from .dataframe import ( DataFrameLoader, UnifiedDataFrame, create_masks, ) from .code...
# -*- coding: utf-8 -*- """ Folium Tests ------- """ import json import os import branca.element import folium from folium.features import PolygonMarker, RectangleMarker, TopoJson import jinja2 from jinja2 import Environment, PackageLoader import pandas as pd import pytest from six import PY3 try: from un...
from django.shortcuts import render, redirect from django.contrib import messages import os, csv, io, numpy as np from math import sqrt from .forms import StaffForm from .models import uCalibrationUpdate, uRawDataModel from staffs.models import Staff, StaffType from range_calibration.models import RangeParameter...
# Copyright 2021, <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, software...
# pylint: disable=too-many-public-methods from dataclasses import dataclass from typing import Dict, List, Optional, TypeVar from electionguard.utils import get_optional from .ballot import SubmittedBallot from .decryption import ( compute_compensated_decryption_share, compute_compensated_decryption_share_fo...
""" Permission read functions. This is a simple proxy to the permission system implemented in SQL. See sql/functions.sql c_can_see_cg C can view existence of CG c_can_change_cg C can change/delete CG itself, including add/edit/delete fields c_can_see_members_cg C c...
""" WEC Author: <NAME> <<EMAIL>> Has functions set up for checking validity of - link (valid_link) - email (valid_email) """ from validate_email import validate_email def valid_link(raw_link, link): """ Valid: returns false for links which are social media or have words which not in the zone Parameter: ...
import wx from xlrd import XLRDError from frames.frame_design import ObjectDialog, SectionSeparator, VGAP, HGAP, GAP from frames.frame_utilities import GetFilePath from import_ import FromExcel import _icons as ico LIQUID_UNITS = ['stb/day', 'Mstb/day'] GAS_UNITS = ['Mscf/day', 'MMscf/day'] UPTIME_UNITS =...
""" Minesweeper game Download it to scripts directory and import however you like. I believe there are no name conflicts. ------IMPORTANT------- you should put minesweeper.root.mainloop() (or root.mainloop()) as a last line in your script in order to Controls from within your scr...
from datetime import datetime from decimal import Decimal from bson import json_util from django.core.serializers import serialize from django.db.models import Sum, Max, Min from django.shortcuts import render, redirect, get_object_or_404 from . import mongoDatabase from .forms import WalletAccountForm, WalletCreditF...
# -*- coding: utf-8 -*- import os import shutil import ipdb import numpy as np import string from collections import Counter import pandas as pd from tqdm import tqdm import random import time from functools import wraps import collections import sklearn import utils # from utils import log_time_delta from tqdm import...
import boto3 import json import logging import datetime from calendar import monthrange from common import create_client from common import retry from common import clean_account_name from common import create_report_table from common import swap_report_table from common import get_report_table from common import ver...
import cv2 import depthai import numpy as np # numpy - manipulate the packet data returned by depthai import math from math import cos, sin, tan, pi from paho.mqtt import client as mqtt_client from time import sleep import time from scipy.optimize import minimize import datetime broker = '10.44.99.11' port = 1883 pub...
from __future__ import print_function, unicode_literals, absolute_import, division import pkg_resources # non-standard imports from astropy import units as u from astropy.coordinates.matrix_utilities import rotation_matrix from astropy.coordinates import CartesianRepresentation from astropy.utils import lazyproperty f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 17 18:45:28 2019 @author: eddy """ ''' the complete cascade as described in the literature ''' from error_and_compare import * from Bob_Alice import * from binary_protocol import * from defs_for_cascade import * import time as tm import random as...
import discord from random import randint, choice from discord.ext import commands from decorators import * from json import loads from time import time from asyncio import sleep from random import choice, randint from gc import collect class economy(commands.Cog): def __init__(self, client): self.blacklis...
from typing import Dict, Tuple import numpy import math from HyQPy import HyQObservation from gym_robo.utils import quaternion_to_euler from gym_robo.robots import HyQSim from gym_robo.tasks import HyQState from gym.spaces import Box #velocity class MovingAverageBuffer: def __init__(self, size=100): self.s...
#!/usr/bin/env python2 # # Copyright (C) 2014 The Android Open Source Project # # 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 requi...
import argparse from module import NodeBernNet from utils.load_data import load_data import torch.optim as optim import torch import torch.nn.functional as F import numpy as np import matplotlib.pyplot as plt import logging import os from scipy import special device = torch.device("cuda:0" if torch.cuda.is_available()...
from threading import Timer import os import re import time import pickle from ctypes import * import ctypes.wintypes as wtypes from collections import deque # Library imports import numpy as np import torch import cv2 from mss import mss import win32.win32gui as wgui import win32process import keyboard import torch.n...
"""script to train the ssd framework on PASCAL VOC.""" import shutil import keras import click import random from datetime import datetime from keras.callbacks import TensorBoard, ModelCheckpoint, LearningRateScheduler from keras.applications.imagenet_utils import preprocess_input from keras import backend as K from...
import requests import pandas as pd import numpy as np import os import unidecode as udc def get_points(place): """ Transfers one given place to points by following rules: 1st place = 200p 2nd place = 190p 3rd place = 182p 4th place = 176p 5th place = 172p 6th place = 170p 7th plac...
import shutil import logging from algos.mcts.mcts import MCTSPlayer, MCTSNode from algos.encoders.trojangoPlane import TrojanGoPlane from algos.utils import set_gpu_memory_target, save_model_to_disk, load_model_from_disk, display_board, print_loop_info, system_info, bcolors, LOG_FORMAT from algos.gohelper import * from...
#!/usr/local/bin/python # coding=utf-8 # Create your views here. from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render, get_object_or_404, redirect from django.contrib import auth from django.contrib.auth.decorators import login_required, permission_required from django.contrib....
import uuid as uuid from uuid import UUID from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType as DjangoContentType from django....