text
stringlengths
6.04k
39.5k
"""Module for convenient objects to deal with GEDI data products""" from __future__ import annotations import datetime import pathlib import re from dataclasses import dataclass from typing import Iterable, Union import geopandas as gpd import geopandas.array import h5py import numpy as np import pandas as pd from sh...
import collections import theano from theano import tensor import numpy from numpy.testing import assert_raises, assert_allclose, assert_equal from blocks.bricks import Tanh, Sequence from blocks.bricks import (BatchNormalization, SpatialBatchNormalization, BatchNormalizedMLP) from blocks.bri...
#module load python/2.7 import os from subprocess import call import numpy as np from scipy.stats import norm, nbinom ################################################################################################ ### read 2d array def read2d_array(filename,dtype_used): import numpy as np data=open(filename,'r') d...
# -*- coding: utf-8 -*- import itertools import re import networkx from . import fields as F from . import matrix from . import distances from . import utils class FileMeta(type): def __new__(mcs, class_name, bases, attrs): # we need to map the fields by keyword and by field name # data is a dic...
import os import pickle import random import re from datetime import datetime from data_processing import (InteractiveAnswer, _in_list, colorit, space_fill, split_wrd) BOARDER_LENGTH = 40 class Quest(): def __init__(self, q, sel=None, ta=None, args={}): ''' Class rep...
__author__ = 'aymgal' from slitronomy.Util import util from lenstronomy.LightModel.Profiles.starlets import SLIT_Starlets from lenstronomy.LensModel.lens_model import LensModel import numpy as np import numpy.testing as npt import pytest import unittest np.random.seed(18) def test_make_grid(): numPix = 11 ...
#!/usr/bin/env python import argparse import deploy_hdfs import deploy_utils import deploy_zookeeper import os import pwd import socket import subprocess import sys import tempfile import urlparse from deploy_utils import Log # regionserver must start before master ALL_JOBS = ["regionserver", "master"] JOB_MAIN_CLA...
# -*- coding: utf-8 -*- """Run full pipeline of regression model for estimating regulatory programmes of cell types and other covariates which accounting for the effects of experimental batch and technology.""" import gc import os import pickle # + import time from os import mkdir import matplotlib.pyplot as plt from...
#! /usr/bin/env python3 """ """ # MIT License # # 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 restriction, including without limitation the ...
import pandas as pd import numpy as np import warnings from scipy import stats from scipy.stats import multinomial # import statsmodels.api as sm try: import parasail except ImportError: print('Importing palmotif without alignment support from parasail.') __all__ = ['compute_motif', 'compute_pal_mo...
""" Quick Wrapper around the GAM API to allow for pulling reports by either ID or by manual setup. Results can be returned as temporary files, or as pandas dataframes. Raises: Exception -- Raised exception when invalid login credentials are used """ from googleads import ad_manager from googleads import...
import numpy import math from scipy.stats import gaussian_kde from bokeh.plotting import figure from bokeh.models import Range1d, HoverTool, ColumnDataSource, NumeralTickFormatter, FixedTicker from bokeh.io.export import export_png def Violin_SHM_Plot(clone_df, png = None, title = "", vshm_col = "V_SHM", jshm...
"""Db schema definitions and setup routines.""" import sqlalchemy as sa from sqlalchemy.sql import text as sql_text from sqlalchemy.types import SMALLINT from sqlalchemy.types import CHAR from sqlalchemy.types import VARCHAR from sqlalchemy.types import TEXT from sqlalchemy.types import BOOLEAN #pylint: disable=line-...
# -*- test-case-name: twisted.internet.test.test_core -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A reactor for integrating with U{CFRunLoop<http://bit.ly/cfrunloop>}, the CoreFoundation main loop used by macOS. This is useful for integrating Twisted with U{PyObjC<http://pyobjc.sf....
import json import logging import traceback from typing import Any, Dict, Optional, Tuple import numpy as np import pandas as pd import scipy.stats as stats from great_expectations.core import ExpectationConfiguration from great_expectations.execution_engine import ( ExecutionEngine, PandasExecutionEngine, ...
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) <NAME> <<EMAIL>> # Modified by <NAME> <<EMAIL>> # This program is published under a GPLv2 license """ ASN.1 (Abstract Syntax Notation One) """ from __future__ import absolute_import from __future__ import prin...
import dataclasses import enum from functools import lru_cache from typing import List from typing import Mapping import dash import dash_core_components as dcc import dash_html_components as html import dash_pivottable import dash_table import git import more_itertools import pandas as pd from covidactnow.datapublic....
""" Differential evolution implementation """ import random from collections import OrderedDict import os from hops import hdfs, tensorboard, devices, util from hops.experiment_impl.util import experiment_utils from hops.experiment import Direction import pydoop.hdfs import threading import six import time import c...
import base64 import json import os import re from moto.core import ACCOUNT_ID from moto.core.responses import BaseResponse from moto.kms.utils import RESERVED_ALIASES from .models import kms_backends from .exceptions import ( NotFoundException, ValidationException, AlreadyExistsException, NotAuthorize...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
# ================================================================= # # Authors: <NAME> <<EMAIL>> # # Copyright (c) 2021 GeoCat BV # # 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 # ...
# -*- coding: utf-8 -*- """ Created on Mon Apr 15 19:32:53 2019 This file generates training data for the modeller @author: mike_k """ import numpy as np import os from sys import stdout import config import random import datetime from json_to_table import save_word_table import table_to_array #%% TAGS_LIST = 'tags.c...
from pickle import TRUE from flask import * import math import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score import random import socket import os import time import rss23 pid = 3 def rssrd(r, xy,client): f = {} g = {} R =...
# coding:utf-8 # 有关五子棋AI的各个类,参考资料:https://www.cnblogs.com/webRobot/p/5817740.html import numpy as np import re #--------------------------------------------------------------------------- # 评估类 #--------------------------------------------------------------------------- class evaluator: def __init__(self): ...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
#!/usr/bin/python import json, re import subprocess import nanodurationpy as durationpy import csv import time import datetime import os import shutil import shlex RESULT_CSV_OUTPUT_PATH = "/evmraceresults" # must be an absolute path to evm code dir EVM_CODE_DIR = "/evmrace/evmcode" INPUT_VECTORS_DIR = "./inputvec...
import tensorflow as tf import sys import numpy as np import cv2 from tensorflow.keras.callbacks import ReduceLROnPlateau, EarlyStopping, ModelCheckpoint, TensorBoard from yolov3_tf2.models import YoloV3, YoloLoss from yolov3_tf2.utils import freeze_all, draw_outputs import yolov3_tf2.dataset as dataset from matplotlib...
import argparse import os, time, datetime import torch from torch import nn import torchvision import numpy as np import cv2 from dataio import * from torch.utils.data import DataLoader from deep_voxels import DeepVoxels from projection import ProjectionHelper from tensorboardX import SummaryWriter from torchvision...
from collections import OrderedDict from taps.db import Database import sqlite3 from scipy.spatial import KDTree import time import numpy as np from numpy import concatenate as cat from numpy import newaxis as nax from taps.utils.antenna import packing from taps.projectors import Projector class ImageDatabase(Datab...
# 32 bp < input is needed import itertools import random import re import pandas as pd # pre-defined values SEQUENCE_LENGTH_FOR_VALIDATION = 32 RANDOM_SAMPLING_CONSTANT = 60 parameter = 20 NUMBER_OF_FULLY_MATCHED_TARGET = 60 PAM_FOR_RANDOM_GENERTION = ["TTTA", "TTTG"] nt = ["A", "T", "G", "C"] NT = 4 MAXIMUM_NUMBER_O...
import json import requests import datetime from meteocalc import heat_index # Contains ids and states for 125 cities in the US cities = ( {'id': 4960140, 'state': "ME"}, # "Caribou", {'id': 4975802, 'state': "ME"}, # "Portland", {'id': 5089178, 'state': "NH"}, # "Manchester", {'id': 5234372, 'state...
import logging import json from lxml import html from lems_ui.models import LemsElement, LemsModel from lems.model import model, component from lems.parser import LEMS LOG = logging.getLogger(__name__) def component_json_to_model_root_id(model_json): html_root = html.fromstring(json.loads(model_json)['ins...
""" FractalNet for CIFAR, implemented in Gluon. Original paper: 'FractalNet: Ultra-Deep Neural Networks without Residuals,' https://arxiv.org/abs/1605.07648. """ __all__ = ['CIFARFractalNet', 'fractalnet_cifar10', 'fractalnet_cifar100'] import os import numpy as np import mxnet as mx from mxnet import cpu fro...
import time import gym import numpy as np from gym import spaces from gym.envs.classic_control import rendering as visualize from gym.utils import seeding class CarEnv(gym.Env): def __init__( self, prepare_high_obs_method="full", args=None, seed=0, rendering=False, ): ...
from concurrent.futures import ProcessPoolExecutor from copy import deepcopy from itertools import product import logging import multiprocessing from calvin_agent.evaluation.utils import temp_seed import numpy as np logger = logging.getLogger(__name__) task_categories = { "rotate_red_block_right": 1, "rotat...
# stdlib imports from configobj import ConfigObj import os import shutil import numpy as np import tempfile import urllib import re from argparse import Namespace # local imports from mapio.shake import getHeaderData from mapio.gdal import GDALGrid from impactutils.io.cmd import get_command_output from mapio.shake imp...
# 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 required by applicable law or agreed to in writing, software #...
import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import pandas as pd import station # see Python routine "parse-csv.py" for the method of filtering data and making these csv files GIPY05 = pd.read_csv("./data/GIPY05_filtered.csv") GIPY04 = pd.read_csv("./data/GIPY...
from os.path import expandvars import numpy as N from astopy.io import fits as PF from types import FunctionType,MethodType from skymaps import SkyDir from fitstools import rad_extract TWOPI = 2*N.pi def phase_cut(eventfile,outputfile=None,phaseranges=[[0,1]],phase_col_name='PULSE_PHASE'): """Select phases with...
# -*- coding:utf-8 -*- - import rospy import math import time import numpy as np np.random.seed(1) from nav_msgs.msg import Odometry from tf_rl.envs import gazebo_env from geometry_msgs.msg import Twist, Pose, Quaternion, Vector3, Point from std_srvs.srv import Empty from gazebo_msgs.srv import SetModelState, GetModel...
import datetime import socket import struct import time import select import sys import logging import logging.handlers import argparse try: import netifaces except ImportError: print("Failed to import netifaces, --bcastaddr should be set for broadcasts") import random if sys.version_info[0] == 2: import Q...
""" Module providing unit-testing for the component models in `halotools.empirical_models.occupation_components.cacciato09_components` module" """ import numpy as np from scipy.stats import kstest from scipy.interpolate import interp1d from astropy.tests.helper import pytest from scipy.integrate import cumtrapz from ....
#!/usr/bin/python # # Copyright 2013, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. import logging import threading import struct import time import unittest from zk import zkocc from vtdb import topology from vtdb import vtclien...
from copy import deepcopy import vanilla from mojo.UI import CurrentFontWindow, CurrentGlyphWindow, StatusInteractivePopUpWindow from mojo.roboFont import AllFonts, CurrentFont, CurrentGlyph from glyphConstruction import GlyphConstructionBuilder, ParseGlyphConstructionListFromString, parseGlyphName from mojo.extensions...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2019-05-13 at 12:40 @author: cook """ import numpy as np import os import warnings from scipy.signal import convolve2d from scipy.ndimage import map_coordinates as mapc from scipy.ndimage import zoom from apero imp...
# This file has been modified. Original available at https://github.com/taolei87/rcnn import sys import time import argparse import gzip try: import cPickle as pickle except: import pickle from prettytable import PrettyTable import numpy as np import theano import theano.tensor as T from utils import load_em...
import pdb #pdb.set_trace() from collections import defaultdict import pickle import numpy as np from argparse import ArgumentParser import os import sys parser = ArgumentParser(description="Variants Calling:") parser.add_argument('--chr_start','-start',type=int,help="chromosome start from", default=1) parser.add_argu...
# Copyright 2021 qclib 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 # Unless required by applicable law or agreed to in writing, ...
# lstm-crf import codecs import os import re import string import pickle import numpy from keras import regularizers from keras.layers import Dense, Embedding, SpatialDropout1D, Input, Bidirectional, CuDNNLSTM, Lambda, BatchNormalization, Average, Maximum, concatenate from keras.models import Model from keras.models ...
"""bgc.py: bgc is used to manage and run the background model and store to .nc.gz file""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import warnings warnings.f...
import asyncio import configparser import json import time from datetime import datetime import discord import git from discord.ext import commands from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport GHtimestring = "%Y-%m-%dT%H:%M:%SZ" class Loop(commands.Cog): def __init__(self, bot)...
#!/usr/bin/python import katdal as katfile import scape import numpy as np from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt import pickle from katsdpscripts import git_info from scipy.signal import medfilt import logging import scikits.fitting as fit import time, ephem def save_ND(...
# MOE:insert #!/usr/bin/env python # Copyright 2018 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 # # Unl...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== """ Unit tests for reshaping operations. """ import numpy as np import scipy as sp...
import os import logging import time from random import random from itertools import islice from datetime import datetime import numpy as np from cv2 import imread, matchTemplate, TM_CCOEFF_NORMED from cv2 import HOGDescriptor, resize, INTER_AREA from skimage.color import rgb2gray from skimage.transform import AffineT...
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data.sampler import SubsetRandomSampler from torch.utils.data import DataLoader, random_split from torch.nn.utils.rnn import PackedSequence, pack_sequence import os import numpy as np import argparse from datetime import datetime from...
#%%writefile ezHPC/ez_cobalt.py #Uncomment to write the file #%load https://raw.githubusercontent.com/keceli/ezHPC/main/ez_theta.py #Uncomment to load the file def qstat(user='', jobid='', header='JobID:User:Score:WallTime:RunTime:Nodes:Queue:Est_Start_Time', extra='', verbose=False): ...
import celery from sqlalchemy.dialects.postgresql import insert from app.models import Urls, Onions, Pages, Links, Forms, ParseQueue from app import db, app import datetime from datetime import date, timedelta from app.useful_functions import * from urllib.parse import urlsplit, urlunsplit import json @celery.task() ...
# -*- encoding:ascii -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 6 _modified_time = 1415304518.4051909 _template_filename='templates/show_params.mako' _template_uri='show_params.mako' _template_cache=cache.Cache(__name__,...
#!/usr/bin/python3 # -*- coding: utf-8 -*- from PIL import Image import os import glob import shutil import socket import random import itertools import numpy as np import multiprocessing import configparser as cp from joblib import Parallel, delayed from sklearn.metrics import average_precision_score import torch n...
# -*- coding: utf-8 -*- # Copyright 2013-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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...
import re import dash_core_components as dcc import dash_html_components as html import numpy as np import pandas as pd import plotly.express as px # from plotly.subplots import make_subplots import plotly.graph_objs as go from dash.dependencies import Input, Output, State from sklearn.ensemble import RandomForestC...
#!/usr/bin/env python #original author: <NAME> ( http://github.com/wawaka/texture-atlas-generator ) import os import time import pickle import hashlib import subprocess import math from PIL import Image _BLEEDSIZE = 1 def bleeding_image( image ): border = 1 width = border + image.size[0] + border height = borde...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# Copyright (c) 2009-2022 The Regents of the University of Michigan. # Part of HOOMD-blue, released under the BSD 3-Clause License. r"""Implement many body potentials. Triplet force classes apply a force and virial on every particle in the simulation state commensurate with the potential energy: .. math:: U_\ma...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: <NAME>, <NAME>, <NAME> # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) """ This module provides a few methods and classes for visualizing data associated to grids. We use the `PySide <http://www.pyside.o...
from robot_bases import XmlBasedRobot, MJCFBasedRobot, URDFBasedRobot import numpy as np import pybullet import os import pybullet_data from robot_bases import BodyPart class WalkerBase(MJCFBasedRobot): def __init__(self, fn, robot_name, action_dim, obs_dim, power): MJCFBasedRobot.__init__(self, fn, robot_name...
import tkinter as tk from tkinter import ttk import matplotlib.pyplot as plt import numpy as np import talib as ta series = np.random.choice([1, -1], size=200) close = np.cumsum(series).astype(float) # 重叠指标 def overlap_process(event): print(event.widget.get()) overlap = event.widget.get() upperband,...
#!/usr/bin/env python # coding: utf-8 from utils import softmax_cross_entropy, add_momentum, data_loader_mnist, predict_label, DataSplit import sys import os import argparse import numpy as np import json # 1. One linear Neural Network layer with forward and backward steps ### Modules ### #####################...
# coding: utf-8 import collections import io import logging import re import string import sys import weakref import numpy as np from numpy import log import pytest import ray import ray.cluster_utils import ray.test_utils logger = logging.getLogger(__name__) def is_named_tuple(cls): """Return True if cls is a...
"""Support for aggregation-based AMG""" __docformat__ = "restructuredtext en" from warnings import warn import numpy as np import scipy from scipy.sparse import csr_matrix, isspmatrix_csr, isspmatrix_bsr, eye from pyamg import relaxation from pyamg import amg_core from pyamg.multilevel import multilevel_solver from ...
import re from os import walk from os.path import join, exists from threading import Timer import time from enum import Enum from mycroft import dialog from mycroft.audio import wait_while_speaking from mycroft.messagebus.message import Message, dig_for_message from mycroft.util import camel_case_split from mycroft.ut...
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring """fujitsu_ipcom_facts module. Gather facts from ipcom device. <NAME> (@takamitsu-iida) """ ANSIBLE_METADATA = {'metadata_version': '0.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: fujitsu_ipcom_f...
from math import acos, cos, sin, ceil, pi import numpy as np import os.path from PIL import Image from os.path import splitext from osgeo import gdal def parseOptions(): '''Parse command line options. Args: None Returns: (tuple): Tuple containing: options: Output from optpars...
import os import operator from flask import Flask, render_template, abort, redirect from flask.ext.login import LoginManager, login_required, logout_user from prophasis_common.models import Host, HostGroup, HostGroupAssignment, Plugin, Check,\ CheckAssignment, CheckPlugin, Schedule, ScheduleCheck, ScheduleInterval,...
# pylint: disable=not-callable, no-member, invalid-name, line-too-long, unexpected-keyword-arg, too-many-lines """ Some functions related to SO3 and his usual representations Using ZYZ Euler angles parametrisation """ from functools import partial import torch from e3nn import o3 def rep(Rs, alpha, beta, gamma, p...
""" Adapted from https://github.com/orobix/Prototypical-Networks-for-Few-shot-Learning-PyTorch This project is licensed under the MIT License MIT License Copyright (c) 2018 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
import datetime from django.shortcuts import render from django.contrib import messages from django.urls import reverse_lazy from django.core import exceptions from django.contrib.auth import login, decorators from django.contrib.auth import views as auth_views from django.db.models import Q import django.http import d...
import os import sys import math import sys import pkg_resources from argparse import Namespace from .log_and_message import log_and_message from .errors import NoBasesCounted class ShannonScore: def __init__(self, kmers_type): # Create a hash of the kmers that points to the index of an array that holds t...
__author__ = 'axelr' from itertools import islice import numpy from scipy.special import expit from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.cross_validation import train_test_split from sklearn.ensemble.forest import RandomForestClassifier, RandomForestRegressor from sklearn.random_projection i...
from django.contrib.auth.models import User from django.test import TestCase from django.test.client import Client from django.urls import reverse from oauth.models import UserProfile, SocialLink from test.test_assets import get_random_date class OauthModelsTestCase(TestCase): @classmethod def setUpTestData(c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 15 18:59:38 2018 @author: kgross """ import functions.add_path import pandas as pd import numpy as np import matplotlib.pyplot as plt from plotnine import * from plotnine.data import * # specify costumed minimal theme import functions.plotnine_t...
import os import logging import locale import pkg_resources from datetime import datetime import gtk import deluge.component as component import deluge.common from deluge.ui.client import client from deluge.ui.gtkui import notification from deluge.plugins.pluginbase import GtkPluginBase from twisted.internet.defer imp...
# -*- coding: utf-8 -*- """ Created on Thu Apr 2 16:33:34 2015 @author: ajaver """ import os import numpy as np import pandas as pd import tables from scipy.spatial.distance import cdist from tierpsy.helper.misc import TimeCounter, print_flush, TABLE_FILTERS def assignBlobTraj(trajectories_file, max_allowed_dist=...
from logging import debug from operator import matmul import open3d as o3d from tqdm import tqdm import numba import numpy as np import cv2 from PIL import Image import os import json from skimage import measure import trimesh import time from model import dataset import utils.viz_utils as viz_utils import utils.lin...
import gc import random import eventlet from eventlet import hubs, pools from eventlet.support import greenlets as greenlet import six import tests def passthru(a): eventlet.sleep(0.01) return a def passthru2(a, b): eventlet.sleep(0.01) return a, b def raiser(exc): raise exc class GreenPool...
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function as _ from __future__ import division as _ from...
import os from unittest import mock import pytest import requests_mock from ewtwitterbot.imagery import get_quote_image from ewtwitterbot.twitter_bot import ( TwitterImproperlyConfigured, get_credentials_from_environ, get_last_tweet_id, respond_to_tweets, save_last_tweet_id, upload_image_and_s...
#!/usr/bin/env python ''' Contains functions for writing Excel files for the Standard Product Report ''' from __future__ import print_function import re import json import pickle import hashlib from openpyxl import Workbook import dateutil.parser def generate(aoi, track, acqs, slcs, acq_lists, ifg_cfgs, ifgs, audit_t...
import sys sys.path.append('/home/lwang/code/amuse-git/src') import numpy as np import getopt import amuse import os import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import animation, rc from matplotlib import cm from IPython.display import...
import sox import random import glob import argparse import os import tempfile import math import json def get_voice_params(rec_file, silence_maximum_amplitude): tfm1 = sox.Transformer() stat = tfm1.stat(rec_file) file_maximum_amplitude = float(stat['Maximum amplitude'] ) file_duration = float(stat['Length ...
# Copyright 2021 Population Health Sciences and Image Analysis, German Center for Neurodegenerative Diseases(DZNE) # # 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://w...
import threading import logging from collections import deque from contextlib import contextmanager from typing import Union from keri.core.coring import Signer, Verfer from hio.base import doing from hio.core.tcp import clienting import asyncio from keridht.node import Requester from keri.core.eventing import Serde...
# This script uses Google Universal Sentence Encoder to do the following: # * Find all content items that have an average cosine similarity score of >0.65 to a tagging it has # * See if that content either can or _should_ be detagged from it's current tagging (if it is tagged to # two taxons, one of which is below the ...
""" Inventory Decision Model with 15-, 30-minute intervals ------- This file contains the inventory decision model specifications. In particular, we implement: (1) Inputs: Reads demand predictions as inputs to the inventory decision model (Section 3.1) (2) Inventory decision calculation: Step 1. Calculates the...
# Copyright 2016, 2019 <NAME>. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test spectrum.py module.""" # STDLIB import os import shutil import tempfile import warnings # THIRD-PARTY import numpy as np import pytest # ASTROPY from astropy import units as u from astropy.io import fits from astropy.modeling.models import Const...
import os import requests import json import jwt import re from datetime import datetime from flask import Flask, request, jsonify from sqlalchemy import Column, Integer, String, DateTime from sqlalchemy.sql import func from sqlalchemy.exc import SQLAlchemyError from flask_socketio import SocketIO, ConnectionRefusedErr...
""" Make a match param file Note -- will have to edit the param file by hand to insert dmod and Av. """ from __future__ import print_function import argparse import os import sys import time import numpy as np import matplotlib.pylab as plt from .config import PARAMEXT from .fileio import read_calcsfh_param, calcsfh...
# INTRO # indices of strings must be integers if we were to select a non integer we would recieve a TypeError. (ex of good indicies of strings: print(favorite_fruit[0])) (ex of bad: print(favorite_fruit[0.5])) #selects single items from strings ^ #---------------------------------------------------------------------...