text
stringlengths
3.07k
22.1k
import scraper import utils import sys import datetime import argparse import pandas as pd ELO_BASE = 1500 NEW_ELO = 925 K_FACTOR = 43 SEASON_CARRY = 0.9 HOME_ADVANTAGE = 81 ELO_TO_POINTS_FACTOR = -25.7 #divide an elo margin by this to get the predicted point spread GAMES_REQUIRED = 5 DATA_FOLDER = utils.DATA_FOLDER ...
import numpy as np import tensorflow as tf import argparse import time import os import sys import pylab as plt import importlib import gym import roboschool # import pybullet_envs # import pybullet_envs.bullet.racecarGymEnv as re # from pybullet_envs.bullet.kukaGymEnv import KukaGymEnv sys.path.append('/'.join(str....
import multiprocessing import random import time import typing import numpy as np from transformers import GPT2TokenizerFast from .dataclass import ModelParameter from .utils_core import chunks, color_print def render_video(model_output: typing.List[typing.Tuple[np.ndarray, typing.List[str]]], coun...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-RDM-Records is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """JSONSchema tests.""" import json from os.path import dirname...
# 6.0002 Problem Set 5 # Graph optimization # Name: # Collaborators: # Time: # # Finding shortest paths through MIT buildings # import unittest from graph import Digraph, Node, WeightedEdge # # Problem 2: Building up the Campus Map # # Problem 2a: Designing your graph # # What do the graph's nodes represent in this p...
"""This module contains the general information for ComputeRackUnit ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class ComputeRackUnitConsts: ADMIN_POWER_BMC_RESET_DEFAULT = "bmc-reset-default" ADMIN_POWER_BMC_RESET_...
id_map = {} keywords = ["int", "float", "while", "until", "string", "if", "else", "boolean", "true", "false", "for", "printf", "struct", "return"] operators = ["+", "-", "*", "/", "%", "=", "equals", ">", "<", "and", "or", "not", "?", ":"] delimiters = ["{", "}", "(", ")", "[", "]", ";"," "] comments = ['#'] val...
# coding:utf-8 """ A corpus parser for preparing data for a tensorflow chatbot """ import os import random from ast import literal_eval from tqdm import tqdm DELIM = ' +++$+++ ' """分隔符""" SIZE = 3000 movie_lines_filepath = 'data/cornell-movie-dialogs-corpus/movie_lines.txt' movie_conversations = 'data/cornell-movie-di...
import tensorflow as tf import numpy as np try: from models.read_util.read_train_data import get_all_bearings except: from ..read_util.read_train_data import get_all_bearings # from read_train_data import get_all_bearings VIB_SIZE = 2000 step = 20 IMAGE_SIZE = VIB_SIZE//step # Global constants describing ...
""" While users can set up their own (secure) Neo4j database, _mako_ can also set up a local instance. This file contains all functions necessary to start this instance, as well as utility functions for interacting with the Neo4j database. The database model for biological data is arguably the core component of _mako...
#!/usr/bin/env python3 import operator import collections import itertools import functools import numbers import heapq # (x -> y -> z) -> (y -> x -> z) def flip(func): def inner(*args, **kwargs): return func(*(args[::-1]), **kwargs) return inner # (x -> y -> z) -> (Vector x -> a -> Vector z) def vector_operator...
from .fixtures import ( app_client, make_app_client, TestClient as _TestClient, EXPECTED_PLUGINS, ) import asyncio from datasette.plugins import DEFAULT_PLUGINS from datasette.cli import cli, serve from datasette.version import __version__ from datasette.utils.sqlite import sqlite3 from click.testing im...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ A Python runner for DaCe tasklets. Used to execute ``with dace.tasklet`` statements. """ import ast import copy import inspect import sys from typing import Any, Dict, List, Optional, Tuple from dace import data, symbolic from dace.conf...
import string import random import datetime from app import db from passlib.apps import custom_app_context as pwd_context from sqlalchemy import desc class BaseModel(db.Model): __abstract__ = True @classmethod def get_many(cls, order_by='id', descending=True, page_number=1, page_count=10): """ ...
# -*- coding: utf-8 -*- '''Text template compiler. Notable in this module are: * TextTemplate - function building a template from text string or filename. * _pattern - the regex used to find the beginnings of tags and expressions. * _Scanner - scans text and generates a stream of tokens. * _Parser - parses a stream ...
# Copyright 2019 Xanadu Quantum Technologies 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 agre...
""" link followed: https://www.tensorflow.org/lite/guide/inference https://towardsdatascience.com/how-to-download-an-image-using-python-38a75cfa21c https://stackoverflow.com/questions/59143641/how-to-get-useful-data-from-tflite-object-detection-python """...
import csv import os import json import subprocess import copy from collections import Counter import networkx as nx from graphviz import Source import tempfile from typing import Any, Dict, Set, Tuple from conda_forge_tick.utils import frozen_to_json_friendly, load_graph from conda_forge_tick.auto_tick import initi...
import os import sys import logging import contextlib import hou import hdefereval import pyblish.api import avalon.api from avalon.pipeline import AVALON_CONTAINER_ID from avalon.lib import find_submodule import openpype.hosts.houdini from openpype.hosts.houdini.api import lib from openpype.lib import ( any_ou...
#!/usr/bin/env python3.7 import json import typing from dataclasses import InitVar, MISSING, asdict, fields, is_dataclass from enum import Enum from warnings import warn from typed_json_dataclass.utils import to_camel, to_fullcase, to_snake, recursive_rename class MappingMode(Enum): SnakeCase = 1 CamelCase =...
''' Created on 21 Jan 2021 Last updated 12 Feb 2021 @author: thomasgumbricht ''' # Standard library imports from os import path, makedirs # Third party imports # Package application imports import geoimagine.support.karttur_dt as mj_dt from geoimagine.gis import kt_gis as ktgis class LayerCommon: ''' ''...
# Copyright 2020 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...
import tensorflow as tf import numpy as np from FUNCTION import * def psnr(input, label, shave): assert (label.dtype == input.dtype) if shave != 0: input = input[shave:-shave, shave:-shave, :] label = label[shave:-shave, shave:-shave, :] diff = np.int32(label) - np.int32(input) mse = np...
import argparse, logging from typing import Dict, Tuple, Any, Callable, Generic, TypeVar from ast import literal_eval from torch.optim import Optimizer, Adam, SparseAdam from torch.optim.lr_scheduler import * from torch.nn import L1Loss, MSELoss from torch.nn import Module # type aliases Name = str ArgumentName = str...
"""collections library: Tools to manage sequence of items.""" import collections # category: chained dictionaries def chainmap_maps(): """obj.maps(): Linked dictionaries.""" map_one = {1: 0} map_two = {99: "Link"} chained = collections.ChainMap(map_two, map_one) return map_one in chained.maps ...
"""Domains of Gaussian type.""" from sympy.core.numbers import I from sympy.polys.polyerrors import CoercionFailed from sympy.polys.domains import ZZ, QQ from sympy.polys.domains.algebraicfield import AlgebraicField from sympy.polys.domains.domainelement import DomainElement from sympy.polys.domains.field import Field...
# -*- coding: utf-8 -*- # Copyright 2019 IBM # # 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...
import itertools from collections import Counter import numpy as np import copy import networkx as nx import igraph as ig from tensorflow.keras.layers import Dense from gtda.graphs import GraphGeodesicDistance def model2graphig(model, method=None, layer_activation_link=False, visualize=False, include_bias=True, ...
from typing import Optional, Callable, Iterable, Union, List from thinc.api import Config, fix_random_seed, set_gpu_allocator, Model, Optimizer from thinc.api import set_dropout_rate from pathlib import Path from collections import Counter import srsly import time import re from thinc.config import ConfigValidationErr...
""" """ from keras.models import Model from keras.layers import Input,Dense, Activation, BatchNormalization, Dropout from keras import optimizers from keras import backend as K from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau from keras.utils import to_categorical from sklearn.preprocessing...
import torch import torchvision.transforms as transforms import torchvision.models as models import numpy as np import cv2 from PIL import Image from face_parsing.model import BiSeNet from style_transfer.style_transfer import run_style_transfer from fast_style_transfer.utils import tensor_load_rgbimage2, preprocess_bat...
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- __author__ = "<NAME>" __version__ = "1.0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Prototype" import numpy as np # import tf.transformations as tf # import tf2_py.transformations as tf from math import * import cmath # from geometry_msgs.msg impor...
# 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. # # Description: delivering inputs and targets for the dlrm benchmark # The inpts and outputs are used according to the following two option(s)...
import capstone from capstone import * from capstone.arm_const import * from queue import Queue import struct from .constructs import * from .base_analyzer import BaseAnalyzer class ARM_Analyzer(BaseAnalyzer): def __init__(self, executable): super(ARM_Analyzer, self).__init__(executable) if self....
import argparse import copy import pickle import random import easydict import torch from typing import Optional, List, Any from functools import partial import os from copy import deepcopy from ding.config import compile_config, read_config from ding.worker import EpisodeSerialCollector, create_buffer, BaseLearner fr...
#!/usr/bin/env python ## EPlusInterface (EPI) - An interface for EnergyPlus ## Copyright (C) 2004 <NAME> # ======================================================================= # Distributed under the MIT License. # (See accompanying file LICENSE or copy at # http://opensource.org/licenses/MIT) # ================...
# -*- coding: utf-8 -*- # @Time : 2019/10/11 16:02 # @Author : Run # @File : interval.py # @Software : PyCharm from typing import List import matplotlib.pyplot as plt import matplotlib.patches as patches def continuous_int_to_ranges(nums: List[int]): """ LeetCode 228: Summary Ranges Given a so...
import requests import sys import os from os.path import join, dirname from dotenv import load_dotenv from flask import Flask, request, session, g, redirect, url_for, \ abort, render_template, flash, json, jsonify app = Flask(__name__) environment_id = 'system' collection_id = 'news-ja' dotenv_path = join(dirn...
from imutils.object_detection import non_max_suppression from xmlrpc.server import SimpleXMLRPCServer from socketserver import ThreadingMixIn from collections import OrderedDict import paho.mqtt.client as mqtt from datetime import datetime from imutils import paths import urllib.request import numpy as np import urllib...
#--------------------------------------------------------------------------- #ToDo #--------------------------------------------------------------------------- #add folium marker - add popup code with additional infos #folium.Marker( # location=[Latitude, Longitude], # coordinates for the marker from meshtastic...
#!/usr/bin/env python3 ''' kicad-footprint-generator 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. kicad-footprint-generator is distribut...
import cv2 import os import numpy as np from matplotlib import pyplot as plt def normalize(hulls): MIN = np.min(hulls,axis=0) MAX = np.max(hulls,axis=0) normalized = np.divide(hulls-MIN,MAX-MIN) normalized = np.round(normalized,3) return normalized def calculate_hull(img,sensitivity=0.25): gr...
#!/usr/bin/python # # Copyright 2010 Google 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 ag...
# ############################################################################### # Original Author: <NAME> (https://orcid.org/0000-0002-6802-8179), # # CIEMAT - Sci-Track Group (http://rdgroups.ciemat.es/web/sci-track),# # for the EOSC-Synergy project (EU H2020 RI Grant No 857647). # # Lice...
# Import Stuff import os from .....base import MetaWorkflow, load_config, register_workflow from traits.api import HasTraits, Directory, Bool import traits.api as traits from .....flexible_datagrabber import Data, DataBase """ Part 1: Define a MetaWorkflow """ mwf = MetaWorkflow() mwf.uuid = 'f6ac883016fe11e28310d4be...
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
# Copyright (c) OpenMMLab. All rights reserved. import glob import os import os.path as osp import re import tempfile import time import zipfile from collections import defaultdict from functools import partial import mmcv import numpy as np import torch from mmcv.ops import nms_rotated from mmdet.datasets.custom impo...
import os import re import json import math import subprocess import torch import torch.nn as nn import pandas as pd import numpy as np import sys from os.path import dirname, realpath # Add root directory to path file_path = realpath(__file__) file_dir = dirname(file_path) parent_dir = dirname(file_dir) root_dir = di...
#!/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 ...
import hetu as ht from hetu import init import numpy as np def layer_norm( input_tensor, feature_size, eps=1e-8 ): scale = init.ones(name='layer_norm_scale', shape=(feature_size, )) bias = init.zeros(name='layer_norm_biad', shape=(feature_size, )) return ht.layer_normalization_op(input_tensor,...
from sympy.matrices.expressions.blockmatrix import ( block_collapse, bc_matmul, bc_block_plus_ident, BlockDiagMatrix, BlockMatrix, bc_dist, bc_matadd, bc_transpose, bc_inverse, blockcut, reblock_2x2, deblock) from sympy.matrices.expressions import (MatrixSymbol, Identity, Inverse, trace, Transpose, ...
# Copyright 2017-2020 TensorHub, 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 writ...
import torch, math from clustorch.base import ClusteringModel from clustorch.kmeans import KMeans from clustorch.metrics import pairwise class SpectralClustering(ClusteringModel): def __init__( self, n_clusters=2, lmode="sym", similarity="gaussian", assign_labels="sq_kmeans...
import pygame as pg import numpy as np import os from pygame.color import THECOLORS def calculateIncludedAngle(vector1, vector2): includedAngle = abs(np.angle(complex(vector1[0], vector1[1]) / complex(vector2[0], vector2[1]))) return includedAngle def findQuadrant(vector): quadrant = 0 if vector[0] ...
""" This file registers pre-defined datasets at hard-coded paths, and their metadata. We hard-code metadata for common datasets. This will enable: 1. Consistency check when loading the datasets 2. Use models on these standard datasets directly and run demos, without having to download the dataset annotations We hard...
""" Classes defined from the OpenAPI 3.0 specifications. I.e., the objects described https://swagger.io/docs/specification """ from __future__ import annotations from inspect import isclass from typing import Any, Dict, List, Optional, Type, Union, get_type_hints from sanic.exceptions import SanicException from .t...
# -*- coding: utf-8 -*- import keras from keras.models import Sequential from keras.optimizers import SGD from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation from sklearn.metrics import log_loss from load_cifar10 import load...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'x1ang.li' import logging, os, argparse, textwrap import time import chardet # Default configuration will take effect when corresponding input args are missing. # Feel free to change this for your convenience. DEFAULT_CONF = { # Only those files ending w...
# Set Matplotlib to not require X server (for cron use) import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt import os import sys import argparse import glob import re from collections import OrderedDict # Import global variables SCRIPT_DIR = os.path.dirname(os.path.abspath(__file...
import numpy as np from .base_fitter import BaseFitter, reload_scans from .results import FitResult, FitResultSeries from ..models import DefaultTrainedModel from ..xrrloader import FioLoader, NotReflectivityScanError class FioFitter(BaseFitter): @property def file_stem(self): return self._file_name...
""" Calculate docs CSAT based on "Was this page helpful?" feedback submissions and unique pageviews, as tracked via Google Analytics; and generate a graph plotting docs pages based on their negative and positive votes, with dot size indicating number of unique pageviews. Help: python3 docs-csat.py --help Requirements...
# -*- coding: utf-8 -*- # Copyright (C) 2018-2021, earthobservations developers. # Distributed under the MIT License. See LICENSE for more info. import logging from datetime import datetime, timedelta from typing import Optional, Union import pandas as pd from tqdm import tqdm from wetterdienst.metadata.period import...
import pytest import mock from django.test import RequestFactory from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied from django.contrib.auth.models import Permission, Group, AnonymousUser from osf.models import PreprintService from osf_tests.factories import ( AuthUse...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
''' ONEFlux Copyright (c) 2014-2018, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without ...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# To infer 2d object bounding boxes. from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:skip import argparse import os from tqdm import tqdm import torch from torchvision import transforms as T import numpy as np from PIL import Image import Bbox_3d.models as models from Bbox_3d.miscs imp...
"""Defines decorators and plotting functions for xarrays""" from functools import wraps import numpy as np import earthpy.plot as ep import rasterio from rasterio.enums import Resampling from rasterio.plot import plotting_extent as rasterio_plotting_extent import xarray as xr def as_xarray(func): """Wraps a n...
# 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 glob import json import numpy as np import os import urllib from flask import Blueprint from flask import redirect from flask import render_template from flask import request from flask import send_from_directory from flask import url_for from joblib import load from natsort import natsorted from natsort import...
from enum import Enum class StringEnum(Enum): def __init__(self, text): self.text = text class StringTupleEnum(Enum): def __init__(self, key, text): self.key = key self.text = text class MainMenuEnum(StringEnum): OVERVIEW = ('Overview') GRAPH = ('Graph') APPLICATIONS = ...
import copy import re import sqlalchemy.exc from discord.ext import commands from util.config import BotConfig from util.data.guild_data import GuildData from util.decorators import delete_original class ServerManagement(commands.Cog, name="Server Management"): def __init__(self, bot): self.bot = bot ...
"""Defines symbolic linear algebra functions. Function list: - norm(x): returns the L-2 norm of a vector - norm2(x): returns the squared L-2 norm of a vector - norm_L1(x): returns the L-1 norm of a vector - norm_Linf(x): returns the L-infinity norm of a vector - norm_fro(A): returns the Frobeneus norm of a matrix - ...
# (c) Copyright 2011-2016, Synapse Wireless, Inc. """ATmega128RFA1 32-bit math library Since the SNAPpy virtual machine as of version 2.6 only supports signed 2-byte integers a math library must be used to perform calculations that exceed 65535. Currently all operations are 32-bit unsigned. Note: Integers in SNAPpy ar...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
"""Define the litcorpt data models""" # pylint: disable=no-name-in-module # pylint: disable=no-self-argument # pylint: disable=no-self-use # pylint: disable=too-few-public-methods from enum import Enum from typing import List, Optional from datetime import date from pydantic import BaseModel, ValidationError # class...
import os import argparse import numpy as np import galileo as g import galileo.tf as gt import tensorflow as tf from tensorflow.keras.regularizers import l2 import utils import functools class Inputs(g.BaseInputs): def __init__(self, **kwargs): super().__init__(config=kwargs) def tr...
# coding: utf-8 # ## Exercises # # This will be a notebook for you to work through the exercises during the workshop. Feel free to work on these at whatever pace you feel works for you, but I encourage you to work together! Edit the title of this notebook with your name because I will ask you to upload your final no...
""" A collection of interfaces used to work with raw coil channels acquired from MRI scanners """ import os import os.path as op from copy import deepcopy from collections import defaultdict import logging import re import numpy as np import nibabel as nib from nipype.interfaces.base import ( TraitedSpec, traits, B...
# spiral.py # COMP9444, CSE, UNSW import torch import torch.nn as nn import matplotlib.pyplot as plt class PolarNet(torch.nn.Module): def __init__(self, num_hid): super(PolarNet, self).__init__() # INSERT CODE HERE #Fully connected layer with 2 inputs and num_hid as number of hidden units...
import os import sys import textwrap from Cython.Compiler.CmdLine import parse_command_line from Cython.Compiler.Main import create_default_resultobj, CompilationSource from Cython.Compiler import Pipeline from Cython.Compiler.Scanning import FileSourceDescriptor from Cython.Compiler.Visitor import TreeVisitor, PrintT...
#!/usr/bin/env python # # draw_tiles.py reads the output of sample_shapes.py and uses it to # render map tiles for the sampled points. # # Input data is assumed to be sorted such that all records for a # single key (tile) are presented as an uninterrupted sequence. Thus, # tiles are rendered one at a time as data strea...
import matplotlib matplotlib.use("Agg") # noqa import warnings import os import numpy as np import matplotlib.pyplot as plot import matplotlib.font_manager import xarray as xr import seaborn as sns import scipy.optimize try: import tephigram HAS_TEPHIGRAM = True except ImportError: HAS_TEPHIGRAM = Fa...
import numpy as np import scipy from scipy.spatial.transform import Rotation as Rot import cv2 import json from tqdm import tqdm DEBUG = False def get_distance(p4, p6, cam_proj_4, cam_proj_6): ''' calculate minimum distance with epipolar constraint Args: p4: key point on camera 4 -- shape: (3,) ...
""" Module with ctypes bindings for the high-level FUSE 3.x API. These are based on the following libfuse headers: * fuse/fuse.h * fuse/fuse_common.h * fuse/fuse_opt.h Currently the implementation assumes an x86-64 system. """ import ctypes import ctypes.util from enum import Enum # # Helpers # def struct_to_dic...
''' This project attempts to classify 25 different architectural styles using the pretrained resnet50 model combined with final layers defined by me. The dataset was made by https://www.kaggle.com/wwymak/architecture-dataset. It features 25 different architectural styles with in total 10113 images. Additionally, the as...
from __future__ import absolute_import from __future__ import unicode_literals import functools from distutils.version import LooseVersion from django.utils.translation import ugettext from corehq.apps.app_manager import id_strings from memoized import memoized from corehq.apps.app_manager.util import module_offers_s...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import copy from typing import Iterable import pandas as pd import plotly.graph_objs as go from ..graph import BaseGraph, SubplotsGraph from ..analysis_position.parse_position import get_position_data def _get_cum_return_data_with_position( ...
import argparse import os import cv2 import torch import torch.nn.parallel import numpy as np import math import valid import sys import common.config as config import common.TBLogger as TBLogger from common.utils import makedir_if_not_exist, StoreDictKeyPair, save_obj, load_obj from torch import optim from torch.u...
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
import os import math import librosa import librosa.display import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.optimizers import Adam from tensorflow.python.framework import ops from PIL import Image import matplotlib.pyplot as plt from sklearn.preprocessi...
# 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...
import os import argparse import torch import torch.nn as nn import torch.optim as optim from torch.utils.data.sampler import SubsetRandomSampler from .generate_train_dataset import get_train_test_set torch.set_default_tensor_type(torch.FloatTensor) class Net(nn.Module): def __init__(self): super(Net, se...
import cv2 import numpy as np import statistics import imutils import math # from text_segmenter import process_spine_from_extractor from SpineClassifier.text_segmenter import process_spine_from_extractor SHELVES_PATH = 'images/shelves/' class SpineExtractor: x = 0 @staticmethod def extract_spines_from_...
import ctypes LONG = ctypes.c_long DWORD = ctypes.c_ulong ULONG_PTR = ctypes.POINTER(DWORD) WORD = ctypes.c_ushort class MOUSEINPUT(ctypes.Structure): _fields_ = (('dx', LONG), ('dy', LONG), ('mouseData', DWORD), ('dwFlags', DWORD), ('time', DWORD), ...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import itertools import pddl import timers from functools import reduce def convert_rules(prog): RULE_TYPES = { "join": JoinRule, "product": ProductRule, "project": ProjectRule, } ...
""" This query filters articles’ textblocks by selecting the ones that have one of the target word(s) AND any the keywords. Later it produces the segmentation/crop or the filtered texblocks. """ from defoe import query_utils from defoe.fmp.query_utils import segment_image import yaml import os from collections import...
from typing import List from webdnn.backend.code_generator.allocator import MemoryLayout from webdnn.backend.code_generator.injectors.buffer_injector import BufferInjector from webdnn.backend.code_generator.injectors.kernel_name_injector import KernelNameInjector from webdnn.backend.webgpu.generator import WebGPUDescr...
# coding: utf-8 # # Neural Network for Hadronic Top Reconstruction # This file creates a feed-forward binary classification neural network for hadronic top reconstruction by classifying quark jet triplets as being from a top quark or not. from __future__ import print_function, division import pandas as pd import num...
"""Operations that deal with workspaces.""" from __future__ import annotations # noqa: T484 import copy from pydantic import BaseModel, Field from arango.exceptions import DatabaseCreateError, EdgeDefinitionCreateError from arango.cursor import Cursor from arango.collection import StandardCollection from multinet im...