text
stringlengths
8.04k
46.5k
import os from copy import deepcopy from getpass import getuser from multiprocessing import Pool from narrow import calc_remaining_words, AvailableWords from read_words import write_calculated_results, all_answers, all_guesses, all_outcomes_list, read_calculated_results import math # to do # remove checksum in not rer...
#%% [markdown] #-------------------------------------------------- ## Equity Premium and Machine #%% #-------------------------------------------------- import warnings import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = [10, 5] import math import time import datetime import pandas as pd import numpy 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 fro...
import json import math import numpy as np import os import sys import collections from PIL import Image, ImageDraw, ImageFont from reportlab.pdfgen import canvas from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.cidfonts import UnicodeCIDFont from reportlab.lib.colors import red, black, white from report...
""" Interface Module: This module is part of the PyEDA program. It provides several classes to use PyEDA with a graphical Interface using Tkinter. It also acts as a main script to drive the EDA analyses. Classes: EDA_app -> It is the main window where all the other frames are projected. inherited from tkinter....
# -*- coding: utf-8 -*- r"""Module to create and manage an ensemble of models. The method of the :mod:`~.ensemble` submodule are designed to generate an ensemble of models. It contains various methods to assist in generating multiple models from existing :class:`~.MassModel`\ s, using flux data or concentration data i...
# -*- coding: utf-8 -*- from typing import List, Iterable from collections import OrderedDict from functools import cached_property import string import re import hanziconv import spacy import jieba import numpy # "".join([chr(i) for i in range(8211, 8232)]) # "".join([chr(i) for i in range(12289, 12352)]) # "".join(...
""" Base class for freezing scripts into executables. """ import datetime import distutils.sysconfig import imp import marshal import os import shutil import socket import stat import struct import sys import time import zipfile import cx_Freeze __all__ = [ "ConfigError", "ConstantsModule", "Executable", "Freezer" ]...
# # scspell # Copyright (C) 2009 <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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRAN...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Software License Agreement (BSD License) # # Copyright (c) 2008, <NAME>, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyri...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Manage a single benchmark and, when run from the commandline, report its runtime to a file. """ # !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!! # This file, unlike most others, must be compatible with as many # versions of Py...
""" Created on Feb 25, 2015 @author: rgeorgi """ #=============================================================================== # Logging #=============================================================================== import logging import glob import os from intent.eval.pos_eval import poseval logging.basicConf...
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import ast import collections import functools import logging import os import re import traceback from glob import glo...
# coding=utf-8 # Copyright 2020 The SimCLR Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
""" @Author : <NAME> """ import matplotlib matplotlib.use('Agg') # server mode. # import torch import torch.optim from torch.utils.data.sampler import RandomSampler, BatchSampler # import re import os, sys, time, shutil from time import gmtime, strftime import numpy as np from math import pi from easydict import Ea...
################################################## # Import Own Assets ################################################## from hyperparameter_hunter import exceptions from hyperparameter_hunter.settings import G from hyperparameter_hunter.utils.general_utils import now_time, expand_mins_secs ##########################...
import numpy as np import shapefile import patch import environment_utils from numba import jit from dbfread import DBF from pyproj import Proj import time import datum import math import constants import io_utils ''' This File contains all operations that are related to do the geometrical processing of the data ...
""" List of functions used to set up different aspects of the model 用于设置模型不同方面的函数列表""" # Built-in libaries import os # External libraries import pandas as pd import numpy as np from datetime import datetime # Local libraries import pygem_input as input def datesmodelrun(startyear=input.ref_startyear, end...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Implement transformations between sky and focal plane coordinate systems. The :func:`sky_to_altaz` and :func:`altaz_to_sky` functions use the atmospheric refraction model implemented in :class:`astropy.coordinates.AltAz`, based on that implemented in ...
""" Linear State Beam Element Class """ from sharpy.linear.utils.ss_interface import BaseElement, linear_system, LinearVector import sharpy.linear.src.lingebm as lingebm import numpy as np import sharpy.utils.settings as settings import sharpy.utils.algebra as algebra @linear_system class LinearBeam(BaseElement): ...
# pylint: disable=E0401 # stdlib from functools import partial import logging import time import unittest # 3rd from mock import Mock, patch # project from tests.checks.common import Fixtures from utils.timeout import TimeoutException log = logging.getLogger(__name__) WMISampler = None ProviderArchitecture = None ...
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWebEngineWidgets import QWebEngineView import sys import socket import threading import time import random import os import MyCrypto import base64 # 客户端发送数据格式: # 消息:MSG (用户名) DIV (消息内容) END # 用户: LOGIN (用户名)...
""" Definitions of layers and nonlinearities in a neural network. <NAME>, 09/2014 """ import gnumpy as gnp import numpy as np import math import const import struct import loss as ls class LayerParams(object): """ Parameters of a layer. Weight matrix shape is in_dim * out_dim. """ _param_count = 0 ...
#!/usr/bin/env python3 import atddm import pandas as pd import numpy as np import numpy.random as npr from datetime import time # from math import ceil import seaborn as sns # import matplotlib.pyplot as plt from constants import AIRPORTS, COLORS, TZONES, CODES, BEGDT, ENDDT from math import sqrt from scipy import sta...
import __clrclasses__.System.ComponentModel.Design.Serialization as Serialization from __clrclasses__.System import EventArgs as _n_0_t_0 from __clrclasses__.System import MulticastDelegate as _n_0_t_1 from __clrclasses__.System import ICloneable as _n_0_t_2 from __clrclasses__.System import IntPtr as _n_0_t_3 from __c...
# ActivitySim # See full license in LICENSE.txt. import logging # import multiprocessing import pandas as pd from activitysim.core import tracing from activitysim.core import config from activitysim.core import pipeline from activitysim.core import simulate from activitysim.core import inject from activitysim.core i...
import logging from itertools import islice from os import environ from pathlib import Path from pprint import pformat, pprint from time import sleep, time import re from dagr_revamped.builtin_plugins.classes.DAGRHTTPIo import DAGRHTTPIo from dagr_revamped.dagr_logging import log from dagr_revamped.DAGRCache...
""" .. _p2p: p2p_com ======= This module is for p2p communication between two nodes. The communication is done via sockets, for now the messages are not encrypted. For external networks you may need to open ports. Assume you have two nodes. The ip:port of node1 is 123.456.789:5555 and while the ip:port of node2 is 98...
#!/usr/bin/python import math import re import numpy as np import inkscapeMadeEasy.inkscapeMadeEasy_Base as inkBase import inkscapeMadeEasy.inkscapeMadeEasy_Draw as inkDraw import inkscapeMadeEasy.inkscapeMadeEasy_Plot as inkPlot def findMinMaxStep(data, step): ''' returns the limits of the data, such that the ...
import os from distutils.util import strtobool import numpy as np import pytest import opendp.smartnoise.core as sn from tests import (TEST_PUMS_PATH, TEST_PUMS_NAMES) # Used to skip showing plots, etc. # IS_CI_BUILD = strtobool(os.environ.get('IS_CI_BUILD', 'False')) def test_multilayer_analysis(run=True): wi...
""" bitproto.parser ~~~~~~~~~~~~~~~ Grammar parser for bitproto. """ import os from contextlib import contextmanager from dataclasses import dataclass from dataclasses import field as dataclass_field from typing import Iterator, List, Optional, Tuple from typing import Type as T from typing import cast from ply impo...
#!/usr/bin/python # # Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
# This file takes in information about the ball and bat and gives all of the information about the flight of that ball, # whether it was hit or pitched. from __future__ import division from constants import * import numpy as np import numpy.linalg as la from enum import Enum class Ball(object): def __init__(sel...
import math import numpy as np import os import pandas as pd import urllib.request import zipfile import random import itertools import shapefile from shapely.geometry import Polygon from descartes.patch import PolygonPatch import matplotlib as mpl import matplotlib.pyplot as plt plt.style.use('ggplot') import sqlalc...
import typing import mesh_tensorflow as mtf import numpy as np import tensorflow as tf from tensorflow.python.ops.init_ops import Initializer from .dataclass import BlockArgs, ModelParameter from .mtf_wrapper import cast, mtf_range, reshape, concat as mtf_concat, pad as mtf_pad, mtf_slice, add, multiply, \ negati...
"""Handles native ad related ops""" #pylint: disable=too-many-lines import json from datetime import datetime, timedelta from enum import IntEnum from hive.db.adapter import Db from hive.indexer.notify import Notify from hive.utils.normalize import is_valid_nai from hive.utils.normalize import parse_amount from hive...
import os from datetime import datetime from os import listdir import numpy as np import xarray as xr import useful_scit.util.log as log from useful_scit.util.make_folders import make_folders import oas_erf.data_info.variable_info from oas_erf.data_info import get_nice_name_case from oas_erf.data_info.variable_info im...
# -*- coding: utf-8 -*- import torch import numpy as np import cv2 import time import visualization import videoholder import detect.yolowrapper as yolowrapper import carcounter # %% running def run_offline_profile(file, chk_dir, chk_pos, mdl_name, segment, sel_list): #file = 'E:/Data/Video/s3.mp4' #chk_d...
# Copyright 2018 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...
# obsolete.py - obsolete markers handling # # Copyright 2012 <NAME> <<EMAIL>> # Logilab SA <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Obsolete markers handling An obsolete marker maps an ol...
# Author: https://github.com/hbokmann/Pacman # Modified by <NAME> # Reference : https://github.com/melwyncarlo/Vax-Man-in-Python/blob/master/vaxman.py # Objective: Learn pygame to re-create the iconic game : Pacman using Python # Vax-Man is a game developed using pygame library # It is similar to iconic game : Pacman...
from abc import ABC, abstractmethod from typing import Dict, List, Mapping, Union import torch import torch.nn.functional as F import pytorch_lightning as pl from torchmetrics.classification import Accuracy import numpy as np from e2cnn import gspaces, nn, group from .utils import build_optimizer_sfcnn class Networ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 31 17:14:28 2021 *V5- @author: akel controi modelo e malha MT3D(input,opt='string') input --> dicionário contendo informações da simulação,modelo geologico e meshgrid. veja a função loadmigeo para maiores informações. opt --->...
""" This class will implement Multi-dimensional RNN modules and also Multi-dimensional LSTM modules These will be based on a generalization of the native pytorch RNN code from: https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/rnn.py """ import math import torch from torch.autograd import Variabl...
import abc import csv import functools import logging from enum import Enum, unique from . import constants @unique class StringEnum(Enum): @classmethod def all_values(cls): return [m.value for m in cls] @classmethod def values_dict(cls): return {m.value: m for m in cls} class Extr...
import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simplefilter(action='ignore', category=UserWarning) # to surpress future warnings import pandas as pd import sys import textstat import numpy as numpy import math import gensim from pprint import pprint from string import ascii_lowe...
""" ts_utils.py ==================================== The core module for timeseries helper functions. """ import math import inspect from math import radians, cos, sin, asin, sqrt, atan2 import numpy as np from scipy.signal import kaiser from .fsc.rsp import calc_response from .log import LOGGER def max_osc_respons...
from __future__ import absolute_import, division, print_function import inspect import os import re from abc import ABCMeta, abstractmethod from collections import Mapping from enum import Enum import numpy as np from six import add_metaclass, string_types from sklearn.base import BaseEstimator, TransformerMixin from...
# coding: utf-8 from sqlalchemy import Boolean, Column, Date, DateTime, Float, ForeignKey, ForeignKeyConstraint, Index, Integer, LargeBinary, String, Table, Text from sqlalchemy.orm import relationship from sqlalchemy.schema import FetchedValue from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() t_attorney_ca...
import sys sys.path.append('..') from submission import SubmissionBase import numpy as np from scipy.io import loadmat from os.path import join from matplotlib import pyplot def plotData(X, y, grid=False): """ Plots the data points X and y into a new figure. Uses `+` for positive examples, and `o` for ne...
#!/usr/bin/python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import unittest import numpy as np import syft from syft import TensorBase class ConvenienceTests(unittest.TestCase): def test_zeros(self): self.assertTrue((syft.zeros(5).data == np.zeros(5)).all()) def test_ones(self): self.assertTrue((syft.ones(5).data == np.ones(5)).all()) def test_r...
from __future__ import absolute_import from builtins import map from builtins import str from builtins import range from datetime import datetime from decimal import Decimal import unittest import blingalytics from blingalytics import base, caches, formats, widgets from mock import Mock from test import reports cla...
""" Join two KTKG edge files or two KGTK node files. The output file is an edge file or a node file. Note: This implementation builds in-memory sets of all the key values in each input file. """ from argparse import ArgumentParser import attr from pathlib import Path import sys import typing from kgtk.kgtkformat i...
#coding:utf-8 #!/bin/env python2.7 #This python script written for python 2.7.x (should still be compatible with older distributions though) generates a McDonald-Kreitman Test table to be used with SnIPRE, with the values of Ps, Pn, Ds, Dn plus a simple MK Test with no correction and a Pn/Ps column for reference to an ...
#!/usr/bin/python ''' The MIT License (MIT) Copyright (c) 2016 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ...
# -*- coding: utf-8 -*- # Copyright 2017 Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
# This file is part of the Printrun suite. # # Printrun is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Printrun is distributed in ...
from reportlab.lib.enums import TA_JUSTIFY, TA_CENTER, TA_RIGHT from reportlab.lib import colors from reportlab.lib.pagesizes import A4, inch, portrait from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, Image from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from ...
#+ # Name: # snpp # PURPOSE: # calculate the S/N per pixel for CSST and simulate a noisy spectrum for any given template. # CALLING SEQUENCE: # snpp,limitmag, repeatnum=10,obstime=300,targetmag=18,/skyperpixel,$ # galtpl=,wavearr=wavearr,mockgal=mockgal,galflux=galflux # plot, wavearr, galflux ; th...
from nsl import ast, LinearIR, op, types, Errors, Visitor import collections from typing import Optional def _CreateLinearIRType(t: types.Type): if t.IsPrimitive(): if isinstance(t, types.Integer): return LinearIR.IntegerType() elif isinstance(t, types.UnsignedInteger): return LinearIR.IntegerType ...
import json import os import queue import datetime import uuid import six import socket import threading import pytest from requests.exceptions import HTTPError from flask import abort def test_store(mini_sentry, relay_chain): relay = relay_chain() mini_sentry.project_configs[42] = relay.basic_project_config...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
''' .. Created on: 2/12/15 Common functions and data .. Copyright (c) 2015-2016 <NAME> See the https://opensource.org/licenses/MIT for license details. ''' import argparse import io import os from lxml import etree as ET import pkgutil import re import shutil import subprocess import sys from contextlib import c...
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
import warnings import numpy as np from numpy.testing import assert_array_almost_equal from math import sqrt from itertools import izip from nose.tools import assert_almost_equal, assert_true, assert_equal, assert_greater from clustering_metrics.metrics import adjusted_rand_score, \ homogeneity_completeness_v_measu...
from __future__ import print_function import os import time import math import json import numpy as np from itertools import product from compas.geometry import Frame, Transformation from compas.geometry import Translation from compas.datastructures import Mesh from compas.robots import LocalPackageMeshLoader from co...
from django.test import tag from rest_framework.test import APIRequestFactory from rest_framework.views import APIView from rest_framework.test import APITestCase, force_authenticate, APIClient from rest_framework.mixins import \ RetrieveModelMixin, ListModelMixin, CreateModelMixin, UpdateModelMixin from rest_frame...
import sys import os from kivy.app import App from kivy.core.text import LabelBase from kivy.uix.widget import Widget from kivy.properties import ( NumericProperty, ReferenceListProperty, ObjectProperty, StringProperty, DictProperty ) from kivy.uix.behaviors import ButtonBehavior from kivy.uix.image import Image f...
import numpy as np import time from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeRegressor from sklearn.metrics import mean_squared_error # 树节点 class Node: def __init__(self, label=None, feature=None, feature_split=None, prev_feat...
#pylint: disable=C0301,C0111 from typing import List import numpy as np from numpy import zeros, concatenate from pyNastran.op2.result_objects.op2_objects import get_complex_times_dtype from pyNastran.op2.tables.oes_stressStrain.real.oes_objects import StressObject, StrainObject, OES_Object from pyNastran.op2.op2_int...
#!/usr/bin/python3 # # Copyright (C) 2015 <NAME> <<EMAIL>> # # 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 2 of the License, or # (at your option) any later version. # # T...
### generated by caffe2fluid, your net is in class "" ### import math import os import numpy as np from paddle.v2.fluid.initializer import Xavier def import_fluid(): import paddle.v2.fluid as fluid return fluid def layer(op): '''Decorator for composable network layers.''' def layer_decorated(self,...
import sys from datetime import datetime from astropy.units import Quantity from astropy import units as u import numpy as np import aplpy import pytz from typing import Any, BinaryIO, Callable, Generator, List, Optional, Tuple, Union from salt_finder_charts import __version__ from salt_finder_charts.ephemerides impo...
# from monitor import summary_resources, summary_usage, curr_usage # from monitor import summary_usage_per_user, summary_usage_per_user # from monitor import curr_usage_per_machine from log import logger import nodemgr import bisect, uuid,json import random import copy from timeit import Timer class AllocationOfTa...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.tools.misc import formatLang class SaleOrder(models.Model): _inherit = "sale.order" applied_coupon_ids = fields.One2many('sale.coupon', 'sales_order_id', strin...
r""" Hyperbolic Functions The full set of hyperbolic and inverse hyperbolic functions is available: - hyperbolic sine: :class:`sinh() <Function_sinh>` - hyperbolic cosine: :class:`cosh() <Function_cosh>` - hyperbolic tangent: :class:`tanh() <Function_tanh>` - hyperbolic cotangent: :class:`coth() <Function_coth>` ...
#!/usr/bin/env python # # Copyright (c) 2013-2015 <NAME> <<EMAIL>> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" ...
from typing import Set import math import random import triarc.bot import string import time from collections import deque from . import engine, namegen, player from .common import plural, size_cm pad_alphabet = string.ascii_uppercase + string.digits def generate_pad(event: triarc.bot.Message, size=8): retur...
from __future__ import unicode_literals import struct import itertools import logging try: from StringIO import StringIO except ImportError: from io import BytesIO as StringIO class Hello(object): """ Hello(version: String, cookie: String, program_name: String, instance_name: String) ""...
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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...
#! python3 import tkinter import tkinter.ttk as ttk import threading import operator import time import copy import os.path import datetime import queue import BTCe api = BTCe.API('BTCe.ini') console = None def format_float(value): return ('{:0.8f}'.format(float(value)).rstrip('0').rstrip('.')) def validate_float(v...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from . import box_utils class SigmoidFocalClassificationLoss(nn.Module): """ Sigmoid focal cross entropy loss. """ def __init__(self, gamma: float = 2.0, alpha: float = 0.25): """ Args: g...
# watchfolder.py looks at folder and transcodes every .mov file to # .mp4 and .wmv acroding to the length and resolution # The new files are created acording to a set of pre-configured presets, # Last update - 2013-08-08 # determing the resolution and length of the .mov. # Files that are not 16:9 or 4:3 will not be co...
#!/usr/bin/env python3 """ does diagnostic analysis of batchMode batches """ # standard library modules import argparse import collections import csv import datetime import json import logging #import math import os import statistics import sys #import warnings logger = logging.getLogger(__name__) logger.setLevel(log...
import logging import numpy as np import scipy.stats import warnings from scipy.stats import kendalltau, pearsonr, spearmanr from typing import Callable, Dict, List, Optional, Tuple, Union from sacrerouge.data import Metrics ArrayLike = Union[List, np.ndarray] Corr = Optional[float] CorrFunc = Callable[[ArrayLike, Ar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This code is a test of a nearest neighbor algorithm. It measures # times for finding all nearest neighbors (ie the nearest neighbor for # each point in a set of points). In v0, test sets are 2D or 3D with # x,y coordinates uniformly random in a unit square. In a futur...
#!/usr/bin/env python2 # Copyright 2017 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...
import os import json import time import gc import torch import shutil import pandas as pd import numpy as np from deepbiosphere.scripts import GEOCLEF_Utils as utils from deepbiosphere.scripts import GEOCLEF_Dataset as dataset from deepbiosphere.scripts import GEOCLEF_Config as config from deepbiosphere.scripts.GEOCLE...
"""Heritage functions for OMMBV. Will be removed in v2.0.0.""" import numpy as np import warnings from OMMBV import step_along_mag_unit_vector from OMMBV.trace import apex_location_info from OMMBV.trace import footpoint_location_info from OMMBV.trace import full_field_line from OMMBV.trace import magnetic_vector impo...
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
# -*- coding: utf-8 -*- ## \package ui.options # MIT licensing # See: LICENSE.txt import os, wx from custom.check import CheckBox from custom.choice import Choice from custom.combo import ComboBox from custom.spin import SpinCtrl from custom.textinput import TextCtrl from globals ...
from __future__ import print_function import os, sys, time import argparse import cv2 as cv import numpy as np import random # import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader from torchvision.transforms import transforms ...
#!/usr/bin/python # Copyright (c) Microsoft. All rights reserved. from __future__ import print_function import argparse import json import os __version__ = '2017.09.19.1' class BondJson2Cpp: """Class encompassing the whole conversion process""" def __init__(self): """Construct the class and set ba...
from collections import OrderedDict from copy import copy, deepcopy from textwrap import dedent import cPickle as pickle import unittest import numpy as np import pandas as pd from xray import Dataset, DataArray, Variable, backends, utils, align, indexing from . import TestCase _dims = {'dim1': 100, 'dim2': 50, 'd...
#!/usr/bin/env python3 import json import warnings import random import numpy as np from datetime import datetime from pathlib import Path from tqdm import tqdm from PIL import Image, ImageEnhance, ImageOps class MaskJsonUtils(): """ Creates a JSON definition file for image masks. """ def __init__(self, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME> (<EMAIL>) # @Date: 2018-10-08 # @Filename: trajectory.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) from __future__ import annotations import asyncio import json import os import pathlib import time import warnings from ...
import sys import os import csv import math import json from random import * import numpy as np import pandas as pd from flask import * from flask_cors import CORS import src.py.glodberg as gfilter # init dataset name, feature types, and stimulus type DATASET = "MIT300" FEATURE_TYPES = [] FEATURE_SU...
""" _______________________________________________________________________________ This module produces an object of class FSM. It is a representation of an analyzer state machine (object of class DFA) that is suited for code generation. In particular, track analysis results in 'decorations' for states which help to ...