text stringlengths 6.04k 39.5k |
|---|
#author: baiji
#main trainning procedure for end to end transformoer based asr system
import argparse
import time
import math
from tqdm import tqdm
from utils import instances_handler
from utils.BatchLoader import BatchLoader
from utils import constants
import torch
import torch.nn as nn
import torch.optim as optim
f... |
"""Evaluation"""
from __future__ import print_function
import logging
import time
import torch
import numpy as np
from collections import OrderedDict
from transformers import BertTokenizer
from lib.datasets import image_caption
from lib.vse import VSEModel
logger = logging.getLogger(__name__)
class AverageMeter(ob... |
"""
Utilities for reading data files.
"""
from builtins import bytes, range
from . import datafile, location, dict_entry, parse_csv #@UnresolvedImport
from ..utils import dictionary, funcargparse, string #@UnresolvedImport
import datetime
import re
import numpy as np
_depends_local=[".parse_csv"]
_module_paramet... |
import pyxel, math
import numpy as np
from Helper import *
class Entity:
def __init__(self, game, BLOCK_TYPE: BLOCK_TYPES, STARTING_X: float, STARTING_Y: float, STARTING_VEL_X: float =0, STARTING_VEL_Y: float =0, FALLS: bool =False, PERSISTENT: bool =False) -> None:
self.game = game
self.... |
# Copyright 2020 HPS/SAFARI Research Groups
#
# 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, ... |
"""Module to handling typing using pynput or xdotool
"""
import re
import time
from subprocess import call
from pynput import keyboard
from bwm import CONF, SEQUENCE
from bwm.menu import dmenu_err
def autotype_seq(entry):
"""Return value for autotype sequence
Args: entry - dict
Return: string
... |
# coding=utf-8
import os
import re
import sys
from collections import defaultdict
from copy import deepcopy
from functools import partial
from itertools import chain
from operator import eq, itemgetter, contains
from textwrap import dedent
RAISE = 'RAISE'
class Board(object):
_state = NotImplemented
@classm... |
#!/usr/bin/env python
import argparse
import subprocess
import os
from pyfaidx import Fasta
import time
import sys
from concurrent.futures import ThreadPoolExecutor
import concurrent.futures
import numpy as np
FASTK = False
import textwrap as _textwrap
class LineWrapRawTextHelpFormatter(argparse.RawDescriptionHelpF... |
import torch
import argparse
import os
import random
import shutil
import time
import warnings
from torch import nn
import torch.nn.functional as F
from tool.torch_utils import *
from tool.yolo_layer import YoloLayer
from yolo_loss import Yolo_loss
from torch.utils import mkldnn as mkldnn_utils
from models import Yolov... |
from anytree import Node
import anytree
# Constantes
OPERACOES = ['+', '-', '*', '/', ':=', ':']
NOS_SIMPLES_PODA = [
'acao', 'expressao', 'expressao_logica', 'expressao_simples', 'expressao_aditiva',
'expressao_multiplicativa', 'expressao_unaria', 'operador_relacional',
'operador_logico', 'operador_neg... |
from __future__ import unicode_literals
from ..elements.elementbase import ElementBase, LogicElement, Attribute
from ..tags.context import DataSetter
from .. import logic
from .. import errors
from ..elements.attributetypes import *
from ..contextenum import ContextEnum
from ..compat import iteritems, text_type, reload... |
# include the functions that relate to Hamiltonian's and gates
import numpy as np
import scipy.sparse.linalg as la
from TensorBasicModule import cont
from BasicFunctions import combination
import copy
def spin_operators(spin):
op = dict()
if spin == 'half':
op['id'] = np.eye(2)
op[... |
from __future__ import print_function
from __future__ import absolute_import
from past.builtins import basestring
import numpy
import math, time, datetime, calendar
import ephem, pytz
from moby2.util import constants
def _fixed( ra, dec ):
f = ephem.FixedBody()
f._ra = ra
f._dec = dec
return f
class... |
import csv
import os
from itertools import product
from tempfile import TemporaryDirectory, NamedTemporaryFile
from unittest.mock import patch
import numpy as np
import pandas as pd
import pytest
from Bio import SeqIO
from Bio.Alphabet import generic_alphabet
from Bio.Alphabet import generic_dna, generic_rna
from Bio.... |
# -*- coding: utf-8 -*-
import datetime
import functools
import logging
import random
import iso8601
import munch
from oslo_utils import netutils
from oslo_utils import uuidutils
import pytz
import shade
from voluptuous import All
from voluptuous import Any
from voluptuous import Length
from voluptuous import Requir... |
"""
financial_optimizers.py
"""
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import minimize
# my modules
from general_tools import progression_bar_str
def total_allocation_constraint(weight, allocation: float, upper_bound: bool = True):
"""
Used for inequal... |
# Copyright 2017 The Tensor2Tensor 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 ... |
"""
GridToolsUi - An example GUI tool for
working with "powers of two" grid sizes in Maya
Originally Written by <NAME>
"""
import traceback
import pymel
import pymel.all as pm
import maya
import maya.cmds
import maya.cmds as cmds
class T33d_GridToolsFuncs(object):
_Instance = None
@classmethod
... |
import estring.estring as eses
import elist.elist as elel
import conjugar.symmtera as symm
import conjugar.araq as araq
import spaint.spaint as spsp
import copy
class Help():
def __init__(self):
self.DI_U = '''
<diacritic> <U-diaeresi> <ü>
https://en.wikipedia.org/wiki/Umlaut_(diacr... |
# Copyright (c) 2018 The Regents of the University of Michigan
# and the University of Pennsylvania
#
# 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 li... |
from os.path import exists
import cwiid
import time
import numpy as np
import cv2
from scipy import optimize as opt
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use("tkagg")
import final as ff
import asyncio
from multiprocessing import Process, Queue, Manager
manager = Manager()
last_pos_s = manager.li... |
import ast
import core_logic
import validators as v
# The python 3.8 abstract grammar can be found at:
# https://docs.python.org/3/library/ast.html#abstract-grammar
def make_node(node_name):
def action(cursor_trail, tree, get_user_input):
validator, creator = nodes[node_name]
selected_node = cor... |
from PIL import Image
from math import sqrt
import torch
import os
import csv
import numpy as np
import argparse
import h5py
from torchvision import transforms
from torch.autograd import Variable
def _read_data_handle(_filename):
f = open(_filename, 'r')
csv_file_handle = list(csv.reader(f))
_n_lines = len(csv_file... |
import datetime, logging, os, sys, time
import argparse, json, enum
from dataclasses import dataclass
from enum import Enum
from logging.handlers import RotatingFileHandler
from PIL import Image
from util.common import CallExternalProgramAndGetOutput
#### #### #### #### ####
#### Global constants ####
#### #### ... |
#!/usr/bin/env python3
##########################################################
## <NAME> ##
## Copyright (C) 2019 <NAME>, IGTP, Spain ##
##########################################################
"""
Calls BUSCO software for quality control of annotation and assembly datasets
"""
## useful imports
... |
from abc import ABC, abstractmethod
import gym
from negmas import (
Mechanism,
SAOMechanism,
Issue,
Agent,
MechanismState,
Negotiator,
ResponseType... |
# utility functions used to do chunks of database manipulation. most functions are tailored
# to the specifics of this app
import numpy as np
import pandas as pd
from pandas.tseries.offsets import DateOffset
def create_pop_age_gps():
"""
function specifically for getting England population split by the age g... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import copy
import glob
import logging
import mako.template
import multiprocessing
import os
import platform
import shutil
import subprocess
import sys
import tarfile
import yaml
from itertools import chain
try:
from urllib.request import ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 5 12:07:18 2021
@author: <NAME>
Email: <EMAIL>
"""
import time
import os
import scipy.io as sio
import numpy as np
from numpy import genfromtxt
import pandas as pd
import matplotlib.pyplot as plt
import nibabel as nib
import pandas as pd
from eslearn.machine_learning.ne... |
"""
Python tools and algorithms gathered through out the development projects and tutorials.
Sections:
1. File Read/Write/Convert/Save Operations
2. Pandas Utils
3. Path Operations for File/Folder/System
4. Algorithms for Hierarchical Structures
5. Utility functions for xlrd library and read_spir function
"""
import... |
import tensorflow as tf
import tensorflow_probability as tfp
from sklearn.cluster import KMeans
import time
from tqdm import tqdm
import numpy as np
tfd = tfp.distributions
tfm = tf.math
class CPGaussian(tf.keras.Model):
def __init__(self, K, M, seed = None):
super(CPGaussian, self).__init__()
... |
import os
use_gpu = True
# set the number of GPU before importing torch (this fixes some strange bugs)
ngpu = 0
if use_gpu:
cuda_visible="0,1,2"
gpu_id = range(len(cuda_visible.split(',')))
ngpu = len(gpu_id)
os.environ['CUDA_VISIBLE_DEVICES'] = cuda_visible
import torch.utils.data
import numpy as np
... |
from __future__ import annotations
import json
import operator as ops
from typing import Any, Sequence
import attr
import aiger_bv as BV
import aiger_coins as C
import aiger_discrete as D
from bidict import bidict
from fractions import Fraction
from aiger_jani.utils import atom, mux, par_compose, min_op, max_op, min... |
import sys
import traceback
import copy
from pprint import pprint
import pandas as pd
from table import *
import time
import logging
from table_ast import (HOLE, Node, Table, Select, Filter, GroupSummary,
GroupMutate, Mutate_Arithmetic, Join,
n_program_search, run_time, n_... |
# ========================================================================================
#
# Description:
#
# Compiles Hack ASM (assembly) code to Hack BIN (binary) code
# Uses the vanilla TECS specification
#
# Attribution:
#
# Code by www.jk-quantized.com
#
# Redistribution and use of this code ... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import collections
i... |
import os
import argparse
import resource
import math
import random
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras as keras
###############################################################################
# CLI argument parser
parser = argparse.ArgumentParser()
parser.add_arg... |
"""
Created By : <NAME>
LinkedIn :
Icon By : https://www.flaticon.com/authors/freepik
"""
import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QAction, qApp, QFileDialog
from checksum import *
from pyqt_creator import *
class checksum_window(QMainWindow):
"""
Checksum Window Cl... |
import os
import sys
import threading
import time
sys.path.append(os.path.join(os.path.dirname(__file__),'../../../pcg/GpioUtil'))
import RPi.GPIO as io
from BitGrid import BitGrid
from ShiftRegister import ShiftRegister
debug = True
def printDebug( *more ):
if debug:
print(*more)
# letters copied from http://w... |
"""
Alternative implementations of segmented regression routines.
"""
# Author: <NAME>
# License: BSD 3 clause
import numpy as np
from segreg.model.alt import regression_alt, likelihood_util
try:
from numba import jit
except ImportError as e:
from segreg.mockjit import jit
################################... |
# -*- coding: utf-8 -*-
# Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Test suite for valuerep.py"""
import copy
from datetime import (
datetime,
date,
time,
timedelta
)
from pydicom.tag import Tag
from pydicom.values import convert_value
import pydicom
import platform
from p... |
from collections import namedtuple
from itertools import izip
from operator import attrgetter
from tilequeue.log import LogCategory
from tilequeue.log import LogLevel
from tilequeue.log import MsgType
from tilequeue.metatile import common_parent
from tilequeue.metatile import make_metatiles
from tilequeue.process impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Contract) on 2019-07-29.
# 2019, SMART Health IT.
import sys
from dataclasses import dataclass
from typing import ClassVar, Optional, List
from .fhirabstractbase import empty_list
from .ann... |
#! /usr/bin/env python3
"""
Sync Valheim world files between the local Valheim worlds directory and a Google Drive folder.
Copyright <NAME>, August 2021.
Licensed under the MIT License.
"""
import glob
import io
import os
import os.path
import sys
from datetime import datetime, timezone
from enum import Enum
from o... |
#!c:/python36/python.exe
import cgi,cgitb
import os
import sys
import subprocess
import time
import sqlite3
import re
cgitb.enable()
def start_page():
print('''<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>idX MS/MS to PSM p... |
#Embedded file name: ACEStream\Core\DecentralizedTracking\pymdht\plugins\routing_nice_rtt.pyo
import random
import heapq
import logging
try:
import core.ptime as time
import core.identifier as identifier
import core.message as message
from core.querier import Query
import core.node as node
from ... |
"""Assortment of layers for use in models.py.
Author:
<NAME> (<EMAIL>)
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from util import masked_softmax
class Embedding(nn.Module):
"""Embedding layer used by BiDAF... |
"""Handle entities of the maze."""
from __future__ import annotations
from typing import List, Tuple, cast
import pygame.surface
import pygame.rect
import pygame.transform
from . import TILE_SIZE, inflate_to_reality
from . import view
from ..designpattern import event
from ..designpattern import observer
from ..mod... |
# Python standard library
from typing import Iterator, Optional, Union
# 3rd party library imports
# Rosetta library imports
from pyrosetta.distributed.packed_pose.core import PackedPose
from pyrosetta.distributed import requires_init
from pyrosetta.rosetta.core.pose import Pose
# Custom library imports
@requires_i... |
#=========== pakages/modules that are used here ==============================
#import from Python standard modules
import colored
from colored import stylize
import requests
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
import pandas as pd
from os import path
import statsmodels.api as sm
imp... |
from google.appengine.ext import ndb, db
import re, urllib, random, string, hashlib, hmac
class Users(ndb.Model):
username = ndb.StringProperty(required=True)
password = ndb.StringProperty(required=True)
email = ndb.StringProperty(required=True)
pronouns = ndb.StringProperty(required=True)
joined ... |
__author__ = 'agrotov'
import itertools
import numpy as np
import lasagne
import theano
import theano.tensor as T
import time
from itertools import count
import query
import os
from scipy.sparse import dok_matrix
from scipy.special import expit
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
... |
########################################################################################
# ASSIGNMENT 1
# <NAME>
# Goal: refresher of Python and hands-on experience with file input/output, built-in data
# structures (especially dictionaries), and string manipulation.
############################################... |
# Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# <NAME>
from __future__ import division, absolute_import, print_function
import os, signal
import warnings
import sys
import subp... |
"""Utilities for Processing Replies to Domain Read Requests."""
import base58
import base64
import hashlib
import json
from binascii import hexlify
from copy import deepcopy
from .utils import audit_path_length
from .constants import (
ACCUM_FROM,
ACCUM_TO,
ALL_ATR_KEYS,
LAST_SEQ_NO,
VAL,
VALU... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Functions that handle saving and loading of checkpoints."""
import copy
import numpy as np
import os
import pickle
from collections import OrderedDict
import torch
from fvcore.common.file_io import PathManager
import sl... |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... |
from powderday.nebular_emission.abund import getNebAbunds
from powderday.nebular_emission.ASCIItools import *
from powderday.nebular_emission.cloudy_tools import air_to_vac, calc_LogQ, convert_metals
import powderday.config as cfg
from astropy import constants
import logging
import numpy as np
import os
from scipy.inte... |
import asyncio
import importlib
import json
import signal
import sys
from concurrent.futures import ThreadPoolExecutor
from os import path
from pathlib import Path
from typing import Any
from time import sleep
from aiohttp import web
from Firefly import aliases, logging, scheduler
from Firefly.const import COMPONENT_... |
#!/usr/bin/python
from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
import sys
import difflib
import errno
import filecmp
import functools
import io
import json
import logging
import os
import shlex
import shutil
import click
from watch_hook import WatchHook
# Use this instead of click.option
clic... |
#!/usr/bin/env python3
# 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
... |
from expdir_monitor.arch_manager import ArchManager
from meta_controller.base_controller import Vocabulary, EncoderNet, WiderActorNet, DeeperActorNet
from meta_controller.rl_controller import ReinforceNet2NetController
from time import gmtime, strftime, time
from datetime import timedelta
from models.layers import Conv... |
__author__ = 'max'
import torch
import torch.nn as nn
import torch.nn.functional as F
def MaskedRecurrent(reverse=False):
def forward(input, hidden, cell, mask, train=True, dropout=0):
"""
:param input:
:param hidden:
:param cell:
:param mask:
:param dropout: step之... |
#!/usr/bin/env python
#
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: train.py
import argparse
import itertools
import numpy as np
import shutil
import cv2
import six
assert six.PY3, "FasterRCNN requires Python 3!"
import t... |
# vim:ts=4:sw=4:sts=4:et
# -*- coding: utf-8 -*-
"""
Shape drawing classes for igraph
Vertex shapes in igraph are usually referred to by short names like
C{"rect"} or C{"circle"}. This module contains the classes that
implement the actual drawing routines for these shapes, and a
resolver class that determines the appr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: <NAME> (<EMAIL>)
# @Date: 2019-03-10
# @Filename: scheduler.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: <NAME> (<EMAIL>)
# @Last modified time: 2019-03-13 11:37:17
#import line_profiler
impor... |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from datetime import datetime, timedelta
import os
import yaml
from collections import defaultdict
f... |
import base64
import importlib
import numpy as np
from openpathsampling.integration_tools import is_simtk_quantity, unit
import math
import abc
from uuid import UUID
import ujson
import marshal
import types
import opcode
from .base import StorableObject
from openpathsampling.tools import word_wrap
from .cache im... |
"""
Logic for uploading to S3 per Cloudformation Specific Resource
"""
# pylint: disable=no-member
# Copyright 2012-2015 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... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
'''
(C) 2014-2019 <NAME> and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
'''
import os
import platform
import json
import logging
import webbrowser
import socket
from uuid import uuid1
from copy import deepcopy
from threading import Semaphore, Event
from webview import _debug, _user_ag... |
"""
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Refer: https://github.com/ghimiredhikura/Complex-YOLOv3
# Source : https://github.com/jeasinema/VoxelNet-tensorflow/blob/master/utils/utils.py
"""
import sys
import math
import numpy as np
import torch
sy... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This bot obtains a list of recentchanges and newpages and marks the
edits as patrolled based on a whitelist.
See http://en.wikisource.org/wiki/User:JVbot/patrol_whitelist
The following parameters are supported:
¶ms;
"""
#
# (C) Pywikipedia bot team, 2011-2013
#
# Di... |
"""
Classes and functions for upload.
"""
import uuid
import psqlgraph
import flask
import sqlalchemy
from psqlgraph.exc import ValidationError
from sheepdog import dictionary
from sheepdog import models
from sheepdog.auth import authorize
from sheepdog.errors import AuthZError, InternalError
from sheepdog.globals i... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.model.document import Document
from frappe.utils.background_jobs import enqueue
from frappe.utils import get_url, get_datetime
from frappe.desk.form.utils import get_pdf_link
from frappe.utils.ver... |
# Copyright 2018 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 applica... |
from dataclasses import dataclass
from typing import Dict, List, Optional, Any, Set
from hologram import JsonSchemaMixin, ValidationError
import dbt.deprecations
import dbt.exceptions
import dbt.flags as flags
import dbt.clients.gcloud
import dbt.clients.agate_helper
import dbt.links
from dbt.adapters.base import (
... |
import io
import mimetypes
from googleapiclient import errors
from googleapiclient.http import MediaIoBaseUpload
from functools import wraps
from .apiattr import ApiAttribute
from .apiattr import ApiAttributeMixin
from .apiattr import ApiResource
from .apiattr import ApiResourceList
from .auth import LoadAuth
BLOCK_... |
'''
Deviants
--------
'''
import sys
from typing import List, Optional, Tuple, Union
import numpy as np
import scipy.sparse as sparse # type: ignore
import scipy.stats as stats # type: ignore
from anndata import AnnData
import metacells.parameters as pr
import metacells.utilities as ut
if not 'sphinx' in sys.argv... |
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... |
""" A set of utility functions related to plotting
"""
import matplotlib as mpl
import matplotlib.cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import skimage.color
def grouped_bar(features, bar_labels=None, group_l... |
# 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, ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import flags
import os
import collections
import numpy as np
import json
import random
import tensorflow as tf
import sentencepiece as spm
from xlnet.data_utils import SEP_ID, CLS_ID
from xlnet impo... |
import os, sys, datetime, time, resource, argparse, shutil, signal
from subprocess import Popen, PIPE, DEVNULL, STDOUT
from enum import Enum
version=2.0
start_time = time.time()
cmdSuffix = ""
maxWorkers = 8
optSuffix = " "
commands = []
commandsRun = []
disableNew = False
numW = 0
processes = {}
DEFAULT_TOP="-"
DE... |
# Copyright (c) 2021 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... |
# coding=utf-8
# pylint: disable-msg=E1101,W0612
from datetime import datetime, timedelta
import sys
import numpy as np
import pandas.compat as compat
from pandas.compat import lrange, range, u
import pandas as pd
from pandas import (
Categorical, DataFrame, Index, Series, date_range, option_context,
period... |
# -*- coding: utf-8 -*-
# (c) 2009-2020 <NAME> and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 <NAME>.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
WSGI middleware for HTTP basic and digest authentication.
Usage::
from ht... |
import sys
import asyncio
from urllib.parse import urlparse, urlunparse, urljoin
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures._base import TimeoutError
from functools import partial
from typing import Set, Union, List, MutableMapping, Optional
import pyppeteer
import requests
from pyquery ... |
from datetime import datetime
from utilities.config import database
from utilities.common_methods import getDebugInfo
from utilities import log
from utilities.common_methods import Methods as methods
from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import Integer, Float, Date, String, Boolean
from sqla... |
from test.test_support import (findfile, TESTFN, unlink, captured_stdout,
run_unittest)
import unittest
from test import audiotests
import os
import io
import sys
import struct
import aifc
class AifcTest(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSourceFile):
... |
"""
Core
====
"""
import os
import logging
import time
import weakref
import pathlib
import sys
import grpc
from ansys.grpc.dpf import base_pb2, base_pb2_grpc
from ansys.dpf.core.errors import protect_grpc
from ansys.dpf.core import server as serverlib
from ansys.dpf.core import misc
from ansys.dpf.core.common import... |
import argparse
import math
import os
from heapq import heappush, heappop, heappushpop
import matplotlib.pyplot as plotter
import numpy as np
import pandas as pd
from scipy.stats import rankdata
from sklearn.metrics import roc_auc_score, roc_curve
def parse_args():
parser = argparse.ArgumentParser()
parser.... |
"""
Copyright (C) 2018 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
#from torch.utils.serialization import load_lua
from torch.utils.data import DataLoader
from torch.autograd import Variable
from torch.optim impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
python capsc13preprocess_resnet.py --dataset msvd --cpu
RGB instead of BGR
crop then resize. 240:320=>240:20-300=>224:224
nohup python preprocess2.py --filename res_train_ --datasetaddr /home/amirhossein/Desktop/implement/dataset/msrvtt/msrvtt3/TrainValVideo/video{}.... |
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.modules.module_util as mutil
import models.modules.Wavelet as common
import torch.nn.init as init
import models.modules.pac as pac
# try:
# from models.modules.dcn.deform_conv import ModulatedDeformConvPack ... |
from datetime import datetime
import actstream.actions
import django_filters
import json
from django_filters.rest_framework import DjangoFilterBackend
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from rest_framework import serializers, viewsets, per... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 28 13:12:52 2020
@author: henning
"""
import functools
from dataclasses import field
from flax import linen as nn
from flax import optim
import jax.numpy as jnp
import jax
from jax.scipy.special import logsumexp
import numpy as np
import time
... |
# SPDX-FileCopyrightText: 2015-2018 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
``adafruit_pn532``
====================================================
This module will let you communicate with a PN532 RFID/NFC shield or breakout
using I2C, SPI or UART.
* Author(s): Original Raspberry Pi code... |
import os
import math
import argparse
import random
import logging
import numpy as np
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from data.data_sampler import DistIterSampler
from data.util import bgr2ycbcr
import options.options as option
from utils import util
from data import c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.