text
stringlengths
3.07k
22.1k
#!/usr/bin/env python # coding: utf-8 import pandas as pd import logging from amulog import config from logdag import log2event from . import evgen_common from . import filter_log _logger = logging.getLogger(__package__) FEATURE_MEASUREMENT = "log_feature" class LogEventDefinition(log2event.EventDefinition): ...
#!/usr/bin/env python # # Copyright (C) 2018-2020 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this...
import sys import os import ast if "--silent" in sys.argv: os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" if "--cpu" in sys.argv or "--cpu_only" in sys.argv: os.environ["CUDA_VISIBLE_DEVICES"] = "-1" from math import sqrt from argparse import ArgumentParser, Namespace from datetime import datetime, timedelta from ...
import sys import time import math import pdb from PyQt4 import QtGui, QtCore import serial import new_era_vp as new_era # ToDo | 1. Command each pump independently # Syringe diameters syringes = {'1 ml BD': '4.699', '3 ml BD': '8.585', '5 ml BD': '11.99', '10 ml BD':...
# MIT License # # Copyright (c) 2020-2022, <NAME> # # 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, merg...
import bson import pytest import xarray from xarray_mongodb import DocumentNotFoundError, XarrayMongoDB from . import assert_chunks_index from .data import ( da, ds, expect_da_chunks, expect_da_meta, expect_ds_chunks, expect_ds_meta, expect_meta_minimal, parametrize_roundtrip, ) def ...
import torch import torch.nn as nn import tridepth_renderer.cuda.rasterize as rasterize_cuda from . import vertices_to_faces, rasterize_image def flip(x, dim): """ Flip tensor in specified dimension. """ indices = [slice(None)] * x.dim() indices[dim] = torch.arange(x.size(dim) - 1, -1, -1, ...
# -*- coding: cp1252 -*- #Copyright © 2015 B3nac import os import sys import random import math import pygame as pg import galaxyMap import topscore from gamedata import constants as a from gameobjects import blocks from gameobjects import enemies from gameobjects import speedpowerup from gameobjects import galaxywh fr...
from typing import List, Dict, cast import numpy as np from ...math.matrix import Matrix from ...common.config import Config from ...collision.algorithm.gjk import PointPair from ...collision.detector import Collsion from ..body import Body # FIXME: def generate_relation(bodya: Body, bodyb: Body) -> int: # Comb...
import sys import os from docopt import docopt from apiclient.http import MediaFileUpload import core.schedule as schedule import core.auth as conf_auth import core.excel_db as excel_db USAGE = """ Upload the Videos to YouTube Usage: upload_yt_videos.py <video_list.xlsx> <video_root_path> [--no-update] """ argu...
import os import logging import jsonpickle import boto3 from botocore.exceptions import ClientError from aws_xray_sdk.core import xray_recorder from aws_xray_sdk.core import patch_all import tasktable import taskurl import taskmessage import ecsutil logger = logging.getLogger() logger.setLevel(logging.INFO) patch_all...
import math import numpy as np from PIL import Image from skimage import color, io def load(image_path): """Loads an image from a file path. HINT: Look up `skimage.io.imread()` function. Args: image_path: file path to the image. Returns: out: numpy array of shape(image_height, imag...
#!/usr/bin/python from __future__ import division import numpy as np import random import pygame from shapely.geometry import LineString # pyGame initialization FPS = 60 QFPS = 240 SCREEN_WIDTH, SCREEN_HEIGHT = 640, 480 pygame.init() FPS_CLOCK = pygame.time.Clock() SCREEN = pygame.display.set_mode((SCREEN_WIDTH, SCREE...
import os import sys import time from argparse import ArgumentParser import math import numpy as np import time import torch from torch.optim.lr_scheduler import MultiStepLR import torch.utils.data.distributed from src.model import model, Loss from src.utils import dboxes300_coco, Encoder from src.evaluate import ev...
# ----------------------------------- IMPORTS -------------------------------------- # from tkinter.ttk import * from win10toast import ToastNotifier from tkinter import * import math # ---------------------------- CONSTANTS AND VARIABLES ------------------------------- # COUNTER_VELOCITY = 1000 PINK = "#e2979c" RED ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import (Transform, TransformedDistribution, AffineTransform, Distribution) from torch.distributions import constraints from torch.distributions.normal import Normal from torch.distributions.multiv...
# -*- coding: utf-8 -*- """ This module contains the functions necessary to correct atom probe datasets for systematic energy deficits. Details on the algorithm are given in a manuscript titled: ``An Algorithm for Correcting Systematic Energy Deficits in the Atom Probe Mass Spectra of Insulating Samples'' Cre...
# Copyright (c) 2021, NVIDIA CORPORATION. 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 applic...
"""metadata utilities""" from collections import namedtuple from datetime import date, datetime, time from decimal import Context, Decimal, ROUND_HALF_UP from html.parser import HTMLParser from itertools import zip_longest from re import compile, finditer, sub from secrets import choice from string import ascii_letters...
from argparse import Namespace from typing import List, Tuple import torch from chemprop.data import CrystalDatapoint, CrystalDataset # Memoization CRYSTAL_TO_GRAPH = {} ATOM_FDIM = 92 BOND_FDIM = 54 def clear_cache(): """Clears featurization cache.""" global SMILES_TO_GRAPH SMILES_TO_G...
import os import requests from selenium import webdriver import selenium as se from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.chrome.options import Options from selenium.common.e...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # anited. publish - Python package with cli to turn markdown files into ebooks # Copyright (c) 2014 <NAME> # # Distributed under the MIT License # (license terms are at http://opensource.org/licenses/MIT). """This module offers the output classes used to transform book ...
from typing import List, Optional, Union import numpy as np import pandas as pd import pytest import scipy.sparse as sps import tabmat as tm from tabmat import from_pandas from tabmat.constructor import _split_sparse_and_dense_parts from tabmat.dense_matrix import DenseMatrix from tabmat.ext.sparse import csr_dense_s...
import os import numpy as np import argparse import time import torch from utils.net_utils import adjust_learning_rate, save_checkpoint, clip_gradient, calc_grad_norm from utils.box_utils import sample_proposals from model.dc_vgg16 import DC_VGG16_DET, DC_VGG16_CLS from datasets.tdet_dataset import TDETDataset from m...
#!/usr/bin/env python3 import datetime import dateutil.parser import os from path import cd import simplejson as json import sqlite3 import subprocess import sys import yaml import log warn, info, debug, fatal = log.reporters() class UnsupportedDBType(Exception): pass class DBNotFound(Exception): pass class ...
import http.client import logging from telegram import Update, ParseMode, InlineKeyboardMarkup, InlineKeyboardButton, Chat from telegram.ext import TypeHandler, CallbackContext, CommandHandler, MessageHandler, Filters from bot import settings from bot.const import TELEGRAM_BOT_TOKEN, DATABASE_FILE, DEBUG from bot.git...
import atomium import numpy as np def parse_pdb(pdb_file_path, pdbid, chainid): chain = atomium.open(pdb_file_path).model.chain(chainid) if chain is None: return 'invalid chain' aminoacids = [] aminoacid_resnums = [] aminoacid_letters = [] aminoacid_ca_coords = [] ...
# (c) <NAME> 2021 from __future__ import annotations import haiku as hk import jax import jax.numpy as jnp import optax import typing if typing.TYPE_CHECKING: from myriad.neural_ode.create_node import NeuralODE from jax.flatten_util import ravel_pytree from tqdm import trange from typing import Callable, Optional,...
# import the necessary packages from imutils.video import FPS import imutils import os import cv2 import shutil import time import show_option_trafic_sign import define def on_pos_video_trackbar(val): global vs, frame_index if val != frame_index: frame_index = val vs.set(cv2.CAP_PROP_POS_FRAM...
''' Created on Aug 17, 2010 @author: joel ''' import numpy from pypyr.mesh import Basis, ElementFinder, ElementQuadrature, BoundaryQuadrature import itertools as it from pypyr.timing import * def processIndices(basis, boundarytags): """ Given a basis (a collection of elements) and a set of boundaries, extract the...
#!/usr/bin/python import sys import time import logging import praw import prawcore from pprint import pprint submission_pool = [] # Set to True to test, posts won't be removed POST_TEST_MODE = False # Set to a discord webhook for announcements DISCORD_WEBHOOK_URL = None def main(): # SET THESE - reddit applicat...
from sys import modules from copy import deepcopy import numpy as np import tensorflow as tf from gpflow import actions, settings from gpflow.training.tensorflow_optimizer import _TensorFlowOptimizer, _REGISTERED_TENSORFLOW_OPTIMIZERS ### Imports optimizers from TF contrib, uses same code as in GPflow def _register...
from binaryninja import (Architecture, LowLevelILOperation, LowLevelILLabel, log_info, LLIL_TEMP) def add_trunc(a, b, bits=16): maxval = (1 << bits) - 1 r = a + b return r & maxval def _get_2b_reg(il, register): register = register.lower() return il.reg_split(1, register...
#!/usr/bin/env python3 import sys sys.path.append('./py') from tests.test import * from tests.random import * from ga import GA from multivector import MultiVector ga = GA(3) assert ga.n == 3 x = 4 + 3*ga[1] + 4*ga[2] + 5*ga[1,2] y = 3 + 2*ga[1] + 3*ga[2] + 4*ga[1,2] z = 10 + 16*ga[1] + 26*ga[2] + 32*ga[1,2] asse...
#!/usr/bin/env python3 import argparse import datetime import hashlib import os import os.path as osp import uuid import torch import yaml from torch.optim.lr_scheduler import MultiStepLR from torch.utils.data import DataLoader import torchfcn from cmu_airlab.datasets.dataset_air_lab import AirLabClassSegBase from t...
import cv2 import glob import keras import numpy as np import pandas as pd from keras import backend as K from keras.layers import MaxPooling2D, Conv2D, Flatten, Dense, Input, AlphaDropout, Dropout from keras.models import Model from settings import IMAGE_SIZE df = pd.read_pickle('../data/all_obs.pkl', compression='g...
# Author: <NAME> (mgdzwonc) # Last modified: 2020-02-20 from enum import IntEnum import socket import sys import threading host = '' # Get the port on which to run the server socket if len(sys.argv) < 2: print('Please specify a port for the auctioneer server.') sys.exit() try: port = int(sys.argv[1]) ex...
import os import copy import re import nltk from parser import Parser import json from stanfordcorenlp import StanfordCoreNLP import argparse from tqdm import tqdm def tokenize(text): text_i = token_i = 0 tokens = nltk.wordpunct_tokenize(text) # post process tokenization result tokens_ = [] for t...
# -*- coding: utf-8 -*- import py from rpython.flowspace.argument import (ArgumentsForTranslation, rawshape, Signature) class TestSignature(object): def test_helpers(self): sig = Signature(["a", "b", "c"], None, None) assert sig.num_argnames() == 3 assert not sig.has_vararg() a...
""" Function for loading converting data """ from helper import utility as util import os import configparser import numpy as np from scipy import misc import random import logging INPUT_IMAGE_DIR = "input" INTERPOLATED_IMAGE_DIR = "interpolated" TRUE_IMAGE_DIR = "true" def convert_to_multi_channel_image(multi_...
import datetime import gzip import itertools import json import logging import os import shutil import sys import zipfile from blsgov_api import load_db_list, get_loader from config import WRK_DB_DIR, META_FILE_NAME, TMP_DB_DIR, DATA_PREFIX, ASPECT_PREFIX, \ SERIES_PREFIX, JSON_GZ_SUFFIX, JSON_SUFFIX, ZIP_SUFFIX, ...
import os import argparse import numpy as np import math as ma import music21 as m21 THREE_DOTTED_BREVE = 15 THREE_DOTTED_32ND = 0.21875 MIN_VELOCITY = 0 MAX_VELOCITY = 128 MIN_TEMPO = 24 MAX_TEMPO = 160 MAX_PITCH = 128 def load(datapath, sample_freq=4, piano_range=(33, 93), transpose_range=10, stretching_ra...
import discord from discord.ext import commands import database as db import variables as var from functions import get_prefix def has_command_permission(): async def predicate(ctx: commands.Context): plugin_name = ctx.cog.__cog_name__ cmd_name = ctx.command.name guild_doc = await db.PERMI...
#!/usr/bin/env python3 # Copyright (c) 2021, Pelion Limited and affiliates. # SPDX-License-Identifier: 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.or...
""" A module to mix/join information from the deep ahb and the MIG (beyond SGH) """ from typing import Dict, List, Optional, Tuple from maus import DataElementFreeText, DataElementValuePool, DeepAnwendungshandbuch from maus.edifact import is_edifact_boilerplate from maus.models.edifact_components import ( ...
# -*- coding: utf-8 -*- # # This is the Robotics Language compiler # # Parse.py: The parser for the Robotics Language # # @NOTE the RoL parser currently works by generating the composition of # strings of text (see functions `Utilities.xml` and `Utilities.xmlMiniLanguage`) that are eventually # parsed into XM...
# -*- coding: utf-8 -*- """ Created on Sat Jul 6 11:24:44 2019 @author: Rob """ # Create Friends plots # Import all functions as tuple from Friends_analysis import * from wordcloud import WordCloud, STOPWORDS#, ImageColorGenerator from PIL import Image import matplotlib.pyplot as plt import numpy as n...
from __future__ import print_function import os import json import glob import torch import numpy as np import torchvision.transforms as transforms import torch.utils.data as data import random import h5py class ShapeNetLoader(data.Dataset): def __init__(self, data_dump_folder, indim=2, freeze_data=False, id=Non...
from time import time import multiprocessing from knotify.models import Pknot, OUTER, INNER from knotify.pairing import ( get_left_stem_aligned_indices, get_right_stem_aligned_indices, ) from knotify.rna_parser import PseudoknotDetector MAX_LOOP_SIZE = 100 # max number of unpaired bases belonging to a loop M...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 利用华为ups检测机房是否停电 # 停电后发送企业微信告警并对主要服务器关机 import sys import os import time import ssl import json import http.cookiejar import paramiko from urllib import parse, request # ----------------------企业微信配置开始------------------------------------ corpid = '你自己的pid' corpsecr...
import getpass import pyaes import sqlite3 import hashlib import string import random conn = None _name_lock = None class Key: _k = None @staticmethod def set(key: bytes): if key is None: Key._k = None return Key._k = list(key) for i in range(len(Key._k))...
import pandas import scipy import numpy def identity(x): return x def rolling_apply(df, window_size, f, trim=True, **kargs): ''' A function that will apply a window wise operation to the rows of a dataframe, df. input: df - a pandas dataframe window_size...
# !/usr/bin/env python # -*- coding: utf-8 -*- '''from main.test import countries_list, get_country_name_by_id, usuario_list,get_password_by_id,get_rol_by_id if __name__ == '__main__':''' #countries_list() #get_country_name_by_id(25, 'Russia') #usuario_list() #get_password_by_id('<PASSWORD>') #print ...
import os, glob, re import argparse import uuid import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader, Dataset from torch.utils.data.dataloader import default_collate from torchvision import transforms import torchvision import matplotli...
import asyncio from datetime import datetime import re import sys from io import StringIO from aiogram import Bot, Dispatcher from aiogram.dispatcher.filters import Filter from aiogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery from aiogram.utils.exceptions import MessageNotModifie...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from Utils.tool import cal_dist_arr, get_arange # TODO:笛卡尔空间下轨迹那个维度的自变量x,如果是车头不垂直应该问题不大? # TODO:把量化间隔固定,直接存储整条曲线? # TODO:曲线三阶导数在连接点处不连续,没有考虑 # TODO:样条插值中间点的状态自适应给定? """ 样条插值 """ class Curve: def __init__(self, t, dt, x, vec): # x比T多一个数 ""...
import os import os.path from subprocess import Popen, PIPE import h5py import numpy as np import pytopkapi def show_banner(ini_file, nb_cell, nb_time_step): """Show an ASCII banner at run time describing the model. Parameters ---------- ini_file : str The name of the PyTOPKAPI initializatio...
import pytest import numpy as np import jax import pyscf from pyscfad import gto from pyscfad.lib import numpy as jnp TOL_VAL = 1e-12 TOL_NUC = 1e-10 TOL_CS = 1e-10 TOL_EXP = 1e-9 TOL_NUC2 = 5e-9 TEST_SET = ["int1e_ovlp", "int1e_kin", "int1e_nuc", "int1e_rinv",] TEST_SET_ECP = ["ECPscalar"] TEST_SET_NUC =...
import pytz import pytest from itertools import product from unittest.mock import Mock from datetime import datetime, timezone, date from originexample.common import Unit from originexample.auth import User from originexample.agreements.queries import AgreementQuery from originexample.agreements.models import TradeAgr...
from sklearn import datasets from sklearn import svm from sklearn.model_selection import cross_validate import numpy as np import matplotlib.pyplot as plt def plot_svc(model): """Plot the decision function for a 2D SVC""" ax = plt.gca() xlim = ax.get_xlim() ylim = ax.get_ylim() # create grid to ...
# -*- coding: utf-8 -*- """ Copyright 2014 <NAME> This file is part of the Twitter Follow Bot library. The Twitter Follow Bot library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the Lice...
#!/usr/bin/env python """ push-based asynchronous TCP This is a generic library for building event-based / asynchronous TCP servers and clients. It uses a push model; i.e., the network connection pushes data to you (using a 'data' event), and you push data to the network connection (using the write method). """ __a...
import enum import io import ipaddress import re import struct import socket as sk from typing import Optional, Tuple class UTP: """ uTorrent Transport Protocol BEP29: https://www.bittorrent.org/beps/bep_0029.html """ def __init__(self) -> None: pass PROTOCOL_NAME_v10 = b'BitTorrent pr...
from abc import ABC, abstractmethod from copy import deepcopy, copy from typing import Tuple, Optional, Callable, Sequence import numpy as np from scipy.interpolate import interpn from scipy.stats import multivariate_normal, beta from pararealml.core.constrained_problem import ConstrainedProblem from pararealml.core....
import os from selenium.webdriver.common.keys import Keys from pytest_dash.utils import ( wait_for_text_to_equal, wait_for_element_by_css_selector, ) import dash from dash.dependencies import Input, Output, State import dash_html_components as html import dash_core_components as dcc from dash_bio import Volcano...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from . import _utilities...
from functools import reduce import sys import inspect def get_all_classes(): res = [] for _, obj in inspect.getmembers(sys.modules[__name__]): if obj in [CustomIdlBase, FormulaBase]: continue if obj is not None and inspect.isclass(obj): res.append(obj) return res ...
""" Tests for the module "session2bids.py" Because the functionality of extracting BIDS info from a session and getting physio data from a file, etc. is not the scope of the module, I'm mocking a lot of the functions and I just test the code specific to the module Also, this way allows us to run the tests without a...
import re import twint import pandas as pd import matplotlib.pyplot as plt from textblob import TextBlob from collections import Counter from nltk.corpus import stopwords from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator def make_search(username): c = twint.Config() c.Username = username ...
""" Tracker script for RDC Implements the tracker control protocol - start rdc tracker - help nodes to establish links with each other <NAME> """ import sys import os import asyncio import socket import struct import subprocess import time import logging import random import inspect import threading from threading ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # linkedin_jog_scraping.py import os import pandas as pd from parsel import Selector from time import sleep from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.keys import Keys from selenium.webdriver.comm...
import tensorflow as tf from tensorflow.keras import Model, Input from tensorflow.keras.layers import ConvLSTM2D, Conv2D from tensorflow.keras.layers import MaxPooling2D, UpSampling2D, Concatenate from tensorflow.keras.layers import BatchNormalization, Activation, Dropout, TimeDistributed # Conv layer. def conv_layer(...
from dataclasses import dataclass, field import datetime import io import itertools as it import json from typing import Dict, Union, List import pandas as pd import requests from redfin import Redfin from dask import delayed from dask.distributed import Client, as_completed REDFIN_ENDPOINT='https://www.redfin.com/s...
""" Flask Documentation: http://flask.pocoo.org/docs/ Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/ Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/ This file creates your application. """ import os import requests import urllib, urllib3 import gzip import json import quadkey i...
from datetime import timedelta from typing import List, Optional, Tuple import hypothesis.strategies as st import numpy as np import numpy.testing as npt import pandas as pd import pandas.testing as tm import pyarrow as pa import pytest from hypothesis import example, given, settings # fmt: off import fletcher as fr ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Feb 19 16:17:33 2021 @author: tanmay """ import cv2 as cv import matplotlib.pyplot as plt import os import glob import numpy as np import random def visualiseTriangulation(R_o, T_o,R,T, homoge_points, plotPoints = True): f = 1 tan_x = 1 ...
#!/usr/bin/env python import argparse from genologics.entities import Process from genologics.lims import * from genologics.lims_utils import * from genologics.config import BASEURI, USERNAME, PASSWORD import process_categories as pc from datetime import datetime, timedelta import statusdb.db as sdb import multiproce...
from time import sleep from datetime import datetime from influxdb import InfluxDBClient from influxdb.exceptions import InfluxDBClientError import logging import logging.config import os.path import pynvml as N import psutil import subprocess import socket import sys import yaml # Global LOGGER var LOGGER = logging....
#!/usr/bin/env python """ reads .DMCdata files and displays them NOTE: Observe the dtype=np.int64, this is for Windows Python, that wants to default to int32 instead of int64 like everyone else! """ from pathlib import Path import logging import numpy as np import typing as T import typing.io as Tio # from .utils ...
""" Character categories and charsets. """ import sys from pypy.rlib.rsre._rsre_platform import tolower, isalnum # Note: the unicode parts of this module require you to call # rsre.set_unicode_db() first, to select one of the modules # pypy.module.unicodedata.unicodedb_x_y_z. This allows PyPy to use sre # with the sa...
# ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # 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.apa...
from django import forms from django.shortcuts import render, redirect import requests import uuid import json from esm_dashboard.utils import esm_endpoint_check import esm_dashboard.utils as utils from django.contrib import messages class ServiceForm(forms.Form): service_name = forms.CharField(label='Service Nam...
#!/usr/bin/env python3 # Copyright 2019 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 ...
#!/usr/bin/env python import carla import math import numpy as np from collections import deque from agents.tools.misc import get_speed import time class VehiclePIDController: """ VehiclePIDController is the combination of two PID controllers (lateral and longitudinal) """ def __init__(self, vehicl...
# Copyright 2019 The Johns Hopkins University Applied Physics Laboratory # # 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 ...
import os import re from time import sleep from opensextant import Place from opensextant.gazetteer import DB, estimate_name_bias, GazetteerIndex, get_default_db from opensextant.utility import replace_diacritics, load_list def filter_out_feature(pl: Place, feats): """ Filter out places by their feature type...
import sys import os import struct import time import numpy as np import array as arr import configuration as cfg from scipy.ndimage import convolve1d def read8byte(x): return struct.unpack('<hhhh', x) class FrameConfig: # def __init__(self): # configs in configuration.py self.numTxAntennas =...
from typing import List from model import Entry, Directory, NormalFile, VirusFile def __dir_arg_parse(directory: Directory, directory_path: str) -> Entry: """Parses a concatenated directory path to return the proper target which may be a file or directory """ dir_split = directory_path.split("/") ...
import torch # from models import BaseVAE from torch import nn from torch.nn import functional as F from . types_ import * class ClusterVAE(nn.Module): def __init__(self, # in_channels: int, latent_dim: int, total_cluster: int, hidden: List = None, fgx = 2, fgy = 2, **kwargs) -> None...
#!/usr/bin/env python # # cli.py: CLI for gene cluster enrichment analysis # Copyright (C) University of Manchester 2018-2021 <NAME>, <NAME> # from builtins import str import os import argparse import logging # Deal with matplotlib backend before importing seaborn # See https://stackoverflow.com/a/50089385/5799...
# encoding=utf8 # -*- coding: utf-8 -*- u from __future__ import unicode_literals from __future__ import division import frappe import frappe, os , math from frappe import _ from frappe.model.document import Document from frappe.utils import get_site_base_path, cint, cstr, date_diff, flt, formatdate, getdate, get_link_...
'''prosperbot.py: bot for prosper stuff''' from os import path, makedirs from datetime import datetime, timedelta import requests import demjson from nltk import download as nltk_download import nltk.sentiment as sentiment import pandas as pd import pandas_datareader.data as web import discord from discord.ext import ...
import xml.etree.ElementTree as ET import time import select from io import StringIO from threading import Thread, Event, Lock from os import read from .coqapi import Ok, Err from .xmltype import * class CoqHandler: def __init__(self, state_manager, printer): self.printer = printer self.state_mana...
""" Intermediate form schema definitions. These get constructed from either a json-parsed avro schema, or from a python dataclass. """ from abc import ABC, abstractmethod from dataclasses import dataclass, field from enum import Enum from importlib import import_module from typing import Any, Iterable, List, Optional...
import numpy as np import tensorflow as tf # import tensorflow.compat.v1 as tf from keras.preprocessing.image import ImageDataGenerator def mnist_x(x_orig, mdl_input_dims, is_training): # rescale to [0, 1] x_orig = tf.cast(x_orig, dtype=tf.float32) / x_orig.dtype.max # get common shapes height_width...
#!/usr/bin/env python3 """Train an XGBoost model for colour segmentation of images. Segmentation of up to six colours is supported. Fewer number of colours are possible simply by providing training data for only a subset of the colours. """ import argparse import pathlib import random import sys import time import c...
# DIFF-DIRS # Author: <NAME> (<EMAIL>) # Version: 1.01 # Description: Compares two directories and shows any differences # in the files/folders contained in those directories. # This script is my second Python script, so there are several # places in the code that are mangled or h...
import torch from torch import nn import torch.nn.functional as F import os import numpy as np from utility import * import pandas as pd from kornia.filters import filter2D import imageio import math from collections import OrderedDict import random def save_models(gs, ds, location): folder = create_folder("Saved...
# 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 appl...
# Copyright (c) <NAME> # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from chronos import Chronos import chronos_utils import pytest import pandas as pd import numpy as np ################################################################...