text stringlengths 6.04k 39.5k |
|---|
#!/usr/bin/python3
"""Tests for archivebot.py/Timestripper."""
#
# (C) Pywikibot team, 2014-2022
#
# Distributed under the terms of the MIT license.
#
import datetime
import re
from contextlib import suppress
from pywikibot.textlib import TimeStripper, tzoneFixedOffset
from tests.aspects import TestCase, unittest
Ma... |
import multiprocessing
import multiprocessing.connection
import random
import cv2
import gym
import numpy as np
import torch
import time
import matplotlib.pyplot as plt
from typing import Dict, List
from torch import nn
from torch import optim
from torch.distributions import Categorical
from torch.nn import functional... |
import argparse
import logging
import uuid
from tornado import gen, web
from tornado.escape import json_decode, json_encode
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.options import options
from appscale.common import appscale_info
from appscale.common.constants import (
HTTPCodes,
LOG_FORMA... |
import math, os, json, torch, datetime, random, copy, shutil, torchvision, tqdm
import argparse, yaml
import torch.nn as nn
import torch.optim as Optim
import torch.nn.functional as F
import torch.utils.data as Data
import numpy as np
from collections import namedtuple
from tkinter import _flatten
import torch.distrib... |
# -*- coding: utf-8 -*-
'''
'''
import torch
import os, sys
from torch.nn import functional as F
from easydict import EasyDict as ED
import numpy as np
from packaging import version
if version.parse(torch.__version__) >= version.parse('1.5.0'):
def _true_divide(dividend, divisor):
return torch.true_divi... |
# Copyright 2017 The Forseti Security 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 ap... |
#! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2018 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : utils.py
# Author : YunYang1994
# Created date: 2018-11-22 12:02:52
# Description :
#
#=========================... |
from __future__ import absolute_import
import time
import logging
import click
import cachetools
import itertools
import sys
from copy import deepcopy
from pathlib import Path
from pandas import to_datetime
from datetime import datetime
import datacube
from datacube.api.core import Datacube
from datacube.index.index ... |
"""
This script contains the VAE and HVAE classes. HVAE inherits from VAE
"""
from argparse import Namespace
import pdb
import tensorflow as tf
import numpy as np
class VAE():
"""
Class for implementing the structure of the base VAE
This class contains the following:
- Inference and Generative Ne... |
from numpy.lib.function_base import append
from torch.autograd import grad
import utils as u
import torch
from torch.nn.parameter import Parameter
import torch.nn as nn
import math
from torch.nn import functional as F
class EGCN(torch.nn.Module):
def __init__(self, args, activation, device='cpu', skipfeats=False )... |
import numpy as np
from numpy import array
import matplotlib.pyplot as plt
import os,glob
color=[(223 / 255, 25 / 255, 27 / 255),(54 / 255, 123 / 255, 180 / 255), (75 / 255, 171 / 255, 72 / 255),
(249 / 255, 124 / 255, 0 / 255)]
marker=['o', '^', 's','P']
def sigma_sensitivity(x,y,title='sigma_sensitivit... |
"""
Various functions to help with bboxes for object detection
Everything is covered with tests to ensure correct output and scriptability (torch.jit.script)
Written by @bonlime
"""
import torch
def box2delta(boxes, anchors):
# type: (Tensor, Tensor)->Tensor
"""Convert boxes to deltas from anchors. Boxes are ... |
# pyOCD debugger
# Copyright (c) 2015 <NAME> <<EMAIL>>
# Copyright (c) 2018-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
# %% markdown
# Portfolio Optimization - Risk
# %% add path
if __name__ == '__main__' and __package__ is None:
import sys, os.path
sys.path
# append parent of the directory the current file is in
inputfilename1 = r"C:\Users\<NAME>\Documents\Onedrive\Python scripts\_01 Liam Stock Analysis Project\stock_a... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.math
~~~~~~~~~~~~~~~~~~~~
Lexers for math languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
try:
set
except NameError:
from sets import Set as set
from pygments.l... |
from __future__ import absolute_import
import types
from rpython.annotator.signature import (
enforce_signature_args, enforce_signature_return, finish_type)
from rpython.flowspace.model import FunctionGraph
from rpython.annotator.argument import rawshape, ArgErr, simple_args
from rpython.tool.sourcetools import val... |
import os
import string
from urllib.parse import urlparse
import uuid
import random
from docker.errors import APIError, NotFound
from escapism import escape
from remoteappmanager.docker.async_docker_client import AsyncDockerClient
from remoteappmanager.docker.container import Container
from remoteappmanager.docker.doc... |
#!/usr/bin/env python3
'''
backup.py
=========
Generador de copias de respaldo incrementales e históricas.
por <NAME>
https://drmad.org
Genera copias de seguridad incrementales de cada ruta especificada, dentro de
la carpeta destino. Comprime los ficheros y preservan dueños y permisos.
Debería de trabaja en cualquie... |
#!/usr/bin/env python
"""
This script is the does same function as resilient_coverage.py.
This script contains the functions to perform multi processing
"""
from __future__ import print_function
from get_rad_tune import get_rad_tune
import argparse
import os
import os.path
import math
import multiprocessing as mult... |
import torch
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from skimage import measure
from deepqmc.solver.plot_data import plot_observable
def regular_m... |
"""
Training script for scene graph detection. Integrated with Rowan's faster rcnn setup
"""
from dataloaders.visual_genome import VGDataLoader, VG, build_graph_structure
import numpy as np
from torch import optim
import torch
import pandas as pd
import time
import os
from config import ModelConfig, BOX_SCALE, IM_SCA... |
"""Compilation of functions used for data processing."""
import os
import yaml
from itertools import compress
from datetime import datetime
import pandas as pd
import numpy as np
from ideotype.utils import get_filelist
from ideotype import DATA_PATH
def read_sims(path):
"""
Read and condense all maizsim raw... |
"""
Functions for generating bootstrapped error bars
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Governm... |
# ModelSwarm.py
import Tools
from Agent import *
import commonVar as common
common.worldStateExist = True
try:
from WorldState import *
except BaseException:
common.worldStateExist = False
from ActionGroup import *
if common.kernelUsesNumpyRandom: import numpy.random as random
else: import random
import os
impo... |
# coding=utf-8
# Copyright 2021 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... |
# Copyright (C) July 2018: TF TECH NV in Belgium see https://www.threefold.tech/
# In case TF TECH NV ceases to exist (e.g. because of bankruptcy)
# then Incubaid NV also in Belgium will get the Copyright & Authorship for all changes made since July 2018
# and the license will automatically become Apache v2 for al... |
from collections import OrderedDict
from functools import reduce
from typing import Callable, List, Dict, Union, Optional, Tuple, Sequence, TypeVar
import copy
import onnx # type: ignore
import onnx.helper # type: ignore
import onnx.shape_inference # type: ignore
import onnx.numpy_helper # type: ignore
import onn... |
#!/usr/bin/env python
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2016 <NAME> <<EMAIL>>
# -------------------------------------------------------------------------
#
# Utility to dump PMD_INFO_STRING support from an object file
#
# -------------------------------------------------------------------------
f... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import os
# Define conversions in x and y from pixels space to meters
ym_per_pix = 30/720 # meters per pixel in y dimension
xm_per_pix = 3.7/600 # meters per pixel in x dimension
def undistort_image(image, mtx, dist):
"""Undistort the image based on ca... |
# Imports
import os
import h5py
import numpy as np
from collections import Counter, defaultdict, namedtuple
# Keras Imports
import keras.backend as K
# Package Imports
from . import defines
from . import tensor_maps
READ_ELEMENTS = 8
Read = namedtuple("Read", "seq qual cigar reverse mate_reverse first mapping_qualit... |
# Copyright (C) 2019 GreenWaves Technologies
# All rights reserved.
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
# Copied from TOCO code to reference orders
# // Helper to deal with TensorFlow arrays using a different ordering of
# // dimensi... |
# Copyright: (c) 2020, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type # noqa (fixes E402 for the imports below)
import collections
import datetime
import struct
from sp... |
# coding=utf-8
""" Google Earth Engine collections """
import ee
from .. import indices, bitreader
from datetime import date
from .. import tools
TODAY = date.today().isoformat()
# HELPERS
def allequal(iterable):
""" Check if all elements inside an iterable are equal """
first = iterable[0]
rest = iterab... |
# This Python module is part of the PyRate software package.
#
# Copyright 2021 Geoscience Australia
#
# 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/... |
'''
Class for the DeepHyperNEAT genome and genes.
Largely copied from neat-python. (Copyright 2015-2017, CodeReclaimers, LLC.),
though heavily modified for DeepHyperNEAT.
'''
import numpy as np
from itertools import count
from deep_hyperneat.util import iteritems,itervalues,iterkeys
from random import choice, randint
... |
from infer_detectron2_densepose import update_path
from ikomia import core, dataprocess
import copy
import numpy as np
import cv2
import os
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.structures.boxes import BoxMode
from infer_detectron2_densepose.DensePose_git.d... |
import heterocl as hcl
import time
from computeGraphs.CustomGraphFunctions import *
############################## 6D DERIVATIVE FUNCTIONS #############################
def spa_derivX6_6d(i, j, k, l, m, n, V, g): # Left -> right == Outer Most -> Inner Most
left_deriv = hcl.scalar(0, "left_deriv")
right_deriv... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Tests for pg_agent."""
from collections import Counter
from absl import logging
import numpy as np
from six.moves import xrange
import tensorflow as tf
from research.brain_coder.common import utils # bra... |
import csv
import json
import operator
import collections
def load_json(filename):
with open(filename, 'r') as f:
return json.load(f)
def csv_to_dict(file_path):
object_list = []
with open(file_path) as f:
for row in csv.DictReader(f, skipinitialspace=True):
object_dict = {}
for key, val in... |
import discord,os,datetime,re,asyncio,copy,unicodedata,inspect,psutil,sys
from discord.ext.commands.cooldowns import BucketType
from collections import OrderedDict, deque, Counter
from discord.ext import commands
import json
class TimeParser:
def __init__(self, argument):
compiled = re.compile(r"(?:(?P<hour... |
import os
import math
import yaml
import lmdb
import numpy as np
import torch
import wandb
import carla
import random
import string
from torch.distributions.categorical import Categorical
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
from leaderboard.autoagents.autonomous_agent import Auton... |
# GUM: GAMBIT Universal Models Machine
# ************************************
# \file
#
# Master module for all routines relating
# to parameters, manipulation, etc.
#
# *************************************
#
# \author <NAME>
# (<EMAIL>)
# \date 2018, 2019
#
# \author <NAME>
# (<EMAIL>)
# ... |
# pyOCD debugger
# Copyright (c) 2020-2021 <NAME>
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
# ... |
"""
Notes: if some expressions do not simplify why they should they might
have 'duplicates'. remove them by using remove_duplicates
"""
import numpy as np
import sympy.physics.optics as so
import sympy
sympy.init_printing(use_unicode=True, use_latex=True, pretty_printing=True)
from sympy import Symbol
RMS_TO_FWHM =... |
from django.shortcuts import render
from django.views.generic.base import View
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.urls import reverse
from datetime import datetime, timedelta
import pytz
from django.cont... |
"""Transformers for applying data augmentation."""
# Monkey patch for: https://github.com/aleju/imgaug/issues/537
# TODO: Fix when PyPI/conda packages are available for version fencing.
import numpy
if hasattr(numpy.random, "_bit_generator"):
numpy.random.bit_generator = numpy.random._bit_generator
import sleap
... |
from django.shortcuts import render
from django.http import HttpResponse
from .models import *
import uuid # https://github.com/skorokithakis/shortuuid
from django.core import serializers
import json
from subprocess import check_output
from django.views.decorators.clickjacking import xframe_options_exempt
import reque... |
#!/usr/bin/env python3
import sys, getopt, signal
sys.path.append('/home/ros/catkin_ws/src/icclab_grasping_niryo/scripts/')
import rospy
import numpy as np
import copy
import tf
import vtk
from tf import TransformListener
import tf2_ros
import yaml
import datetime
import gc
#from tools import *
from pprint import pprin... |
import warnings
from copy import deepcopy
from typing import Any, Dict, List
import numpy as np
from ase.atoms import Atoms
from ase.build import molecule
from ase.collections import g2
from pymatgen.analysis.adsorption import AdsorbateSiteFinder
from pymatgen.core import Structure
from pymatgen.core.surface import Sl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the "snake" Python module. It is the lower level module used to
analyze non-magnetic bright points.
It is assume that small UIO 3D boxes containing single nMBPs are given.
The goal of this module is to locate the 3D region in which nMBP forms.
The set of mini... |
# -*- coding: utf-8 -*-
import pytest
from six import PY3
from ruamel.yaml import YAML
import os
import shutil
import pandas as pd
import sqlalchemy as sa
from great_expectations.exceptions import BatchKwargsError
from great_expectations.datasource import PandasDatasource, SqlAlchemyDatasource, SparkDFDatasource
fr... |
#!/usr/bin/env python3
# requires mpv
import os
import sys
import random
version = '0.1.3'
# --------------------
# configuration start
# song format extension
song_ext = '.mp3'
# number of seconds to play
clipsec = 5
cheatsec = 10
# name your file of directories below
songfile = 'songs'
# team information
team... |
"""PyQt interface to query elements."""
from typing import Tuple
import sys
from PyQt6 import QtCore, QtGui
from PyQt6.QtWidgets import (
QApplication,
QDialog,
QGridLayout,
QHBoxLayout,
QLabel,
QMainWindow,
QPushButton,
QVBoxLayout,
QWidget,
)
import numpy as np
from rimseval.uti... |
from multiprocessing import cpu_count
import parasail
from scipy.sparse.csr import csr_matrix
from tqdm.contrib.concurrent import process_map
import itertools
from typing import Union, Sequence, Tuple, Optional
import numpy as np
import abc
from Levenshtein import distance as levenshtein_dist
from Levenshtein import ha... |
import collections
import contextlib
import json
import logging
import os
import progressbar # type: ignore
import re
import requests
import shutil
import tarfile
import tempfile
import toml
import traceback
import urllib.parse
import uuid
from . import configuration
from . import utils
from typing import (
cast,... |
"""
Sudoku solver with GUI interface
"""
from itertools import chain
from copy import deepcopy
from random import sample
import tkinter as tk
from matplotlib import pyplot as plt
__author__ = "<NAME>"
def sudoku_gui():
"""
Displays a GUI to enter the initial sudoku values into, and allows t... |
# def warn(*args, **kwargs):
# pass
# import warnings
# warnings.warn = warn # to ignore all warnings.
from cvxopt import matrix, solvers
import numpy as np
import pandas as pd
# import plotly.plotly as ply
# import plotly.tools as tls
import matplotlib.pyplot as plt
from functools import partial
from sklearn.ut... |
# encoding:utf-8
# This program is written for video creators who would like to generate artificial voice for their videos.
# The main function of this program is subtitle generation along with speech file generation.
# The program uses google translate service (gtts), so good luck whoever don't have access to googl... |
from collections import defaultdict
from collections.abc import MutableMapping
import enum
import itertools
from typing import BinaryIO, DefaultDict, List, Tuple, Union, Optional
import numpy as np
import h5py
from mlagents_envs.exception import UnityException
# Elements in the buffer can be np.ndarray, or in the ca... |
# pylint: disable=unsupported-assignment-operation
import io
import os
import typing
import logging
import collections
import urllib
import urllib.request
import typing_extensions
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import validators
import cv2
log = logging.getLogger(__name__)... |
from logging import getLogger
import collections
import numpy as np
import torch
from torch.nn import functional as F
from torch import nn
import copy
import pfrl
from pfrl.agent import GoalConditionedBatchAgent
from pfrl.agents import TD3
from pfrl.utils.batch_states import batch_states
from pfrl.replay_buffer impor... |
import os
import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import config as cfg
import random
import pickle
import parameters_BL as params
import json
import math
import cv2
from tqdm import tqdm
import time
import torchvision.transforms as trans... |
"""Sudoku Game representations"""
import collections
import copy
import itertools
import random
DEBUG = True
SHOW_EACH_MOVE = True
SHUFFLE_RULES = True
CHOICES = list(range(1, 10))
ROW_NAMES = CHOICES
COL_NAMES = CHOICES
def dbg(fmt, *args, **kwargs):
if DEBUG:
print(fmt.format(*args, **kwargs))
def d... |
"""
Routines & classes that are related to HTTP protocol processing.
A basic HTTP server can be assembled in a simple way::
import asyncio
from pyx.http import (HttpHeader, HttpConnectionCB)
@asyncio.coroutine
def req_cb(req):
resp = req.respond(200)
resp.headers.append(HttpHeader('Co... |
import os
import mimetypes
from datetime import datetime, date
from dateutil.rrule import rrule, MONTHLY
from calendar import monthrange
from collections import OrderedDict, namedtuple
from django.http import HttpResponse, HttpResponseRedirect, StreamingHttpResponse
from django.views.generic import View, ListView, For... |
# coding=utf8
import sublime
import json
import os
import re
from ..utils.debug import Debug
from ..utils.CancelCommand import catch_CancelCommand, CancelCommand
from ..utils.fileutils import read_file
from ..utils.pathutils import package_path
from ..utils.viewutils import get_content
from ..utils.options import al... |
import os
from typing import Optional, Dict, List, Tuple, Any
from ..filetools import gzip
from ..lowlevel import call, printf
from ..dna import translate, rev_comp
from ..fasta import FastaParser, FastaWriter, read_fasta
def hmmbuild(seed: str, hmm: str):
"""
Args:
seed: path-like
The inp... |
from sympy import Symbol, Rational, nfloat
from sympy import Expr as spexpr
from sympy import sin as sp_sin
from sympy import pi as sp_pi
import os
from subprocess import Popen, PIPE
from warnings import warn
from appdirs import AppDirs
from pyfurc.util import (
AutoCodePrinter,
DataDir,
ParamDict,
Aut... |
#!/usr/bin/env python
'''
----------------------------
ONTdrstools.DRS_seqErrors.py
----------------------------
This script parses an aligned set of ONT DRS data, looking at the sequencing
errors in the data. The errors distributions are summarized by type and they
are broken down by the base relative to the proporti... |
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. T... |
"""
Defines Neural Networks
"""
import torch
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
from torch.autograd.variable import Variable
from ..utils.generators.mixed_len_generator import Parser, \
SimulateStack
from typing import List
from globals import device
from closest_token import c... |
from typing import Any, Dict, List, Optional
import re
import os
import json
import logging
from pathlib import Path
from copy import copy
import yaml
import networkx as nx
from jsonschema.validators import Draft7Validator
from jsonschema.exceptions import ValidationError
from haystack import __version__
from haysta... |
import tkinter
from tkinter import *
import numpy as np
import matplotlib.pyplot as plt
import tkinter.font as tkFont
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import time
import matplotlib.animation as animation
import math
##Begin Default Values
precisionDefault = 2
figureDPI = 50 #DPI value f... |
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
import nltk
import heapq
import re
import numpy as np
import pandas as pd
from collections import Counter
from math import ceil
from pycorenlp import StanfordCoreNLP
def add_period(line):
''' add a period to the end of the reference'''
if line[-1] != '.':
line = line + '.'
return line
def eval_r... |
#! /usr/bin/env python3
import os, sys, re
import collections
import json
import pprint as pp
######################################################################
# Parsing optional command line arguments
######################################################################
import argparse
verbosity = 0
json_fna... |
import html
import time
from datetime import datetime
from io import BytesIO
from SaitamaRobot.modules.sql.users_sql import get_user_com_chats
import SaitamaRobot.modules.sql.global_bans_sql as sql
from SaitamaRobot import (DEV_USERS, GBAN_LOGS, OWNER_ID, STRICT_GBAN,
SUDO_USERS, SUPPORT_CHAT,... |
#!/usr/bin/env python3
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
Some codes are borrowed from https://github.com/PrefectHQ/prefect/blob/master/src/prefect/engine/runner.py
"""
import asyncio
import functools
import inspect
import threading
import traceback
from typing import Callable, List, Union, Optional, Coroutine, Set, Tuple
import flowsaber
from flowsaber.client.client imp... |
import itertools
import os
import warnings
from functools import partial
from glob import glob
from time import time
import imageio
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from skimage.metrics import normalized_mutual_information, structural_similarity
from skimage.transform import resiz... |
import networkx as nx
import math
import operator
from datetime import datetime
import os
import queue
import copy
import threading
import crestdsl.model as model
import crestdsl.model.api as api
from crestdsl.simulation.simulator import Simulator
import crestdsl.simulation.dependencyOrder as DO
from crestdsl.cachin... |
import tempfile
import os
import filecmp
import shutil
import time
import uuid
import configparser
from datetime import datetime
import pytest
from unittest.mock import patch
from synapseclient import client
from synapseclient import Activity, Annotations, File, Folder, login, Project, Synapse, Team
from synapseclie... |
import torch
import torch.nn as nn
from Utils.util import Bunch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Attention(nn.Module):
def __init__(self, opt):
super(Attention, self).__init__()
self.att_hidden_size = opt.att_hidden_size
self.rnn_hidden_size =... |
import torch
import torch.nn as nn
import torch.distributions as distributions
from luafun.draft import DraftFields
from luafun.game.action import Action, AbilitySlot, ARG
import luafun.game.constants as const
from luafun.model.components import HeroEncoder, CategoryEncoder, AbilityEncoder
from luafun.game.ipc_send i... |
"""
redrock.external.boss
=====================
redrock wrapper tools for BOSS
"""
from __future__ import absolute_import, division, print_function
import os
import sys
import re
import warnings
import traceback
import argparse
import numpy as np
from scipy import sparse
from astropy.io import fits
from astropy.t... |
#!/usr/bin/env python3
r"""
This module provides many valuable functions such as my_parm_file.
"""
# sys and os are needed to get the program dir path and program name.
import sys
import errno
import os
import shutil
import collections
import json
import time
import inspect
import random
try:
import ConfigParser
... |
"""
Module implements the describer for GB entry
"""
from functools import reduce
from math import gcd
from typing import Dict
import numpy as np
import pandas as pd
from monty.json import MSONable
from pymatgen.analysis.gb.grain import GrainBoundary
from pymatgen.analysis.local_env import (
BrunnerNN_real,
Br... |
'''
An audio analysis program that produces fingerprints of training audio files, then matches
the fingerprints to realtime audio.
Primary Author: <NAME>
Date: 8/6/14
Version 1.0
Python Version: 2.7
Sections:
1: TK GUI setup
2: Global Variable Definitions
3: Functions
'''
# You may need to download PyAudio and Sci... |
# Copyright 2020 Google LLC.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# loaded inside of the environments
import logging
import os
from jiminy import pyprofile
import sys
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
import threading
import time
import ujson
import collections
from autobahn.twisted import websocket
from jiminy.twist... |
import asyncio
import itertools
import json
import logging
import random
import typing as t
from datetime import datetime, time, timedelta
from pathlib import Path
import arrow
import discord
from discord.embeds import EmptyEmbed
from discord.ext import commands
from bot.bot import SeasonalBot
from bot.constants impo... |
"""
Import CSV file in Graph-tool.
Note: the log file wasn't converted to the new filename parsing API.
Note: ID generation is fixed. The standard ID generator should be used instead.
"""
from argparse import Namespace
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def parser():
ret... |
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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 ... |
import tensorflow as tf
import os
from models.net import Net
######## 3 Classes, one for each type of neural network:
# - CondensedGoogLeNet
# - CondensedAlexNet
# - ResNet
class CondensedGoogLeNet(Net):
""" A parametrically reduced version of GoogleNet-like CNN (For description and implementation of full Goo... |
# !/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
from pybpodapi.state_machine.conditions import Conditions
from pybpodapi.state_machine.global_counters import GlobalCounters
from pybpodapi.state_machine.global_timers import GlobalTimers
from pybpodapi.bpod.hardware.events import EventName
from pybpodapi.bpo... |
#!/usr/bin/env python
###########################################################
#
# Exposes basic functionality of the hand in a ReFlex class
# The reflex package is designed to be used in two ways
# First, you can instantiate a ReFlex class and use it's methods/variables.
# This is intended for scripts
# Second, yo... |
import logging
from threading import Thread
from ast import literal_eval
def _parse_arg_list(arglist):
"""
Parses a list of arguments.
Arguments are expected to be split by a comma, surrounded by any amount
of whitespace. Arguments are then run through Python's eval() method.
"""
args = []
... |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import hashlib
import hmac
import re
import binascii
from ..asn1crypto import core, pkcs12, cms, keys, x509, pem
from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
from .symmetric import (
aes_cbc_pkcs7_decrypt,
des_c... |
# -*- encoding: utf-8 -*-
"""
@File : dataset.py
@Contact : <EMAIL>
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2020/2/22 14:16 Kevin 1.0 None
"""
from keras.datasets import imdb
from keras.datasets import mnist
from keras.da... |
import unittest
import re
from datetime import datetime
from lxml import etree
from pyramid import testing
from pyramid.renderers import render, get_renderer
from ..schema import master_schema
from ...util import (
format_datestamp,
filter_illegal_chars,
)
from ...exception import (
BadArgument,
Expi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.