text stringlengths 3.07k 22.1k |
|---|
import os
import numpy as np
import pandas as pd
import tarfile
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler
###########################################################################
### criteo
###########################################################################
def download... |
import pytest
import numpy as np
import pymaster as nmt
from .utils import normdiff
class BinTester(object):
def __init__(self):
self.nside = 1024
self.lmax = 2000
self.nlb = 4
self.bc = nmt.NmtBin(self.nside, nlb=4, lmax=self.lmax)
ells = np.arange(self.lmax - 4, dtype=int... |
#!/usr/bin/env python3.5
from shared.finesse.helper import *
import time, sys
import copy
__author__ = '<NAME>'
__copyright__ = 'Copyright (c) 2015-2016 Eclipse Technologies'
EPSILON = sys.float_info.epsilon
_PLANES = {
'xy': np.array([0, 0, 1]),
'xz': np.array([0, 1, 0]),
'yz': np.array([1, 0, 0])
}
_... |
from pathlib import Path
import numpy as np
from datetime import datetime
from nilearn import plotting, image, masking
import pandas as pd
import subprocess
import json as js
from pandas import json_normalize
from skimage import filters
def convert2NIFTI(base_folder=Path.home() / "Sync/MRdata/Avanto_MR2", **kwargs):
... |
#!/usr/bin/python3
from traceback import format_exc
from struct import *
from collections import namedtuple
import base64
import struct
import logging
from profiles import Profile
from devices import ClassicPCController
from common import phexlify
_logger = logging.getLogger(__name__ if __name__ != '__main__' else _... |
# -*- coding: utf-8 -*-
import sqlparse
from sqlparse import sql
from sqlparse import tokens as T
from tests.utils import TestCaseBase
class TestGrouping(TestCaseBase):
def test_parenthesis(self):
s = 'select (select (x3) x2) and (y2) bar'
parsed = sqlparse.parse(s)[0]
self.ndiffAssertE... |
from __future__ import annotations
import asyncio
import enum
from abc import abstractmethod
from typing import Any, Generic, TypedDict, TypeVar, Union, cast
import discord
from aioitertools import enumerate as aenumerate
from aioitertools import starmap
from aioitertools.helpers import maybe_await
from aioitertools.... |
""" Embed finer gridded data in coarser, using curvature flow smoothing to reconcile
Main function is called embed_fine
"""
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
import scipy.ndimage as cv
from scipy.integrate import odeint
from nodepy import *
import sys
import os.path
from sc... |
from torch.utils.data import Dataset
import glob
import os
import json
from shapely import wkt
from shapely.geometry import mapping
import numpy as np
import cv2
from PIL import Image
from simplecv.api.preprocess import comm
from simplecv.api.preprocess import segm
import torch
from simplecv.util import viz
from torchv... |
# BSD 3-Clause License
#
# Copyright (c) 2019-2020, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# l... |
"""Read and write Cortex Motion Analysis Corporation ASCII related files.
Read .trc file:
read_trc(fname, fname2, units, dropna, na, fmt, show_msg)
Write .trc file
write_trc(fname, header, df, show_msg)
"""
__author__ = "<NAME>, https://github.com/demotu/"
__version__ = "0.0.2"
__licen... |
# Volatility
#
# Authors:
# <NAME> <<EMAIL>>
#
# This file is part of Volatility.
#
# Volatility 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... |
"""
Copyright (c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Self-test of the matcher infrastructure. This is less about individual matchers,
and more about if the various sequences and groups work (and fail!) as expected.
"""
from __future__ import print_function
import unittest
import plugin_test_helpe... |
import re
import operator
import string
import numpy as np
import spacy
from nltk.tokenize import word_tokenize as nltk_word_tokenize
from nltk.tokenize import sent_tokenize as nltk_sent_tokenize
from nltk.corpus import stopwords
from nltk.stem.porter import *
from nltk.stem import WordNetLemmatizer
stop_words = set(st... |
from mudclientprotocol import (
McpMessage, McpPackage, mktoken
)
from mufsim.errors import MufRuntimeError
from mufsim.insts.base import Instruction, instr
from mufsim.interface import network_interface
import mufsim.stackitems as si
existing_dialogs = {}
def get_dlog(dlogid):
global existing_dialogs
... |
################################################################################
#
# Package : AlphaPy
# Module : variables
# Created : July 11, 2013
#
# Copyright 2020 ScottFree Analytics LLC
# <NAME> & <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except... |
import collections
import csv
import datetime
import itertools
import logging
import math
import numpy
import os
import sys
import utility
MOVIE_COUNT = 17770
USER_COUNT = 480189
MAX_USER_ID = 2649429
NUM_RATING = 100480507
Datasets = collections.namedtuple('Datasets', ['train', 'validation', 'test'])
class DataS... |
#!/usr/bin/python3.5
import sys
import os
import time
import asyncio
import telepot
import json
import requests
import atexit
import re
import random
import string
import operator
import cv2
import matplotlib
import numpy as np
import urllib.request
import matplotlib.pyplot as plt
from urllib impo... |
"""
Tests for integration executed by CI.
"""
import sys
import pytest
@pytest.mark.integration
@pytest.mark.parametrize('python_path', (
'/usr/bin/python3', '/usr/bin/python')
)
@pytest.mark.skipif(not pytest.helpers.is_root_user(),
reason='needs root authority.')
def test_install_failed_o... |
# 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 required by applicable law or agreed to ... |
import random
# Ok, I think what we have below is correct as pseudo-code.
# Next: test it with a simple environment and make it no-longer pseudo-code
# After that: make it into a persistent thing that I can make multiple calls to.
'''
A snag:
I need some way of figuring out whether a node has already been explored. ... |
#!/usr/local/bin/python
#
# This script analyzes sys/conf/files*, sys/conf/options*,
# sys/conf/NOTES, and sys/*/conf/NOTES and checks for inconsistencies
# such as options or devices that are not specified in any NOTES files
# or MI devices specified in MD NOTES files.
#
# $FreeBSD$
from __future__ import print_funct... |
"""
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
import tensorflow as tf
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
... |
from datetime import datetime
from typing import List
from marshmallow import Schema, fields
from nzbclients.nzbdrone.common import (
Image,
ImageSchema,
Ratings,
RatingsSchema,
SonarrDateTime,
)
class AlternateTitle(object):
def __init__(self, title: str = None, season_number: int = None):
... |
#!/usr/bin/env python
# coding=utf-8
# Copyright (c) 2018-2021 UT-BATTELLE, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyrigh... |
from __future__ import print_function
import configargparse
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torchnet as tnt
from torchnet.engine import Engine
from torchnet.logger import VisdomPlotLogger, VisdomLogger
from tqdm import tqdm
from models i... |
from tkinter import filedialog
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import warnings
import math
from point2d import Point2D
from PIL import Image, ImageTk
import os
import errno
from message_box import *
import shutil
import cv2
import numpy as np
import sys as sys
import re as re... |
#! /usr/bin/env python3
# coding: utf-8
# vim:set ts=4 sw=4 et:
# René 2016/11/07
"""
Module d'interrogation d'Eco-Devices GCE Electronics
"""
from __future__ import print_function
import sys
import socket
import select
import xml.sax
import requests
# compatibilité Python 2.7
if sys.version_info[0] == 2:
... |
import os
import wget
from pathlib import Path
import pandas as pd
import numpy as np
class CSVUrl:
COVIDPRO_CSV = "https://raw.githubusercontent.com/CEEDS-DEMM/COVID-Pro-Dataset/master/deathsItaProv.csv" # noqa: E501
DPC_REGIONI = "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-... |
WHITESPACE_CHARACTER = "▁"
from typing import Generator, List, Dict, Optional, Union, Tuple
import random
import ujson
import aiohttp
import json
from rapidfuzz import cpp_fuzz, cpp_process
#API: >> process.extractOne("cowboys", choices, scorer=fuzz.WRatio)
#("<NAME>", 90, 3)
from loguru import logger
from dotenv impo... |
#from py2neo import Graph, Node, Relationship
# passlib.hash import bcrypt
from flask import Flask, render_template
from rdflib import Graph, Literal, BNode, Namespace, RDF, URIRef, term
from rdflib.namespace import FOAF, DC
from datetime import datetime
import matplotlib.pyplot as plt
import pandas as pd
foaf = Gra... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 18 11:49:51 2017
@author: <NAME>, <NAME>
"""
import numpy as np
import sympy
from stablab.finite_difference_code import pde
from sympy import Matrix
from stablab.finite_difference_code import approximate
"""Used for both pdes and odes"""
def newtonSolve(in... |
import sys
import os
import os.path
import json
import logging
from email.parser import Parser
from collections import namedtuple
from zipfile import ZipFile
from pkg_resources import EntryPoint, parse_version
import minemeld.loader
LOG = logging.getLogger(__name__)
__all__ = [
'get_metadata_from_wheel',
'... |
import socket
import threading
import sys
import monoclient
import decorators
import loads
def request_server_option():
"""
Is used to request the option and prints it.
Returns
-------
option: int
The option that has to be returned
"""
colors = decorators.Colors()
option = 0
... |
##############################################################
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
##############################################################
"""... |
# Coder: <NAME>
# Github: https://github.com/wenxinxu/resnet_in_tensorflow
# ==============================================================================
import tarfile
from six.moves import urllib
import sys
import numpy as np
from hyper_parameters import *
import pickle
import os
from scipy import ndimage... |
"""
This script was used to create all generated DynoBit NFTs on OpenSea (000-799 excluding special editions)
Ensure you can successfully run test_making_dyno.py before using this script
To make dynos, make sure a folder named 'dyno_images' & 'dyno_gifs' is in current dir and empty
Next, cd to this dir and run this c... |
import os
import sys
sys.path.insert(0, os.getcwd())
import numpy as np
import argparse
import json
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from models.pretraining_nasbench101 import configs
from utils.utils import load_json, preprocessing
from models... |
#!/usr/bin/env python3
# Copyright 2017-2019 Nativepython 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 re... |
import audio_parameters as ap
import pandas as pd
from torch.utils.data import Dataset, DataLoader
import os
import librosa
import numpy as np
from data import raw_text_to_phoneme_ids, data_path
import collections
from scipy import signal
import torch as t
import math
class LJDatasets(Dataset):
"""LJSpeech datase... |
import argparse
import bz2
import json
import os
import pickle
import sys
from pandas import Timestamp, read_pickle, ExcelWriter
from scripts import FilePaths
from scripts.algorithms.term_focus import TermFocus
from scripts.algorithms.tfidf import LemmaTokenizer, TFIDF
from scripts.utils.datesToPeriods import tfidf_w... |
#
# Author : <NAME>
# Copyright (c) 2020 <NAME>. All rights reserved.
# Licensed under the MIT License. See LICENSE file in the project root for full license information.
#
#
# ME210B - Homework 5
#
import numpy as np
from scipy.linalg import toeplitz
import tikzplotlib
import odesolvers
from hw4ex1 import hw4e... |
'''
.. Copyright (c) 2016 <NAME>
See the https://opensource.org/licenses/MIT for license details.
'''
import os
from .config import pathjoin
from .log import getLogger
from .error import CommandlineError, FileFormatError
from .utils import mkdirs, ensureCSV, QueryResultsDir
from .query import readCsv, dropExtraCol... |
import math
import random
# numberOfGene:dataRequiredToExpressGene-numberOfSecondGene:DataToExpressSecondGene
# for example:
# 0:FFFFFF-1:A
# this is a gene for an organism of colour white (255, 255, 255)
# and a fotosynthetic gene with a production rate of 10
class Genes:
size = (1000, 1000)
# Fotosnthesis
... |
#!/usr/bin/env python
# coding=utf-8
import numpy as np
import tensorflow as tf
import random
import time
import generate_sample_v1
random.seed(9102)
# add bn layer
norm, epsilon = False, 0.001
INPUT_EMBEDDING_LENGTH = 260
FILE_PREDICT='ceshi'
LEARNING_RATE = 0.001
SUMMARIES_DIR = './Summaries/'
NUM_EPOCH = 50
# n... |
import random
import sys
import time
from collections import deque
from threading import Thread
import cv2
import numpy as np
from pynput.keyboard import Key, Listener, KeyCode
from algorithms.utils.algo_utils import main_observation, goal_observation, EPS
from algorithms.utils.env_wrappers import reset_with_info
fro... |
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, floor, ceil
from scipy.interpolate import RegularGridInterpolator
import random
import warnings
import sys
import os
import csv
def is_perfect_cube(x):
x = abs(x)
return int(round(x ** (1. / 3))) ** 3 == x
def getRowColumn... |
#
# Copyright (c) 2017-2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# All Rights Reserved.
#
from cgtsclient.common import constants
from cgtsclient.common import utils
from cgtsclient import exc
from cgtsclient.v1 import idisk as idisk_utils
fro... |
import copy
from pyschema import types
import pyschema
import os
import sys
from collections import defaultdict
DEFAULT_INDENT = " " * 4
class SourceGenerationError(Exception):
pass
def to_python_source(classes, indent=DEFAULT_INDENT):
"""Convert a set of pyschemas to executable python source code
Cur... |
# RCS14_entrainment_naive.py
# Generate timeseries analysis and power estimate
# Author: maria.olaru@
"""
Created on Mon May 3 18:22:44 2021
@author: mariaolaru
"""
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.dates as md
import scipy.signal as signal
import pandas as pd
import math
impo... |
from enum import Enum
import numpy as np
from gym import Env
from gym.spaces import Discrete
from gym_pomdp.envs.coord import Coord, Moves, Grid
# from gym_pomdp.envs.gui import TagGui
def action_to_str(action):
if action == 0:
return "up"
elif action == 1:
return "right"
elif action =... |
# Copyright (C) 2020 <NAME> (Technical University of Munich)
# For more information see <https://vision.in.tum.de/research/vslam/dh3d>
#
# 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 cv2
# import speed_prediction
import tools.speed_prediction as speed_prediction
# from core.config import cfg
# from core.utils import read_class_names
# is_vehicle_detected = [0]
left_vehicle_counter = 0
right_vehicle_counter = 0
bottom_vehicle_counter = 0
LEFT_INTERSECTION_ROI_POSITION = 400
LEFT_INTERSECTI... |
#!/usr/bin/env python
# coding: utf-8
# # Interactive Analysis
# One need for bioimage analysts is to interactivly perform analysis on images. This interaction could be manual parameter tuning, such as adjusting thresholds, or performing human-in-the-loop analysis through clicking on specific regions of an image.
#
#... |
import typing as tp
import unittest
from dataclasses import dataclass
from unittest import mock
from pymeterreader.device_lib.common import ChannelValue, Device, ConfigurationError
from pymeterreader.device_lib.sensor_bme280 import Bme280Reader
from pymeterreader.device_lib.test_meter import TestData
@dataclass(froz... |
import copy
import json
import os
import re
import torch
from requests import HTTPError
from transformers import custom_object_save
from transformers.utils import logging
from transformers.file_utils import (
CONFIG_NAME,
EntryNotFoundError,
RepositoryNotFoundError,
RevisionNotFoundError,
cached_p... |
"""Python module to request PMU data from a running ANDES
"""
import logging
import time
from .dime import Dime
from numpy import array, ndarray, zeros
from pypmu import Pmu
from pypmu.frame import ConfigFrame2, HeaderFrame
def get_logger(name):
logger = logging.getLogger(name)
if not logger.handlers:
... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
import time
import torch.autograd
import torch.nn as nn
from core.label_smooth import LabelSmoothCrossEntropyLoss
from core.utils import *
from core.warmup_scheduler import GradualWarmupScheduler
class View(nn.Module):
"""
Reshape data from 4 dimension to 2 dimension
"""
def forward(... |
from collections import namedtuple
from astropy import convolution
import numpy as np
import math
import extinction
from .define_filters import define_filters, get_cenwave
#Like a light weight class with attributes wavelength and flux
#spectrum1d = namedtuple("spectrum1d", ['wave', 'flux'])
class spectrum1d(object... |
import os
import numpy as np
import pytest
from sklearn.base import clone
from tensorflow.python.keras.testing_utils import get_test_data
from scikeras.wrappers import KerasClassifier, KerasRegressor
from .mlp_models import dynamic_classifier, dynamic_regressor
# Defaults
INPUT_DIM = 5
HIDDEN_DIM = 5
TRAIN_SAMPLE... |
# --- Do not remove these libs ---
from freqtrade.strategy.interface import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame, Series
# --------------------------------
import logging
import pandas as pd
import numpy as np
import datetime
from freqtrade.persistence impor... |
import torch
import numpy as np
from scipy.interpolate import splprep, splev
from scipy.special import comb as n_over_k
def upcast(t):
# Protects from numerical overflows in multiplications by upcasting to the equivalent higher type
# https://github.com/pytorch/vision/pull/3383
if t.is_floating_point():
... |
# Copyright (c) <NAME>.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
"""Eigen based implementation of multi objective
Differential Evolution using the DE/pareto/1 strategy.
Derived and adapted for MO from its C++ counterpart
https://github.com/... |
from flask import Blueprint, render_template, request, flash, redirect, url_for
from random import randint
from flask import Flask, render_template, Response
import requests
import os
import tensorflow as tf
import cv2
import time
import argparse
import posenet
home = Blueprint('home', __name__)
ALLOWED_EXTENSIONS =... |
import os
import sys
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as pll
from collections import Counter
from mpl_toolkits.mplot3d import Axes3D
def gcn_atop(atom_tot, cn, nn_list, col):
cn_bulk = 12
gcn = [0]*atom_tot
gcn_col = ['grey']*atom_tot
for i in range... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
wz_table/spreadsheet.py
Last updated: 2019-01-28
Spreadsheet file reader, returning all cells as strings.
Currently Excel files (.xlsx) and Open Document files (.ods) are supported.
Dates are returned as strings in the format 'yyyy-mm-dd'.
=+LICENCE==============... |
import sys
import os
import argparse
from io import StringIO
from pdfminer.converter import TextConverter, PDFConverter, PDFPageAggregator
from pdfminer.layout import LTTextBox, LAParams
from pdfminer.layout import LTTextLine
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager... |
import cv2
import numpy as np
import Polygon as plg
import pyclipper
import tensorflow as tf
import psenet.config as config
def random_flip(images, prob=0.5, dim=1):
random_value = tf.random.uniform([])
def flip():
flipped = []
for tensor in images:
flipped.append(tf.reverse(tens... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
██▀███ ▒█████ ▒█████ ▄▄▄█████▓ ███▄ ▄███▓▓█████
▓██ ▒ ██▒▒██▒ ██▒▒██▒ ██▒▓ ██▒ ▓▒▓██▒▀█▀ ██▒▓█ ▀
▓██ ░▄█ ▒▒██░ ██▒▒██░ ██▒▒ ▓██░ ▒░▓██ ▓██░▒███
▒██▀▀█▄ ▒██ ██░▒██ ██░░ ▓██▓ ░ ▒██ ▒██ ▒▓█ ▄
░██▓ ▒██▒░ ████▓▒░░ ████▓▒░ ▒██▒ ░ ▒██▒ ... |
import pyvex
from .errors import SimSlicerError
class SimLightState(object):
def __init__(self, temps=None, regs=None, stack_offsets=None, options=None):
self.temps = temps if temps is not None else set()
self.regs = regs if regs is not None else set()
self.stack_offsets = stack_offsets ... |
import os
import pickle
import random
import shutil
import time
import traceback
import math
import numpy as np
from mpi4py import MPI
from mpi4py.futures import MPICommExecutor
from sklearn.metrics import mean_squared_error
from sklearn.neighbors import KDTree
from k_means_constrained import KMeansConstrained
from c... |
from __future__ import unicode_literals
from traceback import print_exc
from copy import deepcopy
import re
import logging
from docutil.str_util import find_list
from docutil.etree_util import HierarchyXPath, SingleXPath, FlatXPath
from doc.parser.generic_parser import GenericParser
from doc.parser.parser_util import J... |
import itertools
from string import Template
import numpy as np
from PuzzleLib.Compiler.Codegen.Types import half_t, float_t
from PuzzleLib.Cuda.Utils import roundUpDiv
transformTmpl = Template("""
extern "C"
__global__ void transform2d$ext($T * __restrict__ dst, const $T * __restrict__ src, int dstOffset, int src... |
#!/usr/bin/env python
"""
Author: <NAME>
Email: <EMAIL>
"""
import os, traceback, random, numpy as np
import networkx as nx
from matplotlib import pyplot as plt
from process import Process
x = np.zeros((1,32,32,3))
y = np.zeros((1,10))
y[0] = 1
def plot_graph(individual, dna):
G= dna['graph']
dense_no... |
import gpxpy
import gpxpy.gpx
import datetime
import pprint
pp = pprint.PrettyPrinter(indent = 4)
class GpxError(Exception):
pass
def view():
with open('/home/henry/Downloads/track_march_02.gpx', 'r') as gpx_file:
gpx = gpxpy.parse(gpx_file)
for track in gpx.tracks:
for segment in track.... |
import argparse
import logging
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
def check_nans(df):
""" Auxiliary function for data wrangling logs """
n_rows = len(df)
check_df = {'col': [], 'dtype': [], 'nan_prc': []}
for col in df.columns:
check_d... |
from itertools import cycle
import argparse
import joblib
from sklearn.metrics import roc_curve, auc, confusion_matrix, plot_confusion_matrix
from sklearn.model_selection import cross_val_score
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import label_binarize
from surprise import KNNWi... |
import numpy as np
import gym
from copy import deepcopy as copy
import tensorflow as tf
from abc import ABC, abstractmethod
import os
def single_elem_support(func):
"""aop func"""
type_list = (type([]), type(()), type(np.array(1)))
def wrapper(*args, **kwargs):
"""wrapper func"""
res = fu... |
from __future__ import print_function
import numpy as np
import cntk as C
from cntk.train.training_session import *
from cntk.logging import *
import argparse
#model_type = "" # or "blstm"
data_dir = "../Experiments"
list_path = os.path.join(data_dir, "lists")
am_path = os.path.join(data_dir,"am")
globals = {
"fe... |
"""
Classes for persisting and restoring GradeFast state to/from a save file.
Licensed under the MIT License. For more, see the LICENSE file.
Author: <NAME> <<EMAIL>>
"""
import pickle
import queue
import shelve
import sqlite3
import threading
from typing import Any, Optional
from pyprovide import inject
from grad... |
import pandas as pd
import numpy as np
import sklearn
import torch
import os
import re
from os import listdir
from os.path import isfile, join
from bs4 import BeautifulSoup
from pathlib import Path
from gensim.models.keyedvectors import KeyedVectors
from gensim.scripts.glove2word2vec import glove2word2vec
from sklearn.... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import io
import requests
import re
import sys
import argparse
import logging
import json
import yaml
default_orion = 'http://orion:1026'
default_latest = False
default_log_level = 'INFO'
default_path = '/Portugal'
default_service = 'weather'
default_timeout = -1... |
#!/usr/bin/env python2.7
from __future__ import print_function
import argparse, rospy, tf2_ros, tf, numpy as np
from geometry_msgs.msg import TransformStamped
parser = argparse.ArgumentParser()
def add_bool_option(p, opt, *args, **kwargs):
p.add_argument("--{}".format(opt), action="store_true", *args, **kwargs)
... |
################################################################################
# Copyright (c) 2020 AT&T Intellectual Property. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... |
# Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
from abc import ABC
import numpy as np
import airsim
import gym
# from tasks import Shaping
from jsbsim_simulator import Simulation
from jsbsim_aircraft import Aircraft, cessna172P, ball, x8
from debug_utils import *
import jsbsim_properties as prp
from simple_pid import PID
from autopilot import X8Autopilot
... |
#!/usr/bin/env python3
'''
VDB: Annotation commands
'''
import argparse
import inspect
import multiprocessing
import shutil
import sys
import tempfile
import uuid
from pathlib import Path
import orjson as json
import pyarrow.parquet as pq
import biograph.vdb as vdb
import biograph.vdb.athena as athena
from biograph.... |
#!/usr/bin/env python3
""" Re-create the cells starting with the paired files
Take six mandatory arguments, the two files of sequences, the three
files containing pairs ab, aa and bb and the output file
Modify the list of sequences to add columns containing their paired
alphas/betas, the number of clon... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import neurogym as ngym
from neurogym import spaces
class DelayMatchSample(ngym.TrialEnv):
r"""Delayed match-to-sample task.
A sample stimulus is shown during the sample period. The stimulus is
characterized by a one-dimensional variable... |
import os
import gym
import numpy as np
import copy
import shutil
import torch
from tensorboardX import SummaryWriter
from functools import partial
from easydict import EasyDict
from ding.config import compile_config
from ding.worker import BaseLearner, BattleEpisodeSerialCollector, NaiveReplayBuffer, InteractionSeria... |
import re
import sys
import copy
import importlib
import contextlib
if sys.version_info < (3, 8):
import importlib_metadata as metadata
else:
import importlib.metadata as metadata
from gym import error, logger
# This format is true today, but it's *not* an official spec.
# [username/](env-name)-v(version) ... |
# -*- coding: utf-8 -*-
# Copyright 2014, Digital Reasoning
#
# 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... |
"""card.py
"""
# Standard library imports
# Third party imports
from smartcard import CardType as _CardType
from smartcard.CardRequest import CardRequest as _CardRequest
from smartcard.Exceptions import CardRequestTimeoutException as _CardRequestTimeoutException
from smartcard.scard import \
SCARD_SHARE_SHARED as... |
import pickle
import numpy as np
import cv2 as cv
import pretrained_networks
from keras.utils import get_file
import bz2
import dnnlib
import dnnlib.tflib as tflib
import PIL.Image
import dlib
from faceswap.landmarks_detector import LandmarksDetector
from faceswap.face_alignment import image_align
from faceswap.dataset... |
from tempfile import mkdtemp
from flask import Flask, render_template, request, session, redirect, url_for
from flask_session import Session
from flask_socketio import SocketIO, join_room, emit
from jinja2 import Markup
from config import CATEGORIES
from helpers.helpers import user_required, game_mode_required
from m... |
import logging
import os
import pickle
import signal
import time
from collections import defaultdict
from collections import deque
from twisted.internet import reactor
log = logging.getLogger(__name__)
def consume_dequeue(queue, func):
queue_length = len(queue)
for _ in range(queue_length):
func(que... |
from __future__ import absolute_import
import unet_collection.keras_vision_transformer
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Dense, Conv2D, concatenate
from unet_collection.keras_vision_transformer import swin_layers
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
""" This file is a part of the VeRyPy classical vehicle routing problem
heuristic library and provides implementation of the Clarke and Wright (1964)
savings functions for parallel (as in multip... |
import torch
import torch.nn as nn
import math
import torch.nn.functional as F
from ..utils import Conv_BN_ReLU
class FPEM_v2(nn.Module):
def __init__(self, in_channels, out_channels):
super(FPEM_v2, self).__init__()
planes = out_channels
self.dwconv3_1 = nn.Conv2d(planes, planes, kernel_si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.