text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
"""Machine learning applications.
"""
import pickle
import pathlib
import sigpy as sp
class ConvSparseDecom(sp.app.LinearLeastSquares):
r"""Convolutional sparse decomposition app.
Considers the convolutional sparse linear model :math:`y = \sum_j L_j * R_j`,
with :math:`L` fixed, ... |
import os
import sys
import pygame
import random
from pygame import *
pygame.init()
scr_size = (width,height) = (600,150)
FPS = 60
gravity = 0.65
black = (0,0,0)
white = (255,255,255)
background_col = (235,235,235)
high_score = 0
screen = pygame.display.set_mode(scr_size)
clock = pygame.time.Clock()
pygame.disp... |
# Copyright 2020 <NAME>, <NAME>, and <NAME>. All Rights Reserved.
# Copyright 2017 onwards, fast.ai, Inc.
# Modifications copyright (C) 2019 Uber Technologies, 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 c... |
import pandas as pd
import weatherApi
import numpy as np
from route_coordinate_mapping import HVVCoordinateMapper
from routing import load_routes
import json
import io
class DataGenerator:
def __init__(self):
self.mapper = HVVCoordinateMapper()
self.routes = load_routes()
self.routes_probs... |
# -*- coding: utf-8 -*-
"""Sweep controller.
This module implements the sweep controller.
On error an exception is raised:
ControllerError
Example:
import wandb
#
# create a sweep controller
#
# There are three different ways sweeps can be created:
# (1) create with sweep id from `wandb ... |
from collections import OrderedDict
import math
import requests
import json
from urllib.parse import urljoin
from operator import itemgetter
from flask import abort, flash, redirect, render_template, request, url_for
from sqlalchemy.orm import joinedload
from sqlalchemy.ext.declarative import DeclarativeMeta
from .co... |
from datetime import datetime
import gym
import gym.spaces
import numpy as np
import os
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from typing import Any, Dict, List, Tuple, Union
import wandb
import spin_class.utils as utils
class SampleBatch:
d... |
"""
Residual Censorship
Script is used to detect the presence of residual censorship (typically from null-routing)
to an echo server.
- Connect to the given echo server and send a test string to check that the server is responsive.
- Connect again and send a forbidden HTTP GET request. Wait a second, and then send a... |
#
# MIT License
#
# Copyright (c) 2018 Erriez
#
# 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, pub... |
# -*- coding: utf-8 -*-
import collections
import datetime
import logging
import os
import re
import sys
import dateutil.parser
import pytz
from six import string_types
from elastalert import ElasticSearchClient
from elastalert.auth import Auth
logging.basicConfig()
logging.captureWarnings(True)
elastalert_logger = ... |
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import operator
from six.moves.urllib_parse import unquote_plus
import sqlalchemy.types as sqltypes
from six import iteritems
from sqlalchemy import util as sa_util
from sqlalchemy import event as ... |
import random
import time
import turtle # main GUI user interacts with
from itertools import cycle # for cyclical lists
import re # for regex searches
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
from pygame import mixer # for sound
import math
print('loading please wait..')
screen = turtle.Screen()... |
# import only system from os
from os import system, name
import time
import random
class Battleships:
'''
Class that plays the game of Battleships with varying degrees of intelligence
Built to be used as an API
Singleton class
'''
#class vars
# The ships : length of ship
ships = { 'Airc... |
import logging
from copy import deepcopy
from typing import Dict, Any, List
import h5py
import numpy as np
from Bio.Seq import Seq
from pandas import read_csv, DataFrame, concat as concatenate_dataframe
from sklearn.metrics import pairwise_distances as _pairwise_distances
from bio_embeddings.extract.basic import Basi... |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
# Copyright 2018 Johns Hopkins University (<NAME>)
# Apache 2.0.
""" This module contains some composite layers, which is basically a catch-all
term for things like TDNN-F that contain several affine or linear comopnents.
"""
from __future__ import print_function
import math
import re
import sys
from libs.nnet3... |
import binascii
import os
import struct
import types
from . import libicebox
# magic to attach dynamic properties to a single class instance
def _attach_dynamic_properties(instance, properties):
class_name = instance.__class__.__name__ + "_"
child_class = type(class_name, (instance.__class__,), properties)
... |
"""
I/O for the PLY format, cf.
<https://en.wikipedia.org/wiki/PLY_(file_format)>.
<https://web.archive.org/web/20161221115231/http://www.cs.virginia.edu/~gfx/Courses/2001/Advanced.spring.01/plylib/Ply.txt>.
"""
import collections
import re
import sys
import warnings
import numpy
from .._exceptions import ReadError, ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from utils.to_json import *
UNIT_NAME = 'utP1c0CD'
UNIT_ELEMENT = 'iNy0ZU5M'
UNIT_RARITY = '7ofj5xa1'
UNIT_BASE_HP = 'UZ1Bj7w2'
UNIT_LORD_HP = '3WMz78t6'
UNIT_BASE_ATK = 'i9Tn7kYr'
UNIT_LORD_ATK = 'omuyP54D'
UNIT_BASE_DEF = 'q78KoWsg'
UNIT_LORD_DEF = '32INDST4'
UNIT_BASE_REC ... |
# Import TensorFlow >= 1.10 and enable eager execution
import tensorflow as tf
tf.executing_eagerly()
import os
import time
import numpy as np
import matplotlib.pyplot as plt
import PIL
from IPython.display import clear_output
import glob
import os
import cv2
from matplotlib import pyplot as plt
import matplotlib.imag... |
# -*- coding: utf-8 -*-
# Created by: Vincentzyx
import win32gui
import win32ui
import win32api
from ctypes import windll
from PIL import Image
import cv2
import pyautogui
import matplotlib.pyplot as plt
import numpy as np
import os
import time
import threading
from win32con import WM_LBUTTONDOWN, MK_LBUTTON, WM_LBUTTO... |
import datetime
import json
import logging
import logging.handlers
import threading
import numpy as np
import socketio
from aiohttp import web
# creates a new Async Socket IO Server
from sqlalchemy import desc, and_, or_
from common import db
from common.db_manager import Client, Op, Data, OpStatus, Graph, ClientOp... |
from typing import Dict, Set
import functools
import os
import keyword
import re
import inspect
# functools has cached_property but only for python 3.8+
from cached_property import cached_property
# ========================================================================= #
# configurable ... |
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import math
import time
import gensim
import logging
import json
import numpy as np
from collections import OrderedDict
from scipy import stats
from texttable import Texttable
from gensim.models import KeyedVectors
from tflearn.data_utils import pad_sequences
... |
# 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 u... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 10 08:22:25 2015
@author: bloer
"""
#python 2/3 compatibility
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import super
from .common import units, ensure_quantity, removeclasses, stripdefaults... |
"""Base plotting functions"""
from typing import Union, Sequence, Tuple, Optional
from .._compat import Literal
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from ._styling import style_axes, DEFAULT_FIG_KWS, _init_ax
from .._util import _doc_params
from sklearn.neighbors import KernelDensity
f... |
# -*- coding: utf-8 -*-
"""Utility Functions for the MCMC."""
__author__ = ["<NAME>", "<NAME>"]
###############################################################################
# IMPORTS
# GENERAL
import os
import pickle
import numpy as np
from numpy.linalg import norm
from scipy.interpolate import interp1d
impo... |
import tensorflow as tf
import numpy as np
import random
import sys, os, gc
import pandas as pd
from absl import app, flags, logging
from geformer import Geformer
DTYPE_MAP = {
"fp16": tf.float16,
"bf16": tf.bfloat16,
"fp32": tf.float32,
}
#devices = tf.config.experimental.list_physical_devices('GPU')
#t... |
# Copyright 2021 The NetKet 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 applicable ... |
#!/usr/bin/env python3
# =============================================================================
# This file contains functions used to create the HTML output of the viewer.
#
# Authors: <NAME>, <NAME>, <NAME>
# =============================================================================
import os
import time
fr... |
#
# jcqid.py
# ========
#
"""
Python-3 module for generating and handling Jacques-ID identification
codes.
All exceptions generated by this module are subclasses of JCQIDError and
overload the str operator so that they can be printed as user-friendly
error messages. The messages have punctuation at the end, but they... |
#%%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
import random
from mpl_toolkits.axes_grid1 import make_axes_locatable
import warnings
warnings.simplefilter("ignore")
np.random.seed(1)
random.seed(1)
#%%
def cluster_info(arr):
""" number of clusters (nonzero fields separat... |
#
# Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" fi... |
import torch
import torch.nn as nn
import numpy as np
from copy import deepcopy
from operations import OPS, AuxiliaryHeadCIFAR, AuxiliaryHeadImageNet, drop_path, Identity
class MixedOp(nn.Module):
def __init__(self, space, C, stride, affine, track_running_stats):
super(MixedOp, self).__init__()
self._ops =... |
#!/usr/bin/env python
# coding: utf-8
# In[13]:
import numpy as np
import matplotlib.pyplot as plt
get_ipython().magic(u'matplotlib inline')
import seaborn as sns
import scipy.io as sio
import os
import subprocess
import bisect
import errno
import time
import pandas
import pickle
import num2word
from sklearn.decompo... |
import os
import os.path as op
import numpy as np
import pandas as pd
import nibabel as nib
from tqdm import tqdm
from glob import glob
from nilearn import masking, signal, image
from joblib import Parallel, delayed
from sklearn.metrics import r2_score
from sklearn.linear_model import Ridge, LinearRegression
from sklea... |
# -*- coding: utf-8 -*- #
# Copyright 2016 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... |
#!/usr/bin/env python3
import os
import sys
import numpy
import rospy
import rospkg
import time
import threading
import random
import ctypes
import pybullet as p
import pybullet_data
from geometry_msgs.msg import Twist
from quadruped_ctrl.srv import QuadrupedCmd, QuadrupedCmdResponse
get_last_vel = [0] * 3
robot_heig... |
#!/usr/bin/env python
"""
Implemantation of a GUI for the DoE.
"""
# Import PyQt Widgets for PyQt5 version
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QHeaderView, QFileDialog
# Import pyqtSlot to connect sliders and DoubleSpinBox signals
from PyQt5.QtCore import pyqtSlot, Qt
# I... |
"""LibSPN math functions."""
import tensorflow as tf
import numpy as np
import collections
from libspn import utils as utils
def logmatmul(a, b, transpose_a=False, transpose_b=False, name=None):
with tf.name_scope(name, "logmatmul", [a, b]):
# Number of outer dimensions
num_outer_a = len(a.shape)... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
## Copyright (c) 2021 <NAME>.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditi... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Generic output file parser and related tools"""
import bz2
import fileinput
import gzip
import inspect
import io
impor... |
# *******************************************************#
# Author: <NAME> - UTEP, Computational Science #
# Code developed in Sirimulla Research Group #
# (http://sirimullaresearchgroup.com/) #
# Last modified:10/25/2021 #
# ***************************... |
"""
Bablu
Helper methods for image and video processing for mrcnn inference.
Copyright (c) 2019 <NAME>.
Licensed under the MIT License (see LICENSE for details)
Taken and modified from:
https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/utils.py
"""
import numpy as np
import cv2
import datetime
import skimage... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This script implements algorithm for finding intersecting rectangles,
both on the 2D dotplot and 1D-projection
`range_chain` implements the exon-chain algorithm
"""
import sys
from itertools import groupby
from collections import namedtuple, defaultdict
LEFT, RIGH... |
#!/usr/bin/python
import atexit
import json
import urllib
import os
import requests
from pyVim.connect import SmartConnectNoSSL, Disconnect
from ansible.module_utils.basic import *
from pyVmomi import vim, vmodl
__author__ = 'chaitanyaavi'
def is_vm_exist(si, cl, vm_name):
container = si.content.viewManager.Cre... |
"""
The data processing functions in this file are largely derived from the example for question
answering in the huggingface transformers library. The license for the transformer's library is
reproduced below.
==================================================================================================
Copyrigh... |
from config import get_config, SUPPORTED_YEARS, SUPPORTED_LANGUAGES, DEFAULT_YEAR
from csp import csp
from feature_policy import feature_policy
from flask import Flask, abort, redirect, render_template as flask_render_template, request, send_from_directory, url_for
from flask_talisman import Talisman
from language impo... |
# -*- encoding: utf-8 -*-
import discord
from discord.ext import commands
from discord.enums import MessageType
from cogs.utils.dataIO import fileIO
from .utils import checks
import asyncio
import re
import os
import psutil
import datetime
import time
class Custom:
"""Adds usefull custom crap"""
def __init__(self, b... |
# Copyright (c) 2016 - 2019 Nordic Semiconductor ASA
# 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
# list o... |
# Copyright 2011-2013 <NAME>
#
# This file is part of POX.
#
# POX 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 3 of the License, or
# (at your option) any later version.
#
# POX is distribut... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import errno
import importlib
import logging as log
import os
import re
import sys
import warnings
import nibabel as nib
import numpy as np
import scipy.ndimage
import tensorflow as tf
from tensorflow.core.framework impor... |
#!/usr/bin/env python3
"""
Script that handles command line argument parsing and calls Builder module
"""
import argparse
import biskit as B
import random
import os
# If type=divide does not work, try action='append_const'
def divide(s):
"""
Converts entries for the --chain argument into tuples, and checks ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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.or... |
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python3
#
# MIT License
#
# (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP
#
# 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 w... |
# -*- coding: utf-8 -*-
# vim: set ft=python ts=4 sw=4 expandtab:
"""
Classes that track game state.
Note that these classes track game state, but do not implement game rules. The
only validations are to prevent changes that literally cannot be represented in
game state, such as selecting an invalid square. All oth... |
import os
import sys
import tempfile
import yaml
import zlib
import numpy as np
import simplejson as js
import subprocess as sb
from time import time,sleep
from os import path
from scipy.stats.mstats import mquantiles
try:
from sklearn.lda import LDA
from sklearn.svm import SVC
from sklearn.neighbors impor... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: attribute
# Purpose: Descriptors for defining attributes
#
# Author: <NAME> (<EMAIL>)
#
# Copyright: (c) 2014 <NAME>
# License: This program is part of a larger application. For license
#... |
"""
This script contains useful mathematical operations
Copyright (c) 2022, SKAO / Science Data Processor
SPDX-License-Identifier: BSD-3-Clause
"""
import errno
import os
import pickle
import shutil
from math import modf
import lsmtool
import numpy as np
import psutil
from astropy.io import fits as pyfit... |
from __future__ import absolute_import, division, print_function
import rosbag
import pandas as pd
import numpy as np
import h5py
import glob
import matplotlib.pyplot as plt
from collections import OrderedDict, defaultdict
xy_extract_dict = OrderedDict([
('/object_state/1', OrderedDict([
('x1', lambda m: ... |
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glob
import time
import threading
from helpers.parameters import (
parse_args, load_config
)
# used for dates
from datetime import date, datetime, timedelta
import time
#gogo MOD telegram needs import reque... |
# Copyright (c) 2020 NVIDIA CORPORATION.
# Copyright (c) 2018-2020 <NAME> (<EMAIL>).
#
# 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 ri... |
#!/usr/bin/env python
#
# 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
# "L... |
import pathlib
import pickle
import time
from collections import defaultdict
from functools import partial
from pathlib import Path
import cv2
import numpy as np
from skimage import io as imgio
from second.core import box_np_ops
from second.core import preprocess as prep
from second.core.geometry import points_in_con... |
# Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... |
# HOME CREDIT DEFAULT RISK COMPETITION
# Most features are created by applying min, max, mean, sum and var functions to grouped tables.
# Little feature selection is done and overfitting might be a problem since many features are related.
# The following key ideas were used:
# - Divide or subtract important features t... |
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import six
from coremltools.converters.mil.mil import types
from coremltools.converters.mil.mil.types... |
import asyncio
import atexit
import copy
import weakref
from tornado import gen
from dask.utils import format_bytes
from .cluster import Cluster
from ..comm import connect
from ..core import rpc, CommClosedError
from ..utils import (
log_errors,
LoopRunner,
silence_logging,
ignoring,
Log,
Logs... |
import numpy as np
from matplotlib import pyplot as plt
import random
# ----------------- CONSTANTS SETTINGS -----------------------
BETA = 1000000000
# ----------------- CLOUDING SYSTEM ENVIRONMENT --------------
class cloud_Env:
def __init__(self, U, M, D, W, Tmax, P, R_sbs, f_local, f_sbs, f_mbs, sigma_l, sig... |
# Copyright 2021, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
"""
ExperimentData module allows us to abstract the data format from the library
such that we can have multiple fetcher modules that only need import this
module, and none of our analysis modules need know anything about the fetchers.
In other words, this is the interface between data fetching and data analysis.
"""
... |
# -*- coding: utf-8 -*-
'''
:codeauthor: <NAME> <<EMAIL>>
'''
# Import Python libs
from __future__ import absolute_import
import copy
import errno
import logging
import os
import shutil
import textwrap
import subprocess
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.paths ... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.integrate import trapz, quad, solve_ivp
from scipy.interpolate import interp1d
from ErgodicHarvestingLib.utils import matmult
class ProjectionBasedOpt(object):
def __init__(self, nx, nu, R, time, Quinit):
"""
Class to represent an optimization... |
'''
Application for training a CycleGAN model.
Usage: train in_config_path
<NAME>,
Real-Time Computer Vision,
Institut fuer Neuroinformatik,
Ruhr University Bochum.
'''
import datetime
import time
import math
import os
import tensorflow as tf
import cyclegan.model.train as train
import cycl... |
from os import path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from enmspring.graphs_bigtraj import BackboneMeanModeAgent
from enmspring import pairtype
from enmspring.k_b0_util import get_df_by_filter_PP, get_df_by_filter_R, get_df_by_filter_RB
from enmspring.basestack_k import StackResidPl... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 9 02:58:30 2021
@author: qcao
v2 - denser structures
"""
import os
import sys
sys.path.append('../') # use bonebox from source without having to install/build
from bonebox.phantoms.TrabeculaeVoronoi import *
from bonebox.FEA.fea import *
impor... |
"""CGCNN Wrapper."""
import argparse
import os
import time
import sys
import shutil
from typing import Dict, List, Tuple, Any
import warnings
import numpy as np
from monty.dev import requires
from pymatgen.core.structure import Structure
import torch
import gcn.cgcnn
import torch.optim as optim
import torch.nn as nn
... |
#!/usr/bin/python3
# Install confirmation with details window
import logging
import os
import pathlib
import subprocess
import sys
import webbrowser
import tempfile
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('WebKit2', '4.0')
from gi.repository import Gtk, WebKit2
from distutils.version import St... |
from pyv.module import *
from pyv.port import *
from pyv.reg import *
from pyv.mem import *
import pyv.isa as isa
from pyv.util import *
from pyv.defines import *
# class Stage:
# def __init__(self):
# pass
# A_i = Port()
# B_i = Port()
# C_o = Port()
# def process(self):
# self.C... |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for the osutils.py module (imagine that!)."""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(... |
### XGBoost
import numpy as np
import sklearn
from xgboost import XGBClassifier
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import RandomizedSearchCV
from itertools import cycle
from scipy import interp
import matplotlib.pyplot as p... |
#!/usr/bin/env python
############################################################################
# Copyright (c) 2011-2014 Saint-Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
############################################################################
import sys
import os
impo... |
def Retweet (my_path, worksheet1, worksheet9, my_path_judge) :
from collections import defaultdict
from operator import itemgetter
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib as mpl
tweet_number = worksheet9.cell(1, 0).value
retwe... |
import open3d as o3d
from spherical_voxel import spherical_voxel as sv
from lie_learn.spaces import S2
from typing import Tuple
import numpy as np
import math
import copy
import torch
def get_rotation_matrix(alfa, beta, gamma, hom_coord=False):
"""
Create a rotation matrix with an optional fourth homogeneous ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2005-2006 <NAME>
# Copyright (C) 2006-2007 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from utils import *
# support route shortcut
class MatrixNet(nn.Module):
def __init__(self, num_classes, in_channels, num_layers_stage=[1, 2, 8, 8, 4]):
super(MatrixNet, self).__init__()
# Initial para... |
import math
import matplotlib as mpl
import pandas as pd
import pyvista as pv
from pyvista import MultiBlock, Plotter, PolyData, UnstructuredGrid
from typing import Optional, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
def create_plotter(
jupyter: boo... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This module is not automatically loaded by the `cros` helper. The filename
# would need a "cros_" prefix to make that happe... |
"""Module containing classes and methods for for loading vehicle and
cycle data. For example usage, see ../README.md"""
### Import necessary python modules
import os
import numpy as np
import pandas as pd
import re
import sys
from numba.experimental import jitclass # import the decorator
from numba imp... |
import unittest
from mock import Mock, MagicMock, patch, call
import numpy as np
from dataProcessing import AnalysisData, AnalysisNodeData
from trees import TreeNode
class TestAnalysisData(unittest.TestCase):
def setUp(self):
self.ukey = 'unique_key'
self.eSignFactor = 'eSignFactor'
keys ... |
import copy
import logging
import os
import requests
import smtplib
import socket
import subprocess
import six
import sys
from email.mime.text import MIMEText
import teuthology.lock.query
import teuthology.lock.util
from teuthology import repo_utils
from teuthology.config import config
from teuthology.exceptions imp... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import pdb
import json
import random
import _pickle as cPickle
import logging
import numpy as np
import torch
from torch.utils.data ... |
"""Read a GO Annotation File (GAF) and store the data in a Python object.
Annotations available from the Gene Ontology Consortium:
http://current.geneontology.org/annotations/
"""
import sys
import os
import re
import collections as cx
import datetime
from goatools.anno.annoreader_base import AnnoReaderBa... |
#
# CLI interactions with the chia binary.
#
import datetime
import json
import os
import pexpect
import psutil
import re
import requests
import signal
import shutil
import socket
import sys
import time
import traceback
import urllib
import yaml
from flask_babel import _, lazy_gettext as _l
from flask import Flask, j... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import sys
import os
import codecs
import io
import re
from . import engine
from . import csv_utils
PY3 = sys.version_info[0] == 3
default_csv_encoding = 'utf-8'
user_home_dir = os.path.expanduser('~')
table_name... |
#!/usr/bin/env python3
"""
collection of download operations
http://docs.python-guide.org/en/latest/scenarios/scrape/
http://stackabuse.com/download-files-with-python/
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2017, <NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import os
import re
from collecti... |
from __future__ import absolute_import, division, print_function
from functools import partial
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
from warnings import warn
import numpy as np
import scipy as sp
import tensorflow as tf
from odin.backend.tensor import dropout as apply_dropout... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.