text
stringlengths
3.07k
22.1k
import tkinter as tk from tkinter import Frame, Label, CENTER import constants as c def new_game(n, m): matrix = [] for i in range(n): matrix.append([-1] * m) # matrix = add_two(matrix) # matrix = add_two(matrix) return matrix class GameGrid(Frame): def __init__(self): Fra...
#!/usr/bin/python3 """ Copyright 2018-2019 Firmin.Sun (<EMAIL>) 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 o...
from cort.core import corpora, external_data import codecs import re import os import sys from cort.core.documents import CoNLLDocument from utils import subtrees_over_span, span_subtract,\ remove_linear_positions, format_conll, add_system_set_ids, spans_over_tokens from cort.core.spans import Span from cort.core.c...
# Copyright 2019 <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 agreed to in writing, softw...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: style.py # Purpose: Music21 classes for non-analytic display properties # # Authors: <NAME> # # Copyright: Copyright © 2016 <NAME> and the music21 # Project # License: ...
import cv2 import numpy as np import math import random import torch from PIL import Image def get_max_overlap(box1, box2): # get overlap lt = np.maximum(box1[None, :2], box2[:, :2]) # [N,2] rb = np.minimum(box1[None, 2:], box2[:, 2:]) # [N,2] TO_REMOVE = 1 wh = np.clip(rb - lt, TO_REMOVE, None...
from util import adict, xset, tdict, tlist, tset, idict, PhaseComplete, PhaseInterrupt, GameEnds from tnt_cards import discard_cards from tnt_units import add_unit, move_unit from tnt_util import travel_options from government import check_revealable, reveal_tech from structures.common import condensed_str from b...
#author felipe from pyspark import SparkContext from pyspark.sql import SQLContext import sys import os from subprocess import Popen from dateutil import parser sc = SparkContext() sqlContext = SQLContext(sc) def help(): print("Usage: spark-submit (...) log_parsing.py"+\ "\n\t --in <input-path>\n\t\t# Direc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 02 10:13:22 2019 @author: ivancalderon """ # %% import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input from dash.dependencies import Output import get_data as gt import plotly.graph_obj...
"""Custom package sources used for feeding checks.""" import os from collections import deque from operator import attrgetter from pkgcore.ebuild.repository import UnconfiguredTree from pkgcore.restrictions import packages from snakeoil.osutils import listdir_files, pjoin from . import addons, base from .packages im...
__author__ = '<NAME>' # imports import pygame import random import os # setting window dimensions WIN_WIDTH = 600 WIN_HEIGHT = 300 # initializing pygame, loading images and declaring some variables pygame.init() STAT_FONT = pygame.font.SysFont('pixelmix', 30) END_GAME = pygame.font.SysFont('pixelmi...
""" Sinks This module contains functions to create new sink particles. These can be used to model accretion, for example unto protostars or compact objects. """ import numpy from amuse.units import units, quantities from amuse.units.quantities import zero, AdaptingVectorQuantity from amuse.datamodel import Particle, ...
## # Copyright (c) 2010-2017 Apple 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 applicab...
# Copyright 2022 The Magenta 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 agreed to in ...
from __future__ import print_function import numpy as np import torch import torch.nn.functional as F import time import os import pathlib import sys import nibabel as nib import scipy.io import argparse cuda_idx = 0 from utils.tools import countParam, dice_coeff from utils.datasets import MyDataset from utils impor...
# coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """XML reporting for coverage.py""" import os import sys import time import xml.dom.minidom from coverage import env from coverage import __url__, ...
""" Name: create_curvature_images.py Author: <NAME>, CVGL Desc: Creates images where color corresponds to the Gaussian curvature Since we need to used vertex colors to render out curvature, and the maximum bit-depth for vertex colors is 8-bits, we need to be somewhat careful about how we store the cur...
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import os, re, sys from waflib import Utils, Errors, Logs import waflib.Node if sys.hexversion > 0x3040000: import types class imp(object): new_module = lambda x: types.ModuleType(x)...
# -*- coding: utf-8 -*- import os from argparse import Namespace from typing import Dict, List, Optional, Tuple, Union import click import torch import yaml from model.bottleneck_layer import BottleneckSummary from model.scalar_mix import ScalarMixWithDropout from model.utils import move_to_cuda, move_to_cpu, pad_sequ...
# !/usr/bin/env python # -*- coding: UTF-8 -*- # # # VIZ MODULE : util to visualize an ontology as html or similar # # import click import os from shutil import copyfile # Fix Python 2.x. try: input = raw_input except NameError: pass # django loading requires different steps based on version # https://docs.dj...
# -*- coding: UTF-8 -*- # # Copyright 2018 <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 a...
import logging import multiprocessing import sys import time import timeit from math import isnan from multiprocessing import Queue import networkx as nx from mongoengine import connect, DoesNotExist, connection from mongoengine.base.datastructures import BaseDict from pycoshark.mongomodels import Project, VCSSystem, ...
# -*- coding: utf-8 -*- # wandb login <PASSWORD> from torch_struct import TreeCRF, SelfCritical try: import torchtext.legacy.data as data except ImportError: import torchtext.data as data from torch_struct.data import ListOpsDataset, TokenBucket from torch_struct.networks import TreeLSTM, SpanLSTM import torch ...
from __future__ import absolute_import from torch.nn.modules import Module import torch.nn.functional as F from torch.autograd import Function import numpy as np import sys import os sys.path.insert(0,os.path.abspath('.')) sys.path.insert(0,os.path.abspath('..')) sys.path.insert(0,os.path.abspath('/playpen/zyshen/reg_...
# -*- coding: utf-8 -*- """ Catch-up TV & More Copyright (C) 2018 SylvainCecchetto This file is part of Catch-up TV & More. Catch-up TV & More 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 Foundat...
""" Create Werewolve's Puzzle. """ import argparse from result import WhiteResult, BlackResult from player import Player import strategy def _index_to_alphabet(index): """ Convert the index to the alphabet. """ return chr(ord("A") + index) class PuzzleGenereator(object): """ The generator of puzzl...
# -*- coding: utf-8 -*- """Windows UserAssist information collector.""" import codecs import logging from winregrc import data_format from winregrc import errors from winregrc import interface class UserAssistEntry(object): """UserAssist entry. Attributes: guid (str): GUID. name (str): name. value_...
import flask from flask import Flask, request, redirect, url_for import pickle from bokeh.plotting import figure from bokeh.layouts import layout, widgetbox from bokeh.models import ColumnDataSource, Div, Plot, LinearAxis, Grid, Legend from bokeh.models.widgets import TextInput, Button, Select from bokeh.models.glyphs ...
from pwn import * import angr import claripy import tqdm from .simgr_helper import get_trimmed_input import logging import copy log = logging.getLogger(__name__) # Better symbolic strlen def get_max_strlen(state, value): i = 0 for c in value.chop(8): # Chop by byte i += 1 if not state.solver....
################################################################################ # Copyright (c) 2009-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the...
# -*- coding: utf-8 -*- """ Azure Resource Manager (ARM) Storage Account State Module .. versionadded:: 2.0.0 .. versionchanged:: 4.0.0 :maintainer: <<EMAIL>> :configuration: This module requires Azure Resource Manager credentials to be passed via acct. Note that the authentication parameters are case sensitive....
import tkinter import tkinter.filedialog import os import pygame import keyboard from modules.audio import SoundMusic, BackgroundMusic __version__ = 1.0 FONT = ('Helvetica', '10') # BTN_FONT = ('Helvetica', '15') LENGTH = 30 BUTTONS_NR = 9 sounds_lst = [None for _ in range(BUTTONS_NR)] def ope...
# -*- coding: utf-8 -*- """ BSD 3-Clause License Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software. Redistribution and use in source and binary forms, with or without...
import requests, re, hashlib, time as ttime, datetime, threading, json, logging from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from xlutils.copy import copy from xlrd import open_workbook from bs4 import BeautifulSoup #logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - ...
#coding=utf-8 import pandas as pd from itertools import chain import jieba from tqdm import tqdm import numpy as np import random import os import string import pickle from collections import Iterator #****************************************************************************** class Batch: """Struct containing ...
import numpy as np from matplotlib import pyplot as plt import time from scipy.optimize import curve_fit from scipy import stats def histo(d_out): '''Création de l'histogramme (degree distribution) à partir d'une liste de degrés. d_out : liste de degrés. indice : abscisse de l'histogramme. hist ...
import heapq import os import sys from .heap import MutableHeap FAILED_PATHS = set() class FilesystemObject(object): def __init__(self, path, parent=None): self._path = path self._parent = parent self._name = os.path.basename(path) self._selected = False @property def pat...
# search.py # --------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley.edu. # # A...
import base64 import io import yaml import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from dash.dependencies import Input, Output import numpy as np import pandas as pd import plotly.express as px import tensorflow as tf from PIL import Image f...
import clipboard as c wordList = ["a", "akesi", "ala", "alasa", "ale", "anpa", "ante", "anu", "awen", "e", "en", "esun", "ijo", "ike", "ilo", "insa", "jaki", "jan", "jelo", "jo", "kala", "kalama", "kama", "kasi", "ken", "kepeken", "kili", "kiwen", "ko", "kon", "kule", "kulupu", "kute...
import numpy as np import os from deeplab3.modeling import load_model from deeplab3.config.defaults import get_cfg_defaults from dataloaders.utils import decode_segmap from dataloaders import make_dataset, make_data_loader from deeplab3.utils.model_utils import match_cfg_versions, get_all_models, match_cfg_versions fr...
#!/usr/bin/env python import find_marker import numpy as np import cv2 import time import marker_dectection import marker_displacement import sys import setting import rospy from geometry_msgs.msg import Wrench, WrenchStamped from sensor_msgs.msg import Image from cv_bridge import CvBridge ## Action Server import act...
class Node(object): def __init__(self): self.suffix_node = -1 self.child = [] self.parent = None self.descendant = 0 self.d = 0 self.suffix_index = -1 class Edge(object): def __init__(self, f_char, l_char, source_node_index, dest_node_index): ...
from mujoco_py import MjSim, MjViewer, load_model_from_path import numpy as np from scipy.spatial.transform import Rotation as R import glfw from mujoco_py import const from enum import Enum def rotation(theta_x=0, theta_y=0, theta_z=0): rot_x = np.array([[1, 0, 0],[0, np.cos(theta_x), - np.sin(theta...
#!/usr/bin/env python # Copyright 2016 Datawire. All rights reserved. """scout2csv Exports a DynamoDB table to CSV Usage: scout2csv export [options] <start_date> <end_date> scout2csv (-h | --help) scout2csv --version Options: -a --app=<name> Set the app to filter for. -o --output-file=<...
# -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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 time from telnetlib import Telnet import openstack.compute from fabric.api import env, local from fabric.contrib import console from fabric.decorators import task from fabric.colors import blue, cyan, green, magenta, red, white, yellow # noqa from fabric.operations import prompt from fabric.utils import abor...
import itertools import os from flask import Flask import numpy as np import pandas as pd import pulp from sheetfu import SpreadsheetApp app = Flask(__name__) THRESH = .25 N_GAMES = 5 ssid = '<KEY>' def _game_combos(team_combos, n_games): """Creates game combinations from team combinations ...
# Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module implements the PeripheralKit instance for a bluez peripheral on Raspberry Pi. """ from __future__ import print_function import dbus im...
import argparse import logging import requests import sqlite3 import sys import time from voussoirkit import backoff from voussoirkit import betterhelp from voussoirkit import httperrors from voussoirkit import mutables from voussoirkit import operatornotify from voussoirkit import ratelimiter from voussoirkit import ...
""" Tools used across parameter selection modules """ from typing import List, Dict import itertools import numpy as np import sympy from sympy import Symbol from pycalphad import variables as v from espei.utils import build_sitefractions from espei.parameter_selection.redlich_kister import calc_interaction_product f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ last mod 7/2/18 usage for new detector: first disable metrics check min_sensor_prob to <<0 use simple scoreToProb use the plots to figure out a good scoreToProb function then you can run metrics check current avg precisions: .5 iou -- .855, .783, .774...
#Copyright (C) 2017 <NAME>, <NAME>, <NAME>, <NAME> # #This file is part of Rogueinabox. # #Rogueinabox 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 la...
import torch import math import torch.nn as nn import torch.nn.functional as F from asteroid.dsp import downsample2, upsample2 ### # Utils ### def apply_model_chunked(model, wav, chunk_length): if wav.shape[-1] % chunk_length != 0: padded_length = chunk_length - (wav.shape[-1] % chunk_length) wav...
import sys import argparse import pandas import fasttext import pymorphy2 from sentencepiece import SentencePieceProcessor as sp_processor from razdel import tokenize from razdel.substring import Substring from grammar_ngram_lm import load_grams, make_ngram_correction, make_hypotheses_neni grams = load_grams() to...
#!/usr/bin/env python """ Copyright (c) 2020 <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, modify, merge, publi...
import torch import torch.nn as nn from models.auxiliaries.auxiliary import * from models.auxiliaries.CBAM import CBAM1d ############################################################################## # Classes ############################################################################## # Defines the GAN loss which...
from configobj import ConfigObj # config = ConfigObj('./conf.ini') """ setting_info: site_id """ class RewriteConf(object): def __init__(self, conf_path, setting_info): print('\n\nconf_path: {}\n\nsetting_info: {}'.format(conf_path, setting_info)) self.settings_dc = setting_info self.co...
import os import sys def tstr(time, length=7): """Create ISO8601 date/time string tstr((2000, 1, 1, 2)) # 2000-01-01T02:00:00 tstr((2000, 1, 1, 2, 3)) # 2000-01-01T02:03:00 tstr((2000, 1, 1, 2, 3, 4)) # 2000-01-01T02:03:04 tstr((2000, 1, 1, 2, 3, 4, 567)) # 2000-01-01T02:03:04.000567 """ ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Please note: this program isn't meant to be taken or used seriously, # despite of how functional it may or may not be. try: import string import sys import traceback import time import easyparse import os from stat import S_ISFIFO fr...
from random import random import pybullet as p import pybullet_data import numpy as np from scipy.spatial.transform import Rotation as R import cv2 as cv from tf_agents.environments import py_environment from tf_agents.environments import tf_py_environment from tf_agents.specs import array_spec from tf_agents.trajecto...
from random import choice, randint import numpy as np import matplotlib.pyplot as plt from skidl.pyspice import * import traceback lib_search_paths[SPICE].append('SpiceLib') @subcircuit def vreg(vin, vout, vadj, gnd): '''Voltage regulator similar to NCP1117.''' v_bandgap = v(dc_value=1.25 @ u_V) # Bandgap vo...
from __future__ import print_function import glob import sys import os import re import colorama from colorama import Fore, Back, Style from subprocess import call from doit.tools import create_folder from configobj import ConfigObj colorama.init() DOIT_CONFIG = {'verbosity': 1, 'reporter':'executed-only', 'default_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Project: Multianalyzer data rebinning # https://github.com/kif/multianalyzer # # # Copyright (C) 2021-2021 European Synchrotron Radiation Facility, Grenoble, France # # Authors: <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to ...
""" This module contains functions to group an arbitrary set of positions into a number of strategies, each one of the following "basic" strategies class AssetStrategy(BasicStrategy): A strategy that involves going long or short in an asset class OffsetStrategy(BasicStrategy): A strategy that involv...
"""From https://github.com/zaccharieramzi/tf-mwcnn/blob/master/mwcnn.py """ import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import ( Conv2D, Layer, ) from fastmri_recon.models.subclassed_models.feature_level_multi_domain_learning.multi_domain_convolution import Mu...
from __future__ import annotations import datetime import enum from typing import Optional, Dict, Union, List, Set, TYPE_CHECKING from ravendb.documents.indexes.analysis.definitions import AnalyzerDefinition from ravendb.documents.indexes.definitions import ( IndexDefinition, RollingIndexDeployment, Rollin...
import argparse import os import sys import subprocess import time import tensorflow as tf from keras.models import Model from keras.layers import Dense, Input, BatchNormalization, Softmax, LSTM, Activation, RNN, GRU, CuDNNGRU, CuDNNLSTM from keras.layers import TimeDistributed, Bidirectional, Dropout, Lambda, Masking,...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.cm as cm import matplotlib.ticker as ticker ''' B-field calculator using Biot-Savart law You will need to provide: - series of points in (x, y, z, I) describing the geometry of a coil in a text file. - Ea...
#!/usr/bin/env python3 """Client side executable for sshed. This program needs to be running on the client machine and the SSH client needs to be properly set up to allow sshed to function properly. """ import argparse import difflib import logging import os import shutil import socketserver import subprocess import ...
import torch import os import numpy as np import pandas as pd import sys import time from src.report.logs import print_and_save_logs from src.report.metrics import Metrics import argparse from torch import optim from torch.nn import functional as F from torch import nn, distributions #from torch.optim.lr_scheduler ...
# Copyright 2021 The Distla 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 applicable ...
import numpy as np from mpi4py import MPI import os from SIMP import TO_SIMP, make_Conn_matrix import time from keras.models import load_model from bayesian_optimization import kriging, ExImp, corr_matrix def get_void(nely,nelx): v=np.zeros((nely,nelx)) R=min(nely,nelx)/15 loc=np.array([[1/3, 1/4], [2/3, ...
import asyncio import os import platform import shutil import subprocess import time from os.path import dirname, join import click from salmon import config from salmon.common import flush_stdin, get_audio_files, prompt_async from salmon.errors import ( AbortAndDeleteFolder, ImageUploadFailed, UploadErro...
import base64 from pathlib import Path import subprocess import tempfile import re import urllib import fs from .project import LatexProject, LatexError from .package import LatexPackage from .content import BasicContent from .document import DocumentConfig from .command import LatexCommand svg_packages = ( Lat...
"""Transaction-aware Celery task handling. Inspired by Warehouse project https://raw.githubusercontent.com/pypa/warehouse/master/warehouse/celery.py """ import logging import transaction import venusian from celery import Task from pyramid.request import apply_request_extensions from pyramid.scripting import _make_r...
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
import matplotlib.pyplot as plt import numpy as np import math import json from bresenham import bresenham import time # CONTROL PARAMETERS BOX_SIZE = 0.1 ROOM_SIZE = 15 PROB_HIT = 0.9 PROB_MISS = 0.4 class Cols: HEADER = '\033[34m' INFO = '\033[92m' FAILED = '\033[91m' ENDC = '\033[0m' def prin...
""" Functions for working with glutamate receptor variants """ import re # for abbreviating amino acid names aadict = {'Ala': 'A', 'Cys': 'C', 'Asp':'D', 'Glu':'E','Phe':'F','Gly':'G', 'His':'H','Ile':'I','Lys':'K','Leu':'L','Met':'M','Asn':'N','Pro':'P', 'Gln':'Q','Arg':'R','Ser':'S','Thr':'T','Val':'V','Trp':'W','T...
import numba as nb import numpy as np from numba.pycc import CC import pyrcel.constants as c ## Define double DTYPE DTYPE = np.float PI = 3.14159265358979323846264338328 N_STATE_VARS = c.N_STATE_VARS # AOT/numba stuff auxcc = CC("parcel_aux_numba") auxcc.verbose = True ## Auxiliary, single-value calculations with...
#!/usr/bin/python # -*- coding: utf-8 -*- """This module provides methods conceived to preprocess data stored in a csv file etc., with the intent to perform data analysis and Machine Learning. It was originally created to preprocess data from the EA Sports' FIFA 19 for a Machine Learning project to predictplaye...
import pandas as pd import numpy as np import sys import os import psutil import scipy.sparse as sp import scipy.sparse.linalg import inspect from scipy.sparse import csr_matrix, rand from scipy.misc import imsave from struct import unpack, calcsize from numpy.linalg import inv from numpy.linalg import multi_dot import...
import os import imageio import numpy as np import skimage.transform import concurrent.futures import darc def load_image(path): _, ext = os.path.splitext(path) if ext.lower() == '.npy': image = np.load(path) elif ext.lower() in ('.png', '.jpg'): image = imageio.imread(path).astype(np.float32) / 255.0 else: ...
'''DenseNet in PyTorch.''' import math import torch import torch.nn as nn import torch.nn.functional as F class Bottleneck(nn.Module): def __init__(self, in_planes, growth_rate): super(Bottleneck, self).__init__() self.bn1 = nn.BatchNorm2d(in_planes) self.conv1 = nn.Conv2d(in_planes, 4*gr...
import datetime import logging from collections import OrderedDict import dateutil.parser from six import text_type from ckanext.hdx_package.helpers.extras import get_extra_from_dataset log = logging.getLogger(__name__) UPDATE_FREQ_INFO = OrderedDict( ( ('1', { 'overdue': 1, 'del...
# -------------------------------------------------------- # DaSiamRPN # Licensed under The MIT License # Written by <NAME> (wangqiang2015 at ia.ac.cn) # -------------------------------------------------------- import cv2 import torch import numpy as np def to_numpy(tensor): if torch.is_tensor(tensor): re...
from math import sqrt from copy import deepcopy from dateutil.relativedelta import relativedelta import scipy.stats as ss import math from sklearn.model_selection import KFold, StratifiedKFold, train_test_split import numpy as np from sklearn import metrics import gc import matplotlib.pyplot as plt import seaborn as ...
# 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 u...
import numpy as np import pandas as pd from typing import Mapping, List, Tuple from collections import defaultdict, OrderedDict import matplotlib.pyplot as plt import matplotlib as mpl from sklearn.linear_model import LinearRegression, Lasso from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble impo...
import requests import re import logging import datetime import trafilatura from bs4 import BeautifulSoup class Request(): def __init__(self, lang = 'en', country = 'US', timeout_sec = 60): self.lang = lang.lower() self.country = country.upper() self.http_header = self.set_http_header() self.cookies = sel...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Jan-04-21 20:21 # @Author : <NAME> (<EMAIL>) import os import argparse from datetime import datetime import tensorflow as tf from senet.keras_fn.se_resnet import SE_ResNet_50 def lr_schedule(epoch): """Learning Rate Schedule Learning rate is sche...
# ---------------------------------------------------------- # NDN Hydra Client # ---------------------------------------------------------- # @Project: NDN Hydra # @Date: 2021-01-25 # @Authors: Please check AUTHORS.rst # @Source-Code: https://github.com/UCLA-IRL/ndn-hydra # @Documentation: https://ndn-hydr...
import os import torch import numpy as np from sklearn import svm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns # import umap from constants import * #os.makedirs(result_folder, exist_ok=True) step = 0 umap_model = None sns.set(style='white', context='poster', rc={'...
import websocket, requests, json from datetime import datetime, timedelta import pytz import time from config import * algorithm = __import__('algorithms.{}'.format(ALGORITHM_FILENAME)).__dict__[ALGORITHM_FILENAME] # parameters RESERVED_CASH = 28000 DEBUG = True # socket DATA_SOCKET = 'wss://socket.polygon.io/stocks...
# -*- coding: utf-8 -*- # pylint: disable=no-self-use """ .. module:: api """ from django.contrib import messages from django.contrib.auth import authenticate, get_user_model from django.contrib.auth import login from django.contrib.auth import logout from django.contrib.auth.models import User from django.contrib.au...
#!/usr/bin/env python import argparse from argparse import RawTextHelpFormatter import logging from datetime import datetime from os import path import nibabel as nib import numpy as np from dipy.io.stateful_tractogram import (StatefulTractogram, set_sft_logger_level) from dipy...
# Copyright (C) 2019 <NAME> # # This file is part of QuantLibExt, which is an extension to the # free-software/open-source quantitative library QuantLib - http://quantlib.org/ # # QuantLibExt is free software: you can redistribute it and/or modify it # under the terms of the BSD license. # # QuantLib's license is at <h...
import math import torch import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt from .vq_ema import VectorQuantizerEMA from .ulosd_layers_modified import FeatureMapsToKeyPoints, KeyPointsToFeatureMaps class Residual(nn.Module): def __init__(self, in_channels, num_hiddens, num_resi...
import torch import numpy as np torch.manual_seed(0) from torch import nn from torch.autograd import Function from torch.autograd import Variable class SurfEval(torch.nn.Module): """ We can implement our own custom autograd Functions by subclassing torch.autograd.Function and implementing the forward and b...
# -*- coding: utf-8 -*- """Load remote Python classes from an URL and run them for Kivy on Android. .. note :: We do not claim to offer perfect functionality, just enough to get your few .py files and images into your phone. """ from __future__ import print_function import logging import concurrent.futures imp...