text
stringlengths
3.07k
12.6k
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
import torch import random from scripts.geometry_utils import collision_check from scripts.cross_utils import get_ped_type_from_cross def bce_loss(input, target): """ Numerically stable version of the binary cross-entropy loss function. As per https://github.com/pytorch/pytorch/issues/751 See the Tens...
import os import uuid import json from rest_framework import serializers from django.utils.dateparse import parse_datetime class PTDurationField(serializers.DurationField): def to_representation(self, value): return int(round(value.total_seconds())) def pt_round_float(val): abs_val = abs(float(val))...
#!/usr/bin/python r""" This is a test docstring. """ import subprocess as sb_pr import fire def subprocess_execute(command_list): """Subprocess_execute executes the command on host OS, then dumps the output to STDOUT. Arguments: command_list: This is a list of string making the command to be exe...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 2017-08-20 # STB import sys import regex as re import pandas as pd from argparse import ArgumentParser from file_read_backwards import FileReadBackwards def parse_input(): parser = ArgumentParser() parser.add_argument("-i", type=str, dest="gff_path") pa...
import math from typing import Any, Dict, Iterable from fugue import FugueWorkflow from tune import optimize_by_continuous_asha from tune.constants import TUNE_REPORT_METRIC from tune.concepts.dataset import TuneDatasetBuilder from tune.iterative.asha import ASHAJudge, RungHeap from tune.iterative.objective import Ite...
''' Read metadata SINEX file to get various satellite information (Block, COSPAR ID, SVN - PRN relations, Comments, ...) Author: <NAME> 2020-10-22 21:54 ''' from pathlib import Path import wget import pandas as pd from datetime import datetime, timedelta import subprocess def get_metadata_file(suff): ''' ...
"""tasks.py Simple tutorial invoke based task execution tool for building debian package (rpm support in process...) of ip2w application. Use [invoke.yaml] config file or cli params (see @task specification) Usage: invoke builddeb --no-use-git | --use-git (default) """ import os import time import tempfile as tmp...
#! /usr/bin/env python3 import sys import ftplib import os import re import datetime def getDirDate(inDir=''): """Strip the date from the cdas2 directory name. The directory name that contains the cdas2 files has the pattern cdas2.YYYYmmdd. This function will verify the directory contains the correc...
# -*- coding: utf-8 -*- # # Dao-Ke-Dao: Universal Message Module # # Written in 2021 by Moky <<EMAIL>> # # ============================================================================== # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any ...
#! /usr/bin/env python3 import re import sys import time from typing import Generator, Iterator, List, Match, Optional test = True debug = False stdin = False INFILENAME = "inputs/17.txt" TESTFILENAME = "inputs/17.test.txt" for arg in sys.argv: if arg == "--notest": test = False if arg == "--debug": ...
import os from argon2 import PasswordHasher from argon2.exceptions import VerifyMismatchError from quart import abort, Blueprint, flash, render_template, redirect, url_for from quart import current_app as app from quart import request from quart_auth import current_user, login_user, logout_user, login_required from t...
import json from datetime import datetime from pathlib import Path from typing import Dict import numpy as np import tensorflow as tf from PIL import Image from tensorflow.keras import Model from .cell_cultures import PetriDish from .cellar_automata import MorphCA from .image_utils import to_rgb def is_json_seriali...
import argparse import pathlib import tempfile import warnings import numpy as np import qpimage from drymass.cli import cli_convert, config, dialog, profile def setup_config(pxsize=1e-6, medium_index=1.335, wavelength=550e-9): _, path = tempfile.mkstemp(prefix="drymass_test_config_", suffix=".cfg") cfg = c...
import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder from randomized_l1 import RandomizedLasso def cs(data: pd.DataFrame, threshold=0.5): """ 求cs :param data: Dataframe :param threshold: 阈值,默认为0.5 :return: 一个Series,包括 """ # Dataframe转Array ...
import json import typing import random import os import re import backend.logic_engine class Question: def __init__(self, identifier: str, source: str, prompt: str, input_method: str, correct_grammar: str, correct_formula: str, prohibited_formula: str) -> typing.NoReturn: # User created...
import os import json import requests import time import logging api_domain = os.getenv('GOODDATA_DOMAIN') api_url = api_domain + "/gdc/projects/" + os.getenv('GOODDATA_PROJECT') def auth_cookie(): sst = super_secured_token() temp_token = temporary_token(sst) return temp_token def get_username(): if...
""" Class for interfacing with the Primesense RGBD sensor Author: <NAME> """ import logging import numpy as np import time from cv_bridge import CvBridge, CvBridgeError import rospy import sensor_msgs.msg from autolab_core import CameraIntrinsics, ColorImage, DepthImage, Image from autolab_core.constants import MM_T...
import unittest from theano import theano, tensor as tt import numpy as np import pymc3 as pm from pymc3.distributions import HalfCauchy, Normal from pymc3 import Potential, Deterministic from pymc3.theanof import generator class NewModel(pm.Model): def __init__(self, name='', model=None): super(NewModel,...
import random import copy import logging import time from django.db import connection from django.utils import timezone from core.libs.job import is_event_service from core.common.models import JediJobRetryHistory from core.settings.local import dbaccess _logger = logging.getLogger('bigpandamon') def drop_job_retrie...
""" Display the IOMMU current mapping on a very visual HTML file. """ import os import platform import subprocess import shutil from db_schema import Device from hole_calculator import calc_all_holes, get_all_mappings from db import create_session from math import floor def generate_html_frieze(type, value): """...
import os import platform import sys from datetime import datetime, timezone from pathlib import Path from unittest.mock import MagicMock, Mock import pytest import tzlocal.unix import tzlocal.utils if sys.version_info >= (3, 9): from zoneinfo import ZoneInfo, ZoneInfoNotFoundError else: from backports.zonei...
#!/usr/bin/env python2.7 import logging import os from apiclient.http import MediaFileUpload, MediaIoBaseDownload from babygdcli import ( get_service, get_file, NoSuchFile, get_arg_parser, FOLDER_MIME_TYPE, mkdirp ) def pull_file(service, file_id, src_path, dst_path): request = service.files().get_med...
# Copyright (c) 2018-2021, Texas Instruments # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of condition...
""" Device Registration ===================== Handles registration of IoT Central devices, and gets the hostname to use when connecting to IoT Central over MQTT """ import gc import json import time import circuitpython_base64 as base64 import circuitpython_hmac as hmac import circuitpython_parse as parse from adafru...
#!/usr/bin/python # -*- coding: utf-8 -*- __all__ = ['NONE', 'NORTHWEST', 'NORTH', 'NORTHEAST', 'WEST', 'EAST', 'SOUTHWEST', 'SOUTH', 'SOUTHEAST', 'ANONIMOUS', 'MANUAL', 'AUTOMATIC', 'COLOR', 'GRADIENT', 'PATTERN', 'LINEAR', 'RADIAL', 'HORIZONTAL', 'VERTICAL', 'BOTH', 'CENTIMETERS', 'MILLIMETERS'...
from sklearn.linear_model import * from sklearn.tree import * from sklearn.naive_bayes import * from sklearn.svm import * from sklearn.neural_network import * from sklearn.ensemble import * from sklearn.dummy import * import xgboost as xgb import lightgbm as lgb def get_human_friendly_name(model): if(hasattr(mode...
import pandas as pd import streamlit as st import altair as alt import plotly.express as px import plotly.graph_objs as go from plotly.subplots import make_subplots import datetime #loading the data def load_data(): """ Function to load data param DATA_URL: data_url return: pandas dataframe ""...
from microprediction import MicroWriter import numpy as np from pprint import pprint import matplotlib.pyplot as plt import random import time from pprint import pprint import warnings warnings.filterwarnings('ignore') from copulas.multivariate import VineCopula import pandas as pd from copulas.visualization import sca...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from pprint import pprint import pytest from ibm_zos_ims.tests.functional.module_utils.ims_test_gen_utils import DBDInputParameters as ip __metaclass__ = type GEN_FAIL_MSG = 'FAILURE - DBDGEN execution unsuccessful.' SOURCE = ...
"""Metric file for pixel wise scores computation """ import argparse import math import numpy as np from PIL import Image import os import sklearn.metrics as metrics # for confusion matrix #============================================== #============================================== # IO FUNCTIONS #================...
""" Converts advertisement data into sensor events """ import time import logging from ctypes import c_uint16, c_int16 from enum import IntEnum, unique from adv_parser import AdvParser @unique class MagnetState(IntEnum): NEAR = 0 FAR = 1 @unique class SensorEventType(IntEnum): RESERVED = 0 TEMPERA...
#!env python import urllib.request import re import os import tempfile import numpy as np import pandas as pd import pdfminer from pdfminer.high_level import extract_pages def _extract_text(fn): found_elements = [] for page_layout in extract_pages(fn, maxpages=1): for element in page_l...
""" Custom element manager for community created elements. For more details about this integration, please refer to the documentation at https://custom-components.github.io/hacs/ """ import logging import os.path import json import asyncio from datetime import datetime, timedelta from pkg_resources import p...
""" Basic scraping utility for Twitter """ # imports import os import time import json import csv from datetime import datetime, timedelta from typing import List, Dict import logging import tweepy class TwitterScraper: """ Basic scraping utility for Twitter based on Twython """ def __init__(self, p...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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, either version 3 ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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, overload from .. import _utilities __a...
import numpy as np from rockets.rocket import Rocket class Starship(Rocket): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.radius = 4.5 self.height = 50 self.propellant_mass = 3.3e6 self.dry_mass = 120e3 self.max_thrust = 2e5 * 3 ...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from toolkit.pre_load import neo4jconn from toolkit.pre_load import thuFactory from django.http import JsonResponse import os import sys import json import re thu_lac = thuFactory relationCountDict = {} filePath = os.path....
''' Date: June 11, 2020 Reading all the data in the Excel file finding mean and std of each column and writing it down. And for CorrectedData sheet, comparing values with the number that we got from "MEAN-2STD" and if the numebr is bigger or lower than that number we remove it and calculate it again. @author: <NAME> - ...
# coding: utf-8 """ Trakerr Client API Get your application events and errors to Trakerr via the *Trakerr API*. 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://...
# uncompyle6 version 3.3.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] # Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\Push2\bank_selection_component.py # Compiled at: 2019-04-23 16:19:13 ...
import csv from django.db.models import Count from django.http import HttpResponse from django.shortcuts import render, redirect from main.forms import GetDateForm, PurchasesForm from main.models import Purchases, Promo def index(request): """Главная страница""" return render(request, 'index.html') def cr...
from data import word_frequencies from data.graph import bloom_node, ngram, regex, walk from spec.mamba import * comparison = perf.Perf('trie v regex', ['trie', 'regex']) def get_words( length_mask: int = None, file: str = 'data/g1m_1gram.txt', multi: bool = False) -> list: def _check(word: str) -> bo...
import argparse import datetime import logging import os import sys import unicodedata from cobe_hubbot.brain import Brain from hubbot.Utils.stringutils import delta_time_to_string bots = ["ames", "bojii", "diderobot", "ekimbot", "harbot", "hubbot", "nopebot", "memebot", "pyheufybot", "re_heufybot", "heufybot"...
# MK Jul 2016 import logging.config logging.config.fileConfig('logging.conf') logger = logging.getLogger('runner') from db import ExperimentsOverview import pdfkit from lxml import etree from StringIO import * from db.Devices import Devices import ConfigParser # initialize configuration parser config = ConfigParser....
from __future__ import annotations import os import random from matplotlib import pyplot as plt import pandas as pd from torchvision.utils import draw_bounding_boxes, draw_segmentation_masks import src.data.utils.utils as utils from os.path import join import src.data.constants as c from numpy.typing import ArrayLike i...
import logging import os import sys from logging.handlers import RotatingFileHandler from multiprocessing.pool import ThreadPool as Pool DEFAULT_FOLDER = None THEMES = None TEMP_THEMES = None FP_HASHES = None LOG_FILE = None LOG = logging.getLogger('bw_plex') INI_FILE = None DB_PATH = None CONFIG = None PMS = None POO...
from base64 import b64decode, b64encode import gevent import gevent.event import json from PIL import Image, ImageDraw import StringIO import zlib import logging from ajenti.api import * from ajenti.api.http import HttpPlugin, url, SocketPlugin from ajenti.plugins.configurator.api import ClassConfigEditor from ajenti....
# -*- coding: utf-8 -*- """ State module to install Jenkins Plugins. """ # Import python modules. from __future__ import absolute_import import json import logging import os # Import external modules. import requests log = logging.getLogger(__name__) class PluginCache(object): """Manages the list of plugins av...
############################################################################### # Additional Evaluation Functions # # Author: <NAME> # # Contact: <EMAIL> ############################################################################### __all__ = ['SubpixelAlignment', 'PairwiseDistance', 'PRTF', 'PSD', 'EigenMode'] i...
# vi: set ft=python sts=4 sw=4 ts=4 et: # JupyterHub configuration # ## If you update this file, do not forget to delete the `jupyterhub_data` volume before restarting the jupyterhub service: ## ## docker volume rm jupyterhub_jupyterhub_data ## ## or, if you changed the COMPOSE_PROJECT_NAME to <name>: ## ## doc...
# loosely based on https://medium.com/vacatronics/3-ways-to-calibrate-your-camera-using-opencv-and-python-395528a51615 import sys from copy import deepcopy import cv2 import numpy as np import json import time from taggridscanner.aux.config import store_config, set_calibration from taggridscanner.aux.threading import...
# Requires pillow and pyyaml, iptcinfo3 # example: python3 -m gallery-script -i ~/website -n all import argparse import shutil from datetime import datetime from pathlib import Path import yaml from iptcinfo3 import IPTCInfo from PIL import ExifTags from PIL import Image GALLERY_MARKDOWN = """--- layout: gallery ti...
#!/usr/bin/env python # Disclaimer! # This code is not an optimal HTTP reverse shell! # It is created to introduce as many aspects of 'covertutils' as possible. # There are muuuuuch better ways to implement a reverse HTTP shell using this package, # using many Python helpers like SimpleHTTPServer. # In this file t...
import os, shlex, glob import random from typing import List, Dict, Optional from collections import namedtuple from functools import partial import tensorflow as tf from bs4 import BeautifulSoup from .tokenize_components import get_model_inputs from ..params import config from ..globals import stable_config from .co...
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2012 <NAME>, Opera Software ASA # # 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 # # Unl...
""" Functions to animate an ultrasound utterance. Date: Dec 2017 Author: <NAME> """ import os import shutil import subprocess import matplotlib.pyplot as plt from ustools.read_core_files import * from ustools.ultrasound_utils import reduce_frame_rate from ustools.transform_ultrasound import transform_ultrasound ...
"""Beautify jupyter cells using black.""" import json import logging import typing as t import black from IPython.core import getipython from IPython.core.interactiveshell import ExecutionInfo from IPython.display import display, HTML, Javascript from IPython.terminal.interactiveshell import TerminalInteractiveShell a...
""" Class for reading data from a 3-brain Biocam system. See: https://www.3brain.com/products/single-well/biocam-x Author : <NAME> """ from .baserawio import (BaseRawIO, _signal_channel_dtype, _signal_stream_dtype, _spike_channel_dtype, _event_channel_dtype) import numpy as np try: impo...
import sys sys.path.append("../..") import hashlib from MyCrypto.utils.bitarray import bitarray from MyCrypto.hash.sha_utils import Digest class SHA3: def __init__(self, c:int): self._c = c self._b = 1600 self._r = self._b - c self._d = c // 2 self.digest_size = c // 16...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# -*- coding: utf-8 -*- import sys from threading import Thread from gi.repository import GLib import dbus import dbus.mainloop.glib class LrcReceiver: def __init__(self, update_callback, logger): self.update_callback = update_callback self.logger = logger self.bus = None self....
# -*- coding: utf-8 -*- """ Created on Wed Dec 9 19:51:51 2020 @author: Philipe_Leal """ import pandas as pd import numpy as np import cartopy.crs as ccrs import matplotlib.pyplot as plt import os, sys import matplotlib.ticker as mticker pd.set_option('display.max_rows', 5000) pd.set_option('display.max_columns', 50...
import httplib2 import os import sys from apiclient.discovery import build_from_document from apiclient.errors import HttpError from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client.tools import run_flow video_id = "IrPwZ7ejsw8" channel_id = "UC5aFBZOvtseFQWib...
from collections import namedtuple from datetime import datetime, timedelta from sqlalchemy import and_ import pandas as pd from app import db # ENTSO-E mappings RENEWABLES = ["wind", "hydro", "solar", "biomass"] NON_RENEWABLES = ["coal", "fossil", "natgas", "oil", "other", "refuse"] ModelParameters = namedtuple("M...
# Adapted from conll_srl_scores from typing import Any, Dict, List, Tuple from overrides import overrides import numpy as np import torch # mostly for type annotations from miso.metrics.metric import Metric from miso.metrics.srl import compute_srl_f1 class GVDBScores(Metric): def __init__(self, vocab) -> None: ...
'''Subscribe to custom channels that let us monitor cobra Copyright (c) 2018-2019 Machine Zone, Inc. All rights reserved. ''' import asyncio import collections import json import os from typing import Dict, List import click import humanfriendly import tabulate from cobras.client.client import subscribeClient, unsaf...
"""Bluetooth motion tracker module. Copyright 2017 <NAME> Class to read from a Bluetooth MPU6050 device. Obtain acceleration, angular velocity, angle and temperature """ import threading import struct import bluetooth class MotionTracker(object): """Class to track movement from MPU6050 Bluetooth device. """...
"""This script is responsible for creating the main sketch dataset from the JSON files. Some basic filtering is applied in order to exclude empty sketches. However, as this dataset is intended to capture the original data, further filtering is left to scripts such as `sketchgraphs.pipeline.make_sequence_dataset` which...
#-*- coding: utf-8 -*- from apps.oclib.client import Redis, Mongo import msgpack import binascii R2M_SET = 'r2m_set' class Storage(object): def get(self, id): raise NotImplementedError def set(self, obj): raise NotImplementedError class StorageRedis(Storage): def __init__(...
import base64 import logging import os from dataclasses import dataclass, field from datetime import datetime from functools import lru_cache from typing import Any, Dict, Generator, Union import dateutil.parser import dateutil.tz from google.auth.exceptions import RefreshError from google.auth.transport.requests impo...
import numpy as np from datashader.composite import add, saturate, over, source src = np.array([[0x00000000, 0x00ffffff, 0xffffffff], [0x7dff0000, 0x7d00ff00, 0x7d0000ff], [0xffff0000, 0xff000000, 0x3a3b3c3d]], dtype='uint32') clear = np.uint32(0) clear_white = np.uint32(0x00ffffff) w...
""" <NAME> 2018 """ from math import * # -------------------------------------- # -- # -- PROBLEME I # -- # -------------------------------------- def lucas1(n): if n == 0: return 2 phi = (1 + sqrt(5)) / 2 phi2 = (1 - sqrt(5)) / 2 return phi ** n + phi2 ** n def lucas2(n): if n == 0:...
''' Definitions and tests managing the ASSIN dataset. ''' import os import pickle import random import logging from collections import Counter import xmltodict import numpy as np import torch import sentencepiece as spm from matplotlib import pyplot as plt from torch.utils.data import Dataset, DataLoader from transfor...
import os import numpy as np import pandas as pd from tensorflow.keras.utils import to_categorical from sklearn import model_selection class ACIC(object): def __init__( self, path, trial, center=False, exclude_population=False, ): self.trial ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """sbpy Data Decorators Based on astropy's units decorator: `~astropy.units.quantity_input`. """ __all__ = [ 'quantity_to_dataclass', 'dataclass_input' ] import inspect from functools import wraps from astropy.table import Table, QTable from as...
# Title: util.py # Description: Various utilities useful for online PSP tests # Author: <NAME> (<EMAIL>) and <NAME> (<EMAIL>) ############################## # Imports import numpy as np from scipy.io import loadmat from sklearn.decomposition import PCA ############################## def compute_errors(error_options...
#GUI import tkinter import os import csv import matplotlib import matplotlib.pyplot import matplotlib.image # Creation of first GUI asking for file name input class file_input: # Global variable so file_name can be used across modules def file_name(): global file_name file_name = [] # Cr...
# Copyright 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
"""mcpython - a minecraft clone written in python licenced under MIT-licence authors: uuk, xkcdjerry original game by forgleman licenced under MIT-licence minecraft by Mojang blocks based on 1.14.4.jar of minecraft, downloaded on 20th of July, 2019""" import globals as G import world.gen.layer.Layer import world.gen....
import json import requests import logging import time from requests.models import Response ckan_base_url = 'http://odpapi-migration.saeon.dvn' odp_ckan_api_key = '67a5a3e2-dcec-4eca-8e38-91de3b70416d' method='POST' logging.basicConfig(level=logging.INFO) UPDATE_METRICS = { 'update_count':0, 'records_added'...
import time import terminaltables from paperspace.commands import common from paperspace.exceptions import BadResponseError class _MachinesCommandBase(common.CommandBase): def _log_message(self, response, success_msg_template, error_msg): if response.ok: try: handle = respons...
import numpy as np import h5py from sklearn.preprocessing import StandardScaler from scipy import signal as sig from pathlib import Path from net import RNN # LOADING def check_load(p="project_datasets/"): return Path(p+"pre_data.mat").exists() def save_pre_processed(X, y, Xval, yval, Xtest, ytest, p="project_d...
""" test_google.py Copyright 2006 <NAME> This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distributed in the hope that it will...
from copy import deepcopy from mesh.generic.nodeState import LinkStatus def findShortestPaths(numNodes, meshGraph, startNode): ## Find shortest path to all other nodes using Dijkstra's algorithm # Initialize arrays pathArray = [[i+1,100,[-1]] for i in range(numNodes)] #visited = [startNode...
# This script is used to copy specific application from a build-block # currently it is totally useless for anything other than what it was created for # When ran, this script creates an output of everything it does in a readerfriendly format # run it with out-file for an easy log import xml.etree.ElementTree as ET fr...
"""Content manager. Manages spline motions in content directory. Motion model.""" import collections import glob import os from collections import OrderedDict from typing import Generator from being.configuration import CONFIG from being.curve import Curve from being.logging import get_logger from being.pubsub import ...
# Copyright (c) 2019 Viosoft 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
import pandas as pd import numpy as np import os from PyQt5.QtCore import QAbstractTableModel, Qt, QVariant import cubetools.config as cfg class Model(): '''Creates data for the UI and export''' def __init__(self): super().__init__() self.valid_cncfilelist = self.check_cnc_filepaths() de...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = execute.py __author__ = 'guo_h' __mtime__ = 2020/02/25 # code is far away from bugs with the god animal protecting I love animals. They taste delicious. ┏┓ ┏┓ ┏┛┻━━━━━┛┻━┓ ┃ ☃ ┃ ┃ ┳┛ ┗┳ ┃ ...
# -*- coding: utf-8 -*- import click import os import yaml import time from nitpicker import helpers from nitpicker.report_generator.generator import ReportGenerator TEST_CASE_TEMPLATE = ''' created: {created} author: {author} description: {description} tags: setup: - Do something to start actions: - Action 1 - Acti...
# This Software (Dioptra) is being made available as a public service by the # National Institute of Standards and Technology (NIST), an Agency of the United # States Department of Commerce. This software was developed in part by employees of # NIST and in part by NIST contractors. Copyright in portions of this softwar...
#!/usr/bin/env python from __future__ import division import argparse import json import os.path import sys import time import warnings from six import iteritems import logic warnings.filterwarnings("ignore", category=FutureWarning) warnings.filterwarnings("ignore", category=RuntimeWarning) __author__ = '<NAME>' ...
import spacy from cdeid.utils.resources import * def ent_tuple_to_bio(sentences, bio_scheme=BIO_SCHEME_2): nlp = spacy.load('en_core_web_sm') tokens_list = [] tokens_bio_list = [] for record_txt, record_entities in sentences: entities = record_entities.get('entities', '') entity_strs =...
import os import requests import time from requests.structures import CaseInsensitiveDict #CVALUE blue= '\33[94m' lightblue = '\033[94m' red = '\033[91m' white = '\33[97m' yellow = '\33[93m' green = '\033[1;32m' cyan = "\033[96m" end = '\033[0m' line=yellow+"===========================================================...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import confusion_matrix, roc_curve, auc def multiple_histograms_plot(data, x, hue, density=False, bins=10, alpha=0.5, colors=None, hue_order=None, ...
import torch import torch.nn as nn import numpy as np import torch.nn.utils.rnn as rnn_utils from torch.nn.functional import softmax import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork(nn.Module): def __init__(self, input_dim, self_sta...
import netCDF4 import numpy as np from delft3dfmpy.datamodels.cstructures import meshgeom, meshgeomdim import logging logger = logging.getLogger(__name__) ugrid_dim_dict = { "nnetwork_branches": ('1d', 'nbranches'), "nnetwork_nodes": ('1d', 'nnodes'), "nnetwork_geometry": ('1d', 'ngeometry'), "nnetwo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest from pdf417gen.compaction import compact, compact_bytes, compact_numbers, compact_text from pdf417gen.compaction import optimizations, _split_to_chunks, Chunk from pdf417gen.compaction.text import compact_text_interim from pdf417gen.encodin...