text
stringlengths
3.07k
22.1k
import argparse import datetime import getpass import logging import os import sys from lighthive.client import Client from lighthive.datastructures import Operation from pymongo import MongoClient from .utils import generate_keys logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logging.basicConfig...
""" 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 distributed under the License ...
from django.core.exceptions import FieldError from django.utils.datastructures import SortedDict from base import BaseTable, DeclarativeColumnsMetaclass, \ Column, BoundRow, Rows, TableOptions, rmprefix, toggleprefix __all__ = ('ModelTable',) class ModelTableOptions(TableOptions): def __init__(self, options...
from __future__ import annotations from abc import abstractmethod from typing import TYPE_CHECKING, Callable, Iterable, List, Optional, Tuple, Union from open_mafia_engine.core.enums import ActionResolutionType from open_mafia_engine.core.event_system import ( Action, EPostAction, EPreAction, Event, ...
import random, threading, time import numpy as np from utils import policy from utils.curiosity import CuriosityPrio from utils.learning_rate import LinearAutoSchedule as LinearSchedule def critic_launch(cfg, bot, objective_id, task_factory, update_goal, ping, sync, loss_gate, share_gate, stats): critic = Critic(...
import csv import math from absl import app, flags import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import numpy as np from pylot_utils import ProfileEvent, ProfileEvents, fix_pylot_profile from utils import setup_plot import pandas as pd import seaborn as sns from utils import * from p...
""" Functions for decoding dataclass fields from "raw" values (e.g. from json). """ from collections import OrderedDict from dataclasses import Field, MISSING, fields, is_dataclass from functools import lru_cache from functools import partial from logging import getLogger from typing import TypeVar, Any, Dict, Type, Ca...
bl_info = { "name": "Weld Object Normals", "author": "Some asshole", "version": ( 0, 1, 0 ), "blender": (2, 76, 0), "location": "Tool shelf", "description": "Weld the normals of two objects.", "show_expanded": True, "category": "Object"} import bpy import bmesh import os import logging...
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION, TEXT, TIMESTAMP, \ VARCHAR, INTEGER, REAL, BOOLEAN, DATE from database import Base class CovidCountryWeekly(Base): __tablename__ = "ecdc_covid_country_weekly" iso_a3 = Column(TE...
from haydi.base import basictypes as hdt from haydi import USet def test_uset_flags(): ax = USet(3, "a") assert not ax.filtered assert ax.step_jumps assert ax.strict def test_compare_atoms(): ax = USet(3, "a") bx = USet(5, "b") a1, a2, a3 = ax.all() b3 = bx.get(3) b4 = bx.get(4)...
# Copyright (c) 2022 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 required by ap...
import torch from torch.utils.data import Dataset import re #Based on Batch from Bertsum Implementation class Batch(object): def _pad(self, data, pad_id, width=-1): if (width == -1): width = max(len(d) for d in data) rtn_data = [d + [pad_id] * (width - len(d)) for d in data] ret...
""" pong.py - A python Pong clone. Example from chapter 1 of the book "Python Game Programming by Example": https://www.packtpub.com/game-development/python-game-programming-example """ import tkinter as tk class GameObject(object): """ Defines behavior common for all game objects. All objects in the ga...
"""CheXpert LaTex exporter. Export CheXpert statistics and graphs to be imported in LaTex documents. The goal is to automate the generation of all tables stastical tables used in papers, so that they are accurate and can be regenerated quickly if the dataset is upgraded. """ import os import re from typing import Li...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 """ Interfacing with the Student Web Service, Registration_Search query. """ import logging import json import re from urllib.parse import urlencode from decimal import Decimal, InvalidOperation from datetime import datetime from uw...
# Libraries import json import numpy as np import pandas as pd def load_features_map(filepath): """This method loads the features map json file. Parameters ---------- Return ------ """ # Reading the json as a dict with open(filepath) as json_data: data = json.load(json_data) ...
"""Platform for sensor integration.""" from __future__ import annotations import logging from typing import Final from homeassistant.core import HomeAssistant from homeassistant.config_entries import ConfigEntry from homeassistant.const import (ELECTRIC_POTENTIAL_VOLT, ELECTRIC_CURRENT_AMPERE, POWER_WATT, POWER_KILO_...
# Copyright (C) 2018 TU Dresden # Licensed under the ISC license (see LICENSE.txt) # # Authors: <NAME> from collections.abc import Sequence from itertools import chain, count class listOperations(object): """Class contains custom functions to operate on lists, that are needed to prepare platforms and mappings to...
#!/usr/bin/env python3.4 # Copyright 2018 The go-python Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """ Write symtable_data_test.go """ import sys import ast import subprocess import dis from symtable import symtable try: # ...
#!/usr/bin/env python # # Copyright (C) 2009 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
import os import uuid from datetime import datetime import numpy as np import pandas as pd import pytest import pytz from google.protobuf.duration_pb2 import Duration from pandas.testing import assert_frame_equal from feast.client import Client from feast.data_source import BigQuerySource, FileSource, KafkaSource fro...
"""Analog log report renderers.""" from __future__ import (absolute_import, division, print_function, unicode_literals) import abc import csv try: from cStringIO import StringIO except ImportError: from io import StringIO import textwrap from tabulate import tabulate from analog.except...
import requests from bs4 import BeautifulSoup import re import json import time import os import config def get_episodes(get_path=None, local_file=None): # SET UP AND FETCH DATA if get_path is None: # if no get_path was supplied, start from scratch get_path = '/show-notes' # fetch data from website (or a...
from __future__ import print_function import os import re import sys import git import gzip import errno import base64 import argparse import pkg_resources from lxml import etree from datetime import date if "2.7" in sys.version: from StringIO import StringIO from . import generate from . import __version__ from ....
from __future__ import annotations import math import random from collections import deque from typing import List, Optional, Tuple from tqdm import tqdm from utttpy.game.action import Action from utttpy.game.ultimate_tic_tac_toe import UltimateTicTacToe class MonteCarloTreeSearch: def __init__( self,...
import subprocess from flask import render_template, redirect, flash, request, url_for from app import app, models, db, lm from forms import RuleForm, DeviceForm, GroupForm, LoginForm, ChangePasswordForm from flask_login import login_user, logout_user, login_required @lm.user_loader def load_user(userid): return ...
import asyncio import bisect import importlib import inspect import logging import os from datetime import datetime, timedelta import aiohttp import plyvel import telethon as tg import sentry_sdk from . import command, module, modules, custom_modules, util class Listener: def __init__(self, event, func, module,...
""" TONAS Loader .. admonition:: Dataset Info :class: dropdown This dataset contains a music collection of 72 sung excerpts representative of three a cappella singing styles (Deblas, and two variants of Martinete). It has been developed within the COFLA research project context. The distribution is as...
import torch.optim as optim from torch.utils import data from e2efold.models import ContactNetwork, ContactNetwork_test, ContactNetwork_fc from e2efold.models import ContactAttention, ContactAttention_simple_fix_PE from e2efold.models import ContactAttention_simple from e2efold.common.utils import * from e2efold.commo...
""" API functionality for OCW course site import """ import json import logging import re import uuid from copy import deepcopy import dateutil import yaml from django.conf import settings from main.s3_utils import get_s3_object_and_read, get_s3_resource from main.utils import get_dirpath_and_filename, is_valid_uuid ...
""" This data implement model's metric :paper author: hxq :code author: hxq :code convert: shy """ import math from sklearn import metrics import numpy as np import bottleneck as bn def ndcg_binary_at_k_batch(x_pred, heldout_batch, k=100): """ normalized discounted cumulative gain@k for binary relevance ...
# -*- coding: utf-8 -*- """ Created on Mon Oct 22 14:23:14 2018 @author: omalleyc """ from collections import defaultdict import pandas as pd import gurobipy as gb import sys LAMBDA_CONSTANT_LOWER= -gb.GRB.INFINITY #gb.GRB.INFINITY LAMBDA_CONSTANT_UPPER= gb.GRB.INFINITY #gb.GRB.INFINITY # Class...
""" Module dedicated to enums and flags describing access rights for all kinds of securables. """ from enum import IntFlag class NTSpecificRights(IntFlag): """ The 'specific rights' part of an NT access mask. This particular data type unifies rights for all possible kinds of securables, and is used in da...
import streamlit as st from PIL import Image import requests import pandas as pd import base64 from fake_useragent import UserAgent st.set_page_config(page_title='Co-Win: Covid-19 Vaccination Tracker', page_icon='๐Ÿ’‰', layout = 'centered', initial_sidebar_state = 'expanded') ua = UserAgent() state_response =...
import numpy as np import argparse import config import os import datetime import sys import tensorflow.keras as keras from tensorflow.keras.layers import Input, Conv2D, Flatten, Dense, Conv2DTranspose, Lambda, Reshape, Layer from tensorflow.keras.models import Model from tensorflow.keras.optimizers import Adam from te...
import os import re import discord import logging from googletrans import Translator from google_trans_new import google_translator channel_language_separator = '-_' local_message_prefix = '//' token = os.environ['DISCORD_BOT_TOKEN'] client = discord.Client() logging.basicConfig(level=logging.INFO) @client.event as...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os from collections.abc import Sequence from random import random from time import perf_counter, sleep import numpy as np import pandas as pd import yaml from sklearn.cluster import KMeans as CPUKMeans from sklearn.datasets import make_blobs from sklearn.metrics i...
from collections import defaultdict from typing import Dict, List, Optional from scripts.ensemble import EnsembleChoir, EnsembledCollection, Ensembler from scripts.utils import ENTITIES, RELATIONS, Collection # ======================================================================= # - VotingEnsembler ---------------...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Software License Agreement (BSD License) # # Copyright (c) 2011, <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...
# Copyright (c) 2020 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 required by appli...
r"""@package motsfinder.metric.discrete.discretize Helpers to create discrete versions of (\eg analytical) metrics. These can be used to compare results obtained with analytically implemented metrics with those of the discrete metric classes. @b Examples ``` # Use a simple Brill-Lindquist metric as example here...
""" Train and test the key identification CNN """ import database import generator import eda from glob import glob import os import numpy as np import keras from keras.models import Model from keras.layers import Input, Conv2D, MaxPooling2D, add from keras.layers import Dropout, Flatten, Dense from keras.callbacks...
# Copyright (c) 2020 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 required by appli...
''' This script plots the four test predictions of the predictive expectation and variance of BAR-DenseED seen in Figure 13 of the paper. === Distributed by: <NAME> (MIT Liscense) - Associated publication: url: http://www.sciencedirect.com/science/article/pii/S0021999119307612 doi: https://doi.org/10.1016/j.jcp.2019.10...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 16 08:42:47 2021 @author: <NAME> @name: roi-aselect.py """ import argparse import csv import cv2 import os import sys import numpy as np from pathlib import Path s_default=20 th_default=5.0 threshold=-1 th_under=False th_over=False img_sel=[] ...
import os import json import re import numpy as np from shutil import copyfile from keras.optimizers import SGD import keras.backend as K from AlphaGo.ai import ProbabilisticPolicyPlayer import AlphaGo.go as go from AlphaGo.models.policy import CNNPolicy from AlphaGo.util import flatten_idx def _make_training_pair(st...
import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import itertools from matplotlib import cm def plot_color_table(df, axis=1, title=None, rev_index=None, color='RdYlGn', ...
import discord from discord.ext import commands import asyncio import json from datetime import datetime from random import choice from aux.misc import round_down from aux.stats import Stats class InvalidNumberPlayers(Exception): pass class Warrior(): def __init__(self, member): self.member = member ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 3.3.0 # Copyright (C) 2019-2021 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import (absolute_import, divi...
from typing import List, Optional, Tuple from collections import defaultdict import pickle import json from os import path import click from tqdm import tqdm from sklearn.feature_extraction.text import TfidfVectorizer from flask import Flask, jsonify, request import numpy as np from qanta import util from qanta.datas...
from __future__ import annotations import math from collections import abc from functools import partial from typing import Callable, Iterable, List, Mapping, Optional, Sequence, Tuple, TypeVar, Union, cast import numpy as np import tensorflow as tf from typing_extensions import TypeGuard T1 = TypeVar("T1") T2 = Typ...
from django.utils.translation import ugettext as _ from dimagi.utils.decorators.memoized import memoized from .utils import normal_format, format_percent class HealthStatus(object): # maps method name to header method_map = [ ('awc', "AWC"), ('beneficiaries', "Total # of Beneficiaries Regis...
# Copyright (c) 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re from collections import defaultdict def parse(filename): """Searches the file for lines that start with `# TEAM:` or `# COMPONEN...
from decouple import config import sys, os from .analyze.analyzeSignal import calcPowers from .analyze.pereiraChangeOfMean import pereiraLikelihood, getChangePoints, cleanLikelihoods from .websocket import wsManager from . import data as dataHp import json import numpy as np from django.http import JsonResponse de...
#/usr/bin/python! ##### # unmix_spectra.py performs fully-constrained least-squares # spectral ummixing on an image file # # unmixing implementation described here: # http://pysptools.sourceforge.net/abundance_maps.html # # based on the algorithm desribed here: # <NAME>, <NAME>, and <NAME>. Fully Constrained # Le...
import factory import names import random from faker import Faker from datetime import datetime, timedelta from vtn.models import * import string from django.utils import timezone fake = Faker() ''' CUSTOMER MODEL name = models.CharField('Name', db_index=True, max_length=100, unique=True) utility_id = models...
""" TextCNN Model for Sentiment Analysis =============================================== This example shows how to use convolutional neural networks (textCNN) for sentiment analysis on various datasets. <NAME>. (2014). Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882. """ # co...
import datetime import json from carball.generated.api.metadata import player_loadout_pb2 from sqlalchemy import func, desc, literal from backend.blueprints.spa_api.service_layers.utils import with_session from backend.database.objects import Loadout, Game from backend.database.startup import lazy_get_redis from back...
import re import logging from datetime import date, datetime from itertools import groupby from collections import defaultdict from pyquery import PyQuery as pq from werkzeug.urls import url_decode from mptracker.scraper.common import ( Scraper, pqitems, get_cdep_id, sanitize, url_args, GenericModel) from mptracker...
import torch import torchvision import torch.nn.functional as F from torch import nn, optim, autograd from torch.autograd import Variable from torchvision import transforms, utils import os import numpy as np from summary import summary BATCH_SIZE = 100 # NUM_LABELS = 10 # model_path = 'capsnet.pkl' ...
#!/usr/bin/env python import argparse from glob import iglob as glob from functools import partial from itertools import starmap import h5py import pandas as pd import numpy as np from numba import jit from scipy import linalg from dautil.util import map_parallel IDX = pd.IndexSlice _REAL_TO_SIM = 1e-12 __version...
import inspect import logging from datetime import datetime from typing import Optional, Set, Callable from celery.utils import uuid from server.queue.celery.task_metadata import TaskMetadata from server.queue.celery.task_status import task_status from server.queue.framework import TaskQueue, BaseObserver from server...
import random from testflows.core import * from testflows.asserts import * from clickhouse_backup.requirements.requirements import * from clickhouse_backup.tests.common import * from clickhouse_backup.tests.steps import * @TestScenario @Requirements( RQ_SRS_013_ClickHouse_BackupUtility_TableEngines_OtherEngines...
""" Copyright 2017-present, Airbnb 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 writing, sof...
import time import unittest from typing import Union import torch import numpy as np import random from functools import lru_cache from einops import rearrange, repeat import torch.nn.functional as F from torch import nn, einsum @lru_cache() def get_2dmask(seq_len, nx, ny, w, d): return torch.BoolTensor([ ...
from __future__ import division, print_function, absolute_import from __future__ import absolute_import from __future__ import print_function import numpy as np import numpy import PIL from PIL import Image np.random.seed(1337) # for reproducibility from math import sqrt import random from keras.datasets import mnist...
import torch import torch.nn as nn import torch.nn.functional as F from .lsa_attention import LocationSensitiveAttention from .basic_layers import Linear, Conv1d from .vc_utils import get_mask_from_lengths class DecoderPrenet(nn.Module): def __init__(self, in_dim, sizes): super().__init__() in_siz...
import os import sys import simplejson as json from dataclasses import dataclass from datetime import datetime from flask import Flask, url_for, send_from_directory, render_template, request, redirect, Response, jsonify from flask_sqlalchemy import SQLAlchemy from database import * from models import * app = Flask(__n...
import pytest # Note: # Definitions for `cut1`, `cut2` and `cut_set` parameters are standard Pytest fixtures located in test/cut/conftest.py # ######################################## # ############### PADDING ################ # ######################################## @pytest.mark.parametrize("direction", ["right...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Define miscellaneous utilities. """ from __future__ import absolute_import from debtcollector import removals from collections import Iterable, OrderedDict from itertools import tee import os import sys import subprocess import six from six.moves import range, ...
import binascii from queue import Queue from capstone import * from capstone.arm64_const import * import disassembler import API from formats.constructs import * from formats.enums import * import binascii _ADRP_TYPES = { "else": 0, "text_sec": 1, "data_sec": 2 } class Analyzer(): def __init__(self, loa...
from __future__ import unicode_literals import json import datetime from django.core.urlresolvers import reverse from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from dja...
from os import listdir from os.path import isfile, join from PIL import Image import numpy as np import deep_nn_step_by_step as dnn from sklearn.neural_network import MLPClassifier from sklearn.externals import joblib def flatten_image(img, is_car=True, flat_image_size=3072): flat = list(img.getdata()) label ...
# -*- mode: Python; tab-width: 4 -*- # # Walk the root directory of a project and create a table containing details # of the files and directories it contains # import sys import getopt import os import os.path import subprocess import configparser import cmd import json import ctags import sqlite3 ConfigFile = "tagba...
# SPDX-License-Identifier: BSD-3-Clause """Functions for handling robot exclusion files ("robots.txt"). There is no official standard for these files: it started with a post that was later developed into a draft RFC, but that was never finalized. Later, several search engines invented their own extensions. This modu...
""" Moire library. See http://github.com/enzet/Moire """ import logging import sys from dataclasses import dataclass from io import StringIO from typing import Any, Callable, Optional __author__: str = "<NAME>" __email__: str = "<EMAIL>" # Constants COMMENT_BEGIN: str = "/*" COMMENT_END: str = "*/" TAG_MARKER: st...
from pppr import aabb import numpy as np from pak.datasets.MOT import MOT16 from pak import utils from pppr import aabb from time import time from cselect import color as cs # =========================================== # Helper functions # =========================================== def remove_negative_pairs(Dt, W, ...
import discord from discord import File from discord.ext import commands import time import wget import sys import re import pandas as pd import os import string from selenium import webdriver import random import urllib import json import urllib.request from openpyxl import Workbook import bs4 from PIL import Image, ...
#!/usr/bin/env python """ This is a script that receives two MuNG files. The first is supposed to be the output of an OMR file, while the second represents the expected MuNG (ground-truth.) The script then computes evaluation metrics as regards the notation assembly stage of the OMR pipeline. """ from __future__ import...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil import socket import subprocess import tempfile import time import geocoder import mock from six.moves import StringIO from doom.sysinfo import get_local_ip class TestCachedIP(object): def test_get_cached_ip(self): now = 1460174717.4...
#!/usr/bin/env python import argparse from collections import OrderedDict parser = argparse.ArgumentParser(description= "Given files representing aligned, filtered R1 + R2 sequences, concatenate into" "a single (non-continuous) alignment where the non-covered middle region has " "been removed. Since seque...
#!/usr/bin/env python # https://www.microchip.com/wwwproducts/en/ATSAMD21E18 import attr import time from serial import Serial import struct from math import log10, sin, cos, acos, atan2, asin, pi, sqrt from collections import deque from collections import namedtuple import numpy as np import cv2 from slurm.rate import...
# -*- coding: utf-8 -*- """ Unit tests for the submits """ import os from django.test import TestCase, Client from django.urls import reverse from judge.tests.test_parse import ParseTest from judge.models import FunctionProblem, ProcProblem, TriggerProblem, DiscriminantProblem, \ NumSubmissionsProblemsAchievement...
#!/usr/bin/env python u""" grace_months_index.py Written by <NAME> (05/2021) Creates a file with the start and end days for each dataset Shows the range of each month for (CSR/GFZ/JPL) (RL04/RL05/RL06) Shows which months are missing for each dataset as **missing** INPUTS: base_dir: Working data directory for GRAC...
""" HTTP end-points for the Bookmarks API. For more information, see: https://openedx.atlassian.net/wiki/display/TNL/Bookmarks+API """ import logging import eventtracking from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ from dj...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Generate a report of all new staged test centers, optionally push to Unverified table. import requests import os import importlib from helpers import preprocessing_utils, gtc_auth from dotenv import load_dotenv import time import click import json import boto3 DAY_IN_MILLIS = 60 * 60 * 24 * 1000 S3_BUCKET = 'stagi...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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...
# Copyright (c): <NAME> 2017-2019. # Author: <NAME> # Email: <EMAIL> # Update Date: 2019/5/26 ไธŠๅˆ11:39 import math import torch from torch import nn from torch.autograd import Variable from torch.nn import Parameter from torch.nn import functional as F from torch.nn.modules.utils import _pair from ..Arch import Ea...
# -*- coding: utf-8 -*- # # This file is part of EUDAT B2Share. # Copyright (C) 2017 CERN. # # B2Share 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...
from ButtonClickHandler import PlayGameButtons as P from GUI import root, tk, MyButton from datetime import datetime import threading import socket import json import time import sys import GUI class Client(object): def __init__(self, game): try: self.game = game s...
import six import os, errno, logging, inspect from sqlalchemy.orm.session import object_session from sqlalchemy.orm.interfaces import MapperProperty from sqlalchemy.orm.attributes import get_history from sqlalchemy.orm.util import class_mapper from sqlalchemy import event from sqlalchemy.util import set_creation_order ...
from django.core.paginator import Paginator from django.db.models import Count, Q from rest_framework import status from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from rest_framework_simplejwt.views import ( TokenBlacklist...
import glob import numpy as np import pandas as pd from shapely.geometry import LineString,MultiLineString,Point,MultiPoint from shapely.ops import linemerge import pyproj from sklearn.ensemble import RandomForestClassifier,ExtraTreesClassifier from sklearn.preprocessing import StandardScaler from sklearn.neighbors imp...
import torch import torch.nn as nn import torch.nn.functional as F from models.modelUtils import ChebConv, Pool, residualBlock import torchvision.ops.roi_align as roi_align import numpy as np class EncoderConv(nn.Module): def __init__(self, latents = 64, hw = 32): super(EncoderConv, self).__init__() ...
import numpy as np from PuzzleLib import Config from PuzzleLib.Backend import gpuarray from PuzzleLib.Modules.Module import ModuleError from PuzzleLib.Modules.DeconvND import DeconvND class Deconv1D(DeconvND): def __init__(self, inmaps, outmaps, size, stride=1, pad=0, dilation=1, postpad=0, wscale=1.0, useBias=Tru...
from termpixels.pixeldata import PixelData from time import perf_counter # Boxes _BOX_T = 0 _BOX_B = 1 _BOX_L = 2 _BOX_R = 3 _BOX_TL = 4 _BOX_TR = 5 _BOX_BL = 6 _BOX_BR = 7 BOX_CHARS_ASCII = "--||++++" BOX_CHARS_LIGHT = "โ”€โ”€โ”‚โ”‚โ”Œโ”โ””โ”˜" BOX_CHARS_LIGHT_ARC = "โ”€โ”€โ”‚โ”‚โ•ญโ•ฎโ•ฐโ•ฏ" BOX_CHARS_HEAVY = "โ”โ”โ”ƒโ”ƒโ”โ”“โ”—โ”›" BOX_CHARS_DOUBLE = "โ•โ•โ•‘โ•‘โ•”...
import os import json import argparse import numpy as np import pickle as pkl from tqdm import tqdm import innvestigate from DNN_training import get_damd_cnn def explain_behavior(analyzer, data, labels, dims_to_explain, filenames, save_path): """ Creates explanation for each data instance @param analyze...
from lxml import html import requests import smtplib import sched, time import re import argparse from math import ceil from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText URL = "https://sfbay.craigslist.org/search/apa?query=berkeley&search_distance=1&postal=94704&availabilityMode=0" D...