text
stringlengths
3.07k
22.1k
"""Handler for uploaded assets.""" import decimal from json import dumps, loads import logging from os import environ from urllib.parse import unquote_plus import boto3 logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) log.setLevel(logging.INFO) for b in ('boto', 'boto3', 'botocore'): log...
"Implements ConstraintSet" from collections import defaultdict, OrderedDict from itertools import chain import numpy as np from ..small_classes import Numbers from ..keydict import KeySet, KeyDict from ..small_scripts import try_str_without from ..repr_conventions import GPkitObject from .single_equation import SingleE...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, ) class VGTVIE(InfoExtractor): IE_DESC = 'VGTV and BTTV' _VALID_URL = r'''(?x) (?: vgtv:| ...
import os import numpy as np import torch from torch import optim from torch.utils.data import DataLoader from data import CustomSyntheticDataset from metrics import mean_corr_coef as mcc from utils import Logger, checkpoint from .nets import iVAE, DiscreteIVAE, VAE, DiscreteVAE def IVAE_wrapper(X, U, S=None, batch...
# Copyright (c) 2014, 2015 by California Institute of Technology # 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...
# import sys from django.conf import settings from django.contrib.sites.models import Site from django.db import models from django.contrib.auth.models import Group, Permission # from django.contrib.sites.shortcuts import get_current_site from django.utils.translation import ugettext_lazy as _ from django.utils.text i...
import numpy as np import matplotlib.pyplot as plt from MouseClick import * MAX_VIS_DISTANCE_M = 19700 MAX_VIS_DISTANCE_P = 85000 fc2= [6682.125964, 6681.475962] cc2= [875.207200, 357.700292] alpha_c2 = 0.000101 R2 = np.asarray([[0.48946344, 0.87099159, -0.04241701], [0.33782142, -0.23423702, -0.91...
""" Helper methods for loading and parsing KITTI data. Author: <NAME>, <NAME> Date: September 2017/2018 https://github.com/kuixu/kitti_object_vis """ import numpy as np cbox = np.array([[0,70],[-40,40],[-2.5,1]]) class Calibration(object): ''' Calibration matrices and utils 3d XYZ in <label>.txt are i...
import aioprocessing from dataclasses import dataclass from decimal import Decimal import os from pathlib import Path from typing import Optional, Any, Dict, AsyncIterable, List from hummingbot.core.event.events import TradeType from hummingbot.core.utils import detect_available_port _default_paths: Optional["Gatewa...
import os import re import csv import argparse import numpy as np import pandas as pd import xgboost as xgb import lightgbm as lgb from bayes_opt import BayesianOptimization from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score, fbeta_score, average_precision_score, auc,roc_curve, roc_auc...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is to process Split-seq reads after tagging the bam file with cellular and molecular barcodes. Input: BAM file with reads that have been filtered, polyA and SMART adapter trimmed, and tagged with the following: - XD: cell barcode 1 - XE: cell barcode 2 ...
def build_shopkeeper_dialog(scene, buyer, seller): class ItemDisplay(gui.BorderedControl): def __init__(self, item, depreciate=True, **kwargs): gui.BorderedControl.__init__(self, **kwargs) self.item = item self.depreciate = depreciate self._initComponents() ...
# -*- coding:utf-8 -*- #Use requests (2.13.0), lxml (3.8.0) #Authors: Ati #Date: 2017/09 import os import sys import re import csv import requests from lxml import etree def extractor(tree, fp_name): fp = open(fp_name, 'wt', newline = '', encoding = 'utf-8') writer = csv.writer(fp) lis = tree.xpath("//li...
from uuid import uuid4 from accountancy.mixins import (CashBookEntryMixin, ControlAccountInvoiceTransactionMixin, ControlAccountPaymentTransactionMixin, VatTransactionMixin) from accountancy.models import (MatchedHeaders, T...
#encoding=utf8 # Copyright (c) 2021 PaddlePaddle 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 requi...
import re import unittest from regroup import match, DAWG class TestParens(unittest.TestCase): def test_empty(self): strings = ['', 'aa', 'bb'] self.assertEqual('(aa|bb)?', match(strings)) def test_parens(self): strings = ['aa', 'bb', 'c'] self.assertEqual('(aa|bb|c)', matc...
#!/usr/bin/env python3 # <NAME>, 2019 # <EMAIL> import sys import os import glob import re import argparse import functools not_interesting_modules = set() interesting_modules = set() max_arg_len_to_print = 32 first_call_depth = None old_tracer = None no_trace_funcs = set() class TraceOutputter: def __init__(se...
import torch import pytorch_lightning as pl # for training wrapper from sklearn.metrics import roc_auc_score, average_precision_score class DeepGLAD(pl.LightningModule): def __init__(self, model, learning_rate=0.001, weight_decay=5e-4, **kwargs): super().__init__() self.model = model self.l...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_wandb ---------------------------------- Tests for the `wandb.apis.PublicApi` module. """ import datetime import pytest import os import yaml import tempfile from .api_mocks import * from .api_mocks import _run, _query from click.testing import CliRunner import g...
#!/usr/bin/env python # # atlasinfopanel.py - The AtlasInfoPanel class. # # Author: <NAME> <<EMAIL>> # """This module provides the :class:`AtlasInfoPanel`, which is a sub-panel that is used by the :class:`.AtlasPanel`. """ import logging import numpy as np import ...
import argparse import os import shutil import time import torch import torch.backends.cudnn as cudnn import torch.cuda.amp as amp import _init_paths # pylint: disable=unused-import from lib.utils.analyser import Analyser from lib.utils.checkpointer import CheckPointer from lib.utils.comm import all_gather, get_worl...
from __future__ import print_function from __future__ import absolute_import import sys import random from scipy import stats import numpy as np from ratio import count_terms from numba import jit class AbstractCorrection(object): def __init__(self, pvals, a=.05, array=False): if array: self.p...
#forecast simulations import numpy as np import pandas as pd from sklearn.model_selection._split import (_BaseKFold) import warnings import numbers import time from traceback import format_exception_only import numpy as np import scipy.sparse as sp from sklearn.base import is_classifier, clone from sklearn.utils i...
# Copyright 2010 BSN, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
import pandas as pd from Datasets.utils import read_parquet, get_bib_info, clean import json import sys import time import csv import random from tqdm import tqdm sys.path.append("Models/") from Models import * from position_rank import get_weights def mask(text1, text2): """ a simple vectorization function ...
# -*- coding: utf-8 -*- # 16.10.2019 # # Written by <NAME>, Rocket Science AG to export project reporting from Harvest # # Compatible with Python 3, not version 2 # import harvest2 from datetime import datetime import pickle import json import argparse import pandas as pd import dateutil import jinja2 as ji import re...
import asyncio import re import socket import ssl import struct from abc import ABC, abstractmethod from asyncio.protocols import BaseProtocol from asyncio.transports import BaseTransport from contextlib import closing from dataclasses import dataclass from pathlib import Path from typing import TYPE_CHECKING, Awaitabl...
# 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 # d...
import torch import torch.nn as nn import torch.nn.functional as F from modules.cds_modules import depth_regression, conf_regression, FeatureNet, CostRegNet, Refinement, get_depth_range_samples, ConvBnReLU, homo_warping_3D from modules.dynamic_conv import compute_Fmatrix, compute_epipole Align_Corners_Range = False ...
from collections import Counter from typing import List import hypothesis import pytest import numpy as np from hypothesis import given, HealthCheck from hypothesis.strategies import ( composite, shared, integers, lists, booleans, one_of, ) from hypothesis.extra.numpy import ( ...
from typing import Optional from .tree import BinaryTreeNode class TidierExtreme: left: Optional[BinaryTreeNode] right: Optional[BinaryTreeNode] thread: Optional[BinaryTreeNode] offset: float def __init__(self) -> None: self.left = None self.right = None self.thread = No...
from __future__ import division import time import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import cv2 from util import * import argparse import os import os.path as osp from darknet import Darknet import pickle as pkl import pandas as pd import random # wget https://raw.gi...
import sys import numpy as np import pandas as pd from sys import argv, __stdout__ from datetime import datetime, timedelta import os ### This program makes a timing dataframe from output logfiles generated by graphB. ### It can take multiple files as command line arguments manually, in which it will generate ### one...
"""Author: <NAME> Date: Sunday Sep Oct 10, 2020 9:00 PM The following file contains User Story 11 of sprint 1 which used to find if there is ant bigamy in GedCom file Written each test case at one time and ran code and again rerun for other test cases as follows This code is pristine which is free some bad...
from abc import ABCMeta, abstractmethod from typing import Union, Dict, List, Any, Optional, Type, Literal from .types import DataUnit from .exceptions import CancelBehave class ArpamarBehavior(metaclass=ABCMeta): @abstractmethod def operate(self, interface: "ArpamarBehaviorInterface"): ... class Ar...
#!/usr/bin/env python3 import numpy as np from argparse import ArgumentParser from math import inf from os import fstat from sklearn.linear_model import LinearRegression from tqdm import tqdm, trange # Argparse initializations argument_parser = ArgumentParser(description = 'Molecular Dynamics Residence Time') argume...
import pygame import os from utils.resource_path import resource_path from utils.assets import Assets # list of all game sounds soundList = [] # Initialize Sound System pygame.mixer.init() class Path: # PATH VARS FONT_PATH = os.path.join('assets', 'fonts') EXPLOSION_PATH = os.path.join('assets', 'graph...
from argparse import ArgumentParser import http.client import json import time import subprocess import os from datetime import datetime import socket def main_parse_args(): """Processes command line arguments. Expects a number of pipeline specific and global optional arguments. If argument is missing, ...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. import pytest import numpy as np import os import math import torch from tempfile import TemporaryDirectory import subprocess import re from rnnt_reference import config import popart import transducer_blocks def assert_lists_equal(alist, blis...
import numpy as np import cv2 class Condensation(): """ Parameters: DP - dimension of the dynamical vector MP - dimension of the measurement vector SamplesNum - number of samples in sample set used in algorithm """ def __init__(self, dimDP, dimMP, samplesNum): ...
import asyncio import csv import datetime import io import logging import random import re import time import typing from html import unescape import discord import requests from asgiref.sync import sync_to_async from discord.ext import commands, tasks from django.contrib.humanize.templatetags.humanize import ordinal ...
# -*- coding: utf-8 -*- import sys from collections import defaultdict import logging from enum import Enum from functools import partial from typing import List, Set, Dict, Optional from hashcode20.model import Library logger = logging.getLogger(__name__) def _parse_library(library_id, lines) -> Library: line...
import os import json import matplotlib.pyplot as plt import pandas as pd import pylatex as pl import shutil from data_handlers.geodataGetter import geodataGetter from util.filename_cleaner import filename_cleaner from CONF import DIR_REPORTING def safe_plot_intime_save(file_prefix, file_suffix, object_to_plot,dir=...
"""Utilities for training and evaluating.""" import numpy as np import matplotlib.pyplot as plt import torch import os import pickle from torch import Tensor from torch.optim.optimizer import Optimizer from torch.utils.data import DataLoader from torch.distributions import Normal from gpytorch import settings from gpyt...
# Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.amazon.com/asl/ # # or in the "license" file accompanying ...
# -*- coding: utf-8 -*- # @Time : 2019/10/24 20:12 # @Author : Esbiya # @Email : <EMAIL> # @File : img_locate.py # @Software: PyCharm import os import cv2 import numpy as np import requests from PIL import Image from eastmoney.chaojiying import image_to_text def _pic_download(url, type): """ 图片下载 ...
import logging import sys import numpy as np import math class LBFGS: STOP_ERR = 10 ** -14 MAX_LINE_SEARCH_ATTEMPTS = 20 def __init__(self, n: int, alpha: float): """ Constructor for the Limited Memory BFGS function. :param n: Dimension of the function. (Must be even) :pa...
import cv2 import numpy as np import matplotlib.pyplot as plt from art.estimators.object_detection import PyTorchFasterRCNN from art.attacks.evasion import ProjectedGradientDescent from art.attacks.evasion import DPatch, RobustDPatch import torch import dsld import os os.environ["CUDA_VISIBLE_DEVICES"]="1,2,3" COCO_...
# Copyright 2014 IBM Corp. # # 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 t...
""" PROBLEM Consider the infinite polynomial series AG(x)=xG1+x2G2+x3G3+⋯, where Gk is the kth term of the second order recurrence relation G_k =G_{k−1} + G_{k−2}, G_1=1 and G_2=4; that is, 1,4,5,9,14,23,… . For this problem we shall be concerned with values of x for which A(x) is a positive integer. The correspondi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import UUID from django.db import models from django.dispatch import receiver from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe from ..abstract.helpers import t...
# Writes a CSV with alarm history. # You could use Excel afterwards on the CSV to sort by two radices: 1. NumActionFailure, 2. NumActionSuccess. # # for each alarm # get all alarm history items # calculate time spent in each alarm state (Days Hr Min Sec, and Percent) # count number of alarm action outcomes (succe...
"""Dataset examples for loading individual data points Authors * Anonymous """ import copy import contextlib from types import MethodType from torch.utils.data import Dataset from speechbrain.utils.data_pipeline import DataPipeline from speechbrain.dataio.dataio import load_data_json, load_data_csv import logging ...
import torch import torch.nn as nn import numpy as np import matplotlib.pyplot as plt import random # GPU if available device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') class ServerQueue: """ The server queuing task as described in Example 10.2. """ def __init__(self, num_servers...
"""telemetry_obd/common.py: Common functions.""" from time import sleep from pathlib import Path from typing import List from datetime import datetime, timezone import logging import configparser import obd from pint import UnitRegistry from obd.utils import BitArray from obd.codes import BASE_TESTS from obd.OBDRespon...
from tensorflow import make_tensor_proto, make_ndarray from tensorflow_serving.apis import get_model_metadata_pb2 from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_service_pb2_grpc import cv2 import grpc import logging import numpy as np class RemoteColorization: def _...
from desky.panel import Panel, layout_attribute from desky.button import TextButton from desky.layout.grid import GridLayout class AdjustableDividerGrabber(TextButton): def __init__(self): super().__init__() self.grab_point = None self.adjust = lambda dx, dy, final: None def setup(se...
import random import math import pyglet import entity import agent import agent2 import food from pyglet.gl import * import numpy import simUI config = pyglet.gl.Config(sample_buffer = 1, samples = 8) window = pyglet.window.Window(1200, 1000, config = config) # platform = pyglet.window.get_platform() # display = plat...
# -*- coding: utf-8 -*- # @Time : 2018-8-4 14:53 # @Author : xylon import os import torch import numpy as np import pandas as pd from skimage import io, transform, color from torch.utils.data import Dataset from utils.common_utils import gct from utils.image_utils import im_rescale class HpatchDataset(Dataset):...
#!/usr/bin/env python3 ########################################################################################################### # Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause ########################################################################################################### ...
import cv2 as openCV import numpy # Global variables lower_bound = 254 # upper_bound = 255 # # TODO Add encapsulation because it is not good without it # TODO Improve on the rotated extraction def get_pieces(image): """ Initiates the detection and extraction of patch pieces from an image :param ...
""" This script computes parameters and security estimates for ModFalcon. References: - [BDGL16]: ia.cr/2015/1128 - [DLP14]: ia.cr/2014/794 - [Laa16]: https://pure.tue.nl/ws/files/14673128/20160216_Laarhoven.pdf - [Lyu12]: ia.cr/2011/537 - [MR07]: https://cims.nyu.edu/~regev/papers/average.pdf - [MW16]: ia.cr/2015/112...
# encoding: utf-8 import os import torch import random import argparse import data_loader import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from models import STNClsNet,ClsNet,NeuralNet from torchvision import datasets, transforms from util import Ave...
# -*- coding: utf-8 -*- ################################################################################ # _____ _ _____ _ # # / ____(_) / ____| | | # # | | _ ___ ___ ___ | (___ _ _ ___...
import time import os import sys import numpy as np import gym from tf_agents.replay_buffers import tf_uniform_replay_buffer from tf_agents.utils import common from tf_agents.drivers import dynamic_episode_driver from tf_agents.environments import tf_py_environment from tf_agents.environments import parallel_py_envir...
from django.shortcuts import render from django.forms import inlineformset_factory, ValidationError from django.http import Http404,HttpResponseRedirect,HttpResponse from django.contrib.auth.decorators import login_required,user_passes_test from django.urls import reverse from django.core.mail import send_mail from dja...
""" As the number of dimensions increases linear, the number of samples increases exponentially. This is known as the curse of dimensionality. Except for switching to Monte Carlo integration, the is no way to completly guard against this problem. However, there are some possibility to mitigate the problem personally. O...
# -*- coding: utf-8 -*- import pytest from mock import MagicMock, patch from transifex.common.utils import generate_key from transifex.native.cache import MemoryCache from transifex.native.cds import TRANSIFEX_CDS_HOST from transifex.native.core import NotInitializedError, TxNative from transifex.native.parsing import...
#!/usr/bin/python """ Create a file of taxonomy information from MetaCyc flat pathways file (pathways.dat) Dependencies: MetaCyc flat files and NCBI taxonomy files To Run: $ python make_map_metacyc-pwy_taxonomy.py --input-pathways pathways.dat --input-taxonomy-names names.dmp --input-taxonomy-division division.d...
#!/usr/bin/env python ############################################################################# ## # This file is part of Taurus ## # http://taurus-scada.org ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Taurus is free software: you can redistribute it and/or modify # it under the terms of th...
#!/usr/bin/env python # encoding: utf-8 """ untitled.py Created by <NAME> on 2009-10-06. Updated and extended by <NAME> 2011-2012. Copyright (c) 2009 __UCSF__. All rights reserved. """ import os import sys import re import string from string import join import stat import tempfile import colorsys from tempfile import...
import logging import numpy as np from datetime import datetime import os import sys import uuid import torch from allennlp.modules import TextFieldEmbedder, Seq2VecEncoder, FeedForward from allennlp.modules.seq2vec_encoders import PytorchSeq2VecWrapper from allennlp.nn import Activation from allennlp.training import ...
import logging from typing import AsyncIterator, Awaitable, Callable, Dict, Iterable, Sequence, Tuple import anyio from async_generator import asynccontextmanager from p2pclient.libp2p_stubs.peer.id import ID from multiaddr import Multiaddr, protocols from . import config from .datastructures import PeerInfo, StreamI...
import os import time import random import pickle import argparse import pandas as pd from joblib import dump, load from sklearn import preprocessing from sklearn.multioutput import MultiOutputClassifier from sklearn import tree import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColo...
import os import time from scipy.io import loadmat import h5py import pandas as pd import numpy as np from tqdm import tqdm from modAL.models import ActiveLearner from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans from sklearn.ensembl...
# !/usr/bin/python # -*- coding: utf-8 -*- """Run the main body of this code to generate the loss manifold.""" import numpy as np import matplotlib.pyplot as plt import matplotlib.image from mpl_toolkits.mplot3d import proj3d def orthogonal_proj(zfront, zback): """Find an orthogonal projection. :param zfront...
import argparse import cv2 # TODO<Jim>: Add gflags for handling command-line flags import glog import json import math import numpy as np import camera_definition import define_training_data as dtd import train_and_match as tam # TODO<Jim>: Allow command-line setting of logging level glog.setLevel("INFO") global VISU...
import numpy as np import torch from torchvision import transforms from torchvision.io import read_image import cv2 import matplotlib.pyplot as plt import os import platform from PIL import Image def depth2Cutoff(depth_map, cutoff): '''@param depth_map ~ (H x W) needs to be numpy array''' heatmap = np.ones((*...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose import astropy.units as u from astropy.coordinates import SkyCoord from gammapy.cube import MapDataset, MapDatasetEventSampler, simulate_dataset from gammapy.cube.tests.test_edisp_m...
# -*- coding: utf-8 -*- # Copyright (c) 2019, <EMAIL> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import erpnext from frappe import _ from frappe.utils import flt from frappe.model.document import Document class BankFile(Document): def valid...
import configparser from enum import Enum import gpg from http.cookiejar import LWPCookieJar from io import StringIO import os import stat from . import const from .exceptions import BiteError def csv2tuple(s): return tuple(x.strip() for x in s.split(',')) def iter2csv(x): return ', '.join(map(str, x)) d...
# -*- coding: utf-8 -*- # # Copyright (C) 2019 <NAME> <<EMAIL>> # Licensed under the MIT License. # """ The engine to orchestrate job executions. The orchestration is define as DAG of collections notated using the following brackets: [] - A list of jobs to be executed in sequence. {} - A set of jobs to be exec...
# -*- coding: utf-8 -*- """Module providing widget editor and view""" import hashlib import uuid import uuid as uuid_tool from Acquisition import aq_inner from ade25.panelpage.interfaces import IPanelEditor from plone import api from plone.api.exc import InvalidParameterError from plone.autoform.form import AutoExtens...
# -*- coding: utf-8 -*- """Plotting functions""" import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import plotly.graph_objects as go import holoviews as hv from holoviews import opts import networkx as nx from networkx.algorithms import bipartite from bokeh.io import show, output_file from bo...
import json class Element: def __init__(self, parent, name, **kwargs): self.name = name self.attributes = {} for k, v in kwargs.items(): self.attributes[k] = v self.children = [] self.parent = parent if parent is not None: parent.children.appe...
import os import pytest from dojot.module import Config def assert_config_creation(data=None): config = Config(data) assert config is not None assert config.kafka is not None assert config.data_broker is not None assert config.device_manager is not None assert config.dojot is not None retur...
import torch import torch.nn as nn import onmt from onmt.modules.Transformer.Layers import PrePostProcessing, MultiHeadAttention, FeedForward, Linear from onmt.modules.RelativeAttention import RelPartialLearnableMultiHeadAttn from onmt.utils import flip # Positional Embedding with discrete inputs class PositionalE...
import numpy as np from astropy.io import fits import glob import shk from starchive import identifiers def read_spec(spec_file): '''Read a HARPS 1D spectrum file from the ESO pipeline Parameters ---------- spec_file : string name of the fits file with the data (s1d format) Returns --...
# -*- coding: utf-8 -*- from collections import defaultdict from django import forms from django.core.exceptions import ValidationError from django.forms import DateField, DateInput, ChoiceField from django.utils.datastructures import SortedDict from django.utils.safestring import mark_safe from django.utils.translatio...
"""Converts a trained checkpoint into a frozen model for inference. Once you've trained a model using the `train.py` script, you can use this tool to convert it into a binary GraphDef file that can be loaded into the Android, iOS, or Raspberry Pi example code. Here's an example of how to run it: bazel run tensorflow/ex...
"""Micropede Client for Python""" __version__ = '0.0.2' import asyncio import functools import inspect import json import os import platform import time import types import random import re import urllib import uuid import threading from threading import Timer, Thread from jsonschema import valida...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # File name: main.py # First Edit: 2020-04-06 # Last Change: 08-Apr-2020. """ 事前インストール(後でDockerfileに記載する。) # conda install -c conda-forge tablua-py PyPDF2 -y """ import urllib.request from abc import ABC from abc import abstractmethod import pandas as ...
# 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 from...
#!/usr/bin/env python import logging log = logging.getLogger(__name__) #logging.basicConfig(level=logging.DEBUG) logging.basicConfig() import sys import argparse import os import glob import numpy as np import time import traceback start_time = None end_time = None count = 0 from scipy.optimize import fmin_bfgs NU...
import asyncio import hashlib import html import logging import sys from json import dump from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union from urllib.parse import unquote, urlparse from packaging.utils import canonicalize_name from . import utils from .master import Package...
# ---------------------------------------------------------------------------- # Gimel Studio Copyright 2019-2021 by <NAME> and contributors # # 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 # ...
import PySimpleGUI as sg import statistics as stats import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg def clean_data(window): """ clean and parse the raw data """ raw = window.AllKeysDict["-MLINE RAW-"].DefaultText.split("\n") # remove whitespace data = [r...
""" Convolutional Neural Network. Build and train a convolutional neural network with TensorFlow. This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/) Author: <NAME> Project: https://github.com/aymericdamien/TensorFlow-Examples/ """ from __future__ import division, print...
# -*- coding: utf-8 -*- # Copyright (C) 2012-2015 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package GTW.RST. # # This module is licensed under the terms of the BSD 3-Claus...
# -*- coding: utf-8 -*- # Global imports # import sqlite3 import MySQLdb import time import os # Local imports from src.lsng.helpers import singleton, untextify_mac from src.lsng.database.models import User, Database, GenerationData, GenerationRunBasic def load_json(): import json with open("database.logico...