text
stringlengths
8.04k
46.5k
# Vax-Man, a re-implementation of Pacman, in Python, with PyGame. # Forked from: https://github.com/hbokmann/Pacman # Edited by <NAME> (2021) # Video link: https://youtu.be/ZrqZEC6DvMc import time import pygame # Ghosts multiply themselves every thirty seconds. GHOST_MULTIPLICATION_TIME_GAP = 30 # Thirty-two times...
# -*- coding: utf-8 -*- import asyncio import enum import json import logging import random import time import uuid from typing import * import aiohttp import tornado.websocket import api.base import blivedm.blivedm as blivedm import config import models.avatar import models.translate import models.log logger = logg...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
import os from typing import List, Optional import pickle import numpy as np from utilities import augment_long_text, tokenize, tokenize_long_text, to_chars, align from config import Config as cf PAD = 0 # TODO: choose appropriate index for these special chars UNK = 1 DEFAULT = {'PAD': PAD, 'UNK': UNK} DEFAULT_C = {''...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tools for setting up and using the data recorder of a PI device.""" from logging import debug, warning from time import sleep, time from pipython.pitools import FrozenClass # seconds SERVOTIMES = { 'C-413K011': 0.00003333333, 'C-663.11': 50E-6, 'C-702.00': 100...
"""Defines procedures for training, and evaluation automatic camfi annotation models, and for using them for making automatic annotations (inference). Depends on camfi.util, camfi.datamodel.autoannotation, camfi.datamodel.geometry, camfi.datamode.via, as well as ._torchutils and ._models.""" from datetime import datet...
import io, re, codecs, sys, os.path import pprint REG = 0 SHFT = 1 CTRL = 2 ALT = 4 ALTGR = 6 COMPRESSED_OUTPUT=1 def get_kbd_layout(base_filename, load_patch = False): filename_klc = base_filename filename_changes = base_filename + 'patch' f = io.open(filename_klc, mode="r", encoding="utf-8") lines = f.r...
#!/usr/bin/env python # coding: utf-8 __author__ = '<NAME>' __copyright__ = 'Copyright 2017-2020, <NAME>' __license__ = 'MIT' __version__ = '0.5' __email__ = '<EMAIL>' __status__ = 'Development' __description__ = 'Tkinter based GUI, visualizing PASCAL VOC object detection annotation' """ Changelog: - 2020-06-16 11:3...
import math from math import pi import numpy as np import open3d as o3d import matplotlib.pyplot as plt import cv2 import toml from .cameraparam import CameraParam from .fitted_line import FittedLine from .ransac_fit import ransac_line_fit, ransac_ground_fit from .util import check_all_false # TODO: output random s...
"""Shelving Filter Cascade with Adjustable Transition Slope and Bandwidth <NAME>, <NAME>, <NAME> In: Proc. of 148th AES Convention, Virtual Vienna, May 2020, Paper 10339 http://www.aes.org/e-lib/browse.cfm?elib=20756 """ import numpy as np from scipy.signal import tf2sos, freqs from matplotlib import rcParams def ha...
import csv from sklearn.cluster import MiniBatchKMeans import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import pickle import numpy as np import sklearn.metrics as metrics from yellowbrick.cluster import InterclusterDistance from scipy.optimize import curve_fit import umap.umap_ as umap from col...
#! /usr/bin/python3 ################################################################## # # Raspberry Pi Antenna Driver (RPiAntDrv.py) # # Python GUI script to control H-Bridge via RPi. # H-Bridge drives single DC motor tuned antenna. # # Name Call Date(s) # Authors: <NAME> N7IFC Mar-May2020 # ###...
# -*- encoding: utf8 -*- # version 1.11 import tkinter.messagebox,os from tkinter import * from tkinter.ttk import * from tkinter import Menu import datetime import threading import pickle import time import tushare as ts import pywinauto import pywinauto.clipboard import pywinauto.application NUM_OF_STOCKS = 5 # 自定义...
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright (C) 2006 Fluendo, S.A. (www.fluendo.com). # Copyright 2006, <NAME> <<EMAIL>> # Copyright 2018, <NAME> <<EMAIL>> ''' Devices ======= This module contains two classes describing UPnP devices. :class:`Device` --------------- ...
# ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1 Redistrib...
from models import StandardHMM, DenseHMM, HMMLoggingMonitor from utils import prepare_data, check_random_state, create_directories, dict_get, Timer, timestamp_msg, check_dir, is_multinomial, compute_stationary, check_sequences from data import penntreebank_tag_sequences, protein_sequences, train_test_split from datet...
import torch from torch.optim import lr_scheduler from tqdm import tqdm from torchsummary import summary from torch.utils.tensorboard import SummaryWriter from apex import amp from loss import dice from pathlib import Path from data import CaseDataset, load_case, save_pred, \ orient_crop_case, regions_crop_case, re...
import json import time import requests import re from flask import Flask, render_template, jsonify from pyecharts.charts import Map, Timeline,Kline,Line,Bar,WordCloud from pyecharts import options as opts from pyecharts.globals import SymbolType app = Flask(__name__) #字典,受限于谷歌调用限制 cn_to_en = {'安哥拉': 'Angola', '阿富汗':...
from nltk.corpus import wordnet as wn import json from pyinflect import getAllInflections, getInflection import re import inflect import urllib.parse from SPARQLWrapper import SPARQLWrapper, JSON from urllib.parse import quote from py_thesaurus import Thesaurus import sys, getopt WN_NOUN = 'n' WN_VERB = 'v' WN_ADJECTI...
import unicodedata import warnings import logging import re import argparse import sbol3 import openpyxl import tyto from .helper_functions import toplevel_named, strip_sbol2_version, is_plasmid, url_to_identity, strip_filetype_suffix from .workarounds import type_to_standard_extension BASIC_PARTS_COLLECTION = 'Basi...
# from sklearn.cluster._kmeans import * import copy from typing import Union import torch import torch.nn as nn from sklearn.cluster._robustq import * from .quantizer import Quantizer __all__ = ['MiniBatchRobustqTorch', 'RobustqTorch'] class ClusterQuantizerBase(Quantizer): def __init__(self, n_feature=1, n_cl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Components of the simulation system, namely blocks, wires and plugs. """ from abc import ABC, abstractmethod from typing import Any, Iterable, List, Optional as Opt, Tuple, Union, TYPE_CHECKING from typing_extensions import Literal from bdsim.core import np if TYPE_CH...
#------------------------------------------------------------------------------------------------------- # Copyright (C) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. #-------------------------------------------------------------...
from __future__ import print_function import os import itertools, pkg_resources, sys from distutils.version import LooseVersion if LooseVersion(pkg_resources.get_distribution("chainer").version) >= LooseVersion('7.0.0') and \ sys.version_info.major == 2: print('''Please install chainer <= 7.0.0: sudo pip in...
import os from math import radians, sin, cos, asin, degrees, pi, sqrt, pow, fabs, atan2 from django import forms from django.db import models from django.conf import settings from modelcluster.fields import ParentalKey from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailadmin.edit_handlers impo...
import traceback import copy import gc from ctypes import c_void_p import itertools import array import math import numpy as np from OpenGL.GL import * from PyEngine3D.Common import logger from PyEngine3D.Utilities import Singleton, GetClassName, Attributes, Profiler from PyEngine3D.OpenGLContext import OpenGLContex...
# Copyright (c) 2019 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...
"""Compiler/transpiler for the GerryOpt DSL.""" import ast import json import inspect from copy import deepcopy from textwrap import dedent from dataclasses import dataclass, field, is_dataclass, asdict from enum import Enum from itertools import product from typing import (Callable, Iterable, Sequence, Set, Dict, List...
# coding: utf-8 # In[20]: import numpy as np import pydensecrf.densecrf as dcrf import os import cv2 import random from tqdm import tqdm # In[21]: from skimage.color import gray2rgb from skimage.color import rgb2gray import matplotlib.pyplot as plt from sklearn.metrics import f1_score, accuracy_score from pyden...
import pycropml.transpiler.antlr_py.grammars from pycropml.transpiler.antlr_py.grammars.CSharpLexer import CSharpLexer from pycropml.transpiler.antlr_py.grammars.CSharpParser import CSharpParser from pycropml.transpiler.antlr_py.grammars.Fortran90Lexer import Fortran90Lexer from pycropml.transpiler.antlr_py.grammars.F...
from functools import partial from itertools import chain import os import sublime import sublime_plugin import textwrap from .lint import elect, events, persist, util if False: from typing import ( Any, Dict, Iterable, List, Optional, Set, Tuple, Union ) from mypy_extensions import Typed...
import streamlit as st import numpy as np import pandas as pd import requests import re import altair as alt # Find all available data def find_all_spreadsheets(): available_data = {} r = requests.get('https://www.football-data.co.uk/downloadm.php') if r.status_code != 200: print('Oh dear. Error {}...
# Copyright (c) 2021 PPViT 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 l...
#!/usr/bin/env python # cardinal_pythonlib/sphinxtools.py """ =============================================================================== Original code copyright (C) 2009-2020 <NAME> (<EMAIL>). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (the "License"); ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Author : @Ruulian_ # Date created : 31 Oct 2021 from random import choice from requests_html import HTMLSession from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.firefox.options import Optio...
# -*- coding: utf-8 -*- """ Created on Wed Nov 22 21:44:55 2017 @author: Mike """ import numpy as np import cv2 import glob import pickle import matplotlib.pyplot as plt from matplotlib.pyplot import * import os from scipy import stats from moviepy.editor import VideoFileClip from IPython.display im...
from bs4 import BeautifulSoup as Soup import re import json import sys import shutil import tempfile import os import subprocess from pathlib import Path from docassemble.base.util import log, path_and_mimetype, validation_error, DADict, DAList, Individual, value, force_ask, space_to_underscore __all__ = ['run_automa...
from __future__ import annotations import math from collections import deque from typing import Optional, Callable import numpy as np import pygame from chess.const import PieceType, PieceColour, Piece, CastlingType, Move, \ PIECE_INDICES, init_zobrist, MoveFlags, GameState from chess.utils import load_image, lo...
#!/usr/bin/env python3 import pvml import numpy as np import matplotlib.pyplot as plt import argparse from itertools import zip_longest _NORMALIZATION = { "none": lambda *X: (X[0] if len(X) == 1 else X), "meanvar": pvml.meanvar_normalization, "minmax": pvml.minmax_normalization, "maxabs": pvml.maxabs...
# -*- coding: utf-8 -*- """ Created on Fri Aug 21 20:00:50 2020 @author: takada """ import logging import numpy as np import functools import operator from typing import List, Dict, Callable import time import nidaqmx from nidaqmx.stream_writers import ( DigitalSingleChannelWriter, AnalogMultiChannelWriter) from...
import pandas as pd import numpy as np from matplotlib import pyplot as plt import os from datetime import datetime, date, timedelta from sklearn.linear_model import LinearRegression import scipy import math import sys import locator file_path = os.path.dirname(os.path.realpath(__file__)) proj_path = os.path.abspath(...
import json import os import sys import time from os import path as osp from pathlib import Path from shutil import copyfile import numpy as np import torch from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.utils.data import DataLoader from tqdm import tqdm from model_temporal import LSTMSeqNetwork, B...
#!/usr/bin/env python3 # pylint: disable=too-many-lines """ Provides a stdin/stdout based protocol to safely dispatch commands and return their results over any connection that forwards both stdin/stdout, as well as some other needed remote system related utilities. """ import errno as sys_errno import hashlib import...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime # import rasahub_google_calendar from time import gmtime, time, strftime import json import locale import logging import math import mysql.c...
# -*- coding: utf-8 -*- """ Javelin Web2Py Admin Controller """ # metadata __author__ = "<NAME>" __copyright__ = "(c) 2013, Jacobson and Varni, LLC" __date__ = "7/12/2013" __email__ = "<EMAIL>" __data__ = {'name' : 'jadmin', 'label' : 'Admin', 'description' : 'Only accessible to admins', 'icon' : 'briefcase', 'u-ic...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANT...
#!/usr/bin/env python # coding: utf-8 # # Developing an AI application # # Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho...
import numpy as np import matplotlib.pyplot as plt from astropy import units as u from astropy.coordinates import SkyCoord from astropy.io import fits from astropy.nddata import CCDData from astropy.nddata import Cutout2D from astropy.stats import sigma_clipped_stats from astropy.wcs.utils import proj_plane_pixel_scale...
""" Copyright 2021 Objectiv B.V. """ import datetime import warnings from abc import ABC from enum import Enum from typing import Union, cast, List, Tuple, Optional, Any import numpy import pandas from sqlalchemy.engine import Dialect from bach import DataFrame from bach.series import Series, SeriesString, SeriesBool...
import sys sys.path.append("../src/") from DEVS import CoupledDEVS, AtomicDEVS, RootDEVS, directConnect from infinity import INFINITY from collections import defaultdict from util import allZeroDict, addDict from statesavers import PickleHighestState as state_saver from message import NetworkMessage from messageSchedu...
#!/usr/bin/env python """ package Implementation for the package command that handles helping set up and manipulate packages for use with cirrus. Commands: package init - Initialise a new repo with a basic cirrus.conf file add the appropriate setup, manifest and requirements files package sublime-project - Assist...
""" ========================================================================== bitstruct.py ========================================================================== APIs to generate a bitstruct type. Using decorators and type annotations to create bit struct is much inspired by python3 dataclass implementation. Note ...
"""A module containing tests for the pyIATI representation of Standard metadata.""" import copy import math import operator import pytest import iati.tests.utilities from iati.tests.fixtures.versions import iativer, semver, split_decimal, split_iativer, split_semver class TestVersionInit: """A container for tests...
import math import torch from torch import nn from torch.nn import CrossEntropyLoss from custom_model.CXLNetModel import PosNetModel from transformers import XLNetLMHeadModel, XLNetPreTrainedModel, XLNetModel, Conv1D from transformers.modeling_utils import prune_conv1d_layer from transformers.modeling_xlnet import XL...
import numpy as np import matplotlib.pyplot as plt from matplotlib import patches from matplotlib.legend_handler import HandlerTuple from scipy.integrate import quad, simps from math import * #lets the user enter complicated functions easily, eg: exp(3*sin(x**2)) import pyinputplus as pyip # makes taking inputs ...
''' Created on Jan 26, 2011 This module is a local copy of python locale in order to allow passing in localconv as an argument to functions without affecting system-wide settings. (The system settings can remain in 'C' locale.) @author: Mark V Systems Limited (incorporating python locale module code) (original pytho...
# # (C) Copyright IBM Corp. 2021 # # 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...
from datetime import date from models import gtfs, config, util, nextbus, routeconfig import argparse import shapely import partridge as ptg import numpy as np from pathlib import Path import requests import json import boto3 import gzip import hashlib import math import zipfile # Downloads and parses the GTFS specifi...
# -*- coding: utf-8 -*- """ Created on Wed Jan 15 21:56:08 2020 @author: <NAME> """ # STEP1----------------- # Importing the libraries------------ #------------------------------------------------------------- import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import glob ...
from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.contrib import messages from django.db.models import Q from django.http import HttpResponseRedirect, Http404 from django.views.generic import FormView, RedirectView, TemplateView from django.u...
""" sphinx_c_autodoc is a package which provide c source file parsing for sphinx. It is composed of multiple directives and settings: .. rst:directive:: .. c:module:: filename A directive to document a c file. This is similar to :rst:dir:`py:module` except it's for the C domain. This can be used for both c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 23 19:53:22 2021 @author: <NAME> (<EMAIL>) at USTC This script refers to some theories and codes of Obspy/MoPaD/Introduction to Seismology (Yongge Wan): 1) The MoPaD program (https://github.com/geophysics/MoPaD); 2) str_dip_rake to mt; 3...
# =========================================================================== # Copyright 2013 University of Limerick # # This file is part of DREAM. # # DREAM is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Founda...
from netCDF4 import Dataset, num2date import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' import argparse import ast import gc import logging import math import sys import time import numpy as np import pandas as pd import psutil import tensorflow as t...
from src.features.preprocessing.huawei_traces import HuaweiTracePreprocessor import dataclass_cli import dataclasses import logging import pandas as pd from pathlib import Path from tqdm import tqdm from typing import List, Dict, Set import http import re from .base import Preprocessor from collections import Counter f...
#!/usr/bin/env python3 import time import re import glob import os import platform import sys import unicodedata import urllib.parse import codecs import queue from multiprocessing import Process, Event, Queue from collections import Counter baseDir = os.path.dirname(__file__) sourceDir = os.path.join(baseDir, 'back...
# -*- coding: utf-8 -*- import sys import numpy as np import time from utils import print_bracketing, check_dir import argparse import torch import os.path import re import matplotlib import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec class Saver(): """ Handles the saving of checkpoints a...
#!/usr/bin/env python # coding:utf8 # Copyright (c) 2018, Tencent. All rights reserved # This file contain DataProcessor class which can # 1. Generate dict from train text data: # Text format: label\t[(token )+]\t[(char )+]\t[(custom_feature )+]. # Label could be flattened or hierarchical which is separat...
from __future__ import print_function import argparse import glob import io import os import subprocess as sp import sys from collections import defaultdict from itertools import chain import networkx as nx import requests import yaml from conda_build import api # ----------------------------------------------------...
""" Likelihood maximization script. This program is designed to be entirely separable from ATESA in that it can be called manually to perform likelihood maximization to user specifications and with arbitrary input files; however, it is required by ATESA's aimless shooting information error convergence criterion. """ i...
import numpy as np import gzip from Bio import SeqIO from pathlib import Path import os import subprocess import tarfile from io import BytesIO #for parallel computing from joblib import Parallel, delayed import multiprocessing num_cores_energy = multiprocessing.cpu_count() from tqdm import tqdm import pandas as pd imp...
# encoding: utf-8 import os import re import sys import gzip import time import json import socket import random import weakref import datetime import functools import threading import collections import urllib.error import urllib.parse import urllib.request import collections.abc import json_dict from . import util...
# Reference/tutorial to take a look at # https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__py_ref__tasks_2_assign_rigid_body_8py_example_html # https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__files_GUID_A1189AA0_3816_4350_B8F3_5383DEC25A33_htm # https://mocappys.com/complete-guide-to-poses-in-motionbuilder...
#!/usr/bin/env python3 import sys import os import argparse import time import serial import csv import math import pickle from collections import defaultdict import numpy as np from sklearn.decomposition import PCA, FastICA from sklearn.svm import SVC # Graph WINDOW_WIDTH = 800 WINDOW_HEIGHT = 800 PLOT_SCROLL = 3 ...
# -*- coding: utf-8 -*- import csv import logging as logmodule import math import os import sys import tempfile from collections import OrderedDict # On OS X, the default backend will fail if you are not using a Framework build of Python, # e.g. in a virtualenv. To avoid having to set MPLBACKEND each time we use Studi...
# -*- coding: utf-8 -*- from settings import * from messages import * from functions import * import time import random import sqlite3 from aiogram import asyncio from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils import executor from aiogram.utils.helper import Helper, HelperMo...
# -*- coding: utf-8 -*- """ Helper functions to organize CHDI imaging data Created on Fri Jan 15 11:07:53 2016 @author: <NAME> Python Version: Python 3.5.1 |Anaconda 2.4.1 (64-bit) """ import glob as gl import pandas as pd import numpy as np import os from functools import partial def linear_pred(m,b,x): y = m ...
import salome import SMESH from salome.geom import geomBuilder from salome.smesh import smeshBuilder import sys import math import numpy as np from numpy.linalg import norm from numpy.random import uniform from pathlib import Path from auxiliaryFunctions import clusteringAlgorithm from auxiliaryFunctions import getTr...
#!/usr/bin/python from __future__ import absolute_import import torch import torch.nn as nn from torchvision import transforms from torchvision.models import vgg16_bn from torch.utils.data import Dataset, DataLoader from PIL import Image import numpy as np import matplotlib.pyplot as plt import os from statistics impor...
import argparse import base64 import datetime import hashlib import os import random import sqlite3 import ssl import subprocess import sys import tempfile import threading try: import secrets except ImportError: import string class secrets: def token_urlsafe(size): return (''.join(rand...
#!/usr/bin/env python from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import numpy as np import scipy.io import glob import os import csv import random import tensorflow as tf import transition_model_common as tm # import sys # sys.path.append('./tensorflow_hmm') # import tensorflow_hmm.hmm as hmm ...
# -*- coding: utf-8 -*- # Example package with a console entry point """Reads and formats data from the SWMM 5 output file.""" from __future__ import absolute_import, print_function import copy import datetime import os import struct import sys import warnings from builtins import object, range, str, zip import mand...
""" Module defining transfer functions """ from typing import List, Optional, Dict, Any, Union from pydantic import validator, constr import numpy as np import plotly.graph_objects as go from plotly.subplots import make_subplots from resistics.common import Metadata class Component(Metadata): """ Data class ...
import numpy as np import pandas as pd import sys import re # question type definition S = 0 # [S, col, corr [,rate]] MS = 1 # [MS, [cols,..], [corr,..] [,rate]] Num = 2 # [Num, [cols,..], [corr,..] [,rate]] SS = 3 # [SS, [start,end], [corr,...] [,rate]] # the list of question type and reference # [type, column, ...
#! /usr/bin/env python """ InstrumentData Class -- defines data format, wavelength info, mask geometry Instruments/masks supported: NIRISS AMI GPI, VISIR, NIRC2 removed - too much changed for the JWST NIRISS class """ # Standard Imports import numpy as np from astropy.io import fits import os, sys, time import copy ...
import datetime import os import uuid from os.path import join as opjoin from pathlib import Path import numpy as np import requests import yaml from celery.result import AsyncResult from django.db.models import Q from drf_yasg import openapi from drf_yasg.utils import swagger_auto_schema from rest_framework import mi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 9 15:58:40 2021 @author: <NAME> <<EMAIL>> Try to model data operations on plink files """ import io import re import csv import logging from pathlib import Path from dataclasses import dataclass from tqdm import tqdm from mongoengine.errors imp...
from flask import Flask, render_template, request, redirect, url_for from flaskext.mysql import MySQL app = Flask(__name__) mysql = MySQL() app.config['MYSQL_DATABASE_USER'] = 'root' app.config['MYSQL_DATABASE_PASSWORD'] = '<PASSWORD>' app.config['MYSQL_DATABASE_HOST'] = 'localhost' app.config['MYSQL_DATABASE_DB'] = ...
import warnings import numpy as np import pandas as pd import sklearn from sklearn import metrics class MetricCatalog: catalog_dict = { 'accuracy': { 'func': metrics.accuracy_score, 'params': {}, 'require_score': False, 'binary': True, 'multi': ...
"""Collection of loss and metric functions and classes. A good overview and collection can be found e.g. here: https://lars76.github.io/neural-networks/object-detection/losses-for-segmentation/ *(the contained code samples are quite instructive but in tensorflow, thus not used here)*. """ # Copyright (c) 2020 Contine...
# import json import copy import itertools import multiprocessing import os import sys import time from functools import partial import numpy as np from numpy import linalg from tqdm import tqdm import rmsd import quantum import clockwork import merge import similarity_fchl19 as sim from chemhelp import cheminfo fro...
# Copyright (c) 2012-2020 Jicamarca Radio Observatory # All rights reserved. # # Distributed under the terms of the BSD 3-clause license. """Base class to create plot operations """ import os import sys import zmq import time import numpy import datetime from collections import deque from functools import wraps from ...
#!/usr/bin/env python3 import argparse import os import re import shlex import subprocess from collections import defaultdict, namedtuple ###################################################################### # Common actions that may be reused for multiple devices. # # Need help? Try these: # * xinput --help # * ma...
#! /usr/bin/env python3 """ %(prog)s takes a fault injection executable and executes it Usage: %(prog)s --CLI/--GUI <fault injection executable> <the same options that you use to run the excutable before> %(prog)s --help(-h): show help information Prerequisite: 0. You need to specify --CLI or --GUI dependin...
r""" Echelle Spectrum ---------------- An abstract base class for a high resolution spectrum, for some echelle order :math:`m \in ` out of :math:`M` total orders, each with vectors for wavelength, flux, and uncertainty, e.g. :math:`F_m(\lambda)`. This class is a subclass of specutils' Spectrum1D and is intended to ha...
import json import logging import os import re from collections import namedtuple from copy import deepcopy from typing import Any, Dict, List, Tuple import numpy as np import pandas as pd import spacy from scirex_utilities.analyse_pwc_entity_results import * from scirex_utilities.entity_utils import * from spacy.toke...
import numpy as np from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.cross_validation import train_test_split import theanets import climate climate.enable_default_logging() X_orig = np.load('/Users/bzamecnik/Documents/music-processing/music-processing-experiments/c-scale-piano_spectrogram_2...
from collections import namedtuple from itertools import chain from typing import List, Dict, Tuple, Any from valacefgen import utils from valacefgen.vala import VALA_TYPES, VALA_ALIASES, GLIB_TYPES TypeInfo = utils.TypeInfo EnumValue = namedtuple("EnumValue", 'c_name vala_name comment') class Type: def __init_...
import contextlib import glob import io import json import os import re import requests import subprocess import time from dcicutils import ff_utils from dcicutils.beanstalk_utils import get_beanstalk_real_url from dcicutils.command_utils import yes_or_no from dcicutils.env_utils import full_cgap_env_name from dcicuti...
"""Conversion tool from EDF, EDF+, BDF to FIF.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import calendar import datetime import os import re import numpy as np from ...utils import verbose, logger, warn from ..utils import _blk_read_lims from ..base import BaseRaw, _chec...