text stringlengths 8.04k 46.5k |
|---|
# ----------------------------------------------------------------------------
# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
# -------------... |
'''
Functions related to exporting models.
'''
from __future__ import annotations
from typing import List, Dict, Tuple, Any, Optional
from dataclasses import dataclass, field
import mathutils
import numpy as np
import bpy
import bpy_types
from .common import (
MINECRAFT_SCALE_FACTOR, McblendObject, McblendObjec... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import os
import argparse
import transformers
import soundfile as sf
import librosa
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
from itertools import chain,g... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import glob
import errno, stat
import re
import pkg_resources
import argparse
from argparse import RawTextHelpFormatter
"""
createmodulefromskeleton.py - Create your own submodule form a oneplace Skeleton_skeleton
Renames and cleanup cod... |
# Copyright 2020 Spotify AB
#
# 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, so... |
import logging
import uuid
from django.conf import settings
from django.core.validators import RegexValidator
from django.contrib.gis.db import models
from django.contrib.gis.geos import Polygon
from django.contrib.auth import get_user_model
from django.contrib.postgres.search import SearchVectorField
from django.contr... |
import logging
import time
from datetime import datetime
from os import path
from pathlib import Path
from requests.exceptions import ConnectionError
from xml.etree.ElementTree import SubElement, Element, Comment, tostring
from xml.dom.minidom import parseString
from zipfile import ZipFile
from jikanpy.excep... |
# Author: <NAME> <<EMAIL>>
"""Plot sensor maps."""
from collections.abc import Sequence
from math import sin, cos, asin
import os
import numpy as np
import matplotlib as mpl
from matplotlib.lines import Line2D
from .._data_obj import Datalist, as_sensor
from ._base import EelFigure, ImLayout, Layout
SENSOR_AXES_FRA... |
from typing import Type
from AST.Nodo import Nodo
import data.jsonMode as JM
import Errores.Nodo_Error as err
from prettytable import PrettyTable
import TypeCheck.Type_Checker as TypeChecker
import os
class CreateDatabase(Nodo):
def __init__(self, fila, columna, nombre_BD, or_replace = False, if_not_exist =False,... |
__author__ = 'malbert'
import os
import SimpleITK as sitk
import h5py
import numpy as np
# from dipy.align.imwarp import DiffeomorphicMap
from mvregfus.image_array import ImageArray
# import h5pyswmr # for locking
# for locking:
# import redis_lock
# from redis import StrictRedis
# conn = StrictRedis()
def get(g... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = """\
A collection of functions for obfuscating code.
"""
import os, sys, tokenize, keyword, sys, unicodedata
from random import shuffle, choice
from itertools import permutations
# Import our own modules
import analyze
import token_utils
if not isinstance(sys.... |
# coding=utf-8
# Copyright 2022 The Robustness Metrics 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 appli... |
from decimal import Decimal
import uuid
import logging
from xml.etree import ElementTree
from couchdbkit.exceptions import ResourceNotFound
from django.utils.translation import ugettext as _
from django.dispatch import receiver
from django.db import models
from django.db.models.signals import post_save
from corehq.a... |
import numpy as np
from scipy.special import logsumexp
from scipy.integrate import quad
from scipy.stats import norm, multivariate_normal as mvn
from scem.data_utils.density import rings_log_pdf_grad, rings_sample, rings_log_pdf
from scem.data_utils.data_generators.Gaussian import GaussianGrid
from sklearn.metrics.pair... |
import math, os, random, json, pickle, sys, pdb
import string, shutil, time, argparse
import numpy as np
import itertools
from sklearn.metrics import average_precision_score
from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score
from tqdm import tqdm as tqdm
from PIL import Image
i... |
# <NAME> <<EMAIL>>
#
# Synthesise and Image interferometer data
"""Parameter name meanings:
- p: The uvw coordinates [*,3] (m)
- v: The Visibility values [*] (Jy)
- theta: Width of the field of view to be synthetised, as directional
cosines (approximately radians)
- lam: Width of the uv-plane (in wavelengths). Contr... |
#!/usr/bin/env python
# inst: university of bristol
# auth: <NAME>
# mail: <EMAIL> / <EMAIL>
import os
import sys
import shutil
import getopt
import subprocess
import configparser
import pandas as pd
import numpy as np
import gdalutils
from osgeo import osr
from osgeo import gdal
from lfptools import shapefile
from l... |
# -*- coding: utf-8 -*-
"""
Project: HelloWorldPython
Creator: DoubleThunder
Create time: 2019-09-28 12:18
Introduction: 微信防撤回功能
微信防撤回功能。
(先确定你的微信号能登录网页版微信)
实现功能:
1. 监听所有的消息(好友,群组)保存于字典中,非文字消息,保存文件到缓存文件夹。
2. 监听系统公告通知,如果有好友撤回消息。而从字典中取出数据,发送到你的『文件传输助手』中。
如果你将 is_auto_forward = True,撤回的消息会即可发送给好友或群组。
此项目需要的库有:itchat,... |
import argparse
# ====================================================
# Directory settings
# ====================================================
import os
from utils import CFG
os.environ['CUDA_VISIBLE_DEVICES'] = '0, 1' # specify GPUs locally
OUTPUT_DIR = './submission'
if not os.path.exists(OUTPUT_DIR):
os.mak... |
#!/usr/bin/env python3
#
# Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import argparse
import pkg_resources
import os
import sys
import time
import tempfile
from io import StringIO
import nbformat
from nbconvert.exporters import... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import gc
import cv2
# gc.set_threshold(100, 10, 10)
from lib.model.config import cfg
from lib.rpn.fpn.generate_anchors_global import generate_anchors_global
from lib.... |
import json
import os
import pytest
import yaml
from jina import Flow
from jina.serve.networking import GrpcConnectionPool
@pytest.mark.parametrize('protocol', ['http', 'grpc'])
@pytest.mark.parametrize('flow_port', [1234, None])
def test_flow_to_k8s_yaml(tmpdir, protocol, flow_port):
flow_kwargs = {'name': 'te... |
#!/usr/bin/python3
import os, shutil, subprocess, pexpect, sys, time, re, operator
import operator
import pdb
MAINPATH = '/share/MakeMKV/'
USER_PERMISSION = 'name'
GROUP_PERMISSION = 'users'
STORAGE = [
{'freeSpace' : None, 'share' : '/share/3000gb-1', 'path' : '/Movies/', 'media': 'BluRay'},
{'freeSpace' : None, ... |
'''
Unit tests for the robotutils.robotcomm module.
This is a port of the JUnit test for the corresponding Java
robotutils class, ConfigurationHelper
Author: JMJ
'''
import unittest
import random
import logging
import collections
import time
import concurrent.futures
from robotutils import _utils
from robotutils.com... |
import sys, os, math
from PySide2 import QtCore, QtGui, QtWidgets, QtCharts
import numpy as np
from internal_process import act
#CLASS HANDLING THE PROCESSING THREAD WORKER
class Woker(QtCore.QObject):
finished = QtCore.Signal()
working = QtCore.Signal(int)
def __init__(self, window):
... |
import flask
from flask import render_template
from flask import request
from flask import url_for
import uuid
import json
import logging
# Date handling
import arrow # Replacement for datetime, based on moment.js
import datetime # But we still need time
from dateutil import tz # For interpreting local times
# OA... |
"""
functions for reading and writing the filesystem
"""
import automol
import elstruct
import autofile
from mechlib.amech_io import printer as ioprinter
def atom(sp_ret, cnf_fs, thy_locs, zma,
rng_locs=None, tors_locs=None, zma_locs=(0,)):
""" Save an all of the information for an atom into the
... |
#!/opt/local/bin/python
# pyfu_tool.py
"""
Command-line tool to test the pyFU pipeline functionality or to perform instrument tests.
Assumes the pyFU package has been so installed that the "ifu*" commands are in the current path.
Version 0.4; <NAME> (2022-FEB-23)
- Example of reducing many raw images :
000> bias... |
"""
OpenID Connect related functionality and helpers.
"""
import base64
import functools
import hashlib
import http.server
import json
import logging
import random
import string
import threading
import time
import urllib.parse
import warnings
import webbrowser
from collections import namedtuple
from queue import Queu... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 1 12:15:21 2019
@author: ron
Matching module for extracting lab coordinate particles from
segmented particles' image coordinates.
We are using two matching algorithms in conjunction:
1) the Ray Traversal algorithm reported
by <NAME> Huisman, 2020 (https://arxiv... |
"""A collection of ORM sqlalchemy models for Lambda"""
import zlib
import norm.config as config
from norm.models.mixins import ParametrizedMixin, ARRAY, lazy_property
from norm.models.license import License
from norm.models.user import User
from norm.models import Model
from sqlalchemy import Column, Integer, String,... |
def ev_fill(decimal_part):
"""Pad the first decimal part with zeros, taking into account E / V codes.
"""
if decimal_part.startswith("V"):
return "V" + decimal_part[1:].zfill(2)
elif decimal_part.startswith("E"):
return "E" + decimal_part[1:].zfill(3)
else:
return decima... |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... |
"""
author: <NAME> (E-mail: <EMAIL>)
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_custom.torch_utils import to_gpu
from torch_custom.stft_helper import StftHelper
import torch_custom.spectral_ops as spo
from torch_custom.custom_layers import CustomModel, update... |
"""
pyart.map.grid_mapper
=====================
Utilities for mapping radar objects to Cartesian grids.
.. autosummary::
:toctree: generated/
grid_from_radars
map_to_grid
example_roi_func_constant
example_roi_func_dist
_load_nn_field_data
_gen_roi_func_constant
_gen_roi_func_dist
... |
"""
GENERAL SRF NOTES:
SHYP: hypocentre position along strike from centre
DHYP: hypocentre position along dip from top
Common SRF functions.
SRF format:
https://scec.usc.edu/scecpedia/Standard_Rupture_Format
"""
from math import ceil, cos, floor, radians, sqrt, sin, degrees, atan
from subprocess import Popen, PIPE
i... |
from Common import *
def make_stan_person(num1, num2):
"""字段列表
"busi_reg_no":"客户号",
"ctnm":"客户名称",
"cten":"拼音/英文名称",
"client_tp":"客户类别",1客户,2商户
"account_tp":"账户分类",1/2/3代表1、2、3类账号
"busi_type":"业务类型",
"smid":"主体特约商户编号",
"citp":"证件类型",
"citp_ori":"证件类型原值",
"citp_nt":"证件类型说明",... |
from __future__ import print_function, division
import os
import sys
import math
import argparse
import datetime
import skimage.measure
import numpy as np
from time import time
from os.path import join
import numba
from numpy.matlib import repmat
from scipy.io import loadmat, savemat
from scipy.interpolate import Regul... |
#!/usr/bin/env python
# coding: utf-8
# #### Libraries
# In[1]:
get_ipython().run_cell_magic('javascript', '', 'utils.load_extension("collapsible_headings/main")')
# In[2]:
import pandas as pd
import random
random.seed(0)
from collections import defaultdict
pd.set_option("display.max_columns", None)
import num... |
from collections import namedtuple
from glob import glob
import logging
import multiprocessing
import os
from os import path
import StringIO
import re
import shutil
import subprocess
from subprocess import PIPE, STDOUT
import threading
import sys
import tempfile
import time
import zipfile
import errno
from module_dyna... |
import glob
import os
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import numpy as np
import matplotlib.image as mpimg
import pandas as pd
import cv2
from PIL import Image
import random
import matplotlib.pyplot as plt
class FacialKeypointsDataset(Dataset):
"""Fa... |
# Copyright (C) 2017 chainside srl
#
# This file is part of the btcpy package.
#
# It is subject to the license terms in the LICENSE.md file found in the top-level
# directory of this distribution.
#
# No part of btcpy, including this file, may be copied, modified,
# propagated, or distributed except according to the t... |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, unicode_literals, division
import tempfile
import threading
import os
import six
import re
import numpy as np
from ginga.util import catalog, dp, wcs
from ginga.canvas.types.all import Circle
from astropy import units as u
from astropy.coo... |
import argparse
import operator
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
import numpy as np
import math
from functools import reduce
from oper... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import AutoModel, AutoTokenizer, AutoModelForCausalLM, AutoModelForSeq2SeqLM, \
AutoConfig, EncoderDecoderModel, BertForMaskedLM, BartForConditionalGeneration, T5ForConditionalGeneration
from transformers.conf... |
from datagen import TrainSet, TestSet
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as data
import torchvision
import time
"""
CalculateLandmark2D:
'euler_angle' is a euler_angle tensor with size (batch_size, 3),
'scale' is a sc... |
import sys
from pathlib import Path
path = Path(__file__).parent
sys.path.insert(1, str(path))
import requests
import time
from flask import Flask, request
from threading import Thread, Lock
import sys
import QKD
import mysql.connector
import yaml
import hvac
import json
import logging
import uuid
import random
app ... |
# %BANNER_BEGIN%
# ---------------------------------------------------------------------
# %COPYRIGHT_BEGIN%
#
# Magic Leap, Inc. ("COMPANY") CONFIDENTIAL
#
# Unpublished Copyright (c) 2020
# Magic Leap, Inc., All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains the property
# of COMPAN... |
from attr import attrs, attrib, evolve
import subprocess as sp
import time
import json
import yaml
import tempfile
import argparse
import scannerpy
import os
import signal
import shlex
import cloudpickle
import base64
import math
import traceback
from abc import ABC
from threading import Thread, Condition
import loggin... |
'''
@author: <NAME>
'''
import os
import sys
import glob
import fnmatch
import datetime
import time
import re
import h5py
import numpy
from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation
from schainpy.model.data.jroamisr import AMISR
try:
from gevent import sleep
except:
from time import s... |
PYTHON_SH_BASE = """#!/bin/sh
#**************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import, division
__docformat__ = "restructuredtext en"
# disable: accessing protected members, too many methods
# pylint: disable=W0212,R0904
# pylint:disable=too-many-ancestors
from hamcrest import is_
fr... |
"""Vega3 backend for plotting in physt.
The JSON can be produced without any external dependency, the ability
to show plots in-line in IPython requires 'vega3' library.
Implementation note: Values passed to JSON cannot be of type np.int64 (solution: explicit cast to float)
Common parameters
-----------------
See the... |
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import defaultdict
from itertools import chain
import json
import torch
from torch.nn.parallel import DistributedDataParallel
from torch.utils.data import DataLoader, TensorDataset, Dataset
from ignite... |
import jittor as jt
from jittor import nn, init
from utils import *
from math import sqrt
import numpy as np
class L1Loss(nn.Module):
def __init__(self, size_average=None, reduce=None, reduction='mean'):
self.size_average = size_average
self.reduce = reduce
self.reduction = reduction
... |
#! /usr/bin/env python
# Author:
# <NAME>
#
# History:
# 2020/04/02 <NAME>:
# - Created.
"""
This recipe defines a TolTEC KIDs data simulator.
This recipe additionally requires to install a custom version of animatplot::
pip install git+https://github.com/Jerry-Ma/animatplot.git
"""
from contextlib ... |
"""
desisim.qso_template.desi_qso_templ
===================================
Module for Fitting PCA to the BOSS QSOs
01-Dec-2014 by JXP
"""
from __future__ import print_function, absolute_import, division
import numpy as np
import os
import imp
import pdb
from scipy.interpolate import interp1d
from astropy.io impor... |
import dataclasses
import functools
import itertools
import math
from typing import TypeVar
from typing import Union, Callable, Tuple, Iterable, Optional, List
import dataclass_abc
import termcolor
from .actions import PeelAction, TileOutAction, SlidingTileOutAction
from .base import Impl, spec_to_hole
from .loops im... |
#!/usr/bin/python
import json
import os
import threading
import time
import requests
import telebot
from lxml import etree
from requests import cookies, session
from requests.packages import urllib3
from config import (ADMIN_ID, BAKA_API, BOT_TOKEN, CHANNEL_ID, GROUP_ID,
HEADERS, U2_COOKIE, VERIFY... |
import os
import uuid
import unittest
from yggdrasil.tests import YggTestClassInfo, assert_equal
from yggdrasil.communication import new_comm, get_comm, CommBase
from yggdrasil.communication.filters.StatementFilter import StatementFilter
from yggdrasil.communication.filters.FunctionFilter import FunctionFilter
def te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... |
# coding: utf-8
"""
In-memory screen related code.
"""
import logging
from time import time
import threading
import itertools
from collections import deque, namedtuple
from contextlib import contextmanager
try:
from objc_util import *
except ImportError:
from dummyobjc_util import *
from .shcommon import IN_... |
# Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
"""
Validation and classification
(train) : inner-kfold classifier
(train, test) : kfold classifier
(train, d... |
from sqlalchemy import (create_engine, text, insert, select, bindparam,
literal_column, and_, or_, func, union_all, update,
delete)
from sqlalchemy.orm import Session, registry, relationship, aliased
from sqlalchemy import MetaData, Table, Column, Integer, String, Foreign... |
from __future__ import print_function
import json
import logging
import requests
from datetime import datetime
from flask import flash, Markup
from flask_login import current_user
from werkzeug.exceptions import default_exceptions
from ghost_tools import b64decode_utf8, b64encode_utf8
from libs.provisioners.provisio... |
from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
from UserManager import UserManager
from Error import Error
class LoginApplication(Tk):
"""Questa classe fornisce il framework utile per creare e memorizzare finestre, permettendo una comunicazione tra
di esse molto semplice e dire... |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, ElementNotInteractableException
import time
from datetime import datetime
# To count the number of sessions
global sessions... |
#!/usr/bin/env python3
# Copyright (c) 2019-2021, Dr.-Ing. <NAME>
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import sys
import numpy as np
from petsc4py import PETSc
from dolfinx import fem, io
import ufl
f... |
"""PyTorch compatible samplers.
These determine the order of iteration through a dataset.
Authors:
* <NAME> 2020
* <NAME> 2020
* <NAME> 2020
* <NAME> 2021
"""
import torch
import logging
from operator import itemgetter
from torch.utils.data import (
RandomSampler,
WeightedRandomSampler,
Distribute... |
import datetime
from flask import Flask
from flask import request
from flask import redirect
from flask import render_template
from app.misc import *
import flask_login
import pymongo
# Valore che determina se caricare il mongodb in locale o tramite Docker
IS_LOCAL = True
# assegnazione app e chiave segreta
app = F... |
import re
import datetime
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.core.validators import RegexValidator
from django.db import models, transaction
from django.db.models import Max, ProtectedError
from django.ut... |
from django.db import models
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError as DJValidationError
import s... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... |
"""Create Common Workflow Language (CWL) runnable files and tools from a world object.
"""
import copy
import functools
import json
import math
import operator
import os
import tarfile
import toolz as tz
import yaml
from bcbio import utils
from bcbio.cwl import defs, workflow
from bcbio.distributed import objectstore... |
#!/usr/bin/env python
u"""
esa_cryosat_ftp.py
Written by <NAME> (05/2021)
This program syncs Cryosat Elevation products
From the ESA Cryosat ftp dissemination server:
https://earth.esa.int/web/guest/-/how-to-access-cryosat-data-6842
https://earth.esa.int/web/guest/-/products-overview-6975
INPUTS:
CryoSat-2 produc... |
"""
Module for cloud masking
Credits:
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise)
This source code is licensed under the MIT license found in the... |
# <NAME>'s general utilties
import csv
import os
import functools
import numpy as np
import multiprocessing as mp
from scipy.interpolate import interp1d
import pandas as pd
def map_to_list(func, l):
'''
Maps the list 'l' through the function 'func'
Parameters
----------
func : function
Takes a single argument... |
"""Stochastic Subspace Identification (SSI) module for pyomac."""
from typing import List, Tuple
import numpy as np
from scipy.cluster.hierarchy import fcluster, linkage
from scipy.spatial.distance import cdist
from pyomac.misc import err_rel, mac_value
def ssi_cov(data: np.ndarray, fs: float, ts: float = 5., eps_f... |
import tensorflow as tf
from tensorflow import signal as tf_signal
def _batch_wrapper(inner_function, signals, num_frames, time_axis=-1):
"""Helper function to support batching with signal lenghts respected
Args:
inner_function (function): A function taking the cutted signals as
signals (tup... |
from .parameter import ModelParameters
from .cem_function import posterior_function_returning_predictions
import numpy as np
import os
import matplotlib.pyplot as plt
a = ModelParameters()
def training_data():
""" Function to create neural network training dataset for Chempy data.
We calculate a list of 5 trial val... |
import numpy as np
import matplotlib.pyplot as plt
def plot_subclusters(loom,
layername,
cluster,
sublayers=1,
plot_output=None,
label_clusters=True,
complexity_cutoff=0,
... |
from manimlib.imports import *
from my_manim_projects.my_utils.my_geometry import *
## test Arcs
class Arcs_Test(Scene):
def construct(self):
arcs_01 = Arcs(stroke_width=80).shift(LEFT * 4.5)
arcs_02 = Arcs(angle_list=np.array([10, 20, 30, 40, 50, 60, 70, 80]) * DEGREES, stroke_width=200)
... |
# --------------------------------------------------------
# 3D object detection model for point cloud
# Licensed under The MIT License [see LICENSE for details]
# Created on 17/12/2017
# Modified by <NAME>
# --------------------------------------------------------
"""
Descrption:
"""
import os
import sys
BASE_DIR = ... |
""" Pyneal Setup GUI:
Pyneal is configured using settings stored in a setupConfig.yaml file in
pyneal/src/GUIs/pynealSetup. This setup GUI is basically just a way to view the
current settings as specified by that file, as well as a convienient way for
users to update those settings to fit the parameters of a particula... |
import ROOT as R
import os
import array
from math import sqrt
from analysis.ana import *
from analysis.plot import *
R.gROOT.SetStyle("ATLAS")
R.gStyle.SetErrorX(0.5)
def fakerates(pasid, total, trigger, prong):
data_fakerate = None
mc_fakerate = None
"""
p -> pass
t -> total
pasid -> pass i... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 6 14:13:22 2020
@author: <NAME>
"""
#from pydub import AudioSegment as ad
import pygame as pg
from pygame import mixer
from Menu import *
pg.init()
# music
mixer.music.load('More.mp3')
mixer.music.play(-1)
#lay-out
pg.display.set_caption('ZipZip')
i... |
""" Code for mixture random variable
"""
import warnings
import numpy as np
from randomvars._continuous import Cont
from randomvars._discrete import Disc
from randomvars._random import Rand
from randomvars.options import config, _uses_options
import randomvars._utils as utils
import randomvars._utilsgrid as utilsgrid... |
from sharpy.utils.sharpydir import SharpyDir
import sharpy.utils.ctypes_utils as ct_utils
import ctypes as ct
import numpy as np
import platform
import os
from sharpy.utils.constants import NDIM
UvlmLib = ct_utils.import_ctypes_lib(SharpyDir + '/lib/', 'libuvlm')
class VMopts(ct.Structure):
"""ctypes definition... |
# ------------------------------------------------------------------------------
# Portions of this code are from
# CornerNet (https://github.com/princeton-vl/CornerNet)
# Copyright (c) 2018, University of Michigan
# Licensed under the BSD 3-Clause License
# -------------------------------------------------------------... |
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
web.blueprints.facilities
~~~~~~~~~~~~~~
This module defines view functions for /facilities
... |
import os
import imgui
from .utils import get_idclr
from .utils import help_marker
from .utils import time_delay_ms
from .utils import get_plane_route
from .utils import get_closest_ptidx
from .utils import check_plane_valid
from .data import save_label
from .data import textureDeleter
from .data import clear_curr_da... |
"""
This script is used to compute the PowerRankings and produce an excel file along with printing to the screen.
"""
from golfgenius.stats import Stats
from bbc_stats.collection import RoundsCollection, PlayersCollection
from bbc_stats.data import GithubData
import json
import datetime
from collections import defaultd... |
# Copyright 2014 The Oppia 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 ... |
from collections import namedtuple
from functools import partial
import numpy as np
from ms_deisotope.peak_dependency_network.intervals import SpanningMixin
from glycopeptidepy.structure.composition import Composition
from glycopeptidepy.structure.sequence import PeptideSequence
from glycopeptidepy.structure.parser ... |
"""
Correct the label for callees which do not use some of the arguments.
e.g., A(int a, int b, __attribute__(unused) int c), the label for callee A
would be 2 arguments rather than 3.
"""
import re
import os
import sys
import commands
#import openpyxl
import subprocess
import re
import pickle
from collections imp... |
# -*- coding: utf-8 -*-
"""
controller.front.route
~~~~~~~~~~~~~~~~~~~~~~
Implements the route for controller
:author: Feei <<EMAIL>>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
""... |
import os
from ScienceDynamics.config.configs import VenueType, JOURNALS_PAPERS_SFRAMES_DIR, CONFERENCES_PAPERS_SFRAMES_DIR, \
JOURNAL_AUTHORS_ACADEMIC_BIRTHYEAR_PKL, CONFERENCE_AUTHORS_ACADEMIC_BIRTHYEAR_PKL, FIELDS_OF_STUDY_SFRAME, \
FIELDS_OF_STUDY_HIERARCHY_SFRAME, PAPERS_SFRAME, EXTENDED_PAPERS_SFRAME, PA... |
""" Base module to handle remote tasks """
import os
import sys
import uuid
import pickle
import json
import time
from os.path import join as opj
from biobb_remote.ssh_session import SSHSession
from biobb_remote.ssh_credentials import SSHCredentials
UNKNOWN = 0
SUBMITTED = 1
RUNNING = 2
CANCELLED = 3
FINISHED = 4
C... |
import copy
import itertools
import math
import re
import string
import xml.etree.cElementTree as ET
import pyleri
from pyleri import Grammar, Regex, Choice, Sequence, Token, Keyword, Repeat, Ref
from pyleri.node import Node
import explanations
from explanations import sanitize, asl_bitexpr_to_sail, bitlit_re, Explana... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.