text stringlengths 6.04k 39.5k |
|---|
# Functions used in batch processing
import os, h5py, pickle, psutil, time
import numpy as np
from . import _allowed_kwds, _image_dtype
from ..io_tools.load import correct_fov_image
from ..spot_tools.fitting import fit_fov_image, get_centers
_seed_th={
'750': 400,
'647': 600,
'561': 500,
}
## Process man... |
from numpy import load
import numpy as np
import matplotlib.pyplot as plt
import pdb
from matplotlib.animation import FuncAnimation
import matplotlib
from matplotlib import rc
matplotlib.rc('xtick', labelsize=24)
matplotlib.rc('ytick', labelsize=24)
plt.rcParams.update({'font.size': 22})
rc('text', usetex=True)
# F... |
from . import classification
from .segmentation import *
from . import segmentation
from enum import Enum
from torchvision import models as torch_models
from torchvision.models.inception import InceptionAux
import torch
import torch.nn as nn
import os
import errno
rwightman_repo = 'rwightman/pytorch-image-models'
cl... |
import ast
from ast import BinOp, Compare, Sub
import sympy
from dolo.compiler.function_compiler_sympy import compile_higher_order_function
from dolo.compiler.function_compiler_sympy import ast_to_sympy
from dolo.numeric.decision_rules_states import CDR
from dolo.compiler.function_compiler_ast import (StandardizeDate... |
# coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import numpy as np
import pytest
import ray
import ray.cluster_utils
import ray.test_utils
from ray.test_utils import RayTestTimeoutException
logger = logging.getLogger(... |
#-*-coding:utf-8-*-
import json
from flask import make_response
import datetime,time
from math import sin, asin, cos, radians, fabs, sqrt
from testtrail.examples.allroadstime import *
from testtrail.models.trail import Trail
from testtrail.models.test_roads_name import TestRoadsName
from testtrail.models.roadna... |
import math
import torch
from torch.nn import functional as F
from torch.nn import Sequential, ModuleList, Linear, ReLU, Dropout, LSTM, Embedding
import utils
from modules.layers import ZoneoutLSTMCell, DropoutLSTMCell, ConvBlock
from modules.attention import LocationSensitiveAttention, ForwardAttention, ForwardAttent... |
import argparse
import json
import os
import random
import time
import numpy as np
import torch.distributed as dist
import torch.utils.data.distributed
from apex.fp16_utils import FP16_Optimizer
from apex.parallel import DistributedDataParallel
from tqdm import tqdm
from warpctc_pytorch import CTCLoss
from data.data_lo... |
# -*- 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 蓝鲸基础平台:
------------------------------------------... |
# Copyright 2022 The TensorFlow 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 applica... |
# Copyright 2014 PerfKitBenchmarker 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... |
from unittest import TestCase
from wtforms_sqlalchemy.fields import QuerySelectField
from wtforms_sqlalchemy.fields import QuerySelectMultipleField
from wtforms_sqlalchemy.orm import model_form
from wtforms_sqlalchemy.orm import ModelConversionError
from wtforms_sqlalchemy.orm import ModelConverter
from sqlalchemy imp... |
from math import floor
from typing import Optional, Set
from sc2.data import Race
from sc2.ids.ability_id import AbilityId
from sc2.pixel_map import PixelMap
from sharpy.sc2math import to_new_ticks
from sharpy.managers.core.roles import UnitTask
from sharpy.utils import map_to_point2s_center
from sc2.ids.unit_typeid ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_asm_policy_import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# fetch.py
# import library
import requests
import bs4
import socket
import argparse
import datetime
import whois
import zipfile
import os, time
import threading
import csv
import shutil
try:
from urllib.parse import urlparse
except ImportError:
from urlparse impor... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
import py
import sys
class CommonFSTests(object):
def test_constructor_equality(self, path1):
p = path1.__class__(path1)
assert p == path1
def test_eq_nonstring(self, path1):
p1 = path1.join('sampledir')
p2 = path1.join('sampledir')
assert p1 == p2
def test_new_ide... |
"""A pod encapsulates all files used to build a site."""
from . import catalog_holder
from . import collection
from . import env as environment
from . import locales
from . import messages
from . import podspec
from . import routes
from . import static
from . import storage
from . import tags
from ..preprocessors impo... |
"""numerictypes: Define the numeric type objects
This module is designed so 'from numerictypes import *' is safe.
Exported symbols include:
Dictionary with all registered number types (including aliases):
typeDict
Numeric type objects:
Bool
Int8 Int16 Int32 Int64
UInt8 UInt16 UInt32 UInt64
Fl... |
"""
NWS Valid Time Event Code (VTEC) string parser
Based on NWS Directive NWSI 10-1703: https://www.nws.noaa.gov/directives/sym/pd01017003curr.pdf
07/14/2020, updated 03/20/2021
--------------------------------------------------------------------------------
Copyright (c) 2021, <NAME> (<EMAIL>)
https://github.com/Hump... |
# MIT License
# Copyright (c) 2021 <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 rights
# to use, copy, modify, merge, publish... |
#!/usr/bin/env python
""" runastrodriz.py - Module to control operation of astrodrizzle to
remove distortion and combine HST images in the pipeline.
:License: :doc:`LICENSE`
USAGE: runastrodriz.py [-fhibn] inputFilename [newpath]
Alternative USAGE:
python
from acstools import runastrodriz
runast... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# type: ignore
import logging
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..interface import BaseOneShotTrainer
from .utils import AverageMeterGroup, replace_layer_choice, replace_input_choice, to_de... |
"""
Pipeline code for training and evaluating the sentiment classifier.
We use the Deepmoji architecture here, see https://github.com/bfelbo/DeepMoji for detail.
"""
import re
import codecs
import random
import numpy as np
import sys
import json
import argparse
import pandas as pd
import glob, os
import matplotlib.pyla... |
'''
Tests for ph5toms
'''
import unittest
import copy
import os
import sys
import logging
from mock import patch
from testfixtures import LogCapture
import obspy
from ph5.core.tests.test_base import LogTestCase, TempDirTestCase
from ph5.core import ph5api, experiment
from ph5.clients.ph5toms import StationCut, PH5to... |
import re
import rope.base.change
import rope.contrib.generate
import rope.refactor.change_signature
import rope.refactor.extract
import rope.refactor.inline
import rope.refactor.introduce_factory
import rope.refactor.method_object
import rope.refactor.move
import rope.refactor.rename
import rope.refactor.restructure
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from torch.nn import MSELoss
class f1_loss(nn.Module):
def __init__(self):
super(f1_loss, self).__init__()
self.smoothing = 1e-5
def forward(self, y_pred, y_true):
# y_pred = y_pred[:,1:]
# y_true ... |
#!/usr/local/bin/python
"""
***********************************************
- PROGRAM: boundary2tad.py
- CONTACT: <NAME> (<EMAIL>)
***********************************************
"""
from __future__ import print_function
from __future__ import division
import sys
import argparse
import subprocess
import... |
import os
import numpy as np
import sys
################################################
######### GLOBAL VARIABLES ##########
################################################
location = ""
my_data_location = "../visualize/"
finger_names = ["TYPE_THUMB", "TYPE_INDEX", "TYPE_MIDDLE", "PALM", "TYPE_RING", "TY... |
import numpy as np
from qtpy import QtGui, QtCore, QtWidgets
import sharppy.sharptab as tab
from sharppy.sharptab.constants import *
import platform
## routine written by <NAME>
## <EMAIL>
__all__ = ['backgroundWinter', 'plotWinter']
class backgroundWinter(QtWidgets.QFrame):
'''
Handles drawing the backgroun... |
from __future__ import absolute_import
import warnings
from .api import _, is_validator, FancyValidator, Invalid, NoDefault
from . import declarative
from .exc import FERuntimeWarning
import six
from six.moves import map
from six.moves import zip
__all__ = ['Schema']
class Schema(FancyValidator):
"""
A sch... |
from argparse import ArgumentParser
from pathlib import Path
from tqdm import tqdm, trange
from tempfile import TemporaryDirectory
import shelve
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
from constants import BERT_PRETRAINED_MODEL, SENTIMENT_ADJECTIVES_PRETRAIN_DATA_DIR, \
MA... |
# coding: utf-8
# Copyright (c) Scanlon Materials Theory Group
# Distributed under the terms of the MIT License.
"""
A script to plot phonon band structure diagrams.
TODO:
* automatically plot dos if present in band.yaml
* make band structure from vasprun displacement/DFPT files
* deal with magnetic moments
* Rea... |
import html
from io import BytesIO
from typing import Optional, List
import time
from datetime import datetime
from telegram import Message, Update, Bot, User, Chat, ParseMode
from telegram.error import BadRequest, TelegramError
from telegram.ext import run_async, CommandHandler, MessageHandler, Filters
from telegram... |
import re
import os
import queue
import shlex
import logging
import threading
import contextlib
from multiprocessing import Queue, Process
from typing import (
Dict,
List,
Tuple,
TYPE_CHECKING,
Optional,
Generator,
)
import pytest
import conftest
from rnode_testing.common import (
random_s... |
import numpy as np
import math
import pickle
import matplotlib.pyplot as plt
# matplotlib.use('Agg') # Added for plotting
plt.style.use('seaborn-paper') # Added for plotting
def compute_rbf_encoding(input, rbf_center, rbf_sig=0.15):
"""
Compute the rbf encoding from trained rbf center to new input
m :=... |
import torch
import torch.nn as nn
from vilmedic.networks.models.utils import get_n_params
from vilmedic.networks.blocks.vision import *
from vilmedic.networks.blocks.huggingface.encoder.encoder_model import EncoderModel
from tqdm import tqdm
import numpy as np
from sklearn import metrics
def cosine_similarity(x1, ... |
import os
import shutil
from bson.json_util import dumps
import numpy as np
from pax import plugin, exceptions, datastructure
from pax.formats import flat_data_formats
class TableWriter(plugin.OutputPlugin):
"""Output data to flat table formats
Convert our data structure to numpy record arrays, one for each... |
##
# .python.command - Python command emulation module.
##
"""
Create and Execute Python Commands
==================================
The purpose of this module is to simplify the creation of a Python command
interface. Normally, one would want to do this if there is a *common* need
for a certain Python environment tha... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
#!/usr/bin/env python
import argparse
import os
import random
import subprocess
import sys
import time
import requests
import json
from account_info import *
#from account_info_master import *
#from account_info_sub1 import *
#from account_info_sub2 import *
#from account_info_sub3 import *
local = True;
args = None
... |
# -*- coding: utf-8 -*-
import sys
import threading
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5.QtCore import QTimer, Qt
from StockHoldings import StockHoldings
from StockValues_InteractiveBrokers import StockValues_InteractiveBrokers
from StockSettingsDialog import StockSettingsDialog
from StockSymbolList... |
import jax.numpy as jnp
from jax import grad, vmap, hessian, jit
from jax.config import config;
config.update("jax_enable_x64", True)
# numpy
import numpy as onp
from numpy import random
import argparse
import logging
import datetime
from time import time
import os
# solving -grad(a*grad u) + alpha u^m = f on uni... |
import logging
import warnings
# External libs
import numpy as np
import pandas as pd
import xarray as xr
from scipy import stats
# Optional libs
try:
import salem
except ImportError:
pass
# Locals
from oggm import cfg
from oggm import utils
from oggm import entity_task
from oggm.exceptions import MassBalanc... |
"""Saraga Dataset Loader
.. admonition:: Dataset Info
:class: dropdown
This dataset contains time aligned melody, rhythm and structural annotations of Carnatic Music tracks, extracted
from the large open Indian Art Music corpora of CompMusic.
The dataset contains the following manual annotations refe... |
import math
from direct.actor.Actor import Actor
from direct.interval.ActorInterval import ActorInterval
from direct.interval.MetaInterval import Sequence, Parallel
from direct.interval.FunctionInterval import Func, Wait
from direct.interval.SoundInterval import SoundInterval
from direct.interval.LerpInterval import Le... |
#from pycorenlp import StanfordCoreNLP
#import os
#os.chdir('/app-sentiment-algo')
import pandas as pd
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers import LSTM
from keras.layers.embeddings import Embedding
from ke... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Módulo 'search' de Pydatajson
Contiene los métodos para navegar un data.json iterando y buscando entidades de
un catálogo.
"""
from __future__ import with_statement, absolute_import
from __future__ import unicode_literals, print_function
from six import iteritems
fro... |
from typing import Iterable, Dict, Union, List
from json import dumps
from requests import get
from http import HTTPStatus
import pandas as pd
import zipfile
import requests
import io
import os
import re
import scipy
import scipy.stats
import numpy.random as random
import numpy as np
def get_paginated_dataset(filters... |
#!/usr/bin/env python
"""
Implementation of gpustat
@author <NAME>
@url https://github.com/wookayin/gpustat
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import locale
import os.path
import os
# force alignment between CUDA and nvml dev... |
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from torch.utils.data import DataLoader
import copy
from progress.bar import Bar
import config
import os
import numpy as np
import torch
import cv2
import matplotlib.pyplot as plt
from utils import torch_op
import util
from RPModule.rpmodule import RelativePoseEstimation,getMatchingPrimitive,RelativePoseEstimation_hel... |
import asyncio
import copy
import json
import functools
import os
import sys
import traceback
import pdb
import pandas as pd
from typing import List
from collections import defaultdict
from dsbox.planner.leveltwo.l1proxy import LevelOnePlannerProxy
from dsbox.planner.leveltwo.planner import LevelTwoPlanner
from dsb... |
from __future__ import print_function
import os
import cv2
import glob
import numpy as np
import pandas as pd
import xml.etree.ElementTree as ET
from xml.dom.minidom import parseString
# import uoimages as uo
from .. import uoimdb
from .. import utils
from ..utils import progress, timer, ensure_dir
from ..dataset imp... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, <NAME>"
__license__ = "BSD 3-clause"
__version__ = "0.1.0"
__email__ = "<EMAIL>"
import os
import pandas
import json
import random
import sys
import ast
import numpy as np
def split_propositions(text, propositions_offsets):
propositions = []
for offsets ... |
import tensorflow as tf
import numpy as np
import tensorflow.contrib.slim as slim
# n_activations_prev_layer = patch_volume_prev * in_channels
# n_activations_current_layer = patch_volume * out_channels
# sqrt(3/(n_activations_prev_layer + n_activations_current_layer)) (assuming prev_patch==curr_patch)
def xavier_norm... |
import os
import rasterio
from rasterio.warp import transform_bounds
from rasterio.io import DatasetReader
import math
from rio_tiler.errors import TileOutsideBounds
from . import utils
import numpy as np
def tile_utm_source(src, ll_x, ll_y, ur_x, ur_y, indexes=None, tilesize=256,
nodata=None, alp... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 Caltech.
# Copyright (C) 2021 Northwestern University.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Resources serializers tests.""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (c) Ostap developers.
# =============================================================================
# @file test_fitting_resolutions.py
# Test module for ostap/fitting/resolution2... |
#!/usr/bin/python3
import argparse
import pynetbox
import ipaddress
import yaml
import os
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
import requests
import sys
parser = argparse.ArgumentParser(description='Stupid Netbox Thing')
parser.add_argument('--netbox', help='Netbox server IP / Ho... |
# Copyright (c) 2013, TZCODE SRL and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, flt, date_diff, nowdate
def execute(filters=None):
return get_columns(filters), get_data(filters)
def get_colu... |
import copy;
import h5py;
import inspect;
import json;
import os;
import pprint as PP;
import io;
import sys;
import time;
if sys.version.startswith( "3." ):
xrange = range
else:
pass
# cml = command line
class command_line:
# here is the constructor method.
def __init__( self, in_prefix_str = "-" ):
... |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import re
import logging
import os.path
import requests
from lxml import etree
from lxml.etree import QName
import xml.etree.ElementTree as ET
from indra.literature import pubmed_client
from indra.util import Unicod... |
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, 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/lice... |
#!/usr/bin/python
#coding:utf-8
###########################################################
### A Python wrapper for reading Plexon plx/ddt files
### Written by Huangxin
###########################################################
from __future__ import division
import time
import numpy as np
import logging
import mma... |
"""
zoom.apps
handles requests by locating and calling a suitable app
"""
import configparser
import imp
import logging
import os
import sys
import zoom
from zoom.components import as_links
from zoom.database import Database
import zoom.html as html
from zoom.utils import existing
DEFAULT_SYSTEM_APPS = ['r... |
''' Attempting to write an octree in python
I want this to work with VERY large data sets that can't be stored fully in memory. So my procedure will be as follows:
- need to read in line-by-line and clear memory every X MB (or maybe every X particles;can I check memory load in python?)
- go down to nodes with contain... |
# -*- coding: utf-8 -*-
"""
Created on 2019-04-02
@author: <NAME>
LSystems_3D.py contains a 3D turtle graphics class and applies this to L-systems.
As a result 3D trees can be simulated using L-systems. The code also allows for
the simulation of tropisms.
To see what this code can do, simply run the file and follow... |
# MIT License
#
# Copyright (c) 2022 Quandela
#
# 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, pub... |
#!/usr/bin/env python
# coding: utf-8
# In[69]:
import os, sys, re, math, shutil, json
##############################################################################################################
##DO NOT change this part.
##../setup.py will update this variable
HTC_package_path = "C:/Users/tyang/Documents/Jupyte... |
import click as ck
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
from torch.linalg import matrix_norm
from torch.utils.data import IterableDataset, DataLoader
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_curve,... |
#! /opt/stack/bin/python3
from __future__ import print_function
import getopt
import json
import logging
import os
import re
import socket
import struct
import subprocess
import sys
from pathlib import Path
# Bail if being run in python2.
if sys.version_info[0] < 3:
print("This script can only be run under Python 3... |
import os
import os.path
import urllib.request, urllib.error, urllib.parse
import urllib.parse
import hashlib
import gzip
import numpy as np
import scipy
from pysit import *
from pysit.util.config import get_gallery_data_path
from pysit.util.net import download_file
from pysit.util.io import read_model
from pysit.uti... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
# pylint:skip-fi... |
# 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 agreed to in writing, software
# distributed under t... |
import csv
from dataclasses import dataclass, field
from .autoabilities import AUTOABILITIES, Autoability
from .characters import Character
from .constants import EquipmentType
from .file_functions import get_resource_path
from .monsters import Monster
@dataclass
class Equipment:
owner: Character
type_: Equi... |
import sys
from playYards import playyards
# create logger
import logging
module_logger = logging.getLogger('log.{0}'.format(__name__))
class playtextclass:
def __init__(self):
self.logger = logging.getLogger('log.{0}.{1}'.format(__name__, self.__class__))
self.ind = 8*" "
... |
"""
Vapor-compressor chiller
"""
import pandas as pd
from math import log, ceil
import numpy as np
from cea.technologies.constants import G_VALUE_CENTRALIZED, G_VALUE_DECENTRALIZED, CHILLER_DELTA_T_HEX_CT, \
CHILLER_DELTA_T_APPROACH, T_EVAP_AHU, T_EVAP_ARU, T_EVAP_SCU, DT_NETWORK_CENTRALIZED, CENTRALIZED_AUX_PERC... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import time
import argparse
import numpy as np
from os.path import join
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data im... |
import re
import string
import polib
from dennis.minisix import PY2, HTMLParser
from dennis.tools import VariableTokenizer, all_subclasses
DEBUG = False
def debug(*args):
if DEBUG:
print(' '.join([str(arg) for arg in args]))
class Token(object):
def __init__(self, s, type='text', mutable=True):
... |
"""
Beta python scripts for paper
"Reaction-drift-diffusion models from master equations: application to material defects"
(c) <NAME>, CNRS / CINaM, 2021
tomswinburne.github.io
"""
import numpy as np
import scipy.linalg as spla
import matplotlib.pyplot as plt
import msmtools.analysis as mana
def ordev(... |
# 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 json
import logging
import os
import subprocess
import time
import traceback
from datetime import datetime
from difflib import get_close_matches
from pathlib import Path
import chat_exporter
import discord
import pytz
import requests
from discord.commands import Option
from discord.ext import commands
from disc... |
from manimlib.imports import *
class Hypocycloid(VMobject):
CONFIG = {
'R': 3,
'r': 1,
'd': 0.5,
'theta_max': TAU,
'stroke_width': 2,
}
def __init__(self, **kwargs):
VMobject.__init__(self, **kwargs)
t = np.linspace(0, self.theta_max, 400 + 400 * ... |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# comment_magics: true
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.8
# kernelspec:
# display_name: 'Python 3.8.12 64-b... |
# Copyright (c) PagerDuty.
# See LICENSE for details.
"""
Entity module provides a base class Entity for defining a PagerDuty entity.
Entities should be used as the base for all things that ought to be queryable
via PagerDuty v2 API.
"""
import json
import re
import six
from ..mixins import ClientMixin
from ..log im... |
"""
Features:
1:COMPLETED: print #renvoie str
2:COMPLETED: addition #renvoie Polynomial
3:COMPLETED: multiplication #renvoie Polynomial
4:COMPLETED: derive #renvoie un Polynomial
5:COMPLETED: division #renvoie couple de Polynomial
6:COMPLETED: pgcd #renvoie Polynomial
7:COMPLETED: ppcm #renvoie Polynomial
8:COMPLETED: ... |
#!/usr/bin/env python
"""
==============
Script for FSL randomize - Regression basics
MDB, 10/25/2021
use file AdditionalFiles/MRIScanLog_ABC.csv which includes any possible regressors as columns.
Tell python where to find the appropriate functions.
"""
import os # system functions
import argparse
import csv
import ... |
"""
Python Obit Image Clean class
This class does BGC-like image based cleans
CleanImage Members with python interfaces:
======== =============================================================
InfoList used to pass instructions to processing Member List (readonly)
mosaic ImageMosaic, use PGetMosaic, PSetMosaic
... |
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# coding=utf-8
# Copyright 2021 The Mesh TensorFlow 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... |
# JADESOUND FP
# 20211207
import numpy as np
import pandas as pd
import scipy as sp
import pickle
import scikits.bootstrap as bootstrap
#if things start breaking with no warning comment out these two lines
import warnings
warnings.filterwarnings('ignore')
import statsmodels.api as sm
import statsmodels.stats as smsta... |
import sys
import yaml
import json
def main():
filename=sys.argv[1]
print('Using parameter file: ' + filename)
with open(filename, 'r') as stream:
parameters = yaml.load(stream)
print('Parameters: ' + str(parameters))
template={
"AWSTemplateFormatVersion": "2010-09-09",
"De... |
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Importing the Kratos Library
import KratosMultiphysics
# Import KratosUnittest
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.kratos_utilities a... |
#!/usr/bin/env python3
# FILE CONTENTS: (numerical) methods relating to interaction Hamiltonians on a 3-D lattice
import numpy as np
import sympy as sym
from scipy.special import zeta
from itertools import product as cartesian_product
from itertools import combinations, permutations
from scipy.stats.mstats import gme... |
#!/usr/bin/env python3
"""(DEPRECATED) A reference implementation of an unbiased join sampler.
Compared to factorized_sampler, which samples in an online, "factorized"
fashion (walking the join tree), this implementation naively pre-computes the
entire join counts first. This is less efficient than the proper
factori... |
import argparse
import magma as m
import shutil
import json
import os
import sys
import filecmp
from fault import Tester
import glob
def copy_file(src_filename, dst_filename, override=False):
if (
not override
and os.path.isfile(dst_filename)
and filecmp.cmp(src_filename, dst_filename, sha... |
from flask import send_file, render_template, Blueprint, session, request, current_app, send_from_directory, g, make_response, jsonify, flash
from . import db
from . import auth
from .common import reformat_timestamp, year
from json import loads, dumps
from os.path import basename
from werkzeug.security import generate... |
import os
import torch
import pickle as pkl
from yasa import spindles_detect_multi, get_bool_vector, spindles_detect, sw_detect, sw_detect_multi, rem_detect
import mne
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy.signal import find_peaks
from biosppy.signals.emg import silva_onset_detector
f... |
import numpy as np
from collections import OrderedDict
import re
import os
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
def try_int(x):
if x == int(x):
return int(x)
else:
return x
# Simple function... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.