text stringlengths 6.04k 39.5k |
|---|
import os
import json
import random
import collections
from interfaces import NTRTJobMaster, NTRTMasterError
from concurrent_scheduler import ConcurrentScheduler
import collections
#TODO: This is hackety, fix it.
from evolution_job import EvolutionJob
class LastUpdatedOrderedDict(collections.OrderedDict):
'Store i... |
import copy
import time
import traceback
import typing
from uuid import UUID, uuid4
import numpy as np
import torch
from PySide2.QtCore import QObject, QThread, Signal, Slot
from scipy.optimize import OptimizeResult, basinhopping, minimize
from scipy.stats import norm
from torch.nn import Module, Parameter, ReLU, Soft... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 24 16:09:26 2018
Plotting scripts for Plant_Designer
@author: Drizdar
"""
import matplotlib.pyplot as plt
from numpy.polynomial.polynomial import polyfit
import numpy as np
import pandas as pd
import pro_sys_eqns as pse
import mpld3
from mpld3 import plugins
#note thro... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from torch.nn import functional as F
from PIL import Image
from tqdm import tqdm
import numpy as np
import os
import json
from maskrcnn_benchmark.modeling.roi_heads.mask_head.inference import Masker
from maskrcnn_benchmark... |
import numpy as np
import matplotlib.pyplot as plt
from itertools import compress
from scipy import interpolate
from stl import mesh
import OpenFOAM
def create_panel(p1, p2, N, k, kp, kn, X, Y, kN, kS, S, Solid, D, end):
dx = (p2[0] - p1[0]) / N
dy = (p2[1] - p1[1]) / N
D = interpolate.interp1d... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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... |
import concurrent.futures
import numpy as np
import argparse
import os
from copy import deepcopy
from time import time
from pprint import pprint
from evolution.operators import *
from to.probabilistic_model import ProbabilisticModel
from to.mixture_model import MixtureModel
from evolution.chromosome impor... |
"""
author: ouyangtianxiong
date:2019/12/15
des: implement the Bimodal Deep Auto encoder for eeg modality and eye modality
"""
import sys
sys.path.append('../')
from data_set.seed_iv import SEED_IV, SEED_IV_DATASET
import torch
from torch.optim import Adam
from torch.nn import CrossEntropyLoss, MSELoss
from torch.utils... |
# TODO: cartesian, and Xp1 Yp1 right are not tested.
import pytest
import numpy as np
import xarray as xr
from numpy.testing import assert_array_equal
# From OceanSpy
from oceanspy import open_oceandataset, OceanDataset
# Directory
Datadir = './oceanspy/tests/Data/'
# Test oceandataset
MITgcm_curv_nc = open_oceandat... |
# Part of PushMode: https://pushmode.machinezoo.com
import os
import textwrap
import contextlib
import re
import string
# Attempting to use relative paths would mess up the file tree depending on where the script runs.
# We will instead locate java sources relative to the running script.
rootdir = os.path.dirname(os.... |
# -*- coding:utf-8 -*-
"""
Kraken Trade module.
https://www.kraken.com/features/api
Author: HuangTao
Date: 2018/05/03
Email: <EMAIL>
"""
import copy
import hmac
import base64
import hashlib
import urllib
import urllib.parse
from quant.error import Error
from quant.utils import tools
from quant.utils import logge... |
# Copyright (c) 2015 VMware, 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 b... |
"""This module is a command line script which lists the match tuples associated
with a reference file.
% crds matches --contexts hst_0001.pmap --files lc41311jj_pfl.fits
lc41311jj_pfl.fits : ACS PFLTFILE DETECTOR='WFC' CCDAMP='A|ABCD|AC|AD|B|BC|BD|C|D' FILTER1='F625W' FILTER2='POL0V' OBSTYPE='IMAGING' FW1OFFST='N/A' ... |
import logging
import random
import ujson as json
from collections import namedtuple, OrderedDict, defaultdict
from typing import List
from common.bugsnag import BugSnagContextData
from common.connect.redis import get_redis
from common.enums.jobtype import detect_job_type
from common.id_tools import parse_id_parts
fr... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test numpy functions and ufuncs on Masked arrays and quantities.
The tests here are fairly detailed but do not aim for complete
coverage. Complete coverage of all numpy functions is done
with less detailed tests in test_function_helpers.
"""
import py... |
import sys, glob, os
sys.path.insert(1, '/data/s1825216/git/neural_deprojection/')
import tensorflow as tf
import sonnet as snt
import numpy as np
from tensorflow import keras
from neural_deprojection.graph_net_utils import vanilla_training_loop, TrainOneEpoch, AbstractModule, get_distribution_strategy, build_log_dir,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import sys
import numpy as np
import copy
def rotmat2expmap(R):
theta = np.arccos((np.trace(R) - 1) / 2.0)
if theta < 1e-6:
A = np.zeros((3, 1))
else:
A = theta / (2 * n... |
#!/usr/bin/env python
#
# Copyright 2017, <NAME> <<EMAIL>>
#
# This file is part of HISAT-genotype.
#
# HISAT-genotype is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
"""django-q tasks"""
import datetime
import enum
import logging
import random
from functools import partial
from django.core.cache import cache
from django.db.models import Q
from django.utils import timezone
from twitter.error import TwitterError
from . import models
from .celery import app
from .utils import Error... |
#! /n/local_linux/epd/bin/python2.7
#
# This script will not run with /usr/local/bin/python -> python3.2
# for linux /n/local_linux/python2.5.1/bin/python
#
# default is now vers 3 in /usr/bin/python
# for linux /n/local_linux/python2.5.1/bin/python
# for mac /usr/bin/env python
# for lanl machines /usr/bin/env python... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# S O U R C E A N D S I N K
# ==============================================================================
"""
* File name: sourceSink.py
* Last edited: 2020-06-14
* Created by: <NAME>... |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... |
import numpy as np
from scipy.ndimage import median_filter
from scipy.ndimage import gaussian_filter1d
import Marsh
def getP(data, centroids, aperture_radius, ron, gain, nsigma, polynomial_spacing, polynomial_order, min_column = None, max_column = None, return_flat = False, data_variance = None):
"""
Given a ... |
# This file is copied from IGNN's repo
import sys
import numpy as np
import scipy.sparse as sp
import torch
import torch_sparse
import pickle as pkl
import networkx as nx
from time import perf_counter
from sklearn import metrics
def aug_normalized_adjacency(adj, need_orig=False):
if not need_orig:
adj = a... |
# Copyright (c) 2021, Xilinx
# 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 follow... |
import numpy as np
from .node import *
from .element import *
from .section import *
from scipy.linalg import null_space as null
from ..general import ensure_list, compatibility_matrix as compmat, lagrange_constrain, gdof_ix_from_nodelabels
from copy import deepcopy as copy
class ElDef:
def __init__(self, nodes, e... |
"""Normalized Location Schema
Spec defined here:
https://github.com/CAVaccineInventory/vaccine-feed-ingest/wiki/Normalized-Location-Schema
"""
import datetime
import enum
import re
from typing import List, Optional, Union
from pydantic import (
AnyUrl,
EmailStr,
Field,
HttpUrl,
datetime_parse,
... |
## @package street_labels
# Contains function for reading and parsing labels
#
#Self imports
import street_params as sp
import street_utils as su
#Other imports
import pickle
import numpy as np
from os import path as osp
import my_pycaffe_io as mpio
import subprocess
from multiprocessing import Pool
import copy
from ... |
import enum
import json
from collections import defaultdict, namedtuple
from io import BytesIO
from typing import Any, BinaryIO, Dict, Iterator, List, Optional, Tuple, Union
from minio import Minio
from redis import AuthenticationError, StrictRedis
from urllib3.response import HTTPResponse
from .task import Task, Tas... |
#! /usr/bin/env python
"""
This module includes general utility functions.
Authors
-------
- <NAME>
Use
---
Individual functions from this module are intended to be imported where
needed::
from abscal.common.utils import absdate
"""
import glob, os, sys, yaml
import numpy as np
from astropy.time import Time
f... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#!/usr/bin/env python
"""
#################################
Testing Package Assistants Module
#################################
"""
# -*- coding: utf-8 -*-
#
# rtk.testing.Assistants.py is part of The RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> <EMAIL>rew.rowland <AT> reliaqual <DOT> com
... |
from manimlib.imports import *
### This is the newest (2020.05.16) ThreeDVector class by @魔与方
class ThreeDVector(VMobject):
"""
This vector has two parts
The top part is a cone (tip)
The bottom part is a cylinder
The parameter "tip_length" means the height of the cone (tip)
The parameter "tip_radius" means the... |
# coding=utf-8
# Copyright 2017
# To use GPU, you need to compile Tensorflow following:
# http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.html
# Tested on Tensorflow 0.12 and TensorFlow 1.0
#!/usr/bin/python
from __future__ import absolute_import
from __future__ import div... |
#!/usr/bin/python
#
# Copyright (c) 2016 <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... |
import logging
import stat
import binascii
import winreg
import pathlib
from hurry.filesize import size
from datetime import datetime
from os import path, environ, makedirs, listdir
from os import stat as os_stat
import sys
def app_name():
"""Returns app name as dir name"""
import sys
return path.splitext... |
import configparser
import os
import pytest
import socket
from unittest.mock import call, MagicMock, patch
import docker2ami.ami_builder as ami_builder
from docker2ami.ami_builder import Color
class EmptyObj(object):
""" So we can dynamically add attributes """
pass
def test_color():
assert Color.RED =... |
import json
import os
from functools import partial
import cv2
import numpy as np
from tierpsy.analysis.compress.compressVideo import getROIMask, selectVideoReader, reduceBuffer
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QImage
from PyQt5.QtWidgets import QApplication, QMainWindow, \
QFileDialog, QMes... |
import numpy as np
from tensorflow.keras import backend as K
from tensorflow.keras import constraints, initializers, regularizers
from tensorflow.python.eager import context
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras.engine.base_layer import InputSpec, Layer
from tensorflow.pytho... |
# Name: audio.py
# Description: defines functionality to process audio from audio files
import logging
import librosa
import numpy as np
import os
import pkg_resources
import pandas as pd
import glob
import json
from genreml.model.processing.audio_features import SpectrogramGenerator, LibrosaFeatureGenerator, WavePlo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.models as models
import torchvision.transforms as transforms
import numpy as np
import os
import math
import PIL
from time import time
from argparse import ArgumentParser
class Vgg16_Extractor(nn.Module):
... |
import sys
import sound
import discord
import logging
import config
import psutil
import typing
import string
from discord.ext import commands
import secret_rolls as sroll
# -------------------------
# Bot command global checks
# -------------------------
# params: Discord.ext.commands.Context context
@commands.check... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import string
import re
from itertools import product
END_SYMBOLS = [' ', '\\', '\n', '.', ',', ';', '=', '`', '"', "'", '(', ')', ':', '[', ']', '{', '}', '+'] # no ++
END_SYMBOLS_BY_2 = list(product(END_SYMBOLS, END_SYMBOLS))
def random_st... |
# by XADJILUT, 2020-2021
import asyncio
import base64
import datetime
import hypercorn.asyncio
import io
import pyaes
import random
import re
import sys
from boilerpy3.extractors import KeepEverythingExtractor as CanolaExtractor
from datetime import timedelta
from hypercorn.config import Config
from quart import Quart... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
# Copyright (c) 2015 Wikimedia Foundation
# ImageMagick engine
import logging
import... |
# 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.
"""
RoBERTa: A Robustly Optimized BERT Pretraining Approach.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from fair... |
import os
import argparse
import multiprocessing
import numpy as np
import random
import time
import shutil
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import yaml
from tqdm import tqdm
from checkpoint import (
default_checkpoint,
load_checkpoint,
save_c... |
#
# Copyright (c) 2022 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Metrics and utilities for evaluating time series anomaly detection models.
"""
from bisect impor... |
######################################################################
## TFL_Check_Edits.py
## Purpose: 1. Check the edited TFL lines for attribute integrity
## 2. Run topology rules on the TFL lines
## 3. Build polygons and check spatial rules (overlaps)
## Date: February, 2019
## Author: <NAME>, Ge... |
import numpy as np
import pandas as pd
import warnings
from collections import defaultdict
from collections.abc import Sequence
from tqdm.autonotebook import tqdm
# plotting
import matplotlib.pyplot as plt
# ML algo
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifi... |
# TODO: implement event creation out of frame based results
# TODO: implement wrappers for pandas row based events
# TODO: wrapper for multiclass case
def frame_results_to_events(frame_results, frame_times=None):
"""
Converting frame-by-frame results into a list of events for each label. If the classifier pre... |
import torch
import numpy as np
import pandas as pd
import random
import os
import time
import datetime
import cv2
from PIL import Image
import h5py
from tqdm import tqdm
from dataload import mnist_load, cifar10_load
from models import SimpleCNN, RAN, WideResNetAttention
def seed_everything(seed=... |
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import tensorlayer as tl
from sklearn import preprocessing
from scipy.stats import spearmanr
import pandas as pd
'''
These code comes from Basset:Deep convolutional neural networks for DNA sequence analysis
https://github.com/davek44/Basset... |
import os
import re
import sys
import csv
import penman
from amr_utils.alignments import AMR_Alignment, write_to_json, load_from_json
from amr_utils.amr import AMR
class Matedata_Parser:
token_range_re = re.compile('^(\d-\d|\d(,\d)+)$')
metadata_re = re.compile('(?<=[^#]) ::')
def __init__(self):
... |
import os.path
import re
from abc import ABC, abstractmethod
from logging import getLogger
from typing import Dict, List, Optional, Tuple
from pipkin.common import UserError
from pipkin.util import parse_meta_dir_name
META_ENCODING = "utf-8"
KNOWN_VID_PIDS = {(0x2E8A, 0x0005)} # Raspberry Pi Pico
logger = getLogger... |
# Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2013 California Institute of Technology. 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... |
import numpy as np
import h5py
import time
import csv
import os
import subprocess as sp
import array
import re
import unicodedata
import operator
import shlex
import matplotlib.pyplot as plt
import matplotlib.axes as axes
import matplotlib.cm as cm
import matplotlib.colors as colors
import matplotlib.colorbar as colo... |
from collections import namedtuple
# from eeea.genetic.optimizer import Optimizer
from eeea.firefly.optimizer import FAOptimizer
import logging
from tqdm import tqdm
import csv
import numpy as np
import os
import argparse
import eeea.utils.utils as utils
import glob
import sys
import math
import time
import hashlib
fro... |
import battlecode as bc
import random
import sys
import traceback
import numpy as np
import time
# from itertools import filter
import os
print(os.getcwd())
print("pystarting")
# A GameController is the main type that you talk to the game with.
# Its constructor will connect to a running game.
gc = bc.GameController... |
# -*- coding: utf-8 -*-
import json
from cStringIO import StringIO
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.context_processors import csrf
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
fr... |
import argparse
import h5py
import json
import numpy as np
from keras import backend as K
from sklearn.metrics import roc_auc_score, roc_curve, precision_recall_curve, average_precision_score
from keras.utils import to_categorical
import src.utilities as U
from cleverhans import attacks
from cleverhans.model import Ca... |
import psycopg2
ok = 0
err = 1
def status(x):
if x == ok:
ansewer = "OK"
elif type(x) == type([]):
return {"status": "OK", "data": x}
else:
ansewer = "ERROR"
return {"status": ansewer}
def is_user(conn, dict):
sql = "select * from users where login = %(login)s and passw... |
# -*- coding: utf-8 -*-
# --------------------------
# Copyright © 2014 - Qentinel Group.
#
# 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/LIC... |
import os
import json
import requests
import hmac
import hashlib
import base64
import time
import warnings
from datetime import datetime
from six.moves.urllib.parse import urljoin
from ansible.module_utils.six import iteritems
from ansible.module_utils._text import to_text
from . import tetration_constants
from reques... |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
#!/usr/bin/env python3
import sys
sys.path.append('..')
import os
# for pyinstaller
dllpath = os.path.dirname(os.path.realpath(sys.argv[0]))
if dllpath not in os.environ:
os.environ["PATH"] += os.pathsep + dllpath
import logging
import threading
import time
import json
# import supervolt.supervoltbattery
try:
... |
from collections import OrderedDict
import re
import requests
import json
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.core.exceptions import ValidationError
from rest_framework import status
from rest_framework.response import Response... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
import numpy as np
import pytest
from pydefect.analyzer.defect_structure_info import \
Displacement, DefectStructureInfo, fold_coords, calc_drift, \
calc_displacements, make_defect_structure_info, symmetrize_defect_s... |
import numpy as np
from sl1m.constants_and_tools import *
from numpy import array, asmatrix, matrix, zeros, ones
from numpy import array, dot, stack, vstack, hstack, asmatrix, identity, cross, concatenate
from numpy.linalg import norm
#~ from scipy.spatial import ConvexHull
#~ from hpp_bezier_com_traj import *
#~ f... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: parityAndSpeedTestOfArrayTracingFuncs.py
# Purpose: 1. parity tests
# To verify the correctness of the array ray tracing functions by
# checking the returned data again... |
"""Internationalization and localization support.
This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.
I18N refers to the operation by which a program is made aware of multiple
languages. L10N r... |
from collections import OrderedDict
from collections.abc import MutableMapping
from .util import batch_sum, partial_sum, log_mean_exp
import abc
from enum import Enum
import math
__all__ = ["Stochastic", "Factor", "RandomVariable", "Trace"]
class Provenance(Enum):
SAMPLED = 0
OBSERVED = 1
REUSED = 2
cl... |
'''
This is a file in which we mutate the hypothetical [agent X skill] matrix directly, allowing us to
test and compare different diversity metrics.
'''
import argparse
import copy
import os
import random
import pickle
from pdb import set_trace as T
import numpy as np
# NOTE: to prevent "relative import" error, run `... |
"""
Yandex supports base auth methods:
- password
- magic_link - auth via link to email
- sms_code - auth via pin code to mobile phone
- magic (otp?) - auth via key-app (30 seconds password)
- magic_x_token - auth via QR-conde (do not need username)
Advanced auth methods:
- x_token - auth via super-token (1 year)
- co... |
# Copyright 2013-2018 The Salish Sea NEMO Project and
# The University of British Columbia
# 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
# U... |
import asyncio
import logging
import random
import cachetools
from api.avrae.cogs5e.funcs.scripting.evaluators import MathEvaluator, ScriptingEvaluator
from api.avrae.cogs5e.models.dicecloud.integration import DicecloudIntegration
from api.avrae.cogs5e.models.embeds import EmbedWithCharacter
from api.avrae.cogs5e.mod... |
"""
Creates a MobileNetV3 Model as defined in:
<NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>. (2019).
Searching for MobileNetV3
arXiv preprint arXiv:1905.02244.
Original repository: https://github.com/d-li14/mobilenetv3.pytorch
"""
import math
import warnings
from coll... |
# S/E/I/R : 4 bars in each group
# each group is one week; 3 weeks
# age cat 1 to 5; 5 categories vertically in each bar
# csv format input
# each row has three keys which together identify the row uniquely (age; week; SEIR)
# some hardcoded color maps
# This product includes color
# specifications and designs d... |
# -*- coding: utf-8 -*-
# @Time : 2019/1/23 14:35
# @Author : Alan
# @Email : <EMAIL>
# @File : data_preprocess.py
# @Software: PyCharm
import sys
import numpy as np
import random
from collections import namedtuple
import pickle
import time
random.seed(1337)
np.random.seed(1337)
ModelParam = namedtuple("Mo... |
from datetime import datetime
import traceback
from ..users import basedUser
from .import reactionMenu, expiryFunctions
from discord import Message, Member, Role, Embed, Colour, RawReactionActionEvent
from .. import lib, botState
from typing import Any, Dict, List
from ..scheduling import timedTask
from ..cfg import cf... |
import os
import argparse
from argparse import Namespace
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import copy
from decimal import Decimal
import wandb
import sys
sys.path.append('../../')
from sopa.src.solvers.utils import create_solver
from sopa.src.models.utils ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 21 21:17:55 2021
@author: divyam
"""
import cv2 as cv
import numpy as np
import random
import matplotlib.pyplot as plt
import math
import copy
img1 = cv.imread("im0.png")
img2 = cv.imread("im1.png")
img1 = cv.resize(img1, (600,400))
img2 = cv.resize(img... |
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib import cm
import matplotlib.animation as animation
import pandas as pd
from collections import Counter
import seaborn as sns
import pickle
def gridIndicesToMatIndices(i,j, maxI, maxJ):
"""
converts grid coordinates to nu... |
#!/usr/bin/env python3
"""
A script for calculating the best uptake and depuration constants given historical data as input.
"""
import argparse
import pandas as pd
import numpy as np
from math import isnan,sqrt
from statistics import mean
import os
def calc_rms(x,y):
"""
Calculate the root mean square deviat... |
from xdata import *
import xdata as xd
#print(dir(xd))
sortie=open('triouint.py','w')
trace=open('trace','w')
sortie2=open('sedfile','w')
sortie3=open('TRAD_1.ver','w')
#sortie.write('from objet_u import *\n')
from string import *
from types import *
#dicoclass={'lire':'read','rien':'rien','floattant':'floattant','en... |
#!/usr/bin/env python3
# coding: utf-8
################################################################################
# BLE Logger for ble_sensor ble_logger_vsspp.py
#
# Lapis独自のVSSPPプロファイルでセンサ値を取得するサンプル・プログラムです。
#
# Copyright (c) 2019-2020 <NAME>
#############################... |
import numpy as np
import math
import EOT_simulation.eulerangles as eu
import cv2
import xmltodict
import pdb
HALF_SZ = 224
# HALF_SZ = 1512
SCALE = 224.0 / 1512.0
sample_6para_expand = []
sample_6para = [ \
# Random Sample Scope Define.
# # Sample Translation for Original Photo
[0,0,0,0,0,0], \
[5,0,0,0,0,0], \
[3... |
################################################################################
# populate_obs_mission_cassini.py
#
# Routines to populate fields specific to Cassini. It may change fields in
# obs_general or obs_mission_cassini.
################################################################################
import r... |
import logging
import os
import flask
log = logging.getLogger('flask_flatearth')
BASEPATH = os.getcwd()
class ContentPage(object):
"""
Content page interface object
:var CONTENT_TYPE: Default ContentPage type
:type CONTENT_TYPE: `str`
:var TEMPLATE: Default page template
:type TEMPLATE:... |
#!/usr/bin/env python
from __future__ import division
import numpy as np
import modest
import logging
import scipy
import prior
import reg
import multiprocessing as mp
from slip import steps_and_ramps
from modest import funtime
logger = logging.getLogger(__name__)
def state_parser(Nst,Ns,Ds,Nv,Nx,Dx):
out = {}
o... |
from copy import deepcopy
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from .._parameters import VALID_METHODS_OPENAPI_V3
from ..plugin.plugin import SchemaQualPlugin
from apispec import APISpec
from typing import TYPE_CHECKING, Dict, cast
from .utils import _add_schema_to_componen... |
import numpy as np
import pylab as plt
import logging
from bayes_gain_screens.nn_tools import vanilla_training_loop, TrainOneEpoch, AbstractModule
import sonnet as snt
import argparse
import os
import sys
import astropy.units as au
from h5parm import DataPack
logging.basicConfig(format='%(levelname)s:%(message)s', ... |
import numpy as np
import matplotlib.pyplot as plt
#
import sys, os
sys.path.append('./utils/')
import tools
import datatools as dtools
from time import time
from pixelcnn3d import *
os.environ["CUDA_VISIBLE_DEVICES"]="0"
#
import tensorflow as tf
from tensorflow.contrib.slim import add_arg_scope
from layers import wi... |
import numpy as np
import pywt
import matplotlib.pyplot as plt
from sklearn.cluster import DBSCAN
def get_blocks(n):
l0 = int(np.round(np.log(n) / 2))
blocks = []
i = 0
while i < n - 1:
blocks.append([i, i + l0])
i += l0
if blocks[-1][1] > n - 1:
blocks[-1][... |
from fastapi import FastAPI, Query, Body, Response, status
from fastapi_utils.tasks import repeat_every
import sys
import subprocess
# must import sklearn first or you get an import error
import sklearn
import spacy
from gamechangerml.src.search.embed_reader import sparse
from gamechangerml.src.search.query_expansion ... |
# -*- coding: utf8 -*-
# My imports
from __future__ import division
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
import os
from astropy.io import fits
import matplotlib.pyplot as plt
from PyAstronomy import pyasl
def mad(data, axis=None):
return np.median(np.absolute(data - np.me... |
from keys.config import PARAMS
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from discord import Embed
import discord
import re
import youtube_dl
import asyncio
DEVELOPER_KEY = PARAMS["youtube"]["jinx"]
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
MAX_RE... |
#!/usr/bin/env python3
import os.path
import sys
import heapq
import operator
import statistics as stat
import vpython
import analogy.vpython_drawings as vpython_drawings
import analogy.collision_detection.aabb_collision as aabb_col
import analogy.file_parsers as file_parsers
from analogy.mesh import AABB
from analog... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.