text stringlengths 6.04k 39.5k |
|---|
import pytest
import numpy as np
import torch
import tensorflow as tf
tf.compat.v1.enable_eager_execution()
def test_positional_encoding():
from utils.nerf_helpers import get_embedder as get_embedder_torch
from reference.run_nerf_helpers import get_embedder as get_embedder_tf
multires = 10
i_embe... |
# -*- encoding: UTF-8 -*-
import uno, re, sys, os, traceback
from com.sun.star.text.TextMarkupType import PROOFREADING
from com.sun.star.beans import PropertyValue
pkg = "en"
lang = "en"
locales = {'en-GB': ['en', 'GB', ''], 'en-ZW': ['en', 'ZW', ''], 'en-PH': ['en', 'PH', ''], 'en-TT': ['en', 'TT', ''], 'en-BZ': ['en... |
#===============================================================================
# obus-python - obus client python module.
#
# @file protocol.py
#
# @brief obus python protocol layer
#
# @author <EMAIL>
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistribution and use in source and binary forms, wit... |
import os
import sys
import time
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from torch.utils.tensorboard import SummaryWriter
from model_sea... |
"""Generate torsional profiles for all rotatable bonds.
This script will read in an SD file containing one or more molecules and add an
SD property encoding the torsional profile (generated using TorsionNet) for each
rotatable bond.
This script requires you to have a trained TorsionNet model and the associated
standa... |
# Utility functions and classes
import configparser
import copy
import datetime
import logging
import os.path
import platform
import queue
import threading
import traceback
#import wxversion
# wxversion.select([x for x in wxversion.getInstalled()
# if x.find('unicode') != -1])
#import wx
import erro... |
"""Cisco Switch control object."""
import logging
import warnings
from netaddr import EUI, mac_unix_expanded
from netmiko import ConnectHandler
def deprecated(func):
"""Decorate a deprecated function to warn when it is called.
This is a decorator which can be used to mark functions
as deprecated. It wi... |
import datetime
import numpy as np
from fixed_params import *
import utils
def get_transition_sigmoid(inflection_day, rate_of_inflection, init_r_0, lockdown_r_0):
"""Returns a sigmoid function based on the specified parameters.
A sigmoid helps smooth the transition between init_r_0 and lockdown_r_0,
... |
import ipywidgets as widgets
import run as run_helpers
from bunch import Bunch
import functools
import operator
import stringcase
import subprocess
import os
import toml
import json
import time
from jupyter_ui_poll import ui_events
from IPython.display import display
import analyze
import shutil
# TODO: move constants... |
#!/usr/bin/python
#------------------------ Import Libraries ----------------------------#
import pygame, sys, pygame.mixer, os
path_above = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..'))
sys.path.append(path_above)
from pygame.locals import *
from time import sleep, time
try:
import bluetooth as... |
#!/usr/bin/env python3
import os
import sys
import time
import torch
import logging
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
import os.path as osp
import torch.nn as nn
import torch.utils.data as data
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.backends.... |
#!/usr/bin/env python
# original code: http://code.activestate.com/recipes/577599-nagios-plugin-for-monitoring-database-servers/
# Nagios_sql.py - <NAME> 2011 (<EMAIL>)
# <NAME> 201705 (pablodav at gmail)
#
# changes:
# * use pymssql instead of pyodbc to have simple setup
# * refactor compatible to python3
# ... |
# Copyright 2017 AT&T Intellectual Property. All other 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... |
"""
Created on April, 2019
@author: <NAME>
Toolkit functions used for processing training data.
Cite:
<NAME>, et al. "Cooperative Holistic Scene Understanding: Unifying 3D Object, Layout,
and Camera Pose Estimation." Advances in Neural Information Processing Systems. 2018.
"""
import numpy as np
from scipy.spatial... |
from typing import List, Optional
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
import math
from api import database
from api import models
from api.schemas import detail_sc, area_sc
router = APIRouter(
prefix="/detail",
tags=["Detail"],
responses={404: ... |
import collectd
import metrics
import urllib.request, urllib.error, urllib.parse
import json
from urllib.parse import urljoin
PLUGIN_NAME = "apache_hadoop"
RESOURCE_MANAGER_ENDPOINT = 'ws/v1/cluster'
CLUSTER_METRICS_PATH = 'metrics'
CLUSTER_SCHEDULER_PATH = 'scheduler'
CLUSTER_APPS_PATH = 'apps'
CLUSTER_NODES_PATH = ... |
# Overall imports
import argparse
import operator
# In-package imports
from compare_mt import ngram_utils
from compare_mt import stat_utils
from compare_mt import corpus_utils
from compare_mt import sign_utils
from compare_mt import scorers
from compare_mt import bucketers
from compare_mt import reporters
from compare... |
import numpy as np
import pygame
import sys
import os
from collisionutils import *
from colors import *
import initObstacles
import matplotlib.pyplot as plt
os.chdir(os.path.dirname(os.path.realpath(__file__)))
class RobotDrive:
def __init__(self,x_mid,y_mid, w, h, Gripper = False, startCube = True):
self... |
from typing import List, Dict, Tuple, NamedTuple
import json
import datetime
from collections import defaultdict
import scipy
import numpy
import joblib
from sklearn.feature_extraction.text import TfidfVectorizer
import nmslib
from nmslib.dist import FloatIndex
from scispacy.file_cache import cached_path
from scispac... |
r'''
Representations of a Gerrit site, and the abstract base class for all
executable commands.
All sessions with a Gerrit instance begin by creating a `Site` object and
establishing a connection::
import gerritssh as gssh
mysite = gssh.Site('gerrit.exmaple.com').connect()
Commands are executed by creating a... |
import collections
import re
import numpy as np
badpattern = re.compile('[%"]+')
Author = collections.namedtuple('Author', 'first middle last')
Citation = collections.namedtuple('Citation', 'title authors year venue volume issn pages other_ids')
def FileExtractor(text):
text_dict = {}
for section in ['pa... |
"""Datemath Module"""
import logging
import random
import re
import string
from datetime import timedelta, datetime, date
from time import time
from elasticsearch.exceptions import NotFoundError
from curator_api.exceptions import ConfigurationError, FailedExecution
from curator_api.defaults.settings import date_regex
... |
import neat
import os
import multiprocessing as mp
import timeit
import datetime
import gzip
import pickle
import fileinput
from shutil import copyfile
from lib.des.thfs_model import Model
import lib.toolbox.importer as importer
import lib.toolbox.allocation_functions as alloc
import lib.toolbox.sequencing_functions a... |
#!/usr/bin/python3
from __future__ import absolute_import
from builtins import range
from past.builtins import basestring
from builtins import object
from .interface import tss_lib, ffi
from pytss import tspi_exceptions
import hashlib
def uuid_to_tss_uuid(uuid):
"""Converts a Python UUID into a TSS UUID"""
ts... |
"""Sphinx Material theme."""
import collections
import os
import sys
from multiprocessing import Manager
from typing import List, Optional, Union
from xml.etree import ElementTree
import docutils.nodes
import jinja2
import slugify
import sphinx.addnodes
import sphinx.builders
import sphinx.environment.adapters.toctre... |
"""Module providing different Markov transition kernels."""
import functools
import tensorflow_probability as tfp
from bayes_vi.inference.mcmc.stepsize_adaptation_kernels import StepSizeAdaptationKernel
tfb = tfp.bijectors
class TransitionKernel:
"""Base class for Markov transition Kernels."""
def __init... |
import os
import shutil
import urllib.request
import zipfile
from datasets.eval.PythonAPI.pycocotools.coco import COCO
from datasets.eval.PythonAPI.pycocotools import mask as maskUtils
import skimage.color
import skimage.io
from lib.layers import *
import torch
import tools.image_utils as utils
import torch.utils.data
... |
from json import JSONDecoder, JSONEncoder
from django.urls import reverse
from Instructor.models import ScoredRow
from Main.forms import GradeReviewForm, ReviewForm
from Main.models import Review
from Users.models import User
from tests.testing_base import BaseCase as OldBaseCase, SimpleBaseCase
class BaseCase(OldB... |
from copy import deepcopy
from math import ceil, floor
from struct import pack, unpack
# import calendar
# import datetime
import numpy as np
import os
import re
import warnings
def padtrim(buf, num):
num -= len(buf)
if num >= 0:
# pad the input to the specified length
return str(buf) + ' ' * ... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
from ROOT import *
from copy import deepcopy
from array import array
import six
gROOT.SetBatch() # don't pop up canvases
#Find Data files
def getFileInPath(rfile):
import os
for dir in os.environ['CMSSW_SEARCH_PATH'].spli... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from pims.base_frames import FramesSequence, FramesSequenceND
from pims.frame import Frame
from warnings import warn
import os
try:
import jpype
except ImportError:
jpype = None
d... |
import binascii
import hashlib
import json
import logging
import os
import random
import re
import string
import time
import zlib
from base64 import b64decode
from collections import namedtuple
from copy import deepcopy
from datetime import datetime
from difflib import Differ
from functools import wraps
import boto3.s... |
import asyncio
import discord
from discord.ext import commands
import requests
from discord.ext.commands import Bot
import sqlite3
import os
# imports the file with the API keys and other confidential information
import config
# creates paths necessary to access the boost_checker database in src
CURRENT_DIR = os.path... |
import cv2
import glob
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import re
# STEP0. CALIBRATION BOARD BEFORE CAMERA CALIBRATION
images = glob.glob("camera_cal/calibration*.jpg")
# Chess board (9,6)
objpoints = []
imgpoints = []
objp = np.zeros((6*9, 3), np.float32)
objp[:,:2... |
from concurrent.futures import ThreadPoolExecutor
from functools import reduce, wraps
import io
import logging
import multiprocessing as mp
import os
import queue
import re
import signal
import stat
import subprocess
import sys
import threading
import _thread
import traceback
import psutil
from .core import Namespace... |
# Copyright 2018 <NAME>, <NAME>.
# (Strongly inspired by original Google BERT code and Hugging Face's code)
#
# 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/licen... |
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.autograd import Variable
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class AttentionLayer(nn.Module):
'''
### cite... |
"""
Module to build timelines, delta series from aggregated transactions
This module provides the foundation types needed for real time analytics.
It also includes logic to compute timeline statistics from aggreagated transactions
Author: <NAME>, <NAME>
"""
import time
import numpy
import logging
from collections ... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
#encoding: utf8
"""Server Models"""
import os, uuid
import numpy as np
import csv, json
from flask.ext.restful import Resource, reqparse, request
import pandas as pd
import h5py as h5
from dmapp import app
def conseq(arr):
"""Return the length of consecutive array elements that are true."""
out = np.diff(np.w... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 <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... |
import tensorflow as tf
import scipy.sparse
import numpy as np
import os, time, collections, shutil, sys
ROOT_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
sys.path.append(ROOT_PATH)
import math
class base_model(object):
def __init__(self):
self.regularizers = []
self... |
import os
import sys
import pygame
import requests
from sources.globals import *
from sources.field import Field
from sources.text import Text
from sources.ui import UI
from sources.bot import Bot
from sources.server import Server
from sources.client import Client
# for pyinstaller
def my_except_hook(exctype, value, ... |
#!/usr/bin/env python3
# This file is a part of atari-active-learning project.
# Copyright (c) 2022 <NAME> (<EMAIL>), <NAME> (<EMAIL>, <EMAIL>), IBM Corporation
import os
import shutil
import sys
sys.path.insert(0, './VAE-IW')
import torch
import gym
# from gym.envs.classic_control import rendering
from gym.wrappers ... |
import os
from functools import reduce
from collections import deque
import numpy as np
import scipy as sp
from numpy import linalg as LA
from scipy.spatial import distance_matrix
from Transformations import rotation_matrix, superimposition_matrix
from SWCExtractor import Vertex
from Obj3D import Point3D, Sphere, Co... |
from math import log, isnan
import numpy as np
from bokeh.models import *
from bokeh.plotting import figure
from itertools import cycle
from hail.expr import aggregators
from hail.expr.expressions import *
from hail.expr.expressions import Expression
from hail.typecheck import *
from hail import Table
import hail
pa... |
#!/usr/bin/env python3
import re
import curses
from enum import Enum
from subprocess import Popen, PIPE
import os
import sys
import argparse
from typing import List
BOLD = '\033[1m'
INVERTED = '\033[7m'
RESET = '\033[0m'
AVAILABLE_COLORS = 6
FOOTER_LINE_NO = 2
WORD_REGEX = '\\S+'
CTRL_D = 4
CTRL_G = 7
CTRL_H = 8
CTR... |
from __future__ import division
import sys
import subprocess
from .files import *
from .fasta import *
from .fastq import *
import numpy as np
import gzip
#import matplotlib as mpl
#mpl.use('Agg')
#import matplotlib.pyplot as plt
#plt.ioff()
import json
import re
from collections import defaultdict
###################... |
from flask import Flask, request, jsonify, json, abort, session
from flask_cors import CORS, cross_origin
import numpy as np
import dateutil.parser
import requests
import pandas as pd
import re
import time
import datetime
import csv
import pytz
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Con... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Tools for layout optimisations.
AAB
"""
from thelma.tools.semiconstants import RACK_SHAPE_NAMES
from thelma.tools.semiconstants import get_384_rack_shape
fr... |
#
# data preprocessing
#
from src.const import wells, carotage_types, las_dir, log_dir, slices_dir, wellheads, \
raw_cube, sourceX, sourceY, INLINE_3D, CROSSLINE_3D, nsamples, dt, ilines, xlines, \
well_width, slice_coord_path, norm_dict_path, slice_range
from src.utils import projection
from src.gen1 import d... |
import os
import json
import traceback
import logging
from datetime import datetime
from django.shortcuts import render
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.core.files.storage import FileSystemStorage
from django.contrib.auth.decorators import login_requ... |
import pandas as pd
import numpy as np
import time
import os
from urllib.request import urlopen
import json
from nltk.tokenize import TweetTokenizer
tweet_tokenizer = TweetTokenizer()
from os import listdir
from os.path import isfile, join
configs = yaml.load(file, Loader=yaml.FullLoader)
data_path = configs['EXTRACT... |
##############################################################################
#
# Copyright (c) 2011 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
.. deprecated:: 0.6
It will be removed because it is which MoSQL shouldn't do. If you need a
model, just write a class with :mod:`mosql.query` instead.
.. warning::
This module does not work on Python 3, and will be removed in version 0.11.
It provides us... |
from functools import lru_cache
from plugins import base
from systems.models.base import BaseModel
from utility import query, data
import datetime
import copy
import re
class DataProviderState(object):
def __init__(self, data):
if isinstance(data, DataProviderState):
self.state = data.expor... |
import os
import re
from os import path as fs
from ranger.api.commands import Command
from ranger.ext.shell_escape import shell_quote
# NOTE: jump to next day only at 7:00AM
def today_date(delta=7):
import datetime
return (datetime.datetime.now() - datetime.timedelta(hours=delta)).strftime(
"%Y-%m-%... |
"""Ref: https://github.com/phillipi/pix2pix"""
import argparse
import os
import os.path as osp
import time
import random
from glob import glob
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data imp... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 22 17:27:42 2018
@author: luoyuhao
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import os
import base64
import json
import requests
import heapq
import sys
import pickle
... |
#!/bin/python
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
import os
from torch import Tensor
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
try:
from hparams import create_hparams
except:
import sys; sys.path.append('../..')
from hparams import create_hparams
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
... |
#!/usr/bin/env python
import os
import shlex
import shutil
import glob
import subprocess
import numpy as np
from tqdm import tqdm
from sklearn import model_selection
from sklearn import ensemble
from sklearn import preprocessing
from sklearn import dummy
from sklearn import metrics
import joblib
import pickle
from a... |
from collections import defaultdict
import ctypes
import typing as t
from weakref import WeakKeyDictionary
from loguru import logger
from pyglet.gl import gl
from pyglet.graphics import vertexbuffer
from pyday_night_funkin.core.graphics.pnf_vertex_domain import PNFVertexDomain, PNFVertexList
from pyday_night_funkin.... |
#!/usr/bin/python
# vim:set et sw=4:
#
# certdata2pem.py - splits certdata.txt into multiple files
#
# Copyright (C) 2009 <NAME> <<EMAIL>>
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# 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... |
# 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 use ... |
#!/usr/bin/env python3
"""Design guides naively for diagnostics.
This can be used as a baseline for the output of design.py.
"""
import argparse
import logging
import heapq
from adapt import alignment
from adapt.utils import log
from adapt.utils import seq_io
__author__ = '<NAME> <<EMAIL>>, <NAME> <<EMAIL>>'
logge... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing 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
# Unles... |
import logging
import re
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
from captum.attr import IntegratedGradients
from pandas import read_excel
from scipy.stats import mannwhitneyu
from sklearn.metrics import precision_recall_curve, roc_curve
import scanpypip.utils as ut
... |
import numpy as np
from itertools import product
class ModelEvaluation:
def __init__(self, ids, me_params):
self.ids = ids
self.me_method_label = me_params["method"]
self.me_params = me_params[me_params["method"]]
self.max_iters = 0
self.me_method = self.get_me_me... |
from turtle import color
import configuration
import data
import discord
import re
import random
import math
import matplotlib.pyplot as plt
import numpy as np
import asyncio
import aiocron
import datetime
from datetime import date
intents = discord.Intents.default()
intents.members = True
intents.messages = True
clie... |
"""Streaming CSS stylesheet parser
Why is it streaming? Because I could.
.. note:: This module is *not* designed to minify any CSS; you could in theory
do it by passing the token stream through simple peephole filters.
The module is designed to be able to *manipulate CSS!*
Each parser is an iterable that ... |
# Copyright 2020- Silicon Laboratories Inc. www.silabs.com
#
# The licensor of this software is Silicon Laboratories Inc. Your use of this
# software is governed by the terms of Silicon Labs Master Software License
# Agreement (MSLA) available at
# www.silabs.com/about-us/legal/master-software-license-agreement.
# This... |
# Copyright 2019 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""A drop-in replacement for the re module.
It uses RE2 under the hood, of course, so various PCRE features
(e.g. backreferences, look-around assertions) are not... |
# -*- coding: utf-8 -*-
import json
import os
import sys
from glob import glob
from os.path import dirname, exists, join, realpath
import numpy as np
import pandas as pd
from astropy import units as u
from astropy.coordinates import AltAz, EarthLocation
from astropy.io import fits
from astropy.time import Time
from ca... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
import os, datetime, pprint
# import pickle, sys
import traceback
from jiraEm... |
from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
from functools import wraps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
from retry.api import retry_call # type: ignore
from lisa import notifier, schema,... |
import MySQLdb
import math
import numpy as np
import logging
from datetime import timedelta, datetime
# from geopy.geocoders import Nominatim
_INSTANCE_NAME = 'jdiner-mobile-byte3:mobile-data'
_DB_NAME = 'mobile_data_db'
_USER = 'root'
_IPADDRESS = '172.16.17.32'
_PSWD = '<PASSWORD>'
_ACTIVITY = 'plugin_google_activit... |
import re
import ast
from contextlib import suppress
from random import randint
from typing import Union, List, Tuple, Optional
class GameError(Exception):
pass
class Card:
COLOR_CODES = ['r', 'd', 'o', 'e', 's', 'x']
COLOR_SHORT_NAMES = ["ruby ", "diamd", "onyx ", "emrld", "saphi", "artcr"... |
"""
BSD 3-Clause License
Copyright (c) 2018, <NAME>, Aalto University, Finland
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, t... |
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.messages.flat.QuickChatSelection import QuickChatSelection
from rlbot.utils.structures.game_data_struct import GameTickPacket
from util.ball_prediction_analysis import find_slice_at_time
from util.boost_pad_tracker import BoostPadTracker
f... |
"""
Implementation of the base Fitter, Source, Model and Parameter classes
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
import scipy.optimize as optimize
import lmfit as lm
import emcee
import copy
from .overwrite import SATLASSampler, SATLASHDFBackend, minimize, SATLASMinimizer
__all__ = ['Fitter', 'So... |
# Copyright 2019-, <NAME> and contributors
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
.. contents:: :local:
.. currentmodule:: quantumflow
QuantumFlow supports several ... |
import numpy as np
import warnings
from collections import defaultdict
from scipy.spatial.distance import cdist as sp_cdist
from typing import Callable
from .base_viewer import BaseViewer
from ..cooking_machine import BaseDataset
# If change, also modify docstring for view()
METRICS_NAMES = [
'jensenshannon', '... |
import os
import re
import json
from jsonschema import validate
from kernel_tuner import util
#specifies for a number of pre-defined objectives whether
#the objective should be minimized or maximized (boolean value denotes higher is better)
objective_default_map = {
"time": False,
"energy": False,
"GFLOP... |
from flask import Flask, make_response, request, render_template, current_app, redirect, url_for
from functools import update_wrapper
from flask_sqlalchemy import SQLAlchemy
import json
import os
import random
import requests
from os import path
from urlparse import urlparse
from bs4 import BeautifulSoup
import markdow... |
# Copyright 2020 SAS Project 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 requ... |
import os
import sys
import random
import matplotlib.image as mpimg
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from tqdm import tqdm, tnrange
from itertools import chain
from skimage.io import imread, imshow, concatenate_images
from skim... |
# -*- coding: utf-8 -*-
""" Simple Mercedes me API.
Attributes:
username (int): mercedes me username (email)
password (string): <PASSWORD>
update_interval (int): min update intervall in seconds
"""
import base64
import hashlib
import json
import logging
from os import urandom
import random
import string
i... |
# Copyright (c) .Yunnan Key Laboratory of Computer Technologies Application
# Kunming University of Science and Technology, Kunming 650500, China and its affiliates. All Rights Reserved
# Modified from RFB Net(https://arxiv.org/pdf/1711.07767.pdf)、
# Modified from VOC Dataset Classes(https://github.com/fmassa/vision/bl... |
# This code is from https://github.com/automl/pybnn
# pybnn authors: <NAME>, <NAME>
import emcee
import logging
import numpy as np
from scipy.optimize import nnls
from scipy.stats import norm
from naslib.predictors.lce_m.curvefunctions import curve_combination_models, \
model_defaults, all_models
from naslib.pred... |
import re
import pandas as pd
import spacy
import numpy as np
import gzip
import pickle
from time import time
from time import sleep
import meaningcloud
import networkx as nx
from nltk.corpus import wordnet as wn
def load_and_process(fname, nlp):
# open file and read lines
print('open file and read lines')
... |
#!/usr/bin/env python3
#
# Copyright (c) 2017-2018 <NAME> <<EMAIL>>
# MIT license
#
"""
FITS image manipulate tool.
"""
import sys
import argparse
import numpy as np
from astropy.io import fits
from scipy import ndimage
class FITSImage:
"""
FITS image class that deals with plain 2D image (NAXIS=2), but als... |
#!/usr/bin/env python3
import sqlite3
import sys
import datetime
from dateutil.parser import parse
import boto3
DBFILE = 'costdata.sqlite'
def query_db(query, data): #Retrieves data from db based on input query and data(date)
db = sqlite3.connect(DBFILE) #Sets up db as connection to the sql database
dbc = db.cur... |
# Apache License, Version 2.0
# ./blender.bin --background -noaudio --python tests/python/bl_pyapi_mathutils.py -- --verbose
import unittest
from mathutils import Matrix, Vector, Quaternion
from mathutils import kdtree
import math
# keep globals immutable
vector_data = (
(1.0, 0.0, 0.0),
(0.0, 1.0, 0.0),
... |
import datetime
import logging
import re
import ssl
import threading
from django.core.mail import EmailMessage
from raven.processors import Processor
from sleekxmpp import ClientXMPP
from sleekxmpp.xmlstream import cert
from gchatautorespond.lib import report_ga_event_async
from gchatautorespond.lib.chatworker.thrott... |
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as vtransforms
from typing import Type, Any, Callable, Union, List, Optional
import blocks
from torch.nn import init
import functools
####################
# Utility Functions
####################
... |
from tidalclassifier.cnn.individual_cnn.meta_CNN import custom_flow_from_directory, create_model, fold_tables, trainCNNOnTable
from tidalclassifier.utils.helper_funcs import ThreadsafeIter, shuffle_df
import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score, log_loss, roc_curve, roc_auc_score, ... |
import requests # type: ignore
import pathlib
import json
import typing
from accounting import Account, Ledger, AccountDataTable, data_path
from debug import debug_assert, debug_message
import math
import tkinter as tk
from tkinter import ttk
from tkinter.filedialog import askdirectory, askopenfilename
from tkintert... |
import csv
from pathlib import Path
import unique_count
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import plottools
from mpl_toolkits.axes_grid1 import make_axes_locatable
def isNA(string):
"""Filter #N/A from incoming tables."""
if string == "#N/A" or string == "NA":
return True
el... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 8 10:35:23 2020
@author: X202722
"""
import itertools
import functools
import pandas as pd
import numpy as np
from runVAPS_rev5 import parameters
from fitVapToExpValuesTest import clapeyron, clapeyronFit
# from samplingCoefficients_fitall import samplingCoe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.