text
stringlengths
3.07k
12.6k
from __future__ import unicode_literals import getopt import os import re import sys import wave from pathlib import Path from time import time import ffmpeg import pyperclip import youtube_dl def arg_parser(): try: opts, args = getopt.getopt( sys.argv[1:], "u:o:t:", ["UR...
import os import scrapy import requests import lxml.html import math from scrapy.crawler import CrawlerProcess from scrapy.selector import Selector from scrapy.item import Field from urllib.parse import urlsplit, parse_qs from datetime import datetime from messageq import openConnection from messageq import sendMessage...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Build Order Player - BOP A simple GUI to sync a build order with in game time. """ import sys import glob import os import cairo import requests from requests.exceptions import ConnectionError import gi gi.require_version('Gtk', '3.0') gi.require_version('Notify', '0.7...
import configparser import os from laspy.file import File from shapely.geometry import Polygon from src.utils.helpers import create_path_if_not_exists, Stages class TileTypes: MAIN = "main" SUBTILE = "subtile" class Tile: def __init__( self, tile_name: str, geometry...
import torch import torch.nn.functional as F import torch.nn as nn from utils.rewards import get_scores, get_self_cider_scores class RewardCriterion(nn.Module): def __init__(self): super(RewardCriterion, self).__init__() def forward(self, input, seq, reward): input = input.gather(2, seq.unsque...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2018 Digital Media Professionals 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/lice...
#!/usr/bin/env python # Written against python 3.3.1 # Matasano Problem 23 # Clone An MT19937 RNG From Its Output from prob21 import MT19937 # The internal state of MT19937 consists of 624 32 bit integers. # For each batch of 624 outputs, MT permutes that internal state. By # permuting state regularly, MT199...
import os import pysam from .outlier import outlier_analysis def postprocess(df, data_dir, perform_outlier_analysis, pon): path_to_cosmic = "{}/cosmic/CosmicCodingMuts.indel.vcf.gz".format(data_dir) path_to_non_somatic = "{}/non_somatic/non_somatic.vcf.gz".format(data_dir) non_somatic = pysam.VariantFile...
import random import pygame from pygame.locals import * # Setup pygame.init() WIDTH = 800 HEIGHT = 500 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption('Flappy Bird') clock = pygame.time.Clock() fps = 60 # Variables ground_scroll = 0 scroll_speed = 3 start_fly = False ga...
# Prog-05: The Fucking 24 Game # 645645645646456555655645645654564312156415619489189456 Name <NAME> from itertools import permutations, product # import ทำไมวะงง ไม่เห็นต้องใช้ import math def generate_all_combinations(num_list, operators): all_combi = [] for n, o in product(sorted(set(permutations(num_list)...
import numpy as np import pandas as pd from colassigner import ColAssigner from ..data_management import fe_raw_cols as fe_rc from ..data_management import fe_trepos as fe_t2 from ..data_management import pv_raw_cols as pv_rc from ..data_management import pv_trepos as pv_t2 # manual part start_date = pd.to_datetime([...
# Copyright (c) <NAME> # See LICENSE for details. """Test the directory monitoring code""" import os import shutil import unittest from zope import interface from zope.interface import verify from ncolony import directory_monitor from ncolony import interfaces @interface.implementer(interfaces.IMonitorEventReceiv...
import sys from argparse import ArgumentParser from pathlib2 import Path from clearml import Task from clearml.version import __version__ from clearml.backend_interface.task.populate import CreateAndPopulate def setup_parser(parser): parser.add_argument('--version', action='store_true', default=None, ...
import argparse import asyncio import sys import os sys.path.append('./distributed-learning/') from utils.consensus_tcp import ConsensusMaster import consensus_trainer import consensus_master parser = argparse.ArgumentParser() parser.add_argument('--world-size', '-n', type=int, help='You should ...
#!/usr/bin/env python3 # # kcri.bap.shims.cgMLSTFinder - service shim to the cgMLSTFinder backend # import os, json, tempfile, logging from pico.workflow.executor import Task from pico.jobcontrol.job import JobSpec, Job from .base import ServiceExecution, UserException from .versions import BACKEND_VERSIONS # Our ser...
# This Python file uses the following encoding: utf-8 import os from pathlib import Path import sys import requests import asyncio import pproxy import nest_asyncio nest_asyncio.apply() from PySide6.QtWidgets import QApplication, QWidget, QListWidgetItem, QSystemTrayIcon from PySide6.QtCore import QFile, QThread, Q...
import io import os from minio import Minio try: from zipsendkin import Span, TraceContext, generate_id except ImportError: from src.utils.zipsendkin import Span, TraceContext, generate_id try: from structures import CsvFile, ImageUrl, Product except ImportError: from src.utils.structures import CsvF...
# -*- coding: utf-8 -*- """ Created on Sat Apr 11 09:40:23 2020 @author: yaniv """ class Clustering(): pass from numpy import diff,sign class TextTilingClustering(): ''' used to find clusters by local minima ''' @staticmethod def find_cluster(similarities_array,gap_times): mi...
import autograd.numpy as np from autograd import grad, jacobian import matplotlib.pyplot as plt from scipy.interpolate import CubicSpline, PchipInterpolator def get_cc_to_tangent(x, y, slope, radius): cc_x = np.zeros(np.size(x)) cc_y = np.zeros(np.size(x)) for idx, slopei in enumerate(slope): norm...
import gpflow import numpy as np from matplotlib import pyplot as plt import matplotlib import matplotlib.colors import matplotlib.cm import os from .data.gen import make_data import gp.gp_gpflow import seaborn as sns matplotlib.rcParams['figure.figsize'] = (12, 6) os.environ['KMP_DUPLICATE_LIB_OK'] = 'True' def eva...
import sys, time, logging,recdopt_context, ctypes, math from recdopt_context import * log = logging.getLogger('recd') sys.path.append('..') from common.time_utils import TimeUtils # # Base class for file retrieval queries, iterations, steps. # class RetrievalProgressBase: def __init__(self): self.startSe...
#!/ usr/bin/env # coding=utf-8 # # Copyright 2019 ztosec & https://www.zto.com/ # # 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 r...
#-*-encoding=utf-8-*- # Copyright 2020 The 9nFL 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 req...
# # Copyright (c) 2021 IBM Corp. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset torch.multiprocessing.set_sharing_strategy('file_system') from tqdm import tqdm import numpy as np import os from os.path import join, basename from boltons.fileutils import iter_find_files import soundfi...
""" 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, software distribut...
""" Tools for generating forms based on SQLAlchemy models. """ import inspect from wtforms import fields as f from wtforms import validators from wtforms.form import Form __all__ = ( 'model_fields', 'model_form', ) def converts(*args): def _inner(func): func._converter_for = frozenset(args) ...
#!/usr/bin/env python3 import os import sys import fcntl import base64 import psutil import signal import struct import pexpect import termios import argparse import subprocess import setproctitle import xdg.BaseDirectory from textwrap import dedent from pkg_resources import get_distribution, DistributionNotFound de...
import traceback import discord import configparser import inspect import random import os import string from magicball import MagicBall class Response: def __init__(self, content, reply=False, delete_after=0): self.content = content self.reply = reply self.delete_after = delete_after cl...
""" Module for testing the geometry module. """ from IPython import embed import numpy from nirvana.models import geometry def test_polar(): n = 51 x = numpy.arange(n, dtype=float)[::-1] - n//2 y = numpy.arange(n, dtype=float) - n//2 x, y = numpy.meshgrid(x, y) # Parameters are xc, yc, rotatio...
import sys, math, time from unittest import SkipTest try: import IPython from IPython.core.display import clear_output except: clear_output = None raise SkipTest("IPython extension requires IPython >= 0.12") # IPython 0.13 does not have version_info ipython2 = hasattr(IPython, 'version_info') and (IPy...
import argparse import glob import logging import os import sys import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.utils from torch.autograd import Variable import utils from model import NetworkBathy as Network parser = argparse.ArgumentParser("cifar") parser.add...
# Lint as: python3 # Copyright 2020 DeepMind Technologies Limited. 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 # # ...
import re from .ast.node import Node, IndexedTensor from numpy import ndarray, zeros, float64 from .memory import DenseMemoryLayout from . import aspp class AbstractType(object): @classmethod def isValidName(cls, name): return re.match(cls.VALID_NAME, name) is not None def name(self): return self._nam...
# Copyright (c) 2017-present, <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for details. """Python interface to the Zstandard (zstd) compression library.""" from __future__ import absolute_import, unicode_literals # This mod...
import os import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat from svm import SVM # Exercise 6 | Support Vector Machines def linearKernel(x1, x2): return x1.T @ x2 def gaussianKernel(x1, x2, sigma): diff = x1 - x2 return np.exp(-(diff.T @ diff)/(2*sigma*sigma)) def plotData(...
import amplitf.interface as atfi import amplitf.likelihood as atfl from amplitf.phasespace.rectangular_phasespace import RectangularPhaseSpace from amplitf.phasespace.combined_phasespace import CombinedPhaseSpace import tfa.plotting as tfp import tfa.optimisation as tfo import tfa.rootio as tfr import tfa.toymc as t...
''' Created on Jun 24, 2013 @author: <NAME> <<EMAIL>> ''' from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import super from builtins import str from builtins import int from future import standard_library...
"""Sensor platform for nodered.""" import json import logging from homeassistant.components.websocket_api import event_message from homeassistant.const import ( CONF_ENTITY_ID, CONF_ICON, CONF_ID, CONF_STATE, CONF_TYPE, EVENT_HOMEASSISTANT_START, EVENT_STATE_CHANGED, ) from ho...
"""Docs""" from __future__ import absolute_import, division, print_function, unicode_literals from math import atan2, pi import numpy as np from skimage.feature import canny from _octave import sobel # threshold to characterize blocks as edge/non-edge blocks THRESHOLD = 0.002 # fitting parameter BETA = 3.6 # blo...
# The MIT License (MIT) # # Copyright (c) 2017 <NAME> for Adafruit Industries # # 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 # ...
# -*- coding: utf-8 -*- """ Grid Search =========== """ import itertools import logging import numpy from orion.algo.base import BaseAlgorithm from orion.algo.space import Categorical, Fidelity, Integer, Real from orion.core.utils import format_trials log = logging.getLogger(__name__) def grid(dim, num): """Bu...
# -*- coding: utf-8 -*- ''' Catch-up TV & More Copyright (C) 2017 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 Foundatio...
import torch import torch.nn as nn from feature_networks.vit import forward_vit from feature_networks.pretrained_builder import _make_pretrained from feature_networks.constants import NORMALIZED_INCEPTION, NORMALIZED_IMAGENET, NORMALIZED_CLIP, VITS from pg_modules.blocks import FeatureFusionBlock def norm_with_stats(...
'''ResNet in PyTorch. For Pre-activation ResNet, see 'preact_resnet.py'. Reference: [1] <NAME>, <NAME>, <NAME>, <NAME> Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import math from collections import OrderedDict import logging import numpy as np import torch import torch.nn as nn import tor...
#!/usr/bin/env python """ Torture-test Afterglow Core API """ import argparse import base64 import json import random import requests import time import traceback import warnings from multiprocessing import Process from typing import Any, Dict, Optional, Union def api_call(host, port, https, root, api_version, toke...
#!/usr/bin/env python3 # coding=utf-8 import argparse import os import random import numpy as np import torch from torch import nn import torchvision.models as models import net_sphere from my_utils import create_folder, Tee from my_whitebox_mirror_helper import mirror_attack from my_target_models import get_model, ...
import requests import json import pandas as pd import numpy as np import datetime from django.shortcuts import render from django.core.cache import cache from .forms import UserForm from statsmodels.tsa.arima_model import ARIMA as ai # Create your views here. def home(request): if request.method...
#!/usr/bin/env python3 import filecmp import os import shutil import sys from lib import pyratemp from libshm import parse if os.getcwd().split('/')[-1] != 'libshm': os.chdir('libshm') # create directories to store generated files if they don't exist generated_dirs = ['c', 'py', 'haskell'] for d in generated_di...
#__author__ = 'WeiFu' from __future__ import print_function, division import sys,pdb from ruler import * from table import * from Abcd import * import numpy as np import matplotlib.pyplot as plt from sklearn.tree import DecisionTreeRegressor from sklearn import linear_model def csv(f= "./data/ant/ant-1.7copy.csv"): ...
# Copyright 2017 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 applicab...
import sys sys.path.append("..") import batman import lightkurve as lk import numpy as np import copy import os from matplotlib import pyplot as plt import tqdm from dev.kf import jacobian, KFilter re = 0.009158 eps = 1e-6 # EKF functions for the light curve def get_a(period, mstar, Go4pi=2945.4625385377644/(4*np.pi...
import torch from torch import nn from d2l import torch as d2l # 互相关 def corr2d(X, K): h, w = K.shape Y = torch.zeros((X.shape[0] - h + 1, X.shape[1] - w + 1)) s = 1 # stride for i in range(Y.shape[0]): for j in range(Y.shape[1]): Y[i, j] = (X[s*i : s*i+h, s*j : s*j+w] * K).sum() ...
#!/usr/bin/env python # encoding: utf-8 import os import math import string import time import tarfile import pandas as pd import numpy as np import matplotlib.pyplot as plt import urllib.request from xml.etree import cElementTree as et INPUT_METADATA_FILE = 'final_df.csv' INPUT_REPOINFO_FILE = 'eprints-repository...
"""Main module.""" import numpy as np import logging from scipy.signal import correlate as cor from scipy.interpolate import interp1d, CubicSpline __all__ = ["TimeSync2_1", "TimeSyncException"] class TimeSyncException(Exception): """ Base exception for TimeSync class """ def __init__(self, msg): ...
import io import json import dateparser from datetime import datetime import pytest from AzureADIdentityProtection import (AADClient, OUTPUTS_PREFIX, azure_ad_identity_protection_risk_detection_list_command, azure_ad_identity_protection_ris...
''' Created on 19.05.2016 @author: dieter ''' import datetime import indexdatabase import fetchdata class IndexSelector: def __init__(self): pass def _calcMonthDiff( self, startDate, monthDiff ): year = startDate.year month = startDate.month day = startDate.day if mo...
# Python import logging import time import picamera from picamera.array import PiRGBArray from picamera import PiCamera import numpy as np from threading import Thread logging.basicConfig() LOGLEVEL = logging.getLogger().getEffectiveLevel() RESOLUTION = (320, 320) logging.basicConfig() # https://github.com/dtresku...
from __future__ import division import sys def main(): size_of_corpus=int(sys.argv[1]) scores_file = sys.argv[2] rank_statistics_file = sys.argv[3] get_scores(scores_file) # Load corpus, query profile sizes and similarity scores corpus_profile_sizes, query_profile_sizes, scores = load_profiles() sizes = [corp...
import argparse import joblib import uuid import time import numpy as np import matplotlib.pyplot as plt import pickle from railrl.misc.pyhelper_fns.vis_utils import MyAnimationMulti import gym filename = str(uuid.uuid4()) def env_set_state(env, ob): qpos_idx = env.env.init_qpos.shape[0] env.env.set_state(ob[:qpos...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from copy import deepcopy from indicator_utils import simple_moving_avg, RSI, max_drawdown, BollingerBand, EWM, sliding_window_view, smaCross # Signal Generating Functions def SMASignal(input_data, fast_period, slow_period, signal_to_return = 'buy...
import datetime import logging import os import time import torch from sklearn import preprocessing from sklearn.model_selection import StratifiedKFold from torch import optim, nn from psob_authorship.experiment.utils import make_experiment_reproducible from psob_authorship.features.PsobDataset import PsobDataset fro...
import contextlib import logging from teuthology import misc as teuthology from teuthology.orchestra import run from teuthology.parallel import parallel log = logging.getLogger(__name__) supported_repos = {'1.3.1': 'https://paste.fedoraproject.org/350766/14600017/raw/', '1.3.2': 'http://paste.fedor...
from scripts.helpful_scripts import LOCAL_BLOCKCHAIN_ENVIRONMENTS, get_account from brownie import ( GovernorContract, GovernanceToken, GovernanceTimeLock, Box, Contract, config, network, accounts, chain, ) from web3 import Web3, constants # Governor Contract QUORUM_PERCENTAGE = 4 #...
from flask import Flask, render_template, request, redirect import numpy as np import pandas as pd import operator, os, datetime from bokeh.plotting import figure, output_file, save, show, ColumnDataSource from bokeh.models import HoverTool, OpenURL, TapTool from bokeh.resources import CDN from bokeh.embed import compo...
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from django.forms import formset_factory from .forms import FugacityVaporForm, ActivityForm from .engine.fugacity import * from .engine.chemsep_operation import get_chemical from math import factorial def vle_home(request)...
import cv2 as cv riding = ['motorcycling','riding a bike','riding scooter','riding mountain bike'] smoking = ['smoking','smoking hookah'] driving = ['driving car','driving tractor'] alcohol = ['tasting beer','drinking beer'] #Determine the IOU of two bounding boxes def bb_intersection_over_union(boxA, boxB): # de...
# -*- coding: utf-8 -*- """ Setup Tool """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) def index(): """ Show the index """ return dict() # ----------------------------------------------------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import csv import math import os import sys from elemam.algorithm import calculate, sort from elemam.kanon import AnonCheck from elemam.node import Node sys.path.insert(1, os.path.join(sys.path[0], '..')) from utils.data import transform_columns def create_anon_data(b...
from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.db.models import Q from django.shortcuts import render, redirect from django.shortcuts import render,get_object_or_40...
from pathlib import Path from typing import List import click from blspy import AugSchemeMPL, G1Element, G2Element from src.cmds.init import check_keys from src.consensus.coinbase import create_puzzlehash_for_pk from src.util.bech32m import encode_puzzle_hash from src.util.config import load_config from src.util.defa...
import glob import os import numpy as np import torch from PIL import Image from skimage import io from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision import transforms # , utils from data_loader import RescaleT from data_loader import SalObjDataset from data_loader import To...
import argparse import ast import json import os import sys import tqdm from .simpledicomanonymizer import anonymize_dicom_file, generate_actions def anonymize( input_path: str, output_path: str, anonymization_actions: dict, deletePrivateTags: bool, ) -> None: """ Read data from input path (...
from urllib2 import Request, urlopen, quote import datetime import userlib import pywikibot from pywikibot import pagegenerators, User import json class InactiveChecker: def __init__(self, start=None): self.wook = pywikibot.getSite('en', 'starwars') self.current = datetime.datetime.utcn...
import pygeohash as pgh import georaptor import math import time import argparse from clint.textui import puts, indent, colored def in_circle_check(latitude, longitude, centre_lat, centre_lon, radius): """ Check if given latitude and longitude are within the circle :param latitude: to be checked latitude ...
#Graphviz - <NAME> (Maintainer) from graphviz import Digraph class Nodo: #constructor def __init__(self, orden, hoja): self.orden = orden self.hoja = hoja self.cuenta = 0 self.siguiente = None self.claves = [] self.hijos = [] self.padre = None #***...
""" Utility Classes for Querying Overlaps with Genomic Regions ---------------------------------------------------------- Examples of Detecting Overlaps ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: python >>> from samwell.overlap_detector import Interval, OverlapDetector >>> detector = OverlapDetector() ...
# ------------------------------------------------------------------ # Example of a web scraping script using BeautifulSoup and Selenium # Scrapes select sports stats and records them in a CSV file # # For demonstrative and educational purposes only # (c) 2019 <NAME>, United States # # -------------------------...
#!/usr/bin/python3 import argon2 import bcrypt import hashlib import random import scrypt import string import timeit MESSAGE_LIST_SIZE = 100 MESSAGE_SIZE = 32 BCRYPT_WORK_FACTORS_MIN = 11 BCRYPT_WORK_FACTORS_SUG = 14 PBKDF2_ROUNDS_MIN = 100000 PBKDF2_ROUNDS_SUG = 1000000 SALT = "<PASSWORD>" SCRYPT_MIN = {"N": 2*...
"""A class for feature extraction using the textFeats command line tool.""" import os import tempfile from collections import namedtuple from subprocess import Popen, PIPE, STDOUT from distutils.version import StrictVersion try: import cv2 except ImportError: cv2 = False NamedImage = namedtuple('NamedImage', ...
# -*- coding: utf-8 -*- # Copyright 2020 The PsiZ 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 r...
#!/usr/bin/env python3 import argparse import json import os import re import subprocess import sys import requests import urllib3 if(sys.version_info[0] < 3 or sys.version_info[1] < 6): print("This script requires python version 3.6 and above. Please make sure to run with the proper version. Aborting...") s...
''' Author: <NAME> Date: 2021-07-12 19:21:35 LastEditTime: 2021-07-12 19:28:58 LastEditors: Please set LastEditors Description: In User Settings Edit FilePath: \EndGame\Extraction.py ''' from dataStructure import CONLL2Tree, PreOrder, SPO, Tree2Sentence, findChild, getPath import Baidu import Tencent impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 <NAME> # Copyright (c) 2013 Spotify AB # # 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/LI...
import hashlib import json from datetime import datetime from flask import Blueprint, request, jsonify from sqlalchemy import text from tzlocal import get_localzone from db import db from models.dashboard import Dashboard routes = Blueprint('dashboards', __name__, url_prefix='/dashboards') @routes.route('/', metho...
import os import pickle from datetime import datetime import cv2 import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from skimage import exposure from sklearn.utils import class_weight from tensorflow.keras import layers, models from tensorflow.keras.preprocessing.image import ImageDataGenerator...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 26 12:23:55 2019 @author: jxf """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime #has incomplete data. 999 points are NaN def read_file(fname): with open(fname, "r") as f: try: line1= ...
#!/usr/bin/env python3 import os import sys import math import pandas as pd import numpy as np from dataclasses import dataclass from pprint import PrettyPrinter @dataclass class Param: generator: str = "covtype" seed: int = 0 kappa: float = 0.0 ed: int = 90 reuse_window_size: int = 0 reuse_ra...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: enpassreaderlib.py # # Copyright 2021 <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 l...
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, <NAME> (www...
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm # Displays a progress bar import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms , utils from torch.utils.data import Dataset, Subset, DataLoader, random_split from ...
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import pydoop.hdfs import subprocess import os import stat import sys import threading import t...
# -*- coding: utf-8 -*- """Cli interface for sending in-game messages to Slack.""" import logging from pathlib import Path from typing import Dict import requests import typer from in_game_messages.exporting import Exporting from in_game_messages.messaging import Messaging from in_game_messages.slack_messaging impor...
import tensorflow as tf from src.dataGenerator import generator_from_data_path from model.ESDet import ESDet from src.create_config import load_dict from tensorflow.keras import backend as K import numpy as np from src.evaluation import filter_batch import cv2 import matplotlib.pyplot as plt from src.losses import * im...
#!python3 """ slip.py - Surrogate Launching and Integration Platform python driver To run: $ python3 slip.py run <MODELID> @author: <NAME> <<EMAIL>> """ import os import sys import json # for 'with' blocks import contextlib # SLIP directory (should be where 'slip.py' is) # variables exposed SLIP_DIR = os.path.d...
import numpy as np from sigvisa.models.distributions import PiecewiseLinear from sigvisa.utils.array import index_to_time, time_to_index """ Methods to propose a param value from a piecewise linear approximation to the Gibbs conditional. This can be based on either the full model posterior (proxylp_full) or a cheap ...
"""Contains all the 'top' pytorch NN.modules for this project Authors: <NAME>, <NAME> Functions: conv3x3 -- 3x3 convolution with padding countLearnableParams -- returns the amount of learnable parameters in this model Classes: sn_CNN -- CNN fitted for scattering input sn_Linear...
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from sklearn.utils import shuffle from cnn_util import y2indicator, error_rate, init_weights_bias, init_filter, get_image_data class ConvPoolLayer(object): def __init__(self, mi , mo, fw , fh , pool_size=(2,2)): self.shape = (fw,fh...
import config import player import threading import time import pyautogui import imagesearch class Player(threading.Thread): def __init__(self): super(Player, self).__init__() # If we fought or not last turn self.fought = False # Current mark self.current_mark = (-1, -1) ...
from dataclasses import dataclass from typing import Callable, Dict, Generic, List, Optional, Type, TypeVar, Union import re char = str EOF : char = '' @dataclass class Position: line : int column : int def __str__(self) -> str: return f"({self.line}, {self.column})" @dataclass class Location: ...