text
stringlengths
3.07k
22.1k
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2007, 2008 <NAME> <<EMAIL>> # # This file is part of the Bobcat program. # # Bobcat is free software; you can use it, redistribute it and/or modify it # under the terms of the MIT license. # # You should have received a copy of the MIT license...
r"""Test support for optional strict bounds on transcript coordinates https://github.com/biocommons/hgvs/issues/437 RMPR (- strand, chr 9) NC_000009.12 7751 7759 // 8018 8033 8043 NC_000009.11 7748 7756 // 8015 8030 8040 ...
""" Code to accompany the chapter "Natural Language Corpus Data" from the book "Beautiful Data" (Segaran and Hammerbacher, 2009) http://oreilly.com/catalog/9780596157111/ Code copyright (c) 2008-2009 by <NAME> You are free to use this code under the MIT licencse: http://www.opensource.org/lice...
#!/usr/bin/python # -*- coding: utf-8 -*- # Processes the Raw data of a sample # Following directory tree of the Particle Search: # # # <sample_id> # | # |_____/cropped/ # |_____/Reference Markers/ # |_____/spc/ # |_____/Stub Summary.txt # |_____/<stubinfo csv-File> # import pandas as pd import...
from typing import Any from qtpy.QtCore import Qt, QAbstractItemModel, QModelIndex class TreeItem: """Qt-agnostic tree item. Mocks the general API of QStandardItem for compatibility. Stores check state integer (can be interfaced with the Qt.CheckState enum). Single column support only (right now). P...
# -*- coding: utf-8 -*- """ Created on Thu Mar 19 13:43:52 2020 @author: Tom """ import ecm import numpy as np import matplotlib.pyplot as plt import os from scipy.stats import kstest from sklearn.preprocessing import StandardScaler import scipy import pandas as pd from matplotlib import cm import warnings from scipy...
""" Configuration management for vAPI providers """ __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2015, 2017 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long import os from six.moves import configparser from vmware.vapi.lib.log import get_vapi_logger logger = get_...
from __future__ import print_function from __future__ import division import os import sys import time import os.path as osp import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn from args import argument_parser, image_dataset_kwargs from torchreid.multi_data_manager import Image...
import sys sys.path.append("../") from pathlib import Path import numpy as np import torch from seq_ehr_model import MixModel, MixModelConfig from sklearn.metrics import (accuracy_score, auc, precision_recall_fscore_support, roc_auc_score, roc_curve) from tq...
import datetime from pytz import timezone from repositories import parsed_log, cyclic_log, device from domain import parsed_data INTERVAL_MINUTE = 5 def fetch_items(f, t, device_id): n = 200 items = parsed_log.find_by_event_date(f, t, device_id) items_count = len(items) incremental = int(items_count...
# Braille Dot Numbering # --------------------- # 1 4 # 2 3 # 3 6 # 7 8 # # Unicode Braille Patterns Block # ------------------------------ # https://en.wikipedia.org/wiki/Braille_Patterns # https://www.unicode.org/charts/PDF/U2800.pdf # # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F #...
# -*- coding: utf-8 -*- # Copyright 2004-2005 <NAME>, <NAME>, <NAME> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation from gi.repository import Gtk, Pango, GObject from quodlibet imp...
#!/usr/bin/env python # # This file is part of REANA. # Copyright (C) 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Run REANA CWL conformance tests and generate markdown results.""" from __future__ import ann...
# -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # # 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...
import tensorflow as tf import numpy as np import warnings import logging from sklearn.preprocessing import LabelEncoder from sklearn.utils import shuffle from sklearn.model_selection import train_test_split from sklearn.exceptions import DataConversionWarning from tensorimage.config.info import * from tensorimage.fil...
from matrix_client.api import MatrixRequestError from matrix_client.client import MatrixClient from requests.exceptions import ConnectionError, Timeout import argparse import configparser import importlib import logging import os import paho.mqtt.client as mqtt import queue import re import sys import time import trace...
"""Generic workflows (combinations of git actions) used as opentree git porcelain """ from sh import git # pylint: disable=E0611 from locket import LockError import tempfile from peyotl.utility.str_util import is_str_type from peyotl.utility import get_logger import os from peyotl.git_storage.git_action import MergeEx...
import os import re import sys import time import subprocess MODULE_DIRECTORY = os.path.dirname(__file__) sys.path.append(os.path.join(MODULE_DIRECTORY, "libs")) QDB_LAUNCHER_PATH = os.path.join(MODULE_DIRECTORY, "libs", "qdb_launcher.py") from .debugger_frontend import CallbackFrontend from .components import Con...
#!/usr/bin/env python ''' jc.py A simple arithmetic calculator in the vein of bc. Usage: jc.py [expression[; ...]] TODO: - support arbitrary output base - support floats in non-decimal bases - support complex numbers ''' from __future__ import print_function import ast import math import operator impor...
"""ModelAdmin for Newsletter""" from HTMLParser import HTMLParseError from django import forms from django.db.models import Q from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from emencia.django.newsletter.models import Contact from emencia.django.newsletter.models import Newsl...
from django.views.generic import DetailView, CreateView, UpdateView, DeleteView from django.http import HttpResponse, HttpResponseRedirect from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied from django.contrib.auth.views import redirect_to_login from django.utils.decorators...
# coding: utf-8 import json import discord from discord.ext import commands from discord.http import Route import zlib class ui_actions(): def __init__(self, client:discord.Client): self.buff = bytearray() self.zl = zlib.decompressobj() self._dispatch = client.dispatch ...
# Linky - nextcord # loading print('\nLoading...') import nextcord import asyncio import os import random import getpass import socket import datetime import pytz import json import pymongo import dns.resolver from time import monotonic import environ environ.token() never_gonna_give_you_up = os.getenv('TOKEN') environ...
#coding:utf8 import requests from bs4 import BeautifulSoup from Crypto.Cipher import AES import base64, json import threading, time from multiprocessing.pool import ThreadPool root = "http://music.163.com/" ss = requests.session() threadsNum = 50 # change as you like , better not too large limits = 100 headers = { ...
from collections import deque, namedtuple, defaultdict class BinaryTreeNode(): def __init__(self, data=None, left=None, right=None): self.data = data self.left = left self.right = right self.parent = None if left: left.parent = self if right: right.parent = self def __str__(self): return 'BinaryT...
import os, copy, json, sys from easydict import EasyDict from tqdm import tqdm import scipy import numpy as np import trimesh import tensorflow as tf import rnn_model import dataset import dataset_prepare import utils def fill_edges(model): # To compare accuracies to MeshCNN, this function build edges & edges le...
# -*- coding: utf-8 -*- """alert data view.""" import logging from flask.blueprints import Blueprint from flask.globals import request from flask.json import jsonify from chaos_genius.controllers.alert_controller import ( ALERT_CHANNELS, get_alert_info, get_alert_list, ) from chaos_genius.databases.db_ut...
def decode_sm2_asn1_ciphter_txt(cm): # decode to c1c3c2 bytes if type(cm) == str: tmp = bytes.fromhex(cm) else: tmp = cm # print(tmp) # print(bytes.fromhex("30")) assert tmp[0] == bytes.fromhex("30")[0] # sequence tlen_start = 1 if tmp[tlen_start] < 128: tlen...
#! /usr/bin/env python # --coding:utf-8-- # coding: utf-8 # ━━━━━━神兽出没━━━━━━ #    ┏┓  ┏┓ #   ┏┛┻━━━┛┻┓ #   ┃      ┃ #   ┃   ━  ┃ #   ┃ ┳┛ ┗┳ ┃ #   ┃      ┃ #   ┃   ┻  ┃ #   ┃      ┃ #   ┗━┓   ┏━┛ #     ┃   ┃神兽保佑, 永无BUG! #     ┃   ┃Code is far away from bug with the animal protecting #     ┃   ┗━━━┓ #   ...
""" Copyright (c) 2020, VRAI Labs and/or its affiliates. All rights reserved. This software is licensed under the Apache License, Version 2.0 (the "License") as published by the Apache Software Foundation. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://...
#!/usr/bin/env python # coding: utf-8 # * https://pytorch.org/tutorials/beginner/data_loading_tutorial.html # * https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html # * https://pytorch.org/tutorials/beginner/saving_loading_models.html # In[1]: # In[2]: import numpy as np import os import pandas as pd...
from traitlets import default # Modifications copyright 2020 <NAME> # # Original Code from IPython/lib/pretty.py # copyright IPython Development Team # licensed under the "BSD 3-Clause License" below # # BSD 3-Clause License # # - Copyright (c) 2008-Present, IPython Development Team # - Copyright (c) 2001-2007, <NAME>...
""" Utilities for creating smooth paths. """ # ros import rospy from geometry_msgs.msg import Quaternion, PoseStamped from nav_msgs.msg import Path # other import numpy as np # own import ros_np_tools.pose_msg as pose_msg import ros_np_tools.tf_mat as tf_mat import ros_np_tools.pos_quat_np as pos_quat_np def quat_s...
from __future__ import print_function import collections import concurrent.futures import hashlib import json import logging import sys import time from concurrent.futures import ThreadPoolExecutor import azure.mgmt.batchai.models as models from msrestazure.azure_exceptions import CloudError from msrestazure.polling....
''' Description: A file with functions that serve as endpoints for our backend API to interact with our frontend and our logic apps. ''' from datetime import datetime from flask import Flask, render_template, redirect, url_for, request, send_from_directory, flash from . import app,login # from tasurvey.forms import S...
import gen import algorithms import numpy as np import matplotlib.pyplot as plt def run_perceptron(): best = [0,0,0,0,0,0] for n in range(5): w1, theta1, _ = algorithms.perceptron(d1y[n], d1x[n]) correct1 = verify(w1,theta1,d2x[n],d2y[n]) print("perceptron with n = "+str(n_val[n])) ...
import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..', '..'))) import argparse import os import cv2 import glob import numpy as np import torch import imageio from PIL import Image import scipy.ndimage import torchvision.transforms.functional as F import time from tool.get_flowNN imp...
# 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, software # distributed under t...
""" Module for querying the RCSB web server using the REST API, as described here: http://www.rcsb.org/pdb/software/rest.do There is some overlap with iotbx.pdb.fetch, which really should have gone here instead, but this module is intended to be used in higher-level automation pipelines. """ from __future__ import a...
import logging logging.getLogger('tensorflow').disabled = True logging.getLogger('matplotlib').disabled = True import numpy import tensorflow.random numpy.random.seed(0) tensorflow.random.set_seed(0) import pandas from sklearn.metrics import roc_auc_score import mhcgnomes from mhc2flurry.allele_encoding_pair import...
# coding: utf-8 # Copyright (c) <NAME> # Distributed under the terms of the MIT License. from .plotting import (pretty_plot, gbar, vb_cmap, cb_cmap, dashed_arrow, _linewidth, fadebar) from matplotlib.ticker import MaxNLocator, MultipleLocator from matplotlib.colors import LinearSegmentedColorma...
# encoding: utf-8 import time from . import * import utils def get_images(filter=None): """ Get images names, with optional filter on name. :param filter: if string, get images names containing it, if python container, get images in this set. :return: a list of images names """ images = utils.Co...
#!/usr/bin/env python3 -u # 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. import argparse import glob from subprocess import check_call try: import faiss has_faiss = Tru...
"""NWS BUFKIT Profiles. This service exposes a [massive archive](https://mtarchive.geol.iastate.edu) of [BUFKIT](https://training.weather.gov/wdtd/tools/BUFKIT/index.php) data. For a single model runtime, this service returns one or more forecast profiles based on the parameters provided. There are a number of mechan...
from __future__ import print_function from __future__ import absolute_import from __future__ import division from numpy import float64 from numpy import ceil from compas.hpc.cuda.math_ import cuda_sqrt from compas.hpc.cuda.math_ import cuda_sum try: import pycuda import pycuda.autoinit except Im...
#!/usr/bin/env python3 # pylint: disable=too-many-instance-attributes,too-many-locals,unused-argument,no-self-use,wrong-import-order,unused-argument,too-many-arguments from typing import Dict, List, Optional, Tuple import logging import os import random import subprocess import traceback import typing from collections...
#copyright 2020 Huawei Technologies Co., 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 agreed to ...
from pathlib import Path import numpy as np import subprocess as sp import logging,os,sys from configparser import ConfigParser # %% Col0: vertical pixels (height). Col1: video kbps. Interpolates between these resolutions. BR30 = np.array( [[240, 300], [360, 400], [480, 500], ...
# Copyright 2016 OpenStack Foundation # Copyright 2016 VMware 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/LI...
import requests import pickle import time from time import time import threading import asyncio from Node import Node from config import * from flask import Blueprint, request node = Node() chord = Blueprint('chord', __name__) ''' This is the single point in the application used for returning to the client and term...
#!/usr/bin/env python #-*- coding: utf-8 -*- """ Packages to use across bot programs https://discordapp.com/oauth2/authorize?client_id=260808101744214016&scope=bot&permissions=0 """ import discord from discord.ext import commands import asyncio from subprocess import getstatusoutput from time import str...
import wx import wx.grid as gridlib import os import sys from ReorderableGrid import ReorderableGrid import SeriesModel import Utils from ReadRaceResultsSheet import GetExcelResultsLink, ExcelLink class Sequence(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) self.seriesNameLabel = wx....
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import autograd from models.layers import MLP from models.reparam import NormalDistributionLinear from utils import loss_kld_gaussian, loss_recon_gaussian, normal_energy_func from utils import logprob_gaussian...
# -*- coding: utf-8 -*- """ Created on Mon Mar 7 04:47:31 2022 Creating the tweaked modelled 'baselines' @author: <NAME> """ # Standard Library imports import argparse import gzip import matplotlib.dates as mdates import matplotlib.pyplot as plt import netCDF4 import numpy as np import os import pa...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.13.1 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # %load_ext autore...
# -*- coding: utf-8 -*- """ Created on Sun Oct 16 11:53:51 2016 @author: Villanueva """ # notTODO: INCLUDE .CIF FILE GENERATION OF LATTICE -> doesn't work with multiple sites... # TODO: cooperative sensitization: in progress: SSA works for up and downconversion import sys import logging import logging.config from do...
import torch import numpy as np import copy from scipy.spatial.transform import Rotation as R import cv2 from .pose_estimate_violations import Violation def filter_pcd(pcd, tol=0.05): """ input: pcd : Nx3 torch.float32 returns: mask : N torch.bool """ return pcd[:, 2] > tol def rvec_tvec_to_H(...
from __future__ import print_function import logging import numpy as np import matplotlib.animation as animation import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.patches as patches from torch.utils import data import sys sys.path.append("../PyTorch/") from PreActBlock import PreActBl...
"""Functions for using Hotelling's T-squared test to compare cell embeddings. """ import functools from typing import Optional import jax import jax.numpy as jnp import numpy as np import pandas as pd from sklearn.covariance import OAS CONTROL_UNINFECTED = 'uninfected_control' CONTROL_INACTIVE = 'infected_control' C...
# -*- coding: utf-8 -*- """ This module contains only two public functions: * `read` * `write` Function `read` reads a MF8/MT section from a string and produces a content object with a dictionary-like structure. The content object can be accessed using most of the keywords specified in the ENDF6 manual for t...
# Copyright 2022 Garda Technologies, LLC. 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...
import tensorflow as tf from tensorflow import keras from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, Flatten, Conv2D, MaxPooling2D import numpy as np from PIL import ImageGrab import cv2 import time import pyautogui from entre_direct import PressKey, Releas...
from torchvision.transforms.functional import to_tensor import data from model import ENet, LDCNet import os import torch import numpy as np import glob from torch.utils.data import Dataset, DataLoader from torch import optim from torchvision import transforms, utils from PIL import Image import torch import torch.nn a...
import tensorflow_advanced_segmentation_models as tasm import os import cv2 import numpy as np from time import time import tensorflow as tf import albumentations as A import matplotlib.pyplot as plt import tensorflow.keras.backend as K from labelme.utils import lblsave as label_save from common.utils import visualize...
import copy from threading import Lock from collections import defaultdict from automaton.lib.interpreter import Interpreter from automaton.lib.utils import locked import automaton.lib.logger as logger class ServiceDoesNotExist(Exception): """Indicates that a requested service does not exist in the registrar. ...
import logging import random import time from discord.ext import commands from discord.ext.commands import MissingPermissions from typing import Iterator from prepare import database import discord import datetime logger = logging.getLogger(__name__) def generate_flake(): return ( int((time.tim...
from datetime import datetime, timedelta from decimal import Decimal from pyramid.response import Response from pyramid.view import view_config, render_view_to_response from pyramid.events import subscriber, BeforeRender from sqlalchemy.exc import DBAPIError from sqlalchemy import not_, desc, asc, distinct, func fro...
# @HEADER # ************************************************************************ # # TriBITS: Tribal Build, Integrate, and Test System # Copyright 2013 Sandia Corporation # # Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, # the U.S. Government retains certain ri...
"""Module for Algorand smart contracts integration testing.""" import base64 import pytest from algosdk import constants from algosdk.encoding import encode_address, is_valid_address from algosdk.error import AlgodHTTPError, TemplateInputError from contracts import ( BANK_ACCOUNT_FEE, create_bank_transaction...
from collections import defaultdict, namedtuple import contextlib from dataclasses import fields import glob import json from multiprocessing import Manager from multiprocessing.managers import BaseManager import pickle import os from pikapi.formats.basics import ImageFrame, Timestamped from pikapi.core.camera import I...
"""Generic functions and classes. .. testsetup:: from nitpick.generic import * """ import collections import re from pathlib import Path from typing import Any, Dict, Iterable, List, MutableMapping, Optional, Set, Tuple, Union import jmespath from jmespath.parser import ParsedResult from nitpick.constants impor...
# -*- coding: utf-8 -*- """Extensions for unittest.TestCase.""" import os import warnings from google.appengine.api import apiproxy_stub from google.appengine.api import namespace_manager from google.appengine.datastore import datastore_stub_util from google.appengine.ext import ndb from google.appengine.ext import te...
from sklearn.base import BaseEstimator import numpy as np import torch import torch.optim as optim from torch.autograd import Variable import torch.utils.data as data import torch.nn as nn num_epochs = 20 BATCH = 50 NB_GAUSSIANS = 2 EPSILON = 1e-12 # In this submission, we try to estimate the true distribution by usi...
# ------------------------------------------------------------ # Copyright (c) 2017-present, SeetaTech, Co.,Ltd. # # Licensed under the BSD 2-Clause License. # You should have received a copy of the BSD 2-Clause License # along with the software. If not, See, # # <https://opensource.org/licenses/BSD-2-Clause> # # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import socket import time import fcntl import re import os import errno import struct from threading import Thread from time import sleep from collections import OrderedDict detected_bulbs = {} bulb_idx2ip = {} DEBUGGING = False RUNNING = True current_command_id = 0 MCA...
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Cron commands """ from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.core.cache import cache from core.domains import setup_domain from pandora...
# Copyright 2021 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, ...
""" Download all Goldfish decks in a dictionary. main() grab_links() scrape_deck_page() scrape_cards() deck_text_to_dict() """ from typing import Dict, Optional, Tuple import requests from bs4 import BeautifulSoup from tqdm.auto import tqdm from . import MtgBoard, MtgDeck ...
""" legacyhalos.sky =============== Code to measure the sky variance for each object. """ from __future__ import absolute_import, division, print_function import os, pdb import time, warnings import shutil import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt import legacyhalos.io def sky_coadd...
from textwrap import dedent import hypothesis.strategies as st import pytest from hypothesis import assume from hypothesis import given from hypothesis.stateful import Bundle from hypothesis.stateful import rule from hypothesis.stateful import RuleBasedStateMachine import vdirsyncer.vobject as vobject from tests impo...
# pylint: disable=attribute-defined-outside-init, len-as-condition, unused-argument def load_landmarks(filename): import re from baiji import s3 from baiji.serialization import json, pickle, yaml from lace.serialization import lmrk, meshlab_pickedpoints if not s3.exists(filename): raise Va...
import logging from typing import Any, Dict, List, Optional, Set from premonition import graphql def probe_valid_fields( wordlist: Set, config: graphql.Config, input_document: str ) -> Set[str]: valid_fields = set() for i in range(0, len(wordlist), config.bucket_size): bucket = wordlist[i : i + ...
from typing import Any, Dict, List, Optional, Set from ..config import ConfigValueException, Kind, TransparentConfig, TreeLoader __all__ = ["EuphConfig", "EuphLoader"] class EuphConfig(TransparentConfig): def __init__(self, parent: Optional[TransparentConfig] = None) -> None: super().__init__(parent) ...
""" calc2tex.parse_to_txt ~~~~~~~~~~~~~~~~~~~~~ Reads in a txt-file, creates a partially filled dictionary and calls *calc_unit* and *calc_formula* to fill the dictionary. :copyright: 2020 by <NAME> :license: MIT """ #TODO Exponential-Darstellung für Zahlen anbieten als zusätzliches Argum...
import numpy from .opengmcore._opengmcore import (SparseFunction, TruncatedAbsoluteDifferenceFunction, TruncatedSquaredDifferenceFunction, PottsFunction, PottsNFunction, Pott...
from __future__ import annotations from enum import Enum from typing import Callable, Union import numpy as np from freqtrade.strategy.hyper import BaseParameter, DecimalParameter, IntParameter from pandas import DataFrame, Series import logging logger = logging.getLogger() class IndicatorType(Enum): VALUE = '...
''' Copyright (C) 2010-2021 Alibaba Group Holding Limited. useful function to support model train, test and search ''' # pylint disable=R1705 import os import distutils.dir_util import pprint import ast import argparse import importlib.util import logging import numpy as np def load_py_module_from_path(module_path, ...
# -*- coding: utf-8 -*- """ Created on Sat Jan 26 19:40:13 2019 @author: Titus """ import numpy as np from scipy.optimize import curve_fit import uncertainties as unc import matplotlib.pyplot as plt import uncertainties.unumpy as unp from scipy.integrate import odeint import pandas as pd from scipy import stats # ca...
from mxnet.gluon import nn, HybridBlock from mxnet.gluon.model_zoo.vision.resnet import BasicBlockV2 from mxnet.gluon.model_zoo.vision.densenet import _make_dense_block class DWConv(HybridBlock): def __init__(self, in_channels, out_channels, kernel_size, strides=1, padding=0, use_bn=False): super().__init...
''' Functions to load Fourier series of hydrodynamic friction coefficients from a file - Used in `physics.friction_pairwise.py` and also kept for compatibility. MAYBE: - rewrite define_right_side_of_ODE - s.t. gii is not calculated twice in Gamma_glob and Q_glob - implemented, but the speed remained equal - Cubic in...
import os import sys import numpy as np from matplotlib.widgets import Button import cv2 import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import utils.image as image_utils import utils.general as general_utils class Index(object): def __init__(self, min_area, max_area, fig, ax, img_plot,...
# Copyright (c) 2017 <NAME> <<EMAIL>> # 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 conditions and t...
######################################################### # # ICLOUD SERVICE HANDLER MODULE # ######################################################### from ..globals import GlobalVariables as Gb from ..const_general import (HHMMSS_ZERO, WAZE, WAZE_NOT_USED, WAZE_USED, WAZE...
""" Module cinematic with scipy.optimize.root """ from scipy.optimize import root import matplotlib.pyplot as plt class CinematicPoint: """ Cinematic point """ def __init__(self): self.position = None self.speed = None self.acceleration = None self.time = None def solve(...
# -*- coding:utf-8 -*- __author__ = 'lidongchao' """ 数据库ORM模块 """ from tornado import gen from foundation.log import logger from serverApp.common.connectionPool import dbpool _triggers = frozenset(['pre_insert', 'pre_update', 'pre_insert']) # 所有数据库支持类型的基类,可以根据数据库类型进行扩充 class Field(object): _count = 0 def...
import datetime import os from unittest import skip from django.contrib.auth import get_user_model from django.test import TestCase from project_tracker.settings import ROOT_DIR from .models import Engagement, EngagementType, EngagementWorkStream, EngagementTopic from projects.models import Project from stakeholders....
# Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import ast import builtins import copy import inspect from cros.factory.test.test_lists import test_list as test_list_module from cros.factory.test.utils...
#!/usr/bin/env python2.7 # -*- coding: utf-8; mode: python; -*- """ DESCRIPTION: ============ This module is a light-weight alternative to standard fileinput library. Classes: AltFileInput - class for interactive reading of input files AltFileOutput - class for interactive reading of input files LICENSE (modified MI...
# coding: utf-8 """ Sphinx directive integration ============================ We usually need to document when a parameter is deprecated, to do this, we use `Sphinx <http://www.sphinx-doc.org>`_ directives: - We use admonitions in sphinx to render warnings for every deprecated argument just below its description in d...
""" :module: OpenDrive. :synopsis: :author: <NAME> public classes --------------- .. autoclass:: XXX :members: public functions ---------------- .. autofunction:: XXX private functions ----------------- """ import os from typing import Tuple, List from kivy.properties import ObjectProperty, BooleanPropert...