text
stringlengths
6.04k
39.5k
""" Backends for embarrassingly parallel code. """ import gc import os import sys import warnings import threading import functools import contextlib from abc import ABCMeta, abstractmethod from .format_stack import format_exc from .my_exceptions import WorkerInterrupt, TransportableException from ._multiprocessing_h...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
""" Formalizing the process of running `util.mcmc` """ import abc from copy import deepcopy import numpy as np from tracklib.util import mcmc from .util import Loopingtrace class MCMCRun: """ The results of an MCMC run Attributes ---------- logLs : np.ndarray the likelihoods from the ru...
from __future__ import division import pandas as pd import numpy as np import networkx as nx import geopandas as gp from osmnx.utils import make_str from shapely.geometry import LineString, Point from osmnx_simplify_overwrite import simplify_graph as simp_g from weighted_betweenness import probit_assignment def pr...
''' Copyright 2017, Fujitsu Network Communications, 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 w...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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 # # http...
""" This is the OpenFlow 1.3 dictionary/dissector Here messages, types and codes are converted to names. """ def get_ofp_type(of_type): of_types = {0: 'OFPT_HELLO', 1: 'OFPT_ERROR', 2: 'OFPT_ECHO_REQUEST', 3: 'OFPT_ECHO_REPLY', 4: 'OFPT_EXPER...
# 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...
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
# Import required libraries import sys import pandas as pd import numpy as np def load_data(portfolio_filepath, transcript_filepath, profile_filepath): """ (1) Load portfolio json file into Pandas dataframe called portfolio (2) Load transcript json file into Pandas dataframe called transcript (3) Load...
#!/usr/bin/env python """Implement access to the windows registry.""" import ctypes import ctypes.wintypes import exceptions import os import stat import StringIO import _winreg from grr.client import vfs from grr.lib import rdfvalue from grr.lib import utils # Difference between 1 Jan 1601 and 1 Jan 1970. WIN_UNI...
import copy import io import shutil import PIL import cairo import discord from PIL import Image from discord import Role from moviepy.editor import * from model.memory import * EmojiSet = Tuple[str, str] EmojiArray = Tuple[EmojiSet, EmojiSet] class Player(object): """ Represents a player's profile, which ...
import asyncio import os import re from collections import defaultdict from random import choice from string import ascii_letters import aiohttp import discord from discord.ext import commands, tasks from loguru import logger from .utils.chat_formatting import escape_mass_mentions from .utils.dataIO impo...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import logging import copy import numpy as np from monty.json import MSONable from pymatgen.analysis.graphs import MoleculeGraph, MolGraphSplitError from pymatgen.analysis.local_env import OpenBabelNN from pym...
# https://github.com/ActiveState/code/blob/f9cd012db5068722016b3489398dd3017d53a7b3/recipes/Python/580720_Pagination_widget_in_Tkinter/recipe-580720.py # Copyright (c) 2017 ActiveState Software Inc. # MIT License # Author: <NAME> # Version: 0.8 try: import Tkinter as tk import ttk import tkFont from T...
import numpy as np from client import * import random import json #13508412130.218098 368125762698.6422 #13560827319.190525 370434930576.4746 #13532626957.355581 369745382579.87744 #13510723304.19212 368296592820.6967 this # f=open("overfit.txt","r") # data=f.read() # data=data.rstrip() # data=data.strip('][').spl...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import numpy as np import datetime as dt import pandas as pd import seaborn as sns import scipy.stats as stats import matplotlib.pyplot as plt import matplotlib font = {'family' : 'DejaVu Sans', 'weight' : 'normal', 'size' : 10} matplotlib.rc('font', **font) def prettyxTime(ax): ticks = ax.get...
import ctypes import os import warnings from importlib import import_module, invalidate_caches from glob import glob from subprocess import call from collections import OrderedDict from codepy.jit import CacheLockManager, CleanupManager from devito.compiler import make from devito.logger import debug, yask as log, ya...
import torch import torch.nn as nn import torchvision.transforms as transform import torchvision from torchvision.datasets import ImageFolder # from torch.utils.tensorboard import SummaryWriter # from video_dataset import VideoDataset from torch.autograd import Variable import os import os class XiaoKeEncoder(nn.Modu...
import concurrent.futures import functools import gzip import logging import os import re import requests import shutil import subprocess as sp import threading import time from urllib.request import urlretrieve import anndata import pandas as pd import scipy.io from tqdm import tqdm from .config import ( CHUNK_S...
import subprocess from collections import defaultdict from pathlib import Path from typing import Dict, List, MutableMapping, Optional, Tuple # import fuzzywuzzy.process from dataclasses import dataclass from mako.template import Template from ortools.util.sorted_interval_list import Domain from autojail.model.jailho...
# Copyright 2013 IBM Corp # 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 appl...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: barry.xu(<EMAIL>) # # Created: 2019/2/24 from .helper import Filter from .helper import Where from .helper import strings class Select(Where): """ Build a select sql eg: >> query = Select() >> query.select("city", "education", "AVG(age) a...
import random import torch import torch.nn as nn import torchaudio.transforms as transforms from constants import F_MAX, F_MIN, HOP_SIZE, N_FFT, N_MELS, SAMPLE_RATE class LogMelSpectrogram(nn.Module): def __init__(self): super().__init__() self.melspectrogram = transforms.MelSpectrogram( ...
""" WRITE ME Tests for the R operator / L operator For the list of op with r op defined, with or without missing test see this file: doc/library/tensor/basic.txt For function to automatically test your Rop implementation, look at the docstring of the functions: check_mat_rop_lop, check_rop_lop, check_nondiff_rop, ""...
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of database model for contrail config daemons """ from __future__ import absolute_import from __future__ import unicode_literals from builtins import object from future.utils import with_metaclass from past.built...
""" Defines the ScatterPlot class, and associated Traits UI view and helper function. """ # Standard library imports import itertools # Major library imports from numpy import around, array, asarray, column_stack, \ isfinite, isnan, nanargmin, ndarray, sqrt, sum, transpose, where # Enthought library i...
# GUI Application automation and testing library # Copyright (C) 2006 <NAME> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your optio...
import statistics import os, random, pickle import numpy as np # we are going to show for each timestep, for each layer, what's the majority attention. # majority attention excluding roadmark tokens # majority from typing import List import scipy from collections import Counter from util import convert_enc_attn, lo...
# -*- coding: utf-8 -*- """ Created on Wed Jul 11 21:33:11 2018 @author: ysye """ #run CIRCLET for RNA-seq dataset import os import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sklearn.preprocessing import minmax_scale from math import log from sklearn.metric...
import shelve import cv2 as cv import numpy as np from multiprocessing import Pool from functools import partial from crop_img import sliding_windows_cropping from inference import test_image, fwd_pass_detect, bwd_pass_backtrace from choose_candidates import choose_candidates, non_max_suppression_without_bwd from find...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
import numpy as np #import stochasticSimulationAlgorithm as ssa import time from scipy.sparse import spdiags from scipy.linalg import solve_lyapunov #import generic_solvers #reload(generic_solvers) from .generic_solvers import * import scipy as sp from . import expv, expvt from scipy.sparse.linalg import expm class...
# -*- coding: utf-8 -*- import os import gtk,pango from configobj import ConfigObj from .. extensions.path import path from localwidget import LocWidget from itertools import izip,count from configobj import ConfigObj from searchview import SearchView from .. boss import boss curr = boss.get_state() MARKUP = "<b><i>...
#!/usr/bin/env python """ CREATED:2015-03-01 by <NAME> <<EMAIL>> unit tests for librosa core.constantq """ from __future__ import division import warnings # Disable cache import os try: os.environ.pop("LIBROSA_CACHE_DIR") except KeyError: pass import librosa import numpy as np import pytest from test_core...
import warnings import torch warnings.filterwarnings('ignore') import os from fastNLP.core.dataset import DataSet from .utils import load_url from .processor import ModelProcessor from fastNLP.io.dataset_loader import _cut_long_sentence, ConllLoader from fastNLP.core.instance import Instance from ..api.pipeline impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################### ### Change these parameters ### ############################### """# General parameters NUM_TIMESTEPS = 100 POPULATION_SIZE = 5000 NUM_RESISTANCE_TYPES = 4 # Recovery generally or by treatment (green line in powerpoint) PROBA...
# Portions Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Copyright 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in comp...
from time import sleep import pywinusb.hid as hid from collections import namedtuple import timeit import copy from pywinusb.hid import usage_pages, helpers, winapi # current version number __version__ = "0.2.2" # clock for timing high_acc_clock = timeit.default_timer GENERIC_PAGE = 0x1 BUTTON_PAGE = 0x9 LED_PAGE = ...
""" Daemons are background tasks accompanying the individual resource objects. Every ``@kopf.daemon`` and ``@kopf.timer`` handler produces a separate asyncio task to either directly execute the daemon, or to trigger one-shot handlers by schedule. The wrapping tasks are always async; the sync functions are called in th...
from kafka.protocol.api import Request, Response, RequestHeader from kafka.protocol.struct import Struct from kafka.protocol.types import (Boolean, Int8, Int16, Int32, String, Schema, Array, _pack, _unpack) from kafka....
# coding: utf-8 # Copyright (c) Materials Virtual Lab. # Distributed under the terms of the BSD License. """ RDF implementation. """ from collections import Counter from math import ceil from multiprocessing import cpu_count from typing import List, Tuple, Union, Dict import numpy as np from scipy.ndimage import gau...
r""" Shuffle product of words .. SEEALSO:: The module :mod:`sage.combinat.shuffle` contains a more general implementation of shuffle product. """ #***************************************************************************** # Copyright (C) 2007 <NAME> <<EMAIL>>, # Copyright (C) 2008 <NAME> <<EMAI...
#!/usr/bin/env python """ HUMAnN2 Plotting Tool =============================================== Author: <NAME> (<EMAIL>) """ import os import sys import csv import argparse import math try: import matplotlib matplotlib.use( "Agg" ) matplotlib.rcParams["pdf.fonttype"] = 42 import matplotlib.pyplot as ...
# ENPM661 Project 3 Phase 2 # <NAME> & <NAME> import math import time import numpy as np from matplotlib.path import Path from matplotlib.patches import PathPatch from matplotlib.patches import Ellipse import matplotlib.pyplot as plt w = int(10.2) h = 10 w_radius=int(0.1) sep_dis=1 def convert_RPM_mps (RPM): V...
#!/usr/bin/env python3 # # Copyright 2017-2018, <NAME> # Copyright 2017, <NAME> # Copyright 2017-2018, Wikimedia Foundation 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:/...
from typing import Optional import logging import torch from torch.distributions import Poisson, Gamma, Bernoulli, Normal from torch.utils.data import DataLoader import torch.nn.functional as F from torch import logsumexp import torch.distributions as distributions import numpy as np from scvi.inference import Posteri...
import getpass import logging import os import socket import string import time from urllib.parse import urlparse import uuid from weakref import finalize try: import yaml except ImportError: yaml = False import dask from distributed.deploy import LocalCluster, Cluster from distributed.comm.utils import offlo...
#!/usr/bin/env python3 # coding: utf-8 """The script calculates the atomic parameters of electronic configurations using Cowan's codes.""" import re import os import sys import glob import logging import argparse import subprocess import collections import xraydb xdb = xraydb.XrayDB() class odict(collections.Orde...
from collections import abc from datetime import datetime import dateutil.parser from dateutil import tz from copy import (copy, deepcopy) from pystac import (STACError, STACObjectType, CatalogType) from pystac.catalog import Catalog from pystac.link import Link from pystac.utils import datetime_to_str class Collecti...
#!/usr/bin/env python """ Calculate xtalk coefs for a single CCD with N segments in the form of a NxN matrix """ import os import sys import re import argparse import logging import textwrap import os.path from astropy.io import fits import numpy as np from sklearn import linear_model import matplotlib.pyplot as plt im...
#! /usr/bin/env python """ This module is meant to monitor and gather statistics of the filesystem that hosts data for the ``jwql`` application. This will answer questions such as the total number of files, how much disk space is being used, and then plot these values over time. Authors ------- - <NAME> Use ---...
import warnings from pathlib import Path import json import numpy as np import vcd.core as core import vcd.types as types import time # TODO: get actions and objects per frame # TODO: funtion to get frame intervals per action or object presence #TODO: delete unecessary code # dict for changes in structures # data ...
""" Module with functions to transform heads referring to the future. """ from . import transformer as _tf import clingo as _clingo from clingo import ast as _ast from numbers import Number as _Number from operator import itemgetter as _itemgetter # {{{ data structures g_tel_false_atom = "__false" g_tel_keywords = ...
"""Generate hazard-damage curves """ import os import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.patches as mpatches from matplotlib.ticker import (MaxNLocator,LinearLocator, MultipleLocator) import matplotlib.pyplot as plt from matplotlib impor...
#!/usr/bin/env python3 # MYC blacklist region chr8:129571461-129571635 (b37) # MYC blacklist region chr8:128559215-128559389 (b38) ################################################################# # Configure the enviroment import pandas as pd import argparse from multiprocessing import Pool ########################...
import json import os from tqdm import tqdm import pm_card from config import ROOT_DIR, languages_to_reference, sets_to_reference def trigram_edition_code_test( string_in ): return ((len(string_in) == 3 or len(string_in) == 4) and string_in.upper().isupper() and (string_in in sets_to_reference or string_in[1:] i...
import os, sys import numpy as np import math from scipy.stats import chi2 import torch as tc import torch.tensor as T import torch.nn as nn sys.path.append("../") from conf_set.utils import * from models.BaseForecasters import Forecaster from calibration.calibrator import BaseCalibrator ## ## confidence set ## cla...
#!usr/bin/env/python3 # -*- coding: utf-8 -*- # Instead of using the Docker SDK, this script will form a Docker Compose # command string to execute straight through the docker-compose CLI. This is # required because the Docker SDK does not support communication with Compose # files, and Minitrino benefits hugely from ...
from flask import Flask, render_template, redirect, url_for, request, send_file import pandas as pd import numpy as np from pandas import DataFrame, read_csv from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import matplotlib.pyplot as plt import jinja2 plt.style.use('ggplot') from io import B...
##### Movie of Electric field and density contour: #https://jychoi-hpc.github.io/adios-python-docs/quick.html import adios as ad import postgkyl as pg import matplotlib.pyplot as plt import numpy as np plt.style.use('seaborn-white') import matplotlib.animation as animation from random import seed from random import ran...
# RT - Bog General from typing import Dict from traceback import TracebackException from collections import defaultdict from inspect import cleandoc from itertools import chain from random import choice from time import time import subprocess from discord.ext import commands, tasks import discord fro...
from __future__ import print_function, absolute_import import argparse import os.path as osp import random import numpy as np import sys import collections import time from datetime import timedelta from sklearn.cluster import DBSCAN import faiss from apex import amp import torch from torch import nn from torch.backe...
"""Write Value Change Dump files. This module provides :class:`VCDWriter` for writing VCD files. """ from collections import OrderedDict from numbers import Number import datetime from six.moves import zip, zip_longest import six try: from collections.abc import Sequence except ImportError: from collections...
#!/usr/bin/env python3 import re from json import dumps from os import path from argparse import ArgumentParser from subprocess import Popen from tempfile import TemporaryFile try: from functools import reduce except: pass try: import cxxfilt def cppdemangle(s): if not s.startswith("_Z"): ...
""" Shadertoy Inputs: uniform vec3 iResolution; // viewport resolution (in pixels) uniform float iTime; // shader playback time (in seconds) uniform float iTimeDelta; // render time (in seconds) uniform int iFrame; // shader playback frame uniform...
import scipy.cluster.hierarchy as sch import scipy.spatial as scs from scipy import stats import plotly.graph_objects as go import plotly.figure_factory as ff from scipy.cluster.hierarchy import fcluster from scipy.spatial.distance import squareform import numpy as np import pandas as pd STANDARD_SIZES=[ str(i) for i ...
# PyZX - Python library for quantum circuit rewriting # and optimization using the ZX-calculus # Copyright (C) 2018 - <NAME> and <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 ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ traceroute_history is a quick tool to make traceroute / tracert calls, and store it's results into a database if it differs from last call. Targets are configured in a config file, Also happens to read smokeping configuration files to populate targets to probe """...
import random import math import copy from datasets import miniImageNet_few_shot, tiered_ImageNet_few_shot, ImageNet_few_shot from collections import OrderedDict import warnings import models import time import data import utils import sys import numpy as np import os import argparse from tqdm import tqdm import torch ...
#! /usr/bin/env python import os import sys import argparse import datetime import io import json from enum import Enum import typer import yaml import simple_rest_client.exceptions from curieconf import confclient from curieconf import utils from curieconf.utils import cloud from cloudstorage.exceptions import Not...
import io import re import jinja2 import os import ruamel.yaml import collections import requests import tempfile import tarfile import zipfile from .utils import tmp_directory, render_meta_yaml class Str(ruamel.yaml.scalarstring.ScalarString): __slots__ = "lc" style = "" def __new__(cls, value): ...
# -*- coding: utf-8 -*- """ /dms/utitlies/info_manager.py .. erlaubt Manipulationen der Info-Manager Django content Management System <NAME> <EMAIL> Die Programme des dms-Systems koennen frei genutzt und den spezifischen Beduerfnissen entsprechend angepasst werden. 0.01 01.10.2007 Beginn der Arbeit 0.02 ...
#! python import asyncio from aiohttp import web from aiohttp_sse import sse_response import gzip import sseclient import requests from datetime import datetime import sys import json import argparse # Gotta look pretty on the command line class TColors: END = '\33[0m' BLACK = '\33[30m' RED = '\33[31m' GRE...
############################################## # # # Ferdinand 0.40, <NAME>, LLNL # # # # gnd,endf,fresco,azure,hyrma # # # ############################################...
from sklearn.model_selection import train_test_split, KFold from sklearn.metrics import confusion_matrix import gzip import pickle as pic from sklearn.utils.class_weight import compute_sample_weight import numpy as np from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Dense, Dropout, B...
from scipy.spatial.transform import Rotation import pickle # from shapely.geometry import MultiPoint # import streamlit as st import json import numpy as np WRIST_IDS = [0] FINGER_IDS = dict( index_finger=[ 5, 6, 7, 8 ], middle_finger=[ 9, 10, 11, 12 ], ring_finger=[ 13, 14...
"""Support for hunter douglas shades.""" from __future__ import annotations import asyncio from collections.abc import Iterable from contextlib import suppress from datetime import timedelta import logging from typing import Any from aiopvapi.helpers.constants import ( ATTR_POSITION1, ATTR_POSITION2, ATTR...
""" For Times-series projects: - Checkout a list of projects () - Create tages and checkout tags - Process source code files into one .out file for each project For categories projects: - Checkout a list of projects (showcases_config.json) - Process source code files into one .out file for ...
import tensorflow from objective_functions.hole_reaching.abstract_env import AbstractEnvironment from objective_functions.hole_reaching import planar_forward_kinematics as pfk import matplotlib.pyplot as plt import matplotlib.patches as patches import numpy as np from objective_functions.hole_reaching.mp_lib import d...
# coding=utf-8 # Copyright 2021 The Circuit Training Team 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
""" This module provides routines for the co-alignment of images and `~sunpy.map.mapsequence.MapSequence`. Currently this module provides image co-alignment by template matching. Which is partially inspired by the SSWIDL routine `tr_get_disp.pro <http://www.heliodocs.com/php/xdoc_print.php?file=$SSW/trace/idl/util/tr_...
__version__ = '0.0.1' __author__ = '<NAME>, 2020' import re import numpy as np import pandas as pd fields = { 'AC': 'activating compound', 'AP': 'application', 'CF': 'cofactor', 'CL': 'cloned', 'CR': 'crystallization', 'EN': 'engineering', 'EXP': 'expression', 'GI': 'general informatio...
""" @author: rchakravarti @creation-date: 5/9/17 """ import csv import gzip import json import logging import os import sys from abc import abstractmethod from collections import OrderedDict from collections import deque from configparser import ConfigParser from warnings import warn from pkg_resources import resource...
import asyncio import copy import json from datetime import date, timedelta from typing import Dict, Tuple import pandas as pd from pytz import timezone from tqdm import tqdm from liualgotrader.common import config from liualgotrader.common.data_loader import DataLoader # type: ignore from liualgotrader.common.datab...
import os import sys import copy import logging from torch.nn.utils.rnn import PackedSequence, pad_packed_sequence from colorlog import ColoredFormatter import torch import torch.nn as nn import pandas as pd import numpy as np import operator as op from functools import reduce from sklearn.metrics import ...
#!/usr/bin/env python import json import os import sys import tarfile import tempfile import warnings import click import pandas as pd import sqlalchemy as sa from toolz import dissoc from plumbum import local import ibis from pathlib import Path SCRIPT_DIR = Path(__file__).parent.absolute() DATA_DIR = Path(os.e...
r""" This module creates a model predictive control (MPC) controller for a linear discrete-time (*ldt*) system with input and (optionally) state constraints, and a convex cost function. The MPC problem is reformulated as a condensed convex mathematical program, which can be solved using off-the-shelf optimization algor...
#!/usr/bin/env python import sys import os import rospy import numpy as np import cv2 import pcl import glob import math import std_msgs.msg import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2 from parse_xml import parseXML def load_pc_from_pcd(pcd_path): """Load PointCloud data from pc...
# SPDX-FileCopyrightText: 2017 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT # Adafruit LIS3DH Accelerometer CircuitPython Driver # Based on the Arduino LIS3DH driver from: # https://github.com/adafruit/Adafruit_LIS3DH/ """ `adafruit_lis3dh` ==================================================== Cir...
""" @author: Heerozh (<NAME>) @copyright: Copyright 2019-2020, Heerozh. All rights reserved. @license: Apache 2.0 @email: <EMAIL> """ from abc import ABC from typing import Optional, Sequence, Union import numpy as np import torch from ..parallel import nansum, nanmean, nanstd, Rolling from .plotting import plot_factor...
"""Support for eQ-3 Bluetooth Smart thermostats.""" import asyncio from datetime import datetime import logging from typing import Optional from bluepy.btle import BTLEException # pylint: disable=import-error, no-name-in-module import eq3bt as eq3 # pylint: disable=import-error import voluptuous as vol from homeass...
#!/usr/bin/env python """Executes a TOKIO CLI archiver tool using a stateful schedule """ import os import sys import json import stat import errno import fcntl import argparse import datetime import tokio import tokio.cli.archive_lmtdb import tokio.cli.archive_mmperfmon import tokio.cli.archive_collectdes import tok...
import torch import torch.utils.data as data import numpy as np from PIL import Image import os import os.path import scipy.io import random import csv import matplotlib.pyplot as plt import itertools import torchvision.utils as vutils IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm'...
# -*- coding: utf-8 -*- """Parameter Value Language container datatypes providing enhancements to Python general purpose built-in containers. To enable efficient operations on parsed PVL text, we need an object that acts as both a dict-like Mapping container and a list-like Sequence container, essentially an ordered m...
import sys import os.path from binary_readers import * # S - string # I - 4b int # U - 4b unsigned # F - 4b float # X - bits byte # f - float array # i - int array # B - bool # b - bool array # H - unknown hex bytes # T - time # 1 - " FII" # 2 - "SUFF" # 3 - "FFFF" # 4 - " SISS" # 5 - " SISS U" types_struct = [ ...
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- import abc import argparse import asyncio import collections import concurrent.futures import copy import functools import ipaddress import json import logging import signal import socket import struct import sys import dnslib as dns import uvloop log_handler = logging...
#!/usr/bin/python3 -tt # # Copyright 2004-2006 <NAME> <<EMAIL>> # # 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...