text
stringlengths
6.04k
39.5k
import matplotlib from matplotlib.collections import PatchCollection import matplotlib.cm from matplotlib.axes import Axes import matplotlib.transforms as transforms from matplotlib import pyplot as plt from matplotlib import rc from shapely.geometry import Polygon from collections import OrderedDict, defaultdict impor...
# Copyright 2013-2014 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
import sys from random import choice, randint, random from inspect import signature import math import pyglet from pyglet.window import key import pymunk import pymunk.pyglet_util from .wrapper import BodyShapeWrapper options = pymunk.pyglet_util.DrawOptions() toplevel = sys.modules["__main__"] class Config: ...
import numpy as np import os from copy import deepcopy import datetime import networkx as nx from sqlalchemy import Column, DateTime, String, Boolean, Float, Integer, LargeBinary, ForeignKey, func, JSON, PickleType from sqlalchemy.orm import relationship, backref, validates from sqlalchemy.ext.declarative import decla...
import torch import torch.optim import torch.nn import collections import logging import numpy as np import numbers import os import time import itertools try: from torch.cuda.amp import autocast except ModuleNotFoundError: # PyTorch version did not support autocast autocast = None # type: ignore from .....
from tensorflow import keras from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dropout, Dense, Concatenate, GlobalAveragePooling1D from tensorflow.keras import Input, Model from tcn import TCN from keras.callbacks import EarlyStopping import tensorflow as tf import numpy as np imp...
# Created by <NAME>, <NAME> Scientific # import modules import xml.etree.cElementTree as etree from .converter import register, ValueConverter @register("ED0FB1D9-4E07-47E1-B96C-4013B9AFE534") class MassSpectrumConverter(ValueConverter): """ The pyeds.MassSpectrumConverter is used to convert mass spectrum d...
# -*- coding: utf-8 -*- # vim: set ft=python ts=4 sw=4 expandtab: """ SmartThings API client. Note that all of the public functions in this class that interact with an API are expected to be invoked from within a SmartThings context, like: with SmartThings(pat_token="token", location="My House"): set_swi...
#!/usr/bin/python import sys, string from random import choice import random from string import ascii_lowercase from scipy.stats import beta, uniform import numpy as np import struct import pandas as pd import math import data_gen_utils ############################################################################ # N...
''' HELM classifier library ''' import os, sys import os.path as op import glob import pickle import logging import csv import json from pathlib import Path from tqdm import tqdm import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier from sklearn import metrics from skle...
""" Test unpacking structs """ import io import struct import pytest import six from pcapng.exceptions import ( BadMagic, CorruptedFile, StreamEmpty, TruncatedFile) from pcapng.structs import ( IntField, ListField, NameResolutionRecordField, Option, Options, OptionsField, PacketBytes, RawBytes, read_bloc...
import itertools import json import os import socket import subprocess import threading import tempfile import re import requests from flask import Flask, request # ImportError? Try "pip install flask". app = Flask(__name__) handler = object() # Dict key cookie composite_file = os.path.dirname(os.readlink(__file__)) ...
#!/usr/bin/env python """Read a set of yaml files with fit results and plot sensitivity to neutrino mass hierachy (NMO) It expects the fit data: the model (IO) fit against asimov prediction of model with NO hypothesis """ from matplotlib import pyplot as plt from yaml import load, Loader from mpl_tools.helpers impo...
# coding=utf-8 # # Copyright 2016 timercrack # # 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...
#!/usr/bin/python # Copyright (c) 2003-2012 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # $Id: psexec.py 712 2012-09-06 04:26:22Z <EMAIL> $ # # PSEXEC like functionality exa...
# MIT License # 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, publish...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
########################################## # File: fit_uniform_bspline.py # # Copyright <NAME> 2014. # # Distributed under the MIT License. # # (See accompany file LICENSE or copy at # # http://opensource.org/licenses/MIT) # ########################################## # Imports from __future__ im...
#****************************************************************************** # * Copyright (c) 2019, XtremeDV. 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 ...
# -*- coding: utf-8 -*- """ werkzeug.testsuite.formparser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the form parsing facilities. :copyright: (c) 2011 by <NAME>. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from StringIO import StringIO from os....
import json import logging import re from django import http from django.contrib.auth import login, authenticate, logout from django.contrib.auth.mixins import LoginRequiredMixin from django.db import DatabaseError from django.shortcuts import render, redirect from django.urls import reverse from django.views import V...
from django.shortcuts import render, HttpResponse from django.http import JsonResponse import re import tweepy from tweepy import OAuthHandler from textblob import TextBlob from newsapi import NewsApiClient import json import random from jack import readers from jack.core import QASetting import os from .custom_tf_idf ...
""" Database schema module """ from abc import abstractmethod from typing import Any, DefaultDict, Dict, Iterator, List, NewType, Optional, Union, Set, Sequence, Tuple, Type import sys import re import weakref from enum import Enum from .syntax.sql_expression import SQLExprType import sqlparse # type: ignore impo...
""" Script to create word2vec models, given a set of mapped POIs. """ # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> import argparse import os import math import errno import pandas as pd import geopandas as gpd from geopandas import GeoDataFrame from shapely.geometry import Point import sys sys.path.append(...
# Copyright 2019 IBM Corporation # # 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, ...
import math from collections import Counter import pytest import torch from neuralpp.inference.graphical_model.representation.factor.pytorch_table_factor import PyTorchTableFactor from neuralpp.inference.graphical_model.representation.table.pytorch_log_table import ( PyTorchLogTable, ) from neuralpp.inference.grap...
#!/usr/bin/python3 import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import Qt, QPoint from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtWidgets import QVBoxLayout, QLabel, QFrame, QSlider from PyQt5.QtWidgets import QPushButton, QComboBox, QSpinBox from PyQt5.QtWidgets import QWidget from PyQ...
""" CSeq C Sequentialization Framework module stubs written by <NAME>, University of Southampton. CSeq's Translator modules are built on top of pycparser, BSD licensed, by <NAME>, pycparser embeds PLY, by <NAME>, maintained by <NAME>, University of Southampton. Naming conventions for introduced variables (use...
import subprocess import pwd import os import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QTime from PyQt5.QtWidgets import QFileDialog from src.ui.mainwindow import Ui_MainWindow from src.ui.settings import Ui_MainWindow as Ui_SettingsWindow from src import yin_yang from src import config class Settings...
import os import re import copy from .helpers import save_json, load_json from .collector import Cluster, CollectionSimple from .content import SimpleContent def create_person(name_tag, people, cluster_pos, root, skipped, ambi, auto_create=True, letter_index_dirs=True): """ a People object is loaded in the ca...
import torch import numpy as np torch.manual_seed(120) from tqdm import tqdm from pytorch3d.loss import chamfer_distance from NURBSDiff.nurbs_eval import SurfEval from NURBSDiff.surf_eval import SurfEval as SurfEvalBS import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from...
import logging import sys import tables import collections import os from tia.trad.tools.io.file_handlers import decoratorLockFile, createDir import tia.trad.market.m as Mm import tia.configuration as Mfn from tia.trad.tools.ipc.naming_conventions import IPC LOGGER_NAME = "rl." + __file__.split("/")[-1]; logger = lo...
""" Neo4j GraphDB flask connector """ import re import socket from datetime import datetime, timedelta from functools import wraps from typing import Any, Callable, Dict, List, Optional, TypeVar, cast import pytz from neo4j.exceptions import ( AuthError, CypherSyntaxError, ServiceUnavailable, Transien...
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. team. # # 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 ...
import re import time import logging import collections from ..vendor.Qt import QtCore, QtGui from ..vendor import Qt, qtawesome from .. import style from . import lib log = logging.getLogger(__name__) class TreeModel(QtCore.QAbstractItemModel): Columns = list() ItemRole = QtCore.Qt.UserRole + 1 item_c...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import List, Optional import torch from torch import nn from fairseq.models import (FairseqEncoder, Fa...
"""! @brief Running an experiment with the improved version of SuDoRmRf on universal source separation with multiple sources. @author <NAME> {<EMAIL>} @copyright University of Illinois at Urbana-Champaign """ import os import sys current_dir = os.path.dirname(os.path.abspath('__file__')) root_dir = os.path.abspath(os...
import boto3 import argparse import logging from botocore.exceptions import ClientError ''' usage: purge.py [-h] -p PROFILE -t TAGS [-d {cloudformation,cloudwatch,dynamodb,ec2,ecs,es,events,lambda,logs,s3,secretsmanager,sns,sqs,states}] [--purge-bucket BUCKET_LIST] [-r REGION] [-c {true...
import os import pytest import tempfile from base64 import b64encode from pathlib import Path from unittest import mock from subprocess import CalledProcessError from charms.layer import openstack def patch_fixture(patch_target): @pytest.fixture() def _fixture(): with mock.patch(patch_target) as m: ...
# LT 21/10 version 1 ## including all the needed functions in same file ## runs very slow. # version 2 import hail as hl; from typing import Optional, Union; ## The functions below are from Konrad's original code # # handles filtering for callrate > 80% # AN_ADJ_FILTER = 0.8 data_type_sex_counts = {...
#Various functions for parsing any ratdb file for reactor information. #TO ADD YOUR OWN CLASS PARSER: # 1. Create a new class that inherits from class ratdbEntry # 2. Write a parseMisc() function that parses out your # RATDB entry's information specific to the RATDB type # 3. Write a buildreacdbEntry() function that...
# -:- encoding: utf-8 -:- # This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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.a...
#!/usr/bin/env python """ Generic python script. """ __author__ = "<NAME>" import glob import os import numpy as np import healpy as hp import scipy.stats import scipy.interpolate import scipy.ndimage import simple_adl.query_dl import simple_adl.projector #-----------------------------------------------------------...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Dict, List, Set import json import numpy as np import os from queue import Queue import random import ...
""" Store configuration in :class:`ConfigNamespace` objects and provide tools for reloading, and displaying help messages. Configuration Reloading ----------------------- Configuration reloading is supported using a :class:`ConfigFacade`, which composes a :class:`ConfigurationWatcher` and a :class:`ReloadCallbackCha...
import os import sys import json import sqlite3 import time import shutil import hashlib from pathlib import Path import dataset import colored import click from flask import current_app, g from flask.cli import with_appcontext from . import AppDB def check_file(f): if isinstance(f, str): f = Path(f) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 31 16:26:50 2019 @author: riccardo """ import nibabel as nib import numpy as np from torch.utils.data import Dataset import torch, torchvision, os, MUNet, tqdm, warnings from scipy.ndimage.morphology import binary_fill_holes from skimage.measure imp...
import collections import json import functools import logging import signal import threading import copy import socket import time import socketserver import http.server from nmtwizard import config as config_util from nmtwizard.logger import get_logger logger = get_logger(__name__) class TranslationOutput(object)...
# -*- coding: utf-8 -*- """ Created on Tue Mar 9 23:12:04 2021 @author: <NAME> """ # ENSEMBLE PREDICTION AND REPORT GENERATION ###################################################################### # MODULE/PACKAGE IMPORT import pandas as pd import numpy as np import math import matplotlib.pyplot as plt from sklea...
import sys import os import imp import wx import GUI3 import Propeller import threading import RepeatTimer import logger # set log level to disable warnings caused by this wxPython bug: http://trac.wxwidgets.org/ticket/15360 wx.Log.SetLogLevel(0) # imports for plugins (for compiling) import Queue #import wx.lib.plo...
import pandas as pd #from GaiaOCprojectCode.isochrones_.iso_gen import MIST_isochrone_class from MIST_isochrone_class import MIST_isochrone_class from matplotlib import pyplot as plt from matplotlib.widgets import Slider, Button from matplotlib.gridspec import GridSpec import numpy as np from matplotlib import rcPara...
#!/usr/bin/env python from avi.sdk.avi_api import ApiSession from avi.sdk.avi_api import APIError import getpass import argparse import sys import json import pprint import time ''' Overview: Accelerated networking has been introduced as an SE group level option in 17.2.14 release. By default all SE groups...
import logging from galaxy import eggs eggs.require('SQLAlchemy') from sqlalchemy import false, or_ import tool_shed.util.shed_util_common as suc from galaxy import util from galaxy.model import tool_shed_install from galaxy.web import url_for from galaxy.web.framework.helpers import iff, grids from tool_shed.util im...
import contextlib import itertools import matplotlib.pyplot as plt import numpy as np import os.path import pandas as pd import seaborn as sb import sys from . import classifiers from . import piquant_options as po from . import resource_usage as ru from . import statistics from . import tpms as t RESOURCE_USAGE_DIR ...
import numpy as np import pandas as pd import dask.dataframe as dd import warnings import os import plotly.express as px import datashader as ds import datashader.transfer_functions as tf from datashader.layout import random_layout, forceatlas2_layout from datashader.bundling import connect_edges, hammer_bundle import...
from math import * from matplotlib import pyplot as plt from matplotlib import colors as col import numpy as np import sys,os def cart_comp(x,y): """ A basic comparison function to insure that layers are selected in terms of larger positive to larger negative """ return int(y-x) def parse_tracer_file(...
import platform import os from conans import ConanFile from conans import tools from conans.tools import os_info, SystemPackageTool from conan.tools.cmake import CMakeToolchain from pathlib import PurePath, PurePosixPath def init_impl( derived_conanfile, base_conanfile, repository, path_CPFCMake='Sourc...
#!/usr/bin/env python2 # coding: utf-8 int_types = (int, long) list_like = (type([]), type(())) compatible_types = { type(None): (type(None), ), int: (type(None), int, ), long: (type(None), int, long, ), float: (type(None), int, long, float, ), str: (type(None), str,)...
from time import sleep from tkinter import image_types import numpy as np import torch from torch import autograd import wandb from dotenv import load_dotenv import os import subprocess import shutil import matplotlib.pyplot as plt from matplotlib.pyplot import cm from torch import nn import tifffile # check for exist...
"""PyTorch Module and Function for scalar wave Born propagator.""" import torch import numpy as np import scipy.signal import deepwave.base.propagator class BornPropagator(deepwave.base.propagator.Propagator): """PyTorch Module for scalar wave Born propagator. See deepwave.base.propagator.Propagator for desc...
# -*- coding: utf-8 -*- """ Created 2021-06-01 ​ @author: <NAME> Adapted from PARARULE Plus Depth-5 generation code; Copyright (c) 2021, <NAME>. All rights reserved. Thanks to Qiming Bao for development of the PARARULE Plus dataset and permission to freely utilise it. ​ Generates AbductionRules datasets and creates tr...
import pandas as pd import numpy as np import time import datetime import random from . import gv from kmodes.kmodes import KModes # from pyspark.sql.functions import PandasUDFType, lit, pandas_udf from .clustering_utils.input_validate import InputValidator # import clustering_utils.input_validate.InputValidator from ...
import re from util import * import argparse # only used for line wrapping in the help def print_help(): # | print(''' Matchers are used throughout the program to show and hide messages. A matcher consists of a comma seporated list of object...
""" ------------------------------------------------------------------------------- Created: 11.02.2021, 12:40 ------------------------------------------------------------------------------- Author: <NAME> Email: <EMAIL> Website: https://becuriouss.github.io/matthieu-scherpf/ Project page: tba -------------------------...
""" The :mod:`sklearn.compose._column_transformer` module implements utilities to work with heterogeneous data and to apply different transformers to different columns. """ # Author: <NAME> # <NAME> # License: BSD import numpy as np from scipy import sparse from ..base import clone, TransformerMixin from ..e...
# Copyright 2019 GreenWaves Technologies, SAS # 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 i...
#!/usr/bin/env python3 import os import re import json import sys from decimal import Decimal from pathlib import Path from typing import List, Set, Dict from clang.cindex import * from ctypes.util import find_library lib_path = '/usr/lib' llvm_lib_dir_regex = re.compile(r'llvm-(?P<ver>\d+([.]?\d+)?)') llvm_lib_ver...
# -*- coding: utf-8 -*- import os from tempfile import mkstemp from PIL import Image, ImageDraw, ImageFont from dipy.data import get_sphere import fury from fury import actor, window from matplotlib.cm import get_cmap import nibabel as nib import numpy as np from dmriqcpy.viz.utils import compute_labels_map, rendere...
from __future__ import division """ This is the loadable seq2seq trainer library that is in charge of training details, loss compute, and statistics. See train.py for a use case of this library. Note!!! To make this a general library, we implement *only* mechanism things here(i.e. what to do), and leave the strategy t...
from __future__ import division from collections import deque import os import warnings import numpy as np import keras.backend as K import keras.layers as layers import keras.optimizers as optimizers from rl.core import Agent from rl.util import * def mean_q(y_true, y_pred): return K.mean(K.max(y_pred, axis=-1...
import numpy as np import skimage import logging import random import warnings import scipy from distutils.version import LooseVersion ############################################################ # Bounding Boxes ############################################################ def extract_bboxes(mask): """Comput...
from collections import namedtuple from random import sample, randint, choice from math import floor, ceil import ccobra from copy import deepcopy import logging import sys rank_order_chater_oaksford = \ ['Some not', 'No', 'Some', 'Few', 'Most', 'All'] rank_order_default = rank_order_chater_oaksford ...
"""Utils for visualization of data and comparison """ import os import math import numpy as np import numpy.testing as npt import matplotlib.pyplot as plt from matplotlib.transforms import Bbox, TransformedBbox, blended_transform_factory from mpl_toolkits.axes_grid1.inset_locator import ( BboxPatch, BboxConnect...
"""Convert epidemic forecasts into JSON files for online viewing.""" import datetime import errno import h5py import json import logging import numpy as np import os.path import pypfilt.summary from . import settings fs_fmt = "%Y-%m-%d %H:%M:%S" d_fmt = "%Y-%m-%d" def dtime(dstr): """Convert datetime strings ...
"""Objects for image simulation with.""" from scipy.signal import chirp from .conf import config from .mathops import engine as e, jinc from .convolution import Convolvable from .coordinates import cart_to_polar, polar_to_cart class Slit(Convolvable): """Representation of a slit or pair of slits.""" def __...
__doc__ = """Muscular snake example from <NAME>. al. Nature Comm 2019 paper.""" import sys import numpy as np sys.path.append("../../") from elastica import * from examples.MuscularSnake.post_processing import ( plot_video_with_surface, plot_snake_velocity, ) from examples.MuscularSnake.muscle_forces import Mu...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011 <NAME> # Distributed under the terms of the new BSD license. # # ---------------------------------------------------------------------------...
import numpy as np import matplotlib.pyplot as plt # <NAME>., <NAME>., <NAME>., and Temperville (2010) # Analytical approximate wave form for asymmetric waves. # Coastal Engineering, 57(7):656-667. # doi: http://dx.doi.org/10.1016/j.coastaleng.2010.02.005. # # <NAME>. and <NAME> (2012) Free-stream velocity descr...
import os import random import sys from dotenv import load_dotenv import characters import items import names import random_lists import shared_functions import traits import wizard from bot import bot as bot from shared_functions import party as party from shared_functions import npcs as npcs from shared_functions i...
import inspect import cProfile import pdb import collections import traceback import logging from functools import partial from os import makedirs, getcwd from os.path import join, abspath, exists, isdir import requests from appdirs import user_data_dir from pyprint.Printer import Printer from coala_utils.decorators ...
from __future__ import annotations import sys from collections.abc import Callable, Container from copy import copy from dataclasses import dataclass, field from functools import lru_cache from typing import TYPE_CHECKING, Any, ClassVar, Literal, NamedTuple, TypedDict import dask from dask.utils import parse_bytes f...
import tkinter as tk import tkinter.ttk as ttk import tkinter.font as tkFont from tkinter import Canvas # , Frame from tkinter.scrolledtext import ScrolledText from tkinter.constants import YES # , BOTH from tkinter import messagebox # import threading # import time class TextBoxLineNumbers(Canvas): def __init...
import os import random import string from collections import OrderedDict from abc import abstractmethod import nuke from openpype.api import get_current_project_settings from openpype.pipeline import ( LegacyCreator, LoaderPlugin, ) from .lib import ( Knobby, check_subsetname_exists, reset_select...
""" 3) For missing novels, add the functionality for pausing the code while it's running and scrape those missing novels first. 4) Sometimes `panels` in the `novel page` have different names for different novels, for them, create a json file for storing what kind of a panel they have. For that save it as "str type"...
import os from typing import Tuple, List, Union, Optional, NamedTuple from enum import IntEnum from modalities import ModalityCollection, RawVideo from datasets.tfrecord_builders import TFRecordBuilder, DataSource from datasets.data_readers.VideoReader import VideoReaderProto class SubwayTFRecordBuilder(TFRecordBuil...
#!/usr/bin/python3 from timeit import default_timer as timer from subprocess import Popen, PIPE, TimeoutExpired from pprint import pprint import os import signal import re import types import argparse import os.path import json import shutil import subprocess import sys import tempfile import resource CONSTANT_NOISE ...
import os import glob import cv2 import datetime import numpy as np import matplotlib.pyplot as plt import zipfile import shutil import fnmatch import sys import math import csv ### FUNCTIONS ### def unpack_to_temp(path_to_zipped, path_to_temp): try: # copy zip file to current working directory #pr...
# Copyright 2021 The T5X 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 writ...
from __future__ import print_function import argparse import os import time import model import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler from datasets.mnist import getmnist, NUM_TRAIN from torchvision import datasets, trans...
""" Functions for writing to .csv September 2020 Written by <NAME> """ import os import pandas as pd import datetime def define_deciles(regions): """ Allocate deciles to regions. """ regions = regions.sort_values(by='population_km2', ascending=True) regions['decile'] = regions.groupby([ ...
# Copyright (c) 2016-2018. Mount Sinai School of Medicine # # 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 applicabl...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
class txtprocess: """ When calling txtprocess class is called a results is required and automatically generate a list of sentence dict for using to generate srt or vtt(WIP) file. Args: results (list): A list of results(dict) obtain from Google Speech to Text API whic...
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB 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...
import matplotlib.pyplot as plt import numpy as np import os import pickle from multicell.multicell_class import Multicell from multicell.multicell_replot import replot_scatter_dots from multicell.graph_helper import state_load from singlecell.singlecell_simsetup import singlecell_simsetup from singlecell.singlecell_l...
# -*- coding: utf-8 -*- """This module contains functions to parse KGML files.""" import itertools as itt import json import logging import os from collections import defaultdict from xml.etree.ElementTree import parse import requests from bio2bel_kegg.constants import API_KEGG_GET from bio2bel_kegg.parsers import ...
import pandas as pd import numpy as np import torch import torch.nn as nn class DecoderAttention(nn.Module): def __init__(self, config, hidden_size=40): super(DecoderAttention, self).__init__() self.hidden_size = hidden_size self.directions = 2 self.linear = nn.Linear(...
import math import random import cv2 import glob import librosa import os from pathlib import Path from audio_extractor import extract_audio_snippets character_map = {0: 'kermit_the_frog', 1: 'waldorf_and_statler', 2: 'pig', 3: 'swedish_chef', 4: 'non...
#################################################################################################### #Intro v = "1.0" f0=(""" ,:++. %#::. .....
import datetime import os import functools import logging import traceback from typing import Any, Dict import pysnooper from flask_appbuilder.forms import GeneralModelConverter from flask import abort, flash, g, get_flashed_messages, redirect, Response from flask_appbuilder import BaseView, ModelView,urltools from fl...