text stringlengths 6.04k 39.5k |
|---|
# Copyright 2020 Deepmind Technologies Limited.
#
# 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 agr... |
# Import the needed libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import datetime
# For linear regression function
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.linear_model import LogisticRegression, LinearRegression
from skl... |
#!/home/josers2/anaconda3/bin/python
"""A hogwild style ASGD implementation of RESNET
Based on: https://github.com/pytorch/examples/tree/master/mnist_hogwild
Network and Performance modifications are:
- Use Cifar10 and {Resnet,Lenet}
- Use a step learning rate
- Use the main thread for evaluations, instea... |
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import functools
import glob
import itertools
import re
import time
from argparse import ArgumentParser
from contextlib import... |
# coloring.
from colorama import Fore, init
init()
# type hints and annotations.
from logistics.plugins.metaclass import Meta
# imports all data types.
from logistics.plugins.types import *
# package.
class MonteCarlo:
'''
(OBJECT INFO)
-------------
eg. MonteCarlo = vandal.Mo... |
import warnings
warnings.filterwarnings("ignore")
import sys
import torch.optim as optim
import torch
from torch.autograd import Variable
import string
import math
import os
os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
import time
import random
import numpy as np
import json
import collections
import c... |
#!/usr/bin/python3
#-----------------------------------------------------------------------------
# IoT Communication Monitoring Tools ( IoTCMT ) Create 2021.06
# for Raspberry Pi
# このツールは、Raspberry Pi でWi-Fi接続を行う場合にネットワークの通信状態を
# 監視し、状態変化があった場合に通知と修復処理を行うプログラムです。
# ツールの動作設定は、IoTCNTconfig.json(js... |
import torch
import torch.nn as nn
import time
import errno
import os
import gc
import pickle
import shutil
import json
import os
import pandas as pd
from skimage import io, transform
import numpy as np
import calculate_ap_classwise as ap
import matplotlib.pyplot as plt
import random
import helpers_preprocess as helpe... |
#!/usr/bin/env python3
import csv
import json
import re
import sqlite3
import sys
from copy import deepcopy
from gizmos.hiccup import render
from pprint import pformat
from rdflib import Graph, BNode, URIRef, Literal
from util import compare_graphs
DEBUG=True
def log(message):
if DEBUG:
print(message, f... |
"""Module to create a thumbnail, given enough information"""
from ast import For
import json
import logging
from PIL import ImageColor
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageOps
from PIL import ImageChops
import logging
import numpy as np
logging.basicConfig(form... |
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC.
# Under the terms of Contract DE-NA0003525 with National Technology and Engineering Solutions
# of Sandia, LLC, the U.S. Government retains certain rights in this software.
# standard library
import os
import hashlib
import pic... |
import os
from nipype.interfaces.afni.base import (AFNICommandBase,
AFNICommandOutputSpec,
isdefined)
from nipype.utils.filemanip import split_filename as split_f
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec,
... |
#!/usr/bin/env python3
# standard library modules
import ast
from multiprocessing.dummy import Pool as ThreadPool
import os
import re
import subprocess
import sys
from time import sleep
# non-standard libraries
from flask import flash, render_template, request, url_for
from flask_login import login_required, current_us... |
#!/usr/bin/python
''' MAUDE pipeline for downloading, joining and loading into elasticsearch
'''
from bs4 import BeautifulSoup
import collections
import csv
import glob
import logging
import multiprocessing
import os
from os.path import dirname, join
import re
import sys
import urllib2
import arrow
import elasticsear... |
import numpy as np
import tensorflow_addons as tfa
import tensorflow as tf
import os
from layers.stn import BilinearInterpolation
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow_model_optimization as tfmot
reg=1e-2
quantize_annotate_layer = tfmot.quantization.keras.quantize_annotate_... |
# coding: utf-8
# # Setting up the environment
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.tsatools import detrend
from statsmodels.tsa.stattools import adfuller
from statsmodels.tsa.stattools import ccf... |
"""
Copyright (C) 2018-2020 Intel 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 i... |
import math, torch
from collections import OrderedDict
from bisect import bisect_right
import torch.nn as nn
from ..initialization import initialize_resnet
from ..SharedUtils import additive_func
from .SoftSelect import select2withP, ChannelWiseInter
from .SoftSelect import linear_forward
from .SoftSelect ... |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... |
# MIT License
# Copyright (c) 2021 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish... |
from pdb import set_trace as T
from collections import defaultdict
from itertools import chain
import shutil
import contextlib
import time
import os
import re
from tqdm import tqdm
import numpy as np
import gym
import torch
from torch import nn
from ray import rllib
import ray.rllib.agents.ppo.ppo as ppo
import ra... |
import jax.numpy as jnp
from jax import grad, vmap, hessian
from jax.config import config;
config.update("jax_enable_x64", True)
# numpy
import numpy as onp
from numpy import random
import argparse
import logging
import datetime
from time import time
import os
from scipy.special import gamma
def volumeball(d,R):... |
import csv
import sys
import re
from collections import OrderedDict
###################### globals ##########################
DB_DIR = "./files/"
META_FILE = "./files/metadata.txt"
AGGREGATE = ["min", "max", "sum", "avg", "count", "distinct"]
###################### functions ##########################
def make_sche... |
# Copyright 2019, The TensorFlow 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 t... |
from marshmallow import Schema, fields
from pyramid.security import Allow, Everyone
from sqlalchemy import (
Boolean,
Column,
DateTime,
Integer,
Binary,
String,
Text,
Unicode,
ForeignKey
)
from sqlalchemy.ext.declarative import ( AbstractConcreteBase, declarative_base, declared_at... |
from collections import defaultdict
import numpy as np
from pyNastran.bdf.bdf_interface.assign_type import (
integer, integer_or_blank, double_or_blank, integer_double_string_or_blank)
from pyNastran.bdf.field_writer_8 import print_card_8, set_blank_if_default
from pyNastran.dev.bdf_vectorized2.cards.elements.bars... |
# this generates Suppl Fig7 A-D (re-analysis of Caron et al. result)
import matplotlib.pyplot as plt
exec(open(local_path + "/connectivity/process_caron_data_v2.py").read())
num_exp = 1000
# make all gloms use this universal ids
# glom_id_table = pd.read_excel( "/Users/zhengz11/myscripts/data_results/171012-1D_olf... |
from __future__ import print_function
############################################################################################
#
# The MIT License (MIT)
#
# Intel AI DevJam IDC Demo Classification Server
# Copyright (C) 2018 <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtainin... |
import shutil
from PIL import Image
from ep.evalplatform.create_report import create_report, create_sensible_report
from ep.evalplatform.plotting import Plotter
from ep.evalplatform.utils import *
images_sufixes = [SEGPLOT_SUFFIX, TRACKPLOT_SUFFIX]
SUMMARY_GNUPLOT_FILE = "plot_summary.plt"
terminal_type = "png"
de... |
import re
import requests
import os
import datetime
import time
import sys
singleChapterOutPut=False
supportWebsitesNum=1#增添网站时记得改这里
enabledWebsite=[True]*supportWebsitesNum
def writejianjie(contents,filePath):
with open(sys.path[0]+'\\'+filePath,'a',encoding='utf-8') as ff:#创建jianjie
ff.write(contents)
... |
"""How to represent points clouds, specifying specific data signatures (e.g. choice of features).
Country-specific definitions inherit from abstract class LidarDataLogic, which implements general logics
to split each point cloud into subtiles, format these subtiles, and save a learning-ready dataset splitted into
trai... |
# Copyright 2017 The TensorFlow Lattice 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 a... |
from subprocess import Popen, PIPE, signal
import os
import re
from modules.webrequests import GetCPUHardwareData, UpdateSupportedDevices
from modules.deviceCacher import GetCachedDeviceData, CacheDevice
from modules.deviceInfoFormat import PrintError
CPUHardwareData = {}
def SetCPUHardwareData():
global CPUHar... |
# Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... |
"""
This module provides the FiniteStateMachine class.
"""
import itertools
from collections import defaultdict
from typing import Dict, Iterable, List, Optional, Set, Tuple
# Adapted from: https://stackoverflow.com/a/34325723/13526914
def print_progress_bar(
iteration: int,
total: int,
prefix: str = "",
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 00:44:17 2019
@author: <NAME>
"""
import numpy as np
#import matplotlib.pyplot as plt # to plot
import random
import networkx as nx
import pandas as pd
import csv
import time
from copy import deepcopy as deep_copy
from pgmpy.readwrite import BIFReader
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: python; python-indent-offset: 4 -*-
#
# ./get_peer_reviews_and_comments.py -c course_id -a assignment_id
# Purpose:
# Get the peer reviews and any comments
#
#
# Output: Outputs a directory (assignment_folder) with a name of the form: Assignment_ddddd, where d... |
import argparse
import os
import random
import shutil
import time
import warnings
import numpy as np
from progress.bar import (Bar, IncrementalBar)
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.o... |
# vim: set sw=4 expandtab :
#
# Copyright (C) 2000, 2001, 2013 <NAME>
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apache Software Foundation
#
# 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 t... |
# coding=utf-8
import numpy as np
from scipy import ndimage
from scipy.interpolate import spline
from scipy.ndimage.filters import gaussian_filter
from scipy.spatial import ConvexHull
from scipy.spatial import Delaunay
from cheshire.Grid import *
class Potential(object):
"""
A potential object containing info... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import random
import string
from builtins import object
from builtins import range
from babel.numbers import get_currency_name
from django.core.cache import cache
from django.db import connection
from django.db import models
from django.db.models import C... |
# imports
import bpy
import os
from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty
from bpy_extras.io_utils import ImportHelper
from bpy.types import Operator
import math
import mathutils
from mathutils import *
from math import *
# BLENDER ADDON INFORMATION
bl_info = {
"name": "Latti... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
"""
Intermittency Graph by <NAME>.
Goal here is to emphasize the complexities of daily and seasonal intermittency
compared to baseload low carbon sources like nuclear.
Want two scenarios: nuclear and solar. For each, we'll want winter and summer versions.
So, 2x2 subplots? With text in each one saying how much powe... |
import os
import sys
import time
import shutil
import argparse
import numpy as np
from PIL import Image
from skimage import io
from pathlib import Path
from matplotlib import cm
import matplotlib.pyplot as plt
from imgaug import augmenters as iaa
# Pycoco
from pycocotools.coco import COCO
from pycocotools.cocoeval imp... |
"""
Script to load census and acs data into our models.
Some notes about the data formats and weirdness of it can be found here:
https://www2.census.gov/programs-surveys/acs/summary_file/2019/documentation/tech_docs/ACS_SF_Excel_Import_Tool.pdf
"""
import csv
import json
import os
import zipfile
from ftplib import FT... |
# Copyright (c) 2019-2020 <NAME>
# License: MIT License
# Created 2019-02-15
from typing import TYPE_CHECKING, Tuple, Sequence, Iterable, cast, List, Union
import array
import copy
from contextlib import contextmanager
from ezdxf.math import Vector, Matrix44
from ezdxf.math.transformtools import OCSTransform, NonUnifor... |
# -*- coding: utf-8 -*-
'''Simplicity masking and scoring classes.
'''
import os
import shutil
# 3rd-party packages
import pyfaidx
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# module packages
from . import cli
from .common import *
#
# global constants
#
TERM_CHAR = '$'
NUM_HISTOGRAM_BINS ... |
from __future__ import division
import torch
import torch.nn.functional as F
from torch import nn
import utils_warp as utils
import loss_ssim
pixel_coords = None
device = torch.device(
"cuda") if torch.cuda.is_available() else torch.device("cpu")
class SSIM(nn.Module):
"""Layer to compute the SSIM loss be... |
"""Micro moments."""
import abc
import collections
from typing import Any, Dict, Hashable, List, Optional, Sequence, TYPE_CHECKING
import numpy as np
from . import options
from .utilities.basics import Array, StringRepresentation, format_number, format_table
# only import objects that create import cycles when che... |
import math
from .utils import build_mantissa
from .mantissa_operation import compare, mantissa_sum, mantissa_sub, mantissa_mul, mantissa_div
class FPANumber:
def __init__(self, base, exponent, mantissa, sign):
self._base = base
self._exponent = exponent
self._mantissa = mantissa
... |
import torch
import os
import ctypes
from random import randrange, uniform, seed
import numpy as np
from .Model import Model
from .TransE import TransE
from ...config import Trainer
from ...data import TestDataLoader
from ..strategy import NegativeSampling
from ..loss import MarginLoss
from collections import defaultdi... |
import os.path
import sys
import time
import pickle
import h5py
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Model, Sequential
from keras.layers import Flatten, Dense, Input, Conv1D, AveragePooling1D, BatchNormalization
from keras.optimizers import *
from keras.callbacks import ModelCheck... |
# Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from i... |
import os
import random
import datetime
import argparse
import time
import argparse
import numpy as np
from torchvision import models
import torch.nn as nn
import torch
import random
import dlib
import cv2
import imutils
from imutils.video import VideoStream
from imutils import face_utils
from moviepy.editor import *... |
# from rhombus.models.core import *
from rhombus.models.core import BaseMixIn, Base, Column, relationship, types, deferred, ForeignKey, backref, UniqueConstraint, object_session, Sequence
from rhombus.models.ek import EK
from rhombus.models.user import User, Group
# from rhombus.lib.roles import *
from rhombus.lib imp... |
# Copyright 2020-2021 The MathWorks, Inc.
import sys
import os
import aiohttp
import asyncio
import json
import pkgutil
import mimetypes
from aiohttp import web
from matlab_desktop_proxy import settings
from matlab_desktop_proxy import mwi_environment_variables as mwi_env
from matlab_desktop_proxy import util
import m... |
###########################################################################
# ____ _____________ __ __ __ _ _____ ___ _ #
# / __ \/ ____/ ___/\ \/ / | \/ (_)__ _ _ __|_ _/ __| /_\ (R) #
# / / / / __/ \__ \ \ / | |\/| | / _| '_/ _ \| || (__ / _ \ #
# / /_/ / /___... |
import rospy
import ros_numpy
import numpy as np
import copy
import json
import os
import sys
import torch
import yaml
import time
from std_msgs.msg import Header
import sensor_msgs.point_cloud2 as pc2
from nav_msgs.msg import Odometry
from sensor_msgs.msg import PointCloud2, PointField
from jsk_recognition_msgs.msg ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os.path as op
import json
from collections import defaultdict
import numpy as np
from nipype import logging
import pandas as pd
from nipype.utils.fileman... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
A universal Python parser combinator library inspired by Parsec library of Haskell.
'''
__author__ = '<NAME>, <EMAIL>'
import re
from functools import wraps
from collections import namedtuple
##########################################################################... |
#!/usr/local/bin/python3.7
"""
An automated topology visualization solution based on LLDP data.
NAPALM is used along with Nornir to retrieve the data from hosts:
- NAPALM GET_LLDP_NEIGHBORS_DETAILS getter returns LLDP neighbors details;
- NAPALM GET_FACTS getter returns general device info we can use for visualiz... |
import numpy as np
import scipy.sparse as sp
from scipy.sparse import csr_matrix
from itertools import chain
"""
authors: <NAME>
contact: <EMAIL>
date: May 2015
"""
################## VARIOUS INTERFACES #######################################
""" Generic map from a state (as an array), to a feature vector (as an arr... |
import numpy as np
import numerical.numpytheano as nt
import bvhrw.bvhrw as bvh
import transform3d.transformations as tr
def get_node_position_channels(node):
return node.position_channels
def get_node_position_offset(node):
position = node.offset
return np.array(position)
def get_node_rotation_channe... |
# Authors: <NAME> <<EMAIL>>
# + All contributors to <https://github.com/smarie/python-yamlable>
#
# License: 3-clause BSD, <https://github.com/smarie/python-yamlable/blob/master/LICENSE>
import collections
from abc import abstractmethod, ABCMeta
import six
try: # python 3.5+
from typing import Type... |
import os
import logging
import collections
import numpy as np
import torch
from torch import nn
from torch import autograd
from torch import optim
from torch.utils import tensorboard
from ..tools import timer_tools
from ..tools import py_tools
from ..tools import flag_tools
from ..tools import summary_tools
from ..t... |
from collections import OrderedDict
from hwtypes import BitVector
import os
from ..bit import VCC, GND, BitType, BitIn, BitOut, MakeBit, BitKind
from ..array import ArrayKind, ArrayType, Array
from ..tuple import TupleKind, TupleType, Tuple
from ..clock import wiredefaultclock, wireclock, ClockType, Clock, ResetType, C... |
from tkinter import *
import tkinter.ttk as tk
"""
For those unfamiliar with Tk
A frame is a box, similar to a DIV in html, for formatting
A label is a text object
Pack puts an object into its frame
"""
class Object_Interface:
"""
The object handling the window created when the user adds an object
"""
... |
import logging
import sys
import click
import pkg_resources
import seslib
from seslib.exceptions import SesDevException
logger = logging.getLogger(__name__)
def sesdev_main():
try:
# pylint: disable=unexpected-keyword-arg
cli(prog_name='sesdev')
except SesDevException as ex:
logger.... |
# -*- coding: utf-8 -*-
import collections
import pyjsdoc
from . import jsdoc
from . import utils
from .visitor import Visitor, SKIP
DECLARATOR_INIT_TO_REF = ('Literal', 'Identifier', 'MemberExpression')
class ModuleMatcher(Visitor):
"""Looks for structures of the form::
odoo.define($string, function ... |
import copy
import math
from dataclasses import dataclass, fields
from typing import Optional, Tuple, List, NamedTuple, Union, Iterable, Dict
from pathlib import Path
import pickle
from enum import Enum
import functools
from collections import Counter
import logging
import pandas as pd
import numpy as np
from .physio... |
import os
try:
import fool
except:
print("缺少fool工具")
import math
import pandas as pd
import numpy as np
import random
import tensorflow as tf
import re
np.random.seed(1)
def add2vocab(path,word):
vocab_data=pd.read_csv(path)
idx_to_chars=list(vocab_data['vocabulary'])+[word]
df_data = pd... |
"""Training routines for LSTM model."""
import os
from collections import OrderedDict
import numpy as np
from tqdm import tqdm
import torch
from torch.autograd import Variable
import torch.optim as optim
import torch.multiprocessing as mp
from torch.nn.utils import clip_grad_norm
import utils, criterion
class Trainer... |
import datetime
import decimal
import logging
import uuid
import warnings
from django.conf import settings
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.base.client import BaseDatabaseClient
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.backends... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
# >.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.
# Licensed under the Apache License, Version 2.0 (the "License")
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# --- File Name: hd_networks_stylegan2.py
# --- Creation Date: 22-04-2020
# --- Last Modif... |
#!/usr/bin/env python2
# Copyright 2015 The Android Open Source Project
#
# 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... |
# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t; python-indent-offset: 2 -*-
# vim: tabstop=2:shiftwidth=2:noexpandtab
# kate: tab-width 2; replace-tabs off; indent-width 2;
#
# ==============================================================================
# Authors: <NAME>
#
# Python Sub Module:... |
import numpy as np
import torch
import torch.nn.functional as F
import os
from skimage.io import imsave
import cv2
from PIL import Image
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
def dict2obj(d):
if isinstance(d, list):
d = [dict2obj(x) for x in d]
if not isinstance(d... |
"""Orthogonal matching pursuit algorithms
"""
# Author: <NAME>
#
# License: BSD Style.
import warnings
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel
from ..base import RegressorMixin
from ..utils import array2d
from ..utils.arrayfuncs impo... |
"""
iterative ptychographical reconstruction assuming vector wavefields
the algorithm is developed using the theory outlined in,
"Ptychography in anisotropic media, <NAME>, 2015"
"""
import jones_matrices as jones
import numexpr as ne
import numpy as np
import optics_utils as optics
import pylab as pyl
im... |
import sys
import os
import gensim
import re
import random
import csv
import logging
import numpy as np
# import theanets
import json
# from sklearn.metrics import classification_report, confusion_matrix
import operator
from random import random
from gensim.models import KeyedVectors
### Main program
... |
import numpy as np
from gym.spaces import Dict
from rlkit.data_management.replay_buffer import ReplayBuffer
from rlkit.torch.relational.relational_util import get_masks, pad_obs
class ObsDictRelabelingBuffer(ReplayBuffer):
"""
Replay buffer for environments whose observations are dictionaries, such as
... |
import json
from .tokenizer import Tokenizer, _Tokenizer
class VocabDict(object):
def __init__(self, data_path, out_path, max_n_words=35000):
self.data_path = data_path
self.out_path = out_path
self.max_n_words = max_n_words
def generate_vocabfile(self, data_path=None, out_path=None)... |
import queue
import os, sqlite3
import re
from time import sleep
import threading
import datetime
import flask
import traceback
try:
import simplejson as json
except ImportError:
import json
import copy
import logging
from cbint.utils.templates import binary_template
import dateutil.parser
epoch = datetime.da... |
# -*- coding: utf-8 -*-
"""Define global constants and common helper functions."""
# standard library imports
import locale
import os
from pathlib import Path
from pathlib import PosixPath
# third-party imports
import toml
# first-party imports
import click
from addict import Dict
#
# global constants
#
NAME = "bio... |
import sys
import os
import glob
import string
import logging
import yaml
import yamlordereddictloader
def extract_data(c, param_map):
"""
Method to generate a CPAC input subject list
python file. The method extracts anatomical
and functional data for each site( if multiple site)
and/or scan parame... |
import os
import re
import sys
import logging
import argparse
from enum import Enum
from fractions import Fraction
from typing import List
import mugen.video.video_filters as vf
from mugen import MusicVideoGenerator, VideoFilter
from mugen import paths
from mugen import utility as util
from mugen.events import EventLi... |
import time
import random
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import ops.semantic_segmentation.imageops as imageops
def test(predict, dataset, num_classes,
batch_size=3, ys_mask=None, cutoffs=(0.0, 0.9), bins=np.linspace(0.0, 1.0, 11), verbose=True, period=10):
pred... |
"""
Includes base class and functions for data preprocessing and loading.
"""
from difflib import SequenceMatcher
from abc import abstractmethod, ABCMeta
import cloudpickle
import numpy as np
import pandas as pd
from sklearn.model_selection import ParameterGrid
from sklearn.utils import check_scalar
def _cols(x):
... |
"""
owtf.db.target_manager
~~~~~~~~~~~~~~~~~~~~~~
"""
import os
import datetime
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from owtf.dependency_management.dependency_resolver import BaseComponent, ServiceLocator
from owtf.dependency_management.interfaces import T... |
import torch
import models
import utils
from transformers import BertTokenizerFast
from torch.utils.data import DataLoader
import torch.optim as optim
import pickle as pk
import numpy as np
#performance metrics
from sklearn.metrics import classification_report
import datasets
device = torch.device('cuda') if torch... |
from . import tau_config as ptc
import serial
import struct
import binascii
import time
import logging
import numpy as np
import tqdm
import math
import usb.core
import usb.util
from pyftdi.ftdi import Ftdi
import pyftdi.serialext
# Tau Status codes
CAM_OK = 0x00
CAM_NOT_READY = 0x02
CAM_RANGE_ERROR = 0x03
CAM_UND... |
# -*- coding: utf-8 -*-
"""
Takes the time-series probabilities (generated by likelihood_test_parallel.py) and parses them into events.
Uses a simpmle threshold algorithm.
Created on Fri Jun 27 15:30:51 2014
@author: <NAME> (<EMAIL>)
"""
from datetime import datetime, timedelta
from Queue import PriorityQueue
from ma... |
#!/usr/bin/env python
# encoding: utf-8
# Copyright (c) 2016, <NAME> (www.karlsruhe.de)
#
# 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 th... |
import textwrap
import os
from cloudmesh.common.parameter import Parameter
from cloudmesh.common.console import Console
from cloudmesh.common.Host import Host
from cloudmesh.common.Printer import Printer
from cloudmesh.pi.cluster.k3.K3SDashboard import K3SDashboard
from cloudmesh.common.StopWatch import StopWatch
cl... |
import warnings
import string
import re
import math
import pkg_resources
from collections import Counter
from functools import lru_cache
from pyphen import Pyphen
langs = {
"en": { # Default config
"fre_base": 206.835,
"fre_sentence_length": 1.015,
"fre_syll_per_word": 84.6,
"sylla... |
from .Dispatcher import Dispatcher
from .Component import PyOptSparseComponent
from .TimeSeries import TimeSeries
from .Solution import Solution
# Don't import pyoptsparse here as Gekko users may not want to install it
import numpy as np
import sys
import os
import time as time_lib
import traceback
from typing import ... |
# encoding: UTF-8
import sys
import hashlib
import zlib
import json
from time import sleep
from threading import Thread
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
from twisted.internet.protocol import Reconnec... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import scipy.stats as stats
import h5py as h5
from tensorsignatures.config import *
from tensorsignatures.util import *
import subprocess
import os
class TensorSignatureData(object):
r"""Makes sample data for TensorSignatures
Args:
seed (:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.