text stringlengths 6.04k 39.5k |
|---|
import random
import torch
import numbers
from PIL import Image, ImageOps, __version__ as PILLOW_VERSION
import math
import torchvision
#import torch.nn.functional as F
import numpy as np
#from https://github.com/pytorch/vision/blob/master/references/detection/transforms.py
#from https://github.com/pytorch/vision/blob/... |
import os, time
from itertools import chain
from Malt.SourceTranspiler import GLSLTranspiler, PythonTranspiler
import bpy
from BlenderMalt.MaltProperties import MaltPropertyGroup
from BlenderMalt import MaltPipeline
from BlenderMalt.MaltUtils import malt_path_setter, malt_path_getter
from . MaltNode import MaltNode
d... |
import torch
from torch.autograd import Variable
import torch.utils.data as utils
# import torch.utils.data as utils
# import torch.nn.functional as F
# import torch
# import torch.nn as nn
# from torch.nn.parameter import Parameter
import math
import numpy as np
import copy
import time
def PrepareDataset(speed_mat... |
import math
import numpy as np
from io import open
from scipy.stats import linregress
from util.geometry import Polygon, Rectangle
from util.xmlformats.Page import Page
def load_text_file(filename):
"""Load text file ``filename`` and return the (stripped) lines as list entries.
:param filename: path to the ... |
# Copyright 2019 British Broadcasting 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 a... |
# Authors
# * <NAME>
# * <NAME>
# * <NAME>
#############
## Imports ##
#############
from pandas.core.frame import DataFrame
from pandas.core.series import Series
from tensorflow.keras.preprocessing import timeseries_dataset_from_array
from sklearn.multioutput import MultiOutputRegressor, RegressorChain
from sklearn.b... |
"""
There are a few important sets of datastructures:
dimensions
* N - Size of the dstore.
* K - Number of retrieved neighbors.
* D - Size of the key vectors.
dstore - This is the "ground truth" source of keys, values, and other important
items created by the KNN-LM.
... |
"""
Tests for Bookmarks models.
"""
import datetime
from contextlib import contextmanager
from unittest import mock
import ddt
import pytz
from freezegun import freeze_time
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from openedx.core.djangolib.test... |
from common.commons import *
DATA_PATH = os.environ["DATA_PATH"]
SPINFER_PATH = os.environ["spinfer"]
ROOT_DIR = os.environ["ROOT_DIR"]
SPINFER_INDEX_PATH = os.environ["dataset"]
COCCI_PATH = join(os.environ["coccinelle"],'spatch')
DATASET = os.environ["dataset"]
import bugzoo
from bugzoo import server, Container
from... |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
import traceback
import requests
'''CONSTANTS'''
BitSight_date_time_format = '%Y-%m-%d'
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
class Client(BaseClient):
"""
Client w... |
# !/usr/bin/python3
"""
WilliamsCoeffcientsMaker (LeucipPy.WilliamsCoeffcientsMaker)
------------------------------------------------------
This class takes multiple measures and a dtaframe and calculates relative information coeffcient by convolution (<NAME>' method)
"""
import math
import random
import numpy as np
im... |
from __future__ import print_function
import argparse
import textwrap
import re
import os
import sys
import chainer
from chainer import training
from chainer.training import extensions
from chainer import cuda
DEFAULT_LAYERS = None #!TODO: Remove global
from train_cifar import models
from train_cifar import add... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/8 10:14 下午
# software: PyCharm
from models.products import ProductsModel
from models.logs import LogsModel
from flask_restful import Resource
from flask_restful.reqparse import RequestParser
from common import code, pretty_result
from c... |
# MIT License
#
# Copyright (c) 2020 TheCoder777
#
# 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, ... |
#!/usr/bin/env python
u"""
gldas_mean_monthly.py
Written by <NAME> (10/2021)
Reads GLDAS monthly datafiles from http://ldas.gsfc.nasa.gov/gldas/
Adding Soil Moisture, snow water equivalent (SWE) and total canopy storage
Calculates the time-averaged grid from a determined range of years
Processes as described on the G... |
import torch
import math
import numpy as np
import pandas as pd
import torch.nn.functional as F
import statistics
from glob import glob
from utilities.images import load_images
from models.latent_optimizer import VGGFaceProcessing
from models.vgg_face2 import resnet50_scratch_dag
from models.regressors import ImageToLa... |
# BitFlipper Challenge
import os, sys
from time import sleep
from timeout import timeout, TimeoutError
time = int(os.getenv("TIMEOUT",90))
sensorFile = 'sensor.py'
encodedFile = 'encoded.bin'
decodedFile = 'decoded.py'
def render_intro():
art = [
" BIT FLIPPER\n",
" CHALLENGE\n\n",
"... |
#!/usr/bin/env python
import sys
from PyQt5.QtGui import QIcon, QBrush, QColor
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QFile, QIODevice, Qt, QTextStream, QRegExp, QTime
from PyQt5.QtWidgets import (QDialog, QFileDialog, QGridLayout, QHBoxLayout,
QLabel, QLineEdit, QMessageBox, QPushButton, QTex... |
# # -*- coding: UTF-8 -*-
# trial on the : Satomi machine
# Created by Ush on 2018/3/30-04/13 for the LU decomposition
# Project name : Class06
# Please contact CHIH, HSIN-CHING/D0631008 when expect to refer this source code.
# NOTE : no liability on any loss nor damage by using this source code. it is you... |
from utils import parse_time, calculate_initial_compass_bearing, q_diff, mean_to_median
from typing import Union, Tuple, List, Callable
from sklearn.cluster import KMeans
from sklearn.preprocessing import LabelEncoder, StandardScaler
from geopy.distance import geodesic
from h3 import h3
import numpy as np
im... |
import praw
import requests
from rake_nltk import Rake
from bs4 import BeautifulSoup
import operator
from time import sleep
from datetime import datetime, timedelta
from .secrets import CLIENT_ID, CLIENT_SECRET
from .models import RedditPost, Keyword
common_words = [
"the",
"of",
"to",
"and",
"a"... |
from __future__ import print_function
import numpy as np
import os
import sys
import argparse
import time
import math
import torchvision.utils as vutils
import tensorboard_logger as tb_logger
import torch
import torch.backends.cudnn as cudnn
from torchvision import transforms, datasets
from util import TwoCropTransf... |
from logging import getLogger
import math
from typing import List, NoReturn, Optional, Union
from geographiclib.geodesic import Geodesic
from jageocoder.address import AddressLevel
from jageocoder.node import AddressNode
from jageocoder.tree import AddressTree
logger = getLogger(__name__)
def p_contained(
... |
from manimlib.imports import *
from vivek.vid_0003_selection_sort.code import Code
class Indicator(VGroup):
def __init__(self, indicator_name, **kwargs):
super().__init__(**kwargs)
self.arrow = Arrow(DOWN, UP, stroke_width=1)
self.arrow.set_length(1)
self.index_head = TextMobject("... |
# -*- coding: utf-8 -*-
"""
Module containing classes for diagnoistic variable calculation and diagnoistic plotting.
"""
import os
import datetime as dt
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
from mpl_toolkits import basemap
import input_data
import stj_metric
import run_stj
# Define t... |
import azure.functions as func
import datetime
import json
import base64
import hashlib
import hmac
import requests
import re
import os
import logging
from .state_manager import StateManager
token = os.environ['SentinelOneAPIToken']
domain = os.environ['SentinelOneUrl']
table_name = "SentinelOne"
chun... |
'''
@Brife:
与Pytorch版本 `core.data_loader.py` 相对应
@Author:
RyanHuang
@Github:
DrRyanHuang
@License:
GPL v3
@Notice:
由于基于 `cv2` 实现, 路径不能有中文
本代码大部分是自己写的轮子, 技术较差, 部分地方写的不优雅, 大家凑合看
同时, 我在改Pytorch代码时, 留下了我的疑问和思考, 欢迎大家留言提issue
'''
import os
import random
from pathlib import Path
from itertools impo... |
"""This module contains functions related to creating a storm surge lookup table used
when running pyCIAM in "probabilistic" mode (i.e. running on many thousands of Monte
Carlo samples of sea level rise trajectories). In this mode, calculating storm surge
damages for each elevation slice, each year, each segment, each ... |
from enum import Enum
from typing import Union
from validator_collection import validators, checkers
from spss_converter import errors
from pyreadstat._readstat_parser import metadata_container
class VariableAlignmentEnum(str, Enum):
UNKNOWN = 'unknown'
LEFT = 'left'
CENTER = 'center'
RIGHT = 'right'... |
from __future__ import division
from ..._core import ensure_contiguous_state
from sympl import (
get_constant, TendencyStepper, initialize_numpy_arrays_with_properties,
get_numpy_arrays_with_properties, ImplicitTendencyComponentComposite,
get_tracer_names, restore_data_arrays_with_properties,
)
import numpy... |
# Copyright (c) 2017 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... |
import os
import numpy as np
import pandas
from sklearn.metrics import classification_report
import torch.nn as nn
import torch.optim as optim
import gensim
from gensim import corpora
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from collections import Counter
from torch.utils.data import Dataset, DataLoad... |
# get the model as DPC-RNN
import sys
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('../uc-backbone')
# to extract the features
from select_backbone import select_resnet
# to aggregate the features in one
from convrnn import ConvGRU
class DPC_RNN(nn.Module):
'''... |
######################################################
#
# BioSignalML Management in Python
#
# Copyright (c) 2010 <NAME>
#
# $Id: search.py,v eeabfc934961 2011/02/14 17:47:59 dave $
#
######################################################
import logging
import copy
import tornado.web
import tornado.escape
from ... |
"""
Copyright 2018 Defense Innovation Unit Experimental
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 applicabl... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from collections import defaultdict
from datetime import datetime
from django.conf import settings
from django.core.exceptions im... |
from sklearn.base import BaseEstimator, TransformerMixin
from pyriemann.utils.covariance import _check_est
from pyriemann.utils.covariance import covariances
from scipy.linalg import sqrtm, eigh
import numpy as np
from scipy.special import gammaincinv
from scipy.special import gamma
import logging
from sklearn.utils.va... |
import numpy as np
import pandas as pd
#T9
train_url = "http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/train.csv"
train = pd.read_csv(train_url) #training set
test_url = "http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/test.csv"
test = pd.read_csv(test_url) #test set
print("printing training head..... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import os
import sys
import secrets
import scipy as sp
import math
import time
from sympy.discrete import convolutions
from sympy.polys import *
from sympy import GF
from scipy.signal import fftconvolve
from sympy import pprint
from sympy.abc import x,y,z
# from... |
# https://github.com/heybourn/headwind/blob/master/package.json#L5016
import sublime, sublime_plugin
import json, os, platform, re, sys
from itertools import chain
PROJECT_NAME = "tailwindcss-Class-Sorter"
SETTINGS_FILE = PROJECT_NAME + ".sublime-settings"
KEYMAP_FILE = "Default ($PLATFORM).sublime-keymap"
IS_WINDOWS... |
#!/usr/bin/env python3
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import cv2
import shutil
import caffe
import xml.etree.ElementTree as ET
import os
... |
"""Module for working with matrices over GF(2) field."""
from random import randint, sample
import math
from blincodes import vector
class Matrix():
"""Binary matrix abstraction."""
def __init__(self, value=None, ncolumns=0):
"""Create new matrix.
:param: value - any iterable of integers
... |
"""
When you want to use free text for values, don't. Use preset constants instead.
All constants should be strings. The Extract stage converts all data to
strings, and we want to maintain the ability to compare with constants during
Transform.
"""
class COMMON:
CANNOT_COLLECT = "Not Allowed To Collect"
MULT... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 10 15:23:39 2019
@author: Darin
"""
import numpy as np
import scipy.sparse as sparse
import davidson as dvd
from time import time
import cvxopt; import cvxopt.cholmod
class it_counter(object):
def __init__(self, disp=False):
self._disp = disp
self.it... |
from bs4 import BeautifulSoup
import datetime as dt
import json
import logging
import numpy as np
import os
import pandas as pd
import random
from tqdm import tqdm
import time
import urllib.parse
from utils import *
logger = logging.getLogger(__name__)
def getStockCates(idx, headers, user_agent_list, valid_ips):
... |
# PyAlgoTrade
#
# Copyright 2011 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import os, math
import time
import numpy as np
import pandas as pd
import geopy.distance
import multiprocessing
from data.gcnm_utils import get_dist_matrix
'''
Input: "xxx.csv" with first column as "Date"
Output: the saved files for preprocessed datasets, i.e., "train/val/test_dataTime.npz" including:
... |
import logging
import os
import collections
from espnet.bin.asr_train import get_parser
from espnet.utils.dynamic_import import dynamic_import
from espnet.utils.deterministic_utils import set_deterministic_pytorch
from espnet.asr.pytorch_backend.asr_init import freeze_modules
from torch.nn.parallel import data_paralle... |
"""
Train a deep neural network based classifier on radar data.
Example usage:
$ python3 ./dnn.py \
--datasets datasets/radar_samples_25Nov20.pickle datasets/radar_samples.pickle
Copyright (c) 2021 <NAME>
"""
import os
import collections
import pickle
import argparse
import logging
import sys
import pick... |
import asyncio
from collections import (
namedtuple,
)
from contextlib import (
AsyncExitStack,
asynccontextmanager,
)
from datetime import datetime
import hashlib
import json
from pathlib import PurePosixPath
import re
import weakref
import xml.etree.ElementTree as ET
from fifolock import FifoLock
from a... |
import asyncio
import logging
try:
import curses
except:
pass
import functools
import math
from tsproxy.common import MyThreadPoolExecutor
from pyclda.aio_downloader import Status, Progress
logger = logging.getLogger(__name__)
SCR_ROWS = -1
SCR_COLS = -1
def count_rows(string, cols=10):
str_rows = 0
... |
#!/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:
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec,
OutputMultiPath, File, LibraryBaseInterface,
SimpleInterface, traits
)... |
# -*- coding: utf-8 -*-
"""This module defines dummy/power fill related templates."""
from typing import TYPE_CHECKING, Dict, Set, Any, Tuple, List
import numpy as np
from bag.util.search import BinaryIterator
from bag.layout.util import BBox
from bag.layout.template import TemplateBase
from ..analog_core.base imp... |
from __future__ import absolute_import
from __future__ import annotations
import logging
import re
from pathlib import Path
from shutil import rmtree
from time import sleep
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Literal
from typing import ... |
#!/usr/bin/env python
#
# Main authors:
# <NAME> <<EMAIL>>
#
# This file is part of Unison, see http://unison-code.github.io
#
# Copyright (c) 2018, RISE SICS AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followi... |
from __future__ import print_function
import numpy as np
import sys
import logging
sys.path.insert(1, '/home/vagrant/cpa-multiclass/CellProfiler-Analyst/cpa');
sys.path.insert(1, '/home/vagrant/cpa-multiclass/CellProfiler-Analyst/')
import cpa.sqltools
from dbconnect import DBConnect, UniqueObjectClause, UniqueImage... |
################
#
# Deep Flow Prediction - <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (TUM)
#
# Dataset handling
#
################
from torch.utils.data import Dataset
import numpy as np
from os import listdir
import random
from scipy import interpolate
from matplotlib import pyplot as plt
import pickle
# globa... |
import os
import tkinter
from PIL import Image, ImageTk
class ImageLoader:
def __init__(self, filename: str) -> None:
self.image_data = open(filename, "rb").read()
def convert(self) -> Image:
raise NotImplementedError("implement in subclass")
class KoalaImage(ImageLoader):
colorpalette_... |
#!/usr/bin/python
# encoding: utf-8
"""
@author: Ian
@contact:<EMAIL>
@file: seq2seq1.py
@time: 2019/3/19 19:42
https://spaces.ac.cn/archives/5861
"""
import numpy as np
from tqdm import tqdm
import os,json
# import uniout
from keras.layers import *
from keras.models import Model
from keras import backend as K
from k... |
#!/usr/bin/env python3
########################################################################
# Alignment input folder structure
########################################################################
#
# ./Validation/Network-output/kernel-{3|5|7|9}/{scan_id}/{shape_category_id}_{shape_object_id}/
# /input.json
# ... |
import argparse
import datetime
import hashlib
import os
import re
import zipfile
import yamale
import yaml
from dateutil.parser import parse
from fuzzywuzzy import fuzz
from tempfile import TemporaryDirectory
from yamale.validators import DefaultValidators, Validator
parser = argparse.ArgumentParser(description='Val... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
# author: kuangdd
# date: 2020/4/6
"""
"""
from pathlib import Path
from functools import partial
from multiprocessing.pool import Pool
from matplotlib import pyplot as plt
from tqdm import tqdm
import collections as clt
import os
import re
import json
import numpy as np
imp... |
from sfepy.base.base import *
from sfepy.linalg import cycle
import extmods.fem as _fem
class LagrangeNodes(Struct):
"""Helper class for defining nodes of Lagrange elements."""
@staticmethod
def append_edges(nodes, nts, iseq, nt, edges, order):
delta = 1.0 / float(order)
for ii, edge in e... |
#!/usr/bin/env python3
"""CG vs PG Classification script using cross-validation
"""
import numpy as np
import os
from os.path import expanduser
import sys
sys.path.append('tools')
from numpy import genfromtxt
from sklearn import svm
import sklearn
import csv
import utils
import logging
import multiprocessing as multip... |
"""
Integration-y tests for the REST interface interacting with the Cassandra model.
This is perhaps not the place for these tests to go. Also, perhaps this should
instead be tested by spinning up an actually HTTP server (thus this test can
happen using the mock tap file).
But until a decision has been made for inte... |
# coding: utf-8
from PIL import Image
import numpy as np
from collections import Counter
import pandas as pd
import os
import re
import json
from warnings import warn
import openslide
import cv2
from pycocotools.mask import encode, decode
from slideslicer.extract_rois_svs_xml import extract_rois_svs_xml
from slidesl... |
from typing import *
from dataclasses import asdict
from transformers import BertModel
from torch.nn.utils.rnn import pad_sequence
from stud.models.ner_classifier import NERClassifier
from stud.models.polarity_classifier import PolarityClassifier
from stud.layers.positional_encoder import PositionalEncoding
from axial_... |
#!/usr/bin/env python3
import dateparser
import datetime
import gzip
import logging
import logging.handlers
import pathlib
import pytz
import re
import shutil
import time
from genie.conf import Genie
from pathlib import Path
from os import listdir
from os import remove
from os.path import basename, dirname, exists, ... |
import os
import sys
import click
from stringprocessor import StringProcessor as sp
import loggers
import app
from yammler import DownloadLog
from settings import (
FSEC_DOWNLOAD_DIR,
EXCLUDE_TOKENS,
FSEC_FTP_URL,
FSEC_OUTPUT_DIR,
FSEC_TO_CSV,
FSEC_TO_DATABASE,
DATABASE_URI,
FRAC_SCHEDU... |
"""
Discriminative models: convLSTM2d, conv3d, RF.
"""
from __future__ import print_function
from __future__ import absolute_import
__all__ = ['train_random_forest',
'train_convlstm2d',
'train_conv3d',
'make_parallel']
from vip_hci.conf import time_ini, timing, time_fin
from munch im... |
import scipy.io as spio
import matplotlib.pyplot as plt
import numpy as np
from scipy.special import logsumexp
import pandas as pd
import GPy
from scipy.stats import norm
def mean_upcrossings(y, upcross_level=0):
'''
returns mean number of upcrossings of upcross_level
y: (n_samples, n_gridpoints) array of... |
# import readsnapHDF5 as rs
# header = rs.snapshot_header("snap_063.0")
# mass = rs.read_block("snap_063","MASS",parttype=5) # reads mass for particles of type 5
import numpy as np
import os
import sys
import math
import tables
############
#DATABLOCKS#
############
#descriptions of all datablocks -> add datablocks... |
import os
import sys
import json
import random
import shutil
import argparse
import numpy as np
from tqdm import tqdm
def add_default_args(parser):
parser.add_argument(
'--dataset_name',
type=str,
choices=["clueweb09", "robust04", "trec-covid"],
help="Preprocessing dataset."
... |
import contextlib
import hashlib
import os
import yaml
import shutil
import typing
from glob import glob
from pathlib import Path
from subprocess import run, CalledProcessError
from dotenv import load_dotenv
from sane import *
from sane import _Help as Help
def check_envvar_exists(name):
if name not in os.envir... |
import numpy as np
from scipy.optimize import minimize
from numba import jit
'''
extract information from other numpy waveforms
'''
class Waveana(object):
def __init__(self, wave=[], eid=0):
self.eid = eid
self.wave = wave
self.meanBaseline = 0
self.std = 0
self.allCharge = 0... |
# This file is part of utils.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a... |
"""
Copyright (c) 2019-2020 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 copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
import torch
import numpy as np
from tqdm import tqdm
from scipy import linalg
class FJDMetric:
"""Helper function for calculating FJD metric.
Args:
gan: Model that takes in a conditioning tensor and yields image sample... |
# -*- coding: utf-8 -*-
"""
Identification of spectral properties in analog signals (e.g., the power
spectrum).
:copyright: Copyright 2015-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division, print_function, unicode_literals
impor... |
# !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file: surreal_in_extrinc.py
# @brief:
# @author: <NAME>, <EMAIL>, <EMAIL>
# @version: 0.0.1
# @creation date: 03-07-2019
# @last modified: Thu 18 Jul 2019 04:47:09 PM EDT
import numpy as np
import sys,os
import scipy.io as sio
import cv2
import math
import transforms3d
... |
import copy
import logging
from http import HTTPStatus
from typing import Any, Dict, List, Optional
import requests
from flask import current_app as app
from lighthouse.constants import (
FIELD_COG_BARCODE,
FIELD_COORDINATE,
FIELD_DART_CONTROL,
FIELD_DART_DESTINATION_BARCODE,
FIELD_DART_DESTINATION... |
# Copyright (c) 2016 by <NAME> <<EMAIL>>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# <N... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from IPython import get_ipython
# %% [markdown]
# ##### Copyright 2019 The TensorFlow Authors.
# %%
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... |
# standard library imports
import uuid
import copy
from collections import OrderedDict, namedtuple
import pickle
import base64
# Holoviews imports
import holoviews as hv
from dash.exceptions import PreventUpdate
from holoviews.plotting.plotly import PlotlyRenderer, DynamicMap
from holoviews.plotting.plotly.util import... |
#!/usr/bin/env python
# $Id$
"""
Make gsw_check_data.c and gsw_saar_data.c from the current gsw_data_v3_0.mat,
v3_06_11. Existing versions will be overwritten.
Version recording in the mat files is completely unreliable, so we override it.
One function, geo_strf_dyn_height, is in a state of flux; until it is
complet... |
from concurrent.futures import ThreadPoolExecutor
from .documents import Document
from pyemd import emd, emd_with_flow
from scipy.sparse.csr import csr_matrix
from sklearn.metrics import euclidean_distances
from sklearn.metrics.pairwise import cosine_distances
from typing import Dict, List, Tuple
import itertools
impo... |
import asyncio
import datetime
import enum
import json
import sqlite3
import random
import time
from discord import Embed
from discord.ext import commands
class ItemType(enum.Enum):
ARMOR = 2
WEAPON = 3
class Rumble(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.ses = bot.ses... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 20 12:01:44 2021
@author: puk
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
# def rmse(y, y_pred):
# return np.sqrt(np.mean(np.square(y - y_... |
# Copyright (c) 2017, CNRS-LAAS
# 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 source code must retain the above copyright notice, this
# list of conditions and the f... |
# -*- coding: utf-8 -*-
""" Module to handle CARS climatology
Reference: http://www.marine.csiro.au/~dunn/cars2009/
Evaluate at day-of-year 45 (mid February)
t = 2pi x 45/366
feb = mean + an_cos*cos(t) + an_sin*sin(t) + sa_cos*cos(2*t) + sa_sin*sin(2*t)
download_file('http://www.marine.csiro.au/atlas/export/tempera... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 22 16:20:13 2019
@author: jcloud
"""
import os, sys
import pandas as pd
import numpy as np
import argparse
import json
import datetime
def contains_alpha(x):
res = False
for i in x:
if i.isalpha():
res = True
... |
from __future__ import absolute_import, unicode_literals
import errno
import os
import re
import signal
import socket
import struct
import time
import warnings
import zlib
from builtins import int
from functools import reduce
import six
from colorama import Back, Fore, Style
from past.builtins import map, range
from... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import f1_score
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import date
from time import time
import os
import seaborn as sns
import lib.transformers as trf
import pandas as pd
import matplot... |
import numpy as np
from skimage import io, transform
import math
import copy
from PIL import ImageEnhance, ImageOps, ImageFile, Image
import sys
import cv2
import math
from math import cos, sin
from utils.render import render_texture
import scipy.io as sio
import time
import random
def randomColor(image):
"""
... |
"""Utility supporting initial model setup.
ModelSetup is a Python utility that supports an initial setup of a
computational model that may utilize spiking neural networks implemented using
Nengo and the robot simulator V-REP.
"""
__version__ = '0.2.0'
__author__ = "Przemyslaw (<NAME>"
import argparse
import collecti... |
from re import L, S
import re
from lxml import etree as ET
import numpy as np
import pandas as pd
import json
import os
import csv
import subprocess
from sklearn import metrics as m
"""
for QU we are doing f1 score on concepts
for IR we are doing f1 score on document ids
for QA we use the BioASQ testing r... |
import sys
sys.path.append('./')
import os
import json
from vtkplotter import *
import pandas as pd
from tqdm import tqdm
import numpy as np
from functools import partial
from BrainRender.Utils.data_io import load_json, load_neuron_swc
from BrainRender.Utils.data_manipulation import get_coords, mirror_actor_at_point... |
import numpy as np
import pandas as pd
import time
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 100)
from sklearn.preprocessing import LabelEncoder
import gc
from time_series_pipeline import *
from tqdm import tqdm
from scipy import stats
from catboost import CatBoostRegressor
import ligh... |
"""
The following script contains all functions related to the entity
extraction notebooks.
"""
### IMPORT #####################################################################
# General
import numpy as np
import pandas as pd
import re
from itertools import chain
# Anaysis
from sklearn.metrics import \
accuracy_sc... |
import torch
from torch import nn
import torch.nn.functional as F
from dgl.nn.pytorch import GraphConv, SAGEConv, GINConv
from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling
from torch.nn.parameter import Parameter
from models.structure_sageconv import StructSAGEConv
device = torch.device('cuda' if tor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.