text stringlengths 3.07k 22.1k |
|---|
# Copyright 2022 Google LLC.
#
# 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, ... |
import sys
import os
import copy
import csv
import json
def print_help_string():
print('''
Usage: python3 {} arguments
Arguments:
-h Print help string
-lt filename.csv Loads phoneme vectors from specified csv file
-lj filename.json Loads phoneme vectors from specified json file
... |
###########################################################################
#
# this module meant to provide file handling functions
#
###########################################################################
import os
import shutil
# will return the content of a directory (full paths)
def get_dir_content(dir_path... |
#!/usr/bin/env python
###############################################################################
# processor.py - Class used to generate config file and make calls to the
# snakemake pipeline
###############################################################################
# ... |
import warnings
from chainercv.utils.iterator.unzip import unzip
def apply_to_iterator(func, iterator, n_input=1, hook=None, comm=None):
"""Apply a function/method to batches from an iterator.
This function applies a function/method to an iterator of batches.
It assumes that the iterator iterates over ... |
import logging
from dd import cudd
from nose.tools import assert_raises
from common import Tests
from common_bdd import Tests as BDDTests
from common_cudd import Tests as CuddTests
logging.getLogger('astutils').setLevel('ERROR')
Tests.DD = cudd.BDD
BDDTests.DD = cudd.BDD
CuddTests.DD = cudd.BDD
def test_insert_v... |
from __future__ import print_function
import argparse
import os
import random
import logging
import time
# Ray imports
import ray
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.agents.agent import Agent, with_common_config
from ray.tune.registry import register_env
import ray.tune as tune
from ra... |
import string
from functools import partial
import hypothesis
import hypothesis.extra.numpy as np_st
import hypothesis.strategies as st
import numpy as np
import openmdao.api as om
import pymop
import scipy as sp
import scop
from deap.tools import uniform_reference_points
from scop import DatasetRecorder
import omnsg... |
from pypy.interpreter.error import OperationError
from pypy.objspace.std import newformat
from pypy.objspace.std.inttype import wrapint
from pypy.interpreter.pyopcode import merge_taints, checked_settaint
from pypy.objspace.std.model import registerimplementation, W_Object
from pypy.objspace.std.multimethod import Fail... |
"""
Mixin functionality for experiments, tests, and simulations.
This includes recordings measures used to generate plots in JC's thesis.
"""
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import six
import itertools as it
import ubelt as ub
import pa... |
"""Generating templates of ECG and PPG complexes"""
import numpy as np
from scipy.special import erf
from sklearn.preprocessing import MinMaxScaler
from scipy import signal
import scipy
from scipy.signal import argrelextrema
from scipy.integrate import solve_ivp
from vital_sqi.preprocess.preprocess_signal import squee... |
from flask import url_for
from kqueen_ui.api import KQueenResponse
import pytest
@pytest.mark.parametrize('view,values', [
('ui.index', {}),
('ui.overview_pies', {}),
('ui.logout', {}),
('ui.organization_manage', {}),
('ui.user_invite', {}),
('ui.user_delete', {'user_id': 1}),
('ui.user_c... |
import collections
import csv
import io
import json
import os
from collections import OrderedDict
import sphinxcontrib.jsonschema
from docutils import nodes
from docutils.parsers.rst import Directive, directives
from docutils.parsers.rst.directives.admonitions import Note
from docutils.parsers.rst.directives.tables im... |
"""
Provides classes that represent complete taxonomies, built using components from
the taxacomponents module.
"""
from taxolib.taxacomponents import Citation, RankTable, Taxon
from taxolib.taxonvisitor import TaxonVisitor
from taxolib.taxonvisitors_concrete import PrintTaxonVisitor, CSVTaxonVisitor
from taxolib.nam... |
import math
import uuid
from sdp_par_model import reports
from sdp_par_model.config import PipelineConfig
from sdp_par_model.parameters.definitions import \
Pipelines, HPSOs, Constants as c
class Task(object):
def __init__(self, name, hpso, result_name, time, cost, edge_cost):
"""Creates a new task ... |
import re
import os
import sys
import json
import random
import logging
import urllib.request
from datetime import datetime, timedelta
# import 3rd party modules
sys.path.append('./lib')
import slackweb
import feedparser
from bs4 import BeautifulSoup
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
def... |
"""
Generators for some graphs derived from the D-Wave System.
"""
import networkx as nx
from networkx.algorithms.bipartite import color
from networkx import diameter
from dwave_networkx import _PY2
from dwave_networkx.exceptions import DWaveNetworkXException
__all__ = ['chimera_graph', 'find_chimera_indices']
# co... |
from conans import ConanFile, CMake, tools
import os
def merge_dicts_for_sdk(a, b):
res = a.copy()
res.update(b)
return res
class AwssdkcppConan(ConanFile):
name = "aws-sdk-cpp"
license = "Apache 2.0"
url = "https://github.com/toge/conan-aws-sdk-cpp"
description = "Conan Package for aws-sd... |
# Open Affected Documents
import adsk.core
import adsk.fusion
import os
from ...lib import fusion360utils as futil
from ... import config
app = adsk.core.Application.get()
ui = app.userInterface
# TODO *** コマンドのID情報を指定します。 ***
CMD_ID = f'{config.COMPANY_NAME}_{config.ADDIN_NAME}_openAffectedDocuments'
CMD... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
sys.path.append('./devices')
from devices.camera import RealSenseD400
import threading
from operator import itemgetter
import _init_paths
import os
import numpy as np
import argparse
import pprin... |
"""
tests.components.tests_crawler.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New webServer logic tests implementation, done in order to introduce new
concepts to crawler (noindex, nofollow, sitemaps.xml, robots.txt, etc) as
long as testing currently implemented things.
:copyright: (c) 2019 by <NAME>.
:license: Apache2, ... |
""" A* Shortest Path Finding Algorithm implementation
and interactive visualization """
import pygame
import argparse
from heapq import heappush, heappop
class Cell:
def __init__(self, cell_row: int, cell_col: int,
display_width: int, display_height: int, total_cells: int, NONE: tuple):
... |
# Authors: yuanming-hu and k-ye
import taichi as ti
import numpy as np
import random
import os
write_to_disk = True
ti.init(arch=ti.gpu) # Try to run on GPU
quality = 1 # Use a larger value for higher-res simulations
n_grid = (40 * quality, 80 * quality)
dx, inv_dx = 1 / n_grid[1], n_grid[1]
dt = 1e-4 / quality
p_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 09:12:23 2020
@author: dgratz
"""
from .setup_sim import setup_sim
from .run_sims import SimRunner
from .run_sims_functions import peakCurr, normalized2val
import numpy as np
from functools import partial, wraps
import copy
from sklearn.preproc... |
#!/usr/bin/env python
# SPARK(pyspk) Fireworks Demo script
# original source code is by <NAME>
#
# ////////////////////////////////////////////////////////////////////////////////
# // SPARK particle engine //
# // Copyright (C) 2008-2009 - <NAME> - <EMAIL> ... |
import gc
import pickle
import sqlite3
import changefinder
import pandas as pd
from imblearn.under_sampling import RandomUnderSampler
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import sys, os
from sklearn.utils import shuffle
from codes.rl.upbit_rl_utils import array_2d_to_dict_list_order_boo... |
"""
pool_tr
pool_exec = ThreadPoolExecutor(len(FREEM_SERVICES))
"""
# pylint: disable=too-many-locals
from typing import List, Any, Tuple, Dict, Deque, Optional, Union
import logging
from concurrent.futures import ThreadPoolExecutor, as_completed
from collections import deque
from logzero import logger
# from lo... |
import pandas as pd
import json
import os
from .. import plot
from .cython import seq_dist
from . import stats
from anndata import AnnData
import numpy as np
import time
class tcrdist_dataset(AnnData) :
def __init__(self, seq_data, organism, only_betas = False) :
super(tcrdist_dataset, self).__init__(shape... |
import mysql.connector
from flask import Flask, request, jsonify, redirect
import json
from datetime import datetime
from furl import furl
app = Flask(__name__)
mydb = mysql.connector.connect(
host="127.0.0.1",
#port=3308,
#user="python_boi",
user="admin",
#passwd="<PASSWORD>",
passwd="",
d... |
#!/usr/bin/env python3
from alpha_vantage.timeseries import TimeSeries
from datetime import datetime
import numpy as np
import pandas as pd
import pickle
import progressbar
import time
import api_keys
def word_to_vec(word_string):
return
def fetch_data(interval="1min", num_stocks=10, cache_data=False):
"""
... |
# gui.py
#
# This program let people play chess with AI via GUI
# wxPython installation needed
#
# Author: <NAME> & <NAME>
#
# 2019/01/24
import wx
import chess
import ce
class BoardFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Chess AI", size=(470, 470))
self.board=ches... |
#-----------------------------------------------------------------------
# Copyright (C) 2020, All rights reserved
#
# <NAME>
#
#-----------------------------------------------------------------------
#=======================================================================
#
# DESCRIPTION:
# This software is part of a... |
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QTextEdit, QLabel, QComboBox, QLineEdit
from PyQt5 import QtWidgets, uic
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import Qt
import sys
import csv
YES = 2
PROBABLY = 1
DONTKNOW = 0
PROBABLYNOT = -1
NO = -2
class UI_poke20(QMain... |
import json
import os
import pathlib
from abc import ABC, abstractmethod
import click
import yaml
from .writer import CwsWriter, CwsWriterError
INITIAL_STATE_NAME = "Init"
LAMBDA_ERROR_FALLBACK = "MicroServiceErrorFallback"
class CwsSFNTranslater(CwsWriter):
def __init__(self, app=None, name='translate-sfn', ... |
#coding=utf-8
import numpy as np
import codecs
import os
import sys
import time
from functools import reduce
'''
load dict data which generated by trans_fastText
'''
def load_fastText_dict(dict_path):
dict = np.load(dict_path)
return dict
'''
load word embedding data which generated by trans_fastText
'''
def ... |
import os
import sys
import json
import requests
# json模块常用的四个函数
# 1 import json
# 2 json.load() # 将一个存储在文件中的json对象(str)转化为相对应的python对象
# 3 json.loads() # 将一个json对象(str)转化为相对应的python对象
# 4 json.dump() # 将python的对象转化为对应的json对象(str),并存放在文件中
# 5 json.dumps() # 将python的对象转化为对应的json对象(str)
dirname, filename = os.path.spli... |
import sublime_plugin
try: # Python 3
from .haxe_helper import HaxeComplete_inst
from .haxe_generate_code_helper import *
from .haxe_format import format_statement
except (ValueError): # Python 2
from haxe_helper import HaxeComplete_inst
from haxe_generate_code_helper import *
from haxe_forma... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
"""
A module with timeseries analysis tools.
"""
import logging
from datetime import datetime, timedelta
import pandas as pd
import pytz
from pandas.api.types import is_datetimetz
from pandas.core.algorithms import mode
from pandas.tseries.frequencies import to_offset
def tz_convert_multiindex(ts, to_tz='UTC'):
... |
'''
Derived from: https://github.com/jonasrothfuss/ProMP/blob/master/meta_policy_search/envs/mujoco_envs/ant_rand_direc_2d.py
'''
import numpy as np
from collections import OrderedDict
from gym import utils
from rlkit.envs.meta_mujoco_env import MetaMujocoEnv
from rlkit.envs.meta_task_params_sampler import MetaTaskPara... |
"""
NAME:
calculate_outflow_velocity.py
AUTHOR:
<NAME>
Swinburne
2019
EMAIL:
<<EMAIL>>
PURPOSE:
Calculates the outflow velocity from koffee results.
Written on MacOS Mojave 10.14.5, with Python 3.7
FUNCTIONS INCLUDED:
calc_outflow_vel
calc_save_as_fits
binned_velocities
MODIFICATION HISTORY:
v... |
#!/usr/bin/python
'''
--- Day 7: The Sum of Its Parts ---
You find yourself standing on a snow-covered coastline; apparently, you landed a little off course. The region is too hilly to see the North Pole from here, but you do spot some Elves that seem to be trying to unpack something that washed ashore. It's quite col... |
from __future__ import print_function
from collections import defaultdict
import build_model
import pddl_to_prolog
import pddl
import fact_groups
import timers
import sys
import normalize
USE_PARTIAL_ENCODING = True
def get_fluent_facts(task, model):
fluent_predicates = set()
for action in task.actions:
for ef... |
# Name: parallel_runs.py
# Author: <NAME>
# Description: 1. Run multiple SCALE-Sim commands parellelly.
# Import libraries
import os
from os import listdir
from absl import app
import time
import subprocess
# Executing Paralle scale.py runs
def parallel_runs( config_files_list=[],
topology_files_list=[],
... |
import streamlit as st
import ssl
import pymongo
import os
import pandas as pd
import json
import re
import numpy as np
from pathlib import Path
import shutil
def get_log_directory_path():
return os.path.join((Path(__file__).resolve().parent.parent.parent), 'logs')
def delete_and_create_log_directory():
log_... |
#!/usr/bin/env python
import os
import numpy as np
import math
import time
from util import SaxTerminal
import itertools
class DictionarySizeIsNotSupported(Exception): pass
class SAX(object):
"""
This class is for computing the Symbolic Aggregate approXimation
adapted from https://github.com/nphoff/sax... |
"""Example for exploring SQLAlchemy
This project provide code how to use AQLAlchemy. THis idea is to build an
example sequentially in steps to give new users the idea on where to start
and how to progress. Along the way some principles will be exhibited. The
code should be self-explanatory without as little as... |
from typing import TYPE_CHECKING
from six import PY3, text_type
from .exceptions import JudyError
from .internal import _cjudy, _ffi, _load
if TYPE_CHECKING:
from typing import Iterable, Mapping, Optional, Tuple, Union
__all__ = ["JudySL", "JudySLIterator"]
_load()
class StringCache(object):
MAX_BUILDER... |
import numpy as np
import pickle
import sys
import time
import torch
import yaml
from baller2vecplusplus import Baller2VecPlusPlus
from baller2vecplusplus_dataset import Baller2VecPlusPlusDataset
from settings import *
from torch import nn, optim
from torch.utils.data import DataLoader
from toy_dataset import ToyDatas... |
import datetime
import functools
import click
from cryptography import x509
from cryptography.hazmat.backends import default_backend as crypto_default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization as crypto_serialization
from cryptography.hazmat.prim... |
'''Dark Souls 3 Translation Scrambler'''
# pylint: disable=C0413,C0103,C0111
import asyncio
import datetime
import os
import shutil
import subprocess
import sys
import time
import re
from pathlib import Path
import fsb5
import paco
from . import data
print('d3translate 0.1.1')
print()
if not data.credentialspath.... |
#!/usr/bin/env python
import faulthandler
faulthandler.enable()
import time
import datetime
import cv2
import numpy as np
import pyrealsense2 as rs
import rospy
import tf2_ros
from std_msgs.msg import Float32
from darknet_detector import DarknetDetector
from aim_turret import AimTurret
from video_dumper import Vide... |
# detectors: lib to detect what hardware tags apply to the current system
#
# Copyright (C) 2012 Canonical
#
# Author:
# <NAME> <<EMAIL>>
#
# This program 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; eith... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.forms.models import modelform_factory
from django.forms import TextInput, RadioSelect, CheckboxSelectMultiple
from django.shortcuts import redirect, HttpResponseRedirect
from django.urls import reverse
from django.views.generic import CreateView, Det... |
#!/usr/bin/python3
# Functions
# CodeWriter21
# Imports
from telethon import TelegramClient
from telethon.errors.rpcerrorlist import ChannelInvalidError, ChannelPrivateError, \
UserBannedInChannelError, AuthKeyDuplicatedError, UsernameNotOccupiedError
from telethon.errors import SessionPasswordNeededError
from tel... |
import torch
from PIL import Image
import os
import os.path
import errno
import numpy as np
import sys
import json
import random
import cv2
#Below are the transforms that depend on torch
#Delete these to remove the torch dependency
class ToTensor(object):
"""
Converts PIL image to tensor. Does NOT normalize
... |
import os
import shutil
import glob
import subprocess
import yaml
from charmhelpers import fetch
from charmhelpers.core import host
from charmhelpers.core import hookenv
from charmhelpers.core.services import helpers
from charmhelpers.core.services.base import (
ManagerCallback,
PortManagerCallback,
)
from... |
import pygame
from pygame.locals import *
import time
import random
import math
from pygame.surface import Surface
from anim_sprite import AnimTimer
class FONT_CACHE():
LETTERS = {}
RGB_PROGRESS = {}
@staticmethod
def preload_cache(pyfont, letters):
for letter in letters:
FONT_CA... |
import os
import pickle
import hashlib
import psutil
import datetime
import subprocess
import time
import signal
import sys
import ctypes
dblist = ["db\WHITELIST", "db\BLACKLIST", "db\SEEN", "db\FAILED"]
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f... |
'''Base configurations for tests'''
import os
import pytest
import bs4 as bs
import subprocess
import sys
sys.path.insert(0, 'generator')
import webpageGenerator as gen
@pytest.fixture(scope="session")
def sitemap_name():
return 'sitemap.xml'
@pytest.fixture(scope="session")
def root_directory():
return su... |
import functools
import joblib
import numpy as np
import itertools
import time
import scipy
from scipy import special
import matplotlib.pyplot as plt
cachedir = '.pycache'
memory = joblib.Memory(cachedir, verbose=0)
def clockwork(res, debug=False):
"""
get start, step size and no. of steps from clockwork... |
"""MRP server authentication code."""
import logging
import hashlib
import binascii
from collections import namedtuple
import curve25519
from srptools import (SRPContext, SRPServerSession, constants)
from ed25519.keys import SigningKey
from pyatv.mrp import (chacha20, messages, protobuf, tlv8)
from pyatv.mrp.srp imp... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script that takes as input a matrix counts (spots x genes), a tab delimited
file containing the dimensionality reduced (manifold) coordinates of the spots,
a meta-data file containing variables with information for spot (rows) and a
optional list of genes and then gen... |
#!/usr/bin/env python3
"""An interface for scan on pyqt """
import sys
import os
import time
from datetime import datetime, timedelta
from glob import glob
from gui.window import Ui_MainWindow
from scan import ScanMotors
from PyQt5 import QtWidgets
from PyQt5.QtCore import QThread, QObject, pyqtSlot, pyqtSignal
from ... |
"""
whiteBalance.py
Demonstrates how you can control the white balance on a (color) camera. Furthermore, it also can
instruct the camera to perform automatic white balance.
Note 1: The sample application 'autoexposure.py' also shows how to control camera features that
support continuous and one-time auto adj... |
"""
file: analyze.py
author: <NAME>
incomplete
"""
"""
Part 1:
1. Calculate the mean and median number of points scored. (In other words, each row
is the amount of points a player scored during a particular season. Calculate the
median of these values. The result of this is that we have the median number o... |
import ast
import json
import random
import re
from collections import defaultdict
from django.shortcuts import render, redirect
from django.http import JsonResponse
from django.db.models import F, Q, Sum, Func, Avg, Count
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import authenticate... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, merge, pu... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 16 19:05:29 2019
@author: karm2204
"""
"""
References:
"""
#%%
# https://towardsdatascience.com/model-summary-in-pytorch-b5a1e4b64d25
# https://github.com/pytorch/examples/blob/master/mnist/main.py
# https://discuss.pytorch.org/t/text-autoencoder-nan-loss-... |
# Copyright 2021 AIPlan4EU 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 required by applicable law or agreed to in wri... |
######################### perform optimization ##############################
import numpy as np
import time
import pickle
import sys
import os
import torch
from torch import autograd
from scipy.optimize import minimize
sys.path.append(os.path.abspath("../IO"))
sys.path.append(os.path.abspath("../LDDMM"))
from impo... |
import numpy as np
from sdirl.choicemodel.mdp import ChoiceEnvironment, ChoiceTask, Action
from sdirl.rl.simulator import RLSimulator, RLParams
from sdirl.model import SDIRLModel, SDIRLModelFactory, ObservationDataset
import elfi
from matplotlib import pyplot as pl
import logging
logger = logging.getLogger(__name__)
... |
# utils
import json
import matplotlib.pyplot as plt
import os
from sklearn.metrics import confusion_matrix
# numerical libs
import numpy as np
from gensim.models import Word2Vec # change to fasttext vectors
from keras.callbacks import ModelCheckpoint
from keras.layers import BatchNormalization, Concatenate, Dense, D... |
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
import copy
from typing import Dict, List, Optional, Set, Tuple
import vsrl.verifier.traversal as traversal
from vsrl.verifier.expr import *
# Set REPLACEMENT_LOGGING to ... |
from direct.interval.IntervalGlobal import *
from direct.actor.Actor import Actor
from panda3d.core import *
from Timer import Timer
import random
RIGHT_DOOR = 0
LEFT_DOOR = 1
PointMap = {
1: (Vec3(0, 0, 0), None),
2: (Vec3(-50, 0, 0), {1: LEFT_DOOR}),
3: (Vec3(-100, 30, 0), None),
4: (Vec3(-100, -30, 0), None),
5: ... |
# /usr/bin/env python
import json
import logging
import os
import sys
from datetime import datetime, timedelta
import fhem
import pytz
import requests
from pymongo.mongo_client import MongoClient
from telegram.bot import Bot
from telegram.ext.callbackqueryhandler import CallbackQueryHandler
from telegram.ext.updater i... |
from forms import ParameterTypes
import sqlite3
DEF_SQLITE_TYPES = {
ParameterTypes.INTEGER : "INT",
ParameterTypes.FLOAT : "REAL",
ParameterTypes.BOOLEAN: "INT",
ParameterTypes.STRING: "TEXT",
ParameterTypes.LABEL: "TEXT",
ParameterTypes.URL: "TEXT",
ParameterTypes.ENUM: "INT",
}
def get... |
import os
import tensorflow as tf
import numpy as np
from math import exp
from tqdm import tqdm
from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction
# from pycocoevalcap.meteor.meteor import Meteor
from pycocoevalcap.cider.cider import Cider
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap... |
"""
gpm_download_month_V06B.py
Tools to download monthly data downloaded from NASA GPM mission website (This version is for the V06 of GESDIS).
The files in this tool are a modified version of the PPTs tool presented here: https://github.com/lapig-ufg/PPTs
Authors: <NAME>, <NAME>
Date: 03/02/2022
"""
... |
import os
import bpy
import time
import math
import numpy as np
import imageio
import transforms3d as t3d
import pose_estimation.directories as dirs
import pose_estimation.tools.image as ti
import pose_estimation.gramian.functions as gf
def render_image(
cam_ob, cam_pos, cam_quat, ob, ob_pos, ob_quat, image_... |
#-------------------------------------------------------------------------------------------------------------
## Import Statements
#-------------------------------------------------------------------------------------------------------------
from __future__ import print_function
import sys
import os
import subprocess... |
import os
import re
import subprocess
class Image:
'''Helps to deal with images more easily. Can mount, unmount, and get all
relevant information.
'''
def __init__(self, path='', make=False, name=None, volume=None):
if make:
if not name or not volume:
raise ValueErr... |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import os
import time
import numpy as np
from numpy import random
import pandas as pd
import logging
import pdb
import tempfile
from sqlalchemy import create_engine
from sklearn.preprocessing import MinMaxScaler
from Config import Config
... |
"""
Data Pre-processing
Usage:
1. Given a json file, then download the zip file (the OS should install wget first)
python preprocess.py download [json_file] [target_dir]
2. Extract the zip files and convert y4m file to bmp files (the OS should install ffmpeg first)
python preprocess.py zip2bmp [source_dir] [... |
import sys
import sympy as sym
import math
import numpy as npy
from . import matrices_nav_stokes as matrices
from . import spitter
from .symbols import *
from sympy.interactive import printing
# # force section
# B = velocity * (matrices.Jdet) * (matrices.NT_integrated_respecto_to_epsilon *
# ... |
from operator import truediv
import sys
sys.path.append(
'C:/Users/seand/OneDrive/Documents/University/Autonomous Drone Navigation/Implementation/AirSimAPI/packages')
import airsim
import time
import numpy as np
import cv2
import os
from scipy.spatial import distance
from random import randint, choice
from MonoDept... |
# # -*- coding: utf-8 -*-
"""
"""
from __future__ import absolute_import
from ctypes import *
from itertools import count, takewhile
from pkg_resources import resource_filename
from shutil import copyfileobj
import tempfile
import pytest
from six.moves import map
from six import text_type
from libtcd.compat import b... |
"""
Utilities to get a call tree (from the output of ``cube_dump -w``).
A call tree is represented as a tree of
``(function_name,cnode_id,parent,[list of children])``
named tuples (of class ``CubeTreeNode``)
"""
import logging
from tree_parsing import collect_hierarchy,level_fun
from box import Box
import pandas as p... |
# -*- coding:utf-8 -*-
"""
cron: 16 8,16,21 * * *
new Env('南京大学每日健康自动填报');
"""
from Cryptodome.Cipher import AES
import base64
import json
import re
import sys
import logging
import time
import datetime
import os
import random
import requests
from io import BytesIO
import ddddocr
# from utils.py
def get_GMT8_timestam... |
"""
Batch renames all the files present inside the given directory.
Inputs can supplied as runtime arguments, or will be requested by the script
at runtime under interactivate mode.
"""
import string
from enum import Enum, auto
from io import TextIOWrapper
from os import listdir, rename
from os.path impor... |
import json
import contextlib
import collections
import numpy as np
from retrieve import sparse_utils
def _get_matches_fneg_tpos_at(q_idxs, i_idxs, ranking, at, strict):
matches = []
# [[i, i, i, ... (len(q_idxs))],
# [j, j, j, ...], ...
# [k, k, k, ...]]
i_idxs_array = np.repeat(i_idxs[:, No... |
"""
File for additional tools developed by QCI team
"""
import pandas as pd
import itertools as it
import numpy as np
import h5py
import itertools as it
from scipy import constants as sc
from scipy import integrate as si
from em_simulations.results import network_data as nd
from pyEPR import ansys
def get_cross_kerr_t... |
import time
import random
import pickle
import os
from datetime import date
RANDOM_CHANNEL_ID = os.environ.get("MARVIN_SLACK_CHANNEL_ID")
FILE="plugins/animal.data"
ANIMALS = ['Adelie Penguin',
'African Bush Elephant',
'African Civet',
'African Clawed Frog',
'African Forest ... |
from mdp import MDP
import numpy as np
import pandas as pd
import random
VEL_CHANGES = [-1, 0, 1]
VEL_MIN = 0
VEL_MAX = 5
VEL_RANGE = range(VEL_MIN, VEL_MAX + 1)
VEL_LIST = [(x, y) for x in VEL_RANGE for y in VEL_RANGE]
R_STEP = -1
NOISE_PROB = 0.1
class Velocity:
def __init__(self, v_x, v_y):
self.x = v_x
... |
import numpy as np
import networkx as nx
from SEXTANTsolver import sextantSearch, SEXTANTSolver, sextantSearchList
from astar import aStarSearchNode, aStarNodeCollection, aStarCostFunction, aStarSearch
from pextant.EnvironmentalModel import EnvironmentalModel, GridMeshModel
from pextant.lib.geoshapely import GeoPoint, ... |
# coding: utf8
""" Unit tests:
- :class:`TestMultivariateJacobiOPE` check correct implementation of the corresponding class.
"""
import unittest
import numpy as np
from scipy.integrate import quad
from scipy.special import eval_jacobi
import sys
sys.path.append('..')
from dppy.multivariate_jacobi_ope import (Multi... |
#!/usr/bin/env python3
#
# Copyright 2020 Google LLC
#
# 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... |
import numpy as np
from astropy.modeling import models, fitting
from pylab import *
rcParams.update({"figure.autolayout": True})
# Lines from https://www.us.schott.com/d/advanced_optics/38cfacda-3e20-49d5-a432-d9066f56c05b/1.2/tie_29_refractive_index_and_dispersion_us.pdf
n_bak2_catalog = np.array([[1529.6, 1060.0,... |
from __future__ import unicode_literals
from difflib import SequenceMatcher
from doc.models import SectionMatcher, DocDiff, Section, PageMatcher,\
SectionChanger, LinkChange
ABS_THRESHOLD = 2.0
RELATIVE_THRESHOLD = 1.0
RATIO_THRESHOLD = 0.85
DEFAULT_DISTANCES = ((0.90, 0.75), (0.80, 0.50), (0.70, 0.25))
def... |
import argparse
import asyncio
import base58
import base64
import json
import os
import sys
import datetime
import urllib.request
from typing import Tuple
import nacl.signing
import indy_vdr
from indy_vdr.ledger import (
build_get_validator_info_request,
build_get_txn_request,
Request,
)
from indy_vdr.poo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.