text stringlengths 3.07k 22.1k |
|---|
# Copyright 2017 the GPflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import copy
from logging import getLogger
import os
import numpy as np
import chainer
from chainer import serializers
from chainer import functions as F
logger = getLogger(__name__)
def check_nans(data,text=''):
for key,val in data.items():
if np.any(np.isnan(val)):
print(text + 'NaNs in the ... |
import numpy as np
from typing import Tuple
import scipy.linalg
tol = 1e-12
def flight_phase(
prepared_data: np.ndarray, prepared_probs: np.ndarray, rng: np.random.Generator
) -> np.ndarray:
"""
Attempt to find an exactly balanced sample with an optimized algorithm that
satisfies the balancing equat... |
# Needs Python >= 3.7
import hashlib, json, pathlib, subprocess, xml.etree.ElementTree
REJECTED = False
REJECTION_MESSAGE = ''
CONTRIBUTORS_PATH = 'README.md'
PLACEHOLDER_CONTRIBUTORS = ['<NAME> <EMAIL>',
'<NAME> <EMAIL>']
REJECTED_TEST_MESSAGE = 'submission was rejected, so test was ... |
# Copyright 2021 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
import tensorflow as tf
import utils.renderer as renderer
import utils.helpers as helpers
def DX(x):
return x[:,:,1:,:] - x[:,:,:-1,:] # so this just subtracts the image from a single-pixel shifted version of itself (while cropping out two pixels because we don't know what's outside the image)
def DY(x):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import time
from io import BytesIO
from pprint import pprint
import locale
import PIL
import inkyphat
import krakenex
import matplotlib
matplotlib.use('Agg')
import pandas as pd
import requests
from PIL import Image, ImageDraw, ImageFont
from pykrakenapi impor... |
# -*- python -*-
# Based on commit <PASSWORD> of
# https://github.com/RobotLocomotion/drake/blob/master/tools/workspace/pkg_config.bzl
load("//tools:execute.bzl", "path", "which")
_DEFAULT_TEMPLATE = Label("//tools:pkg_config.BUILD.tpl")
_DEFAULT_STATIC = False
def _run_pkg_config(repository_ctx, command_line, pkg... |
import numpy as np
import cv2
from helpers import crop_from_points, perspective_transform, resize_to_square
from helpers import blend_non_transparent
from sudoku_guessing import Sudoku
# MAIN
def sudoku_master(img_original):
# Tries to find the part of the image with the sudoku
## corners are top left, top r... |
import numpy as np
import time
import sys
import logging
import os
import datetime
import datasets
from h2o4gpu.decomposition import TruncatedSVDSklearn as sklearnsvd
from h2o4gpu.solvers import TruncatedSVDH2O
print(sys.path)
logging.basicConfig(level=logging.DEBUG)
def func(dataset="higgs"):
#Get higgs datase... |
# -*- coding: utf-8 -*-
# dominter
import os
from logging import (getLogger, StreamHandler, basicConfig,
DEBUG, INFO, WARN, ERROR)
from dominter.dom import Window, start_app
logger = getLogger(__name__)
class MyWindow(Window):
def __init__(self):
super(MyWindow, self).... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
import collections
import functools
from sys import maxsize
# tagset = ["CC","CD","DT","EX","FW","IN","JJ","JJR","JJS","LS","MD","NN","NNS","NNP","NNPS","PDT","POS","PRP",
# "PRP$","RB","RBR","RBS","RP","SYM","TO","UH","VB","VBD","VBG","VBN","VBP","VBZ","WDT","WP","WP$","WRB","$","#",
# u"\u201C",u"\u201D","(",")",","... |
import pytest
import nengo
from nengo import spa
import numpy as np
@pytest.mark.slow
def test_thalamus(Simulator, plt, seed):
model = spa.SPA(seed=seed)
with model:
model.vision = spa.Buffer(dimensions=16, neurons_per_dimension=80)
model.vision2 = spa.Buffer(dimensions=16, neurons_per_dime... |
import boto3
from cfn_flip import flip, to_yaml, to_json
import json
from deepmerge import Merger, always_merger
from dictdiffer import diff, patch
import re
import yaml
cfn = boto3.client('cloudformation')
diff_merger = Merger(
[
(list, ["append"]),
(dict, ["merge"])
],
["override"],
... |
import datetime
from django import forms
from django.db.models import Sum
from django.contrib.auth.models import User
from django.contrib import messages
from django.forms.models import inlineformset_factory
from kecupuapp_base import log
from autocomplete.widgets import AutocompleteWidget
from xpos.models import Pa... |
# Copyright 2020 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... |
import os
import torch
import numpy as np
import torch.nn.functional as F
from .dataloader import get_loaders
from .optimizer import get_optimizer
from .scheduler import get_scheduler
from .criterion import get_criterion, epoch_update_gamma, ArcMarginProduct, SphereProduct
from .metric import get_metric
from .model i... |
import numpy as np
import numba
from numbers import Integral
from itertools import zip_longest
from collections.abc import Iterable
from .._slicing import normalize_index
from .convert import convert_to_flat, uncompress_dimension, is_sorted
def getitem(x, key):
"""
GCXS arrays are stored by transposing and re... |
import os
import time
import logging
import numpy as np
import tensorflow as tf
from baseline.tf.optz import optimizer
from baseline.progress import create_progress_bar
from baseline.utils import (
listify,
get_model_file,
get_metric_cmp,
convert_seq2seq_golds,
convert_seq2seq_preds,
)
from baseline... |
import pytest
import ale
import os
import numpy as np
from ale.drivers import co_drivers
import unittest
from unittest.mock import patch
from conftest import get_image_label, get_image_kernels, convert_kernels, compare_dicts
from ale.drivers.co_drivers import CassiniIssPds3LabelNaifSpiceDriver
from conftest import g... |
"""
HW03 - Adversarial search
"""
def get_step_flag():
step = [2,2]
while (len(step) != 1):
step = input('Enter 0 to display only the final results - 1 for single-stepping option: ').split()
step = [int(x) for x in step]
if (step[0]):
print()
print('>> get_step_flag function takes input to de... |
from typing import List, Optional, TypeVar, Sequence, Type
from graphviz import Digraph
operators = ['+', '*']
T = TypeVar('T')
class TreeNode:
label: str
html_label: str
parent: Optional
children: Optional[Sequence]
_value: T
def __init__(self,
value: T,
p... |
#!/usr/bin/env python3
#
# Plots the scales probed by PUMA, including the wedge.
#
import numpy as np
import matplotlib.pyplot as plt
from astropy.cosmology import FlatLambdaCDM
cc = FlatLambdaCDM(H0=67.7,Om0=0.309167)
def wedge_R(zz,bfac=3.0,D=6.0):
"""The foreground wedge, for a dish of D meters."""
# ... |
"""Module that starts the execution of a suite or test."""
import sys
import traceback
import time
from golem.core import (test_execution,
utils,
report,
test_data,
environment_manager,
settings_mana... |
# app myshortURL
from flask import Flask, redirect, request, render_template, make_response, jsonify, escape, abort
from flask import url_for
from flask import session
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import FlaskForm
from flask_bootstrap import Bootstrap
from wtforms import StringField, Su... |
#!/usr/bin/python3
from ctypes import CFUNCTYPE, c_long, c_int, POINTER, cast, CDLL, addressof
import sys, os
import llvmlite.ir as llvmIR
import llvmlite.binding as llvm
import traceback
import signal
i8 = llvmIR.IntType(8)
i32 = llvmIR.IntType(32)
i64 = llvmIR.IntType(64)
i8_ptr = llvmIR.PointerType(i8)
i32_ptr = ... |
#!/usr/bin/env python3
# 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 argparse
import glob
import itertools
import json
import multiprocessing as mp
import os
import os.path as osp
im... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Note: because in Python 3 the socket.recv method returns bytes, not str,
# and most of the higher-level code works with strings
# (which are not fully compatible with bytes,
# especially when it comes to comparisons or use as a key in a dictionary),
# in several places the ... |
from dyndns_updater import __version__
from unittest import TestCase
from dyndns_updater.locator import Locator
from dyndns_updater.utils import Config, SingletonMeta
from dyndns_updater.updater import GandiUpdater, Updater
from dyndns_updater.extractor import Extractor
from unittest.mock import Mock, patch, PropertyMo... |
# Copyright 2019 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, ... |
from discord.ext import commands, tasks
from discord.utils import get
import discord
import json
import datetime
import logging
import traceback
from random import choice
import re
from .utils.dataIO import DataIO
from cogs.default import CustomHelpCommand
class AnimemesHelpFormat(CustomHelpCommand):
def random_r... |
# NOTE: this filename is underscore-prefixed just so it doesn't show up
# in tab-completion for `wf.widgets.`
import typing
from descarteslabs.common.proto.widgets import widgets_pb2
from ...types import Image, ImageCollection
from ...types.widget import Widget
if typing.TYPE_CHECKING:
from .. import WorkflowsLay... |
#!/usr/bin/env python
# Python Version 3.8
#
# Basic analysis of SRST2 output
# Authors - <NAME> (<EMAIL>)
#
# Dependencies:
# R
from argparse import ArgumentParser
import logging
import sys
import collections
import operator
from collections import OrderedDict
def parse_args():
"""Parse the input arguments, u... |
#!/usr/bin/env python
"""
The actual error handler algorithm
The current ErrorHandler will either exhaust jobs based on the retry_count, or move jobs
onward into their necessary cooloff state. The number of retries a job is allowed is
based upon:
config.ErrorHandler.maxRetries
However, it can also be used to handle... |
# Copyright 2019-2021 Xanadu Quantum 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... |
from datetime import datetime, timedelta
from challenges.models import Submission, SubmissionParent
from challenges.tests.fixtures.ignite_fixtures import (setup_ignite_challenge,
teardown_ignite_challenge,
set... |
import numpy as np
from scipy import optimize
def fit(X,
y,
population_count=100,
elite_count=2,
velocity_rate=0.001,
epoch_count=25):
params_count = 4
lower_limits = np.array([0, 0, -np.pi, -1])
upper_limits = np.array([1, np.pi * 2, np.pi, 1])
bounds = np.arr... |
""" Neural Network architecture for Atari games.
"""
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
__all__ = [
"AtariNet",
"BootstrappedAtariNet",
"get_feature_extractor",
"get_head",
]
def get_feature_extractor... |
import os
import json
import gzip
import boto3
s3 = boto3.client('s3')
batch = boto3.client('batch')
BUCKET = 'landsat-pds'
RUN_INFO_KEY = 'run_info.json'
RUN_LIST_KEY = 'run_list.txt'
SCENE_LIST_KEY = 'c1/L8/scene_list.gz'
def complete_run(run_info):
"""
After a run is complete, aggregate the results into... |
import time
import sys
import copy
import random
import ui
from objc_util import on_main_thread
import OpenGLES.Util
import OpenGLES.Util.Model
import OpenGLES.Util.Shader
import OpenGLES.GLES as GLES
import OpenGLES.EAGL as EAGL
import OpenGLES.Util as Util
import OpenGLES.GLKit as GLKit
from OpenGLES.GLES.gles1 imp... |
import base64
import inspect
import sys
import typing
import flask
from nasse import config, exceptions, models, request, timer, utils
from nasse.response import Response, exception_to_response
RECEIVERS_COUNT = 0
def retrieve_token(context: request.Request = None) -> str:
"""
Internal function to retrieve... |
# ==========================================================================
# This example demonstrates how easy it is to create a bot
# that sends chat messages whenever something interesting happens
# on the server you are connected to.
#
# Below you can find a wide range of different events you can watch
# but reme... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
Python Assignment 2: Tic-Tac-Toe
"""
### Create Functions: ###
#first_board function - used to reset winner variable & board list for new game
#(also making winner & board global variables)
def first_board():
global winner, board
winner = False
bo... |
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from mc3g import event
plt.rcParams['axes.linewidth'] = 1.5
plt.rcParams['font.size'] = 15
def plot(
vr : float = 0.8,
ve : float = 0.8,
p : float = 1e-2,
N : int = 100,
sens : float = 0.8,
spec : f... |
# Copyright (c) 2018 Yubico AB
# 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 of conditi... |
"""
Classes used for this assignment.
"""
import multiprocessing.dummy as dummy
import socket
import sys
import traceback
import uuid
import os
import re
import select
from random import choice
from datetime import datetime
from time import sleep
from conf import MAX_BUFFER_SIZE
class Process(object):
"""
Pr... |
#!/usr/bin/env python3
import sys
import os
import importlib
import argparse
import time
import datetime
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
LFUtils = importlib.import_module("py-json.LANforge.LFUti... |
# Copyright 2017 Google, Inc. 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 law or ... |
# -*- coding: utf-8 -*-
import logging
from openerp.osv import osv,fields
from openerp import models, fields, api, _
#CDCM
#07-04-2021
#Se agg libreria para poder usar el ValidationError
from openerp.exceptions import ValidationError
#CDCM
_logger = logging.getLogger(__name__)
class respartnerHistorico(models.Model):... |
# coding=utf-8
from prototypical_batch_sampler import PrototypicalBatchSampler
from prototypical_loss import prototypical_loss as loss_fn
from singlecell_dataset import TrainingDataset
from protonet import ProtoNetBig
from parser_train import get_parser
from misc_utils import fancy_text as fncy_txt
from tqdm import tq... |
import pandas as pd
import numpy as np
from etl_ml.utils.ftps_client import Ftps_client
import hashlib
import os
from configparser import ConfigParser
import ast
import traceback
import logging
import paramiko
logger = logging.getLogger(
name=__name__,
)
class E_M:
logging.basicConfig(level=logging.INFO,... |
# Copyright (c) 2009 <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 rights to
# use, copy, modify, merge, publish, di... |
# Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, <NAME>, Inc.
# 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 copyri... |
# -*- coding: utf-8 -*-
"""Driver for FreeStyle Optium devices.
Supported features:
- get readings (ignores ketone results);
- use the glucose unit preset on the device by default;
- get and set date and time;
- get serial number and software version.
Expected device path: /dev/ttyUSB0 or similar seri... |
import time
from collections import deque
import numpy as np
from scipy.spatial.distance import pdist, squareform
def get_dists(scanners):
result = {}
for scanner, beacons in scanners.items():
dists = pdist(beacons)
result[scanner] = dists
return result
def find_matches(dists, source_sc... |
from __future__ import annotations
import json
import os
import shutil
import logging
from typing import Union, Iterable, Type
import numpy
import rdkit.Chem # type: ignore
import molscore
logger = logging.getLogger(__name__)
class DataHandler:
"""Organizes interacts with many datasets of reactions on file.... |
"""hug_core/interface.py
Defines the various interface hug_core provides to expose routes to functions
Copyright (C) 2016 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restrict... |
import torch
import torch.nn as nn
import torch.nn.init as init
# ------------------------------------------------------------------------------
class _MultiHeadAttention(nn.Module):
def __init__(self, d_k, d_v, d_model, n_heads, dropout):
super(_MultiHeadAttention, self).__init__()
self.d_k = d_k
... |
# coding=utf8
"""
@author: <NAME>
@date: 2019.5.5
MIT License
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the righ... |
#!/usr/bin/env python3
#
# Copyright 2010 by Idiap Research Institute, http://www.idiap.ch
#
# See the file COPYING for the licence associated with this software.
#
# Author(s):
# <NAME>, July 2010
# <NAME>, March 2013
#
#
# Parse Phone-Set file in csv format and create question sets
#
import csv, sys, os, re
from... |
#!/usr/bin/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
# "Lice... |
# -*- coding: utf-8 -*-
# Это упрощенная версия бэктеста, который используется на сервере https://bcsquants.com
# Разработчик <NAME> <<EMAIL>>
from __future__ import print_function
from datetime import datetime as dt
import numpy as np
import csv
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ti... |
import argparse
from argparse import Action
import logging
import numpy as np
import sys
from collections import defaultdict
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from random import Random
@dataclass(frozen=True)
class Point:
x: int
y: int
def __add__(self... |
import pandas as pd
import utilities as utils
import progressbar as pb
import logging
### --------------------------
### Define methods - data prep
### --------------------------
def prep_data_pairs(in_file):
"""Read time series data from file and get *obs_pair_hash* and *alphabet*.
Parameters:
i... |
import argparse
import io
import zipfile
from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import Iterable, Optional, Tuple, Callable, Sequence, Union
import numpy as np
import torch
from torch import nn
from tqdm.auto import tqdm
from einops import rearrange
from ignite.metrics.gan... |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'depot_tools/bot_update',
'depot_tools/gclient',
'depot_tools/git',
'depot_tools/presubmit',
'recipe_engine/context',
'recipe_engine... |
# Copyright 2010-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... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from Pre_proccessing_Data import proccessing_data
from Predict import predict
def y2_indicator(Y, K):
"""
Creates the indicator matrix for the targets
"""
N = len(Y)
ind = np.zeros((N, K))
ind[np.arange(N), Y[... |
# Author: <NAME>
# Contributors: <NAME>, <NAME>
import torch
import torch.nn as nn
from cgnet.feature.utils import ShiftedSoftplus, LinearLayer
class SimpleNormLayer(nn.Module):
"""Simple normalization layer that divides the output of a
preceding layer by a specified number
Parameters
----------
... |
import typing
import pandas as pd
import d3m.metadata.base as mbase
from . import config
# from d3m.primitive_interfaces.featurization import FeaturizationLearnerPrimitiveBase, FeaturizationTransformerPrimitiveBase
# changed primitive class to fit in devel branch of d3m (2019-1-17)
from d3m.primitive_interfaces.u... |
import random
from pprint import pprint as pp
import numpy as np
import quaternion
import qukf
class QUKFModel1(qukf.QuaternionUKFModel):
"""
The internal state:
additive:
world_position(3)
world_velocity(3)
body_acceleration(1), it's only moving forward
angular_velocity(3)
quaternions:
... |
# -*- coding: utf-8 -*-
""" Go ICP implementation of RigidRegistration interface. """
# pylint:disable=invalid-name, no-name-in-module
import logging
import numpy as np
from sksurgerygoicppython import GoICP, POINT3D, ROTNODE, TRANSNODE
import sksurgerysurfacematch.interfaces.rigid_registration as rr
LOGGER = logg... |
"""
Instead of the change detector looking at each revision for an item
what i want here, is to compare the current state of an item's key/value pairs that I define, with another
set of data (a reference dataset, from an owl/obographs json file)
Steps:
- Does a sparql query against wikidata to get all mesh IDs on all ... |
#==============================================================================
# Copyright 2011 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.
# You may obtain a copy of the ... |
"""
Palo Alto Set Additional Threat Logging
In PAN-OS 8.1.2 and higher, Palo Alto introduced additional threat logging that is enabled with an OP/CLI command.
Enable the firewall to generate Threat logs for a teardrop attack and a DoS attack using ping of death,
and also generate Threat logs for the types of packets ... |
from __future__ import annotations
from operator import add, neg, sub
from typing import List, Tuple
from .Audio import writeoutAudio
import numpy as np
from scipy.interpolate.interpolate import interp1d
from scipy.ndimage.filters import uniform_filter1d
from .TimeSeries import TimeSeries
from copy import deepcopy
cl... |
#!/usr/bin/env python
import os
import sys
import glob
import numpy as np
from sklearn.cluster import AgglomerativeClustering
import multiprocessing as mp
def smooth(x, window_len=13, window='hanning'):
s = np.r_[[x[0]]*(window_len//2), x, [x[-1]]*(window_len//2)]
if window == 'flat': #moving average
... |
"""
OSMNx Tools for Street Networks Case Study (oxtools.py)
This script provides the user with functions to streamline the
steps in the case study process:
1. Compute d1, d2 for residential unit and testing site GeoDataFrames
respectively
2. Create residential unit - testing site pair dataframe
3. Compute d3
"""
i... |
from soxs.instrument import instrument_simulator
from soxs.events import write_image, make_exposure_map
from soxs.utils import mylog
import numpy as np
from astropy.io import fits, ascii
from astropy.table import Table
def make_mosaic_events(pointing_list, input_source, out_prefix, exp_time,
i... |
import logging
from pixUtils.pixCommon import *
def videoPlayer(vpath, startSec=0.0, stopSec=np.inf):
cam = vpath if type(vpath) == cv2.VideoCapture else cv2.VideoCapture(vpath)
ok, fno = True, startSec
cam.set(cv2.CAP_PROP_POS_MSEC, fno * 1000)
videoPlayer.cam = cam
while ok:
ok, img = ca... |
"""Bunch of things needed by a bunch of other things which kinda don't have a better place to go."""
import collections
import warnings
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from urllib.error import URLError
import luddite
import numpy as np
import pandas
from packaging.version... |
"""
(C) Copyright 2021 IBM Corp.
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, software
d... |
# -*- coding: utf-8 -*-
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://a... |
import cPickle
import random
import numpy as np
import tensorflow as tf
import utils as ut
from dis_model_pairwise_nn import DIS
from eval.ndcg import ndcg_at_k
from eval.precision import precision_at_k
from gen_model_nn import GEN
FEATURE_SIZE = 46
HIDDEN_SIZE = 46
BATCH_SIZE = 8
D_WEIGHT_DECAY = 0.01
G_WEIGHT_DECA... |
from concurrent.futures import ThreadPoolExecutor
from contextlib import closing
import fnmatch
from functools import partial
import glob as g
import json
import logging
import os
import re
from typing import Dict, Generator, Iterable, List
import backoff
import boto3
from botocore.exceptions import ClientError
logge... |
import torch
from torch.utils.data import Dataset, DataLoader
import torch.distributed as dist
from torch.utils.data.distributed import DistributedSampler
from typing import Sequence, Tuple, List, Union
import numpy as np
import pandas as pd
import random
import re
import os
import linecache
from typing import List
imp... |
import numpy as np
import scipy.stats
import scipy.io
import math
from scipy import signal
from sklearn.cluster import KMeans
def vqpooling_pooling(chunk):
chunk = np.asarray(chunk, dtype=np.float64) # kmeans IndexError out of bound,
# bug here:
# https://stackoverflow.com/questions/41635426/index-n-is... |
# Friday, February 5, 2021
"""
**coordinate_generator.py**
A module that will contain the functions and classes associated with generating x,y coordinates
"""
from .fileio import create_dir_if_not, export_dict
import matplotlib.pyplot as plt
import pandas as pd
class CoordinateGeneratorBase:
"""
This is a ... |
import os
import sys
import numpy as np
inputDir = sys.argv[1]
lpaResultsDir = sys.argv[2]
latexFileName = os.path.join(inputDir, "tables.tex")
latexFile = open(latexFileName, 'w')
def getPartitionTime(graph, config):
filepath = os.path.join(os.path.dirname(graph), "partitions", os.path.basename(graph), config,... |
from typing import List, Any, Optional, Tuple
import logging
import logging
from typing import List, Any, Optional, Tuple
from PyQt5 import QtCore
from .task import ProcessingTask, ProcessingSettings
from ..calculations.subtractionjob import SubtractionScalingMode, SubtractionJob, SubtractionResult
logger = logging... |
#!/usr/bin/env python3
"""
THIS IS FOR docopt !!!
Scripts to drive a donkey 2 car and train a model for it.
Usage:
manage.py (drive) (--config=<config>) [--model=<model>] [--js] [--offline]
manage.py (train) (--config=<config>) [--tub=<tub1,tub2,..tubn>] (--model=<model>) [--no_cache] [--offline]
Options:
... |
"""Use this library to recognize morphology of the token. It'll look for an
appropriate rule in DB and returns you the result.
"""
from libs.arrproc import isSupsetTo
import libs.strproc as strproc
class MorphologyRecognizer:
"""This class contains methods for morphology processing.
"""
def __init__(
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Let viewers pay currency to boost currency payouts
for everyone in chat for x seconds"""
import json
import os
import os.path
import codecs
import threading
import io
import sys
sys.path.append(os.path.dirname(__file__))
from DarkForestCreature... |
import serial
import curses
from time import sleep
from xyzplotlyhandler import XYZPlotlyHandler
def float2string(i):
return '{:+06.2f}'.format(i)
class Rover(object):
def __init__(self, address):
self.address = address
self.ir = {'FRONT': 0, 'REAR': 0}
self.accel = {'X': 0, 'Y': 0, ... |
import numpy as np
import pandas as pd
import math
import bisect
from scipy.interpolate import interpn as _interpn
import matplotlib.pyplot as plt
from mhkit.tidal.resource import _histogram
from mhkit.river.graphics import plot_velocity_duration_curve, _xy_plot
def _initialize_polar(ax = None, metadata=None, flood=... |
import unittest
from testing import rgb_to_hsl_testing
from hsl import rgb_to_hsl, hsl_to_rgb
import timeit
class Test_RGB2HSL_Values(unittest.TestCase):
@staticmethod
def runTest() -> None:
"""
TEST rgb_to_hsl & hsl_to_rgb
Loop over every RGB values possible and check the... |
from typing import Iterable, Tuple, Awaitable
from ...exceptions.executorexceptions import CommandExecutionFailure
from ...exceptions.tardisexceptions import TardisError
from ...exceptions.tardisexceptions import TardisResourceStatusUpdateFailed
from ...interfaces.siteadapter import SiteAdapter
from ...interfaces.sitea... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
import jsonpickle
import re
import time
from abc import abstractproperty
from posixpath import join
from cloudshell.devices.json_request_helper import JsonRequestDeserializer
from cloudshell.devices.networking_utils import UrlParser, serialize_to_json, comman... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.