text stringlengths 6.04k 39.5k |
|---|
import numpy as np
from wisdem.commonse.constants import eps
from wisdem.commonse.utilities import smooth_max, smooth_min, cubic_spline_eval
def hoopStressEurocode(d, t, L_reinforced, hoop):
"""default method for scaling hoop stress using Eurocode method
GB 06/21/2018: Ansys comparisons for submerged case sug... |
"""This code runs a GUI for Raspberry Pi spectrophotometers that use the pi camera
port. It was written for <NAME>'s spectrophotometer. To run the code, cd
into the directory then type "python3 gui.py". You must be in the same directory
as the code, and you must use python 3 (not python 2).
This software is license... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 CANDY LINE INC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
# Copyright 2021, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# QR Code Generator plug-in for Blender 2.5.7+
# plug-in version: 1.1b
# provided by Esponce team
# http://www.esponce.com/
# ***** BEGIN MIT LICENSE BLOCK *****
#
# Copyright (C) 2013 Esponce d.o.o.
#
# Permission is hereby granted, free of charge, to any pe... |
# OBSS SAHI Tool
# Code written by <NAME>, 2020.
import copy
import os
import random
import time
from typing import List, Optional, Union
import cv2
import numpy as np
import requests
from PIL import Image
from sahi.utils.file import Path
class Colors:
# color palette
def __init__(self):
hex = (
... |
import re
from collections import OrderedDict
from rl_threat_hunting.constants import ClassificationTypeTC
from rl_threat_hunting.constants import ClassificationResultTC
from rl_threat_hunting.filter.uris import is_interesting_uri
from rl_threat_hunting.utils import safely_traverse_dict
from rl_threat_hunting.utils ... |
import json
import math
import numpy as np
import pandas as pd
import pytest
from mlflow.exceptions import MlflowException
from mlflow.pyfunc import _enforce_tensor_spec
from mlflow.types import DataType
from mlflow.types.schema import ColSpec, Schema, TensorSpec
from mlflow.types.utils import _infer_schema, _get_tens... |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 11:51:11 2016
@author: neerbek
"""
import os
import io
import time
# from threading import Thread
from queue import Queue
import numpy as np # type: ignore
from numpy.random import RandomState # type: ignore
from typing import List
import psutil # ty... |
from django import forms
from django.conf import settings
from django.contrib import auth
from django.utils import timezone
from pagedown.widgets import PagedownWidget
from dal import autocomplete
from .models import (
Project,
Role,
RoleAssignment,
ProjectInvite,
RemoteSite,
SODAR_CONSTANTS,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import six
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from core import preprocess_utils
from core import utils
_EPSILON = 1e-9
def get_label_weight_mask(labels, ignore_label, num_classes, label_weights=1.0, keep_class_dims=False):
""... |
# 0do.py v3 support, e.g. ssm report custom
import sys, os, json, subprocess, pprint, traceback
from pathlib import Path
from typing import List, Union, Callable
import acmacs
# ======================================================================
def main():
def main_commands():
return [name for 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
# distributed under th... |
import sys
from datetime import timedelta
from celery import conf
from celery.log import setup_task_logger
from celery.utils.timeutils import timedelta_seconds
from celery.result import BaseAsyncResult, EagerResult
from celery.execute import apply_async, apply
from celery.registry import tasks
from celery.backends imp... |
# Copyright 2017 The TensorFlow Lattice Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# coding=utf-8
import json
import requests
import time
import pandas as pd
import datetime
def datetime_parser(DT: str):
""" datetime in iso8601 format parser """
a, b = DT.split('+')
dt = datetime.datetime.strptime(a, "%Y-%m-%dT%H:%M:%S")
return dt
class YClientsAPI:
def __init__(self, token, co... |
from __future__ import division
import os
import sys
import array
import struct
import io
import math
import numpy as np
import colorsys
import pydicom
from pydicom.dataset import Dataset, FileDataset
import pydicom.uid
import skimage as ski
import skimage.io
import skimage.transform
import skimage.draw
import skimage.... |
#!/usr/bin/env python3
#
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Factory toolkit installer.
The factory toolkit is a self-extracting shellball containing factory test
related files and this ... |
import os
import sys
import tempfile
from collections import defaultdict, Counter, namedtuple
from argparse import ArgumentParser
import subprocess
import re
from importlib import resources
import mhca.data
from Bio.SeqIO.FastaIO import SimpleFastaParser
def write_header(fileh, name, length):
""" Writes standar... |
"""
The MIT License (MIT)
Copyright (c) 2020-Current Skelmis
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, mer... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ... |
import numpy as np
from GreedyGRASP.Problem import Problem
from copy import deepcopy
# Assignment class stores the assignment of a driver and a bus to a certain service
class BusAssignment(object):
def __init__(self, busId, serviceId, cost):
self.bus = busId
self.service = serviceId
self.c... |
# -*- coding: utf-8 -*-
# File: box.py
# Copyright 2021 Dr. <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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
from __future__ import print_function, division
import time
import time as ttime
import logging
from pathlib import PurePath
from .utils import makedirs
from collections import OrderedDict
import h5py
from ophyd.areadetector import (DetectorBase, CamBase,
EpicsSignalWithRBV as Signal... |
# Copyright (c) 2018, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... |
from bc4py.config import C, V, P, BlockChainError
from bc4py.bip32 import is_address
from bc4py.chain.block import Block
from bc4py.chain.tx import TX
from bc4py.chain.workhash import generate_many_hash, get_executor_object, update_work_hash
from bc4py.chain.difficulty import get_bits_by_hash
from bc4py.chain.utils imp... |
# Copyright (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>
# All rights reserved.
# This code is licensed under BSD 3-Clause License.
import tensorflow as tf
import tflearn
from modules.inits import *
from utils.tools import camera_trans, camera_trans_inv, reduce_var, reduce_std
_LAYER_UIDS = {}
def get_layer_uid(layer_na... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# MIT License
# Copyright (c) 2020 <NAME>, <NAME>, <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 witho... |
'''
Copyright (c) 2017 <NAME>
This file is part of mac_apt (macOS Artifact Parsing Tool).
Usage or distribution of this software/code is subject to the
terms of the MIT License.
'''
import logging
import os
import posixpath
from plistutils.alias import AliasParser
from plugins.helpers.m... |
"""Miscellaneous utilities."""
from functools import reduce
import os
import os.path as op
import re
import shutil
import subprocess
import warnings
import numpy as np
import mne
from mne import (pick_types, pick_info, make_sphere_model, DipoleFixed, Epochs,
Dipole, make_forward_dipole, Projection)
f... |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... |
# Copyright 2018-2019 <NAME>
# Copyright 2020-2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import re
from calendar import isleap, monthrange
from functools import wraps
from six import integer_types, string_types, text_type
from six.moves import range, zip_longest
from efc.rpn_builder.parser.operands... |
"""
The MIT License (MIT)
Copyright (c) 2021 guaneec
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, publ... |
import pyverilog.vparser.ast as vast
import pyverilog.ast_code_generator.codegen as pycodegen
import json, sys
import argparse
import math
# Change to my template
pycodegen.DEFAULT_TEMPLATE_DIR = './template/'
name_dict = json.load(open('./input/name_dict.json'))
class instance:
def __init__(self, idx=0, strengt... |
import logging
import logging.config
import os
import hid
import time
import shutil
import filecmp
import sys
LOGGING_LEVEL = os.getenv('HID_OP_LOG', 'INFO').upper()
LOGGING_CONFIG = {
'version': 1,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
... |
# coding: utf-8
import json
from base64 import b64decode
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from djoauth2.conf import settings
from djoauth2.errors import DJOAuthError
from djoauth2.models import AccessToken
from djoauth2.models import AuthorizationCode
from djoa... |
# ------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
#
# ------------------------------------------------------------------------------
# Copyright (C) 2014 EOX IT Services GmbH
#
# Permission is hereby granted, free o... |
import math
import os
import numpy as np
import mxnet as mx
from mxnet import random
from mxnet import ndarray
from mxnet import initializer
from mxnet.gluon import nn
from mxnet.gluon.block import HybridBlock
from mxnet.initializer import Initializer
__all__ = ['oth_alpha_pose_resnet101_v1b_coco']
def get_max_pred(... |
import datetime
import os
import http
import json
import pathlib
import pytest
from gidgetlab import (
BadRequest,
GitLabBroken,
HTTPException,
InvalidField,
RateLimitExceeded,
RedirectionException,
ValidationFailure,
)
from gidgetlab import sansio
SAMPLES_PATH = os.path.join(os.path.abspat... |
import numpy as np
from pathlib import Path
import pandas as pd
import datetime
import random
import h5py
import zipfile
import tensorflow as tf
from tensorflow import keras
from sklearn.model_selection import ParameterSampler
from scipy.stats import randint as sp_randint
from scipy.stats import uniform
import trace... |
# Copyright 2014 OpenCore LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# Copyright (c) 2005 <NAME>
# Copyright (c) 2006 <NAME>
# This software is distributed under the MIT Open Source License.
# <http://www.opensource.org/licenses/mit-license.html>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files ... |
import math
import pandas as pd
import plotly.graph_objs as go
from plotly.offline import plot
import cea.plots.technology_potentials
from cea.plots.variable_naming import LOGO, COLOR, NAMING
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich"
__credits__ = ["<NA... |
# this program basically does a constexpr and generates cuda code
import textwrap
import numpy as np
from code_fragments import *
from utils import *
from ptx_utils import *
import random
import os
import argparse
parser = argparse.ArgumentParser(description='CodeGen V1')
parser.add_argument('--IC', type=int, default... |
"""
解析注解RMI
"""
import re
import os
import string
class Param:
"""
存储方法的参数类型
"""
PATTERN_VAR = re.compile(r'[a-zA-Z0-9_]+')
def __init__(self, ctx):
self.content = ctx
self.type = ""
self.name = ""
self.base_type = ""
self.is_const = False
self.is_p... |
# Created By: <NAME>
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium import webdriver
import os, time, sys, random
from bot import InstagramBot
from os.path import abspath, dirname
from selenium.webdriver.support.ui import WebDriverWait
from... |
# Various utilities for SSAM feature analysis
import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.spatial import ConvexHull
from scipy.interpolate import interp2d
import transforms3d as tf3d
from manip... |
#!/usr/bin/env python
"""Creates a CityLex lexicon.
For more information on CityLex, see:
https://github.com/kylebgorman/citylex
"""
import argparse
import csv
import datetime
import io
import logging
import os
import pkg_resources
import re
import sys
import unicodedata
import zipfile
from typing import Dict, Iter... |
#! /usr/bin/env python
"""Generate an OpenType Feature file (fea) from an otf/ttf font."""
# TODO 1: add arguments to set up makeName: prefix, sufix
# TODO 2: Export one fea-file from multiple font sources. Especially merging
# GDEF clsses would be interesting. The other potential clashes can be solved
# by modifyin... |
import json
import re
from typing import Optional
import magic
#!!! This giant block of imports should be something simpler, such as:
# from great_exepectations.helpers.expectation_creation import *
from great_expectations.execution_engine import (
ExecutionEngine,
PandasExecutionEngine,
SparkDFExecutionE... |
'''
Created on Sep 12, 2020
@author: <NAME>
A cwi clone database in sqlite.
Two service functions are included:
- showprogress() : a semi-graphical progress indicator.
- qmarks() : generate a string of "?" characters for use in queries.
Class c4db implements only variables and methods that are agnostic as to
t... |
import base64
from django.shortcuts import render
from django.core.files.uploadedfile import UploadedFile
from django.db.models import F
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.generics import ListAPIView
from rest_framework.generics import CreateAPIVi... |
#coding:utf-8
import requests
from bs4 import BeautifulSoup
import re
import json
from multiprocessing.dummy import Pool as tp
import subprocess
import os
import base64
from ebooklib import epub
#是否抓取内链内容
getinline = False
#连接线程数
threads = 32
#忽略单独链接
ignoresinglelink = True
#增加原作者信息
orginfo = True
#创建epub
makeepub = ... |
import typing
from collections import namedtuple
from functools import partial, lru_cache
try:
from pony.orm.core import Attribute, PrimaryKey, Discriminator, Optional, Required
except ImportError:
import warnings
warnings.warn("pony import skipped")
from onto.mapper import fields
from typing import Type,... |
# coding=utf-8
import re
import time
from selenium.webdriver.common.by import By
from helpers import xroad, ssh_server_actions
from view_models import clients_table_vm, popups, messages
from view_models.messages import WSDL_EDIT_ERROR_VALIDATION_FAILED, \
WSDL_EDIT_ERROR_FILE_DOES_NOT_EXIST, WSDL_EDIT_INCORRECT... |
import argparse
import asyncio
import hashlib
import json
import os
import re
import shutil
import signal
import sys
import time
from typing import Mapping, Sequence
from urllib.parse import urlunparse
import aiohttp
import lxml.html as html
import tqdm
# type definitions
LanguageMapping = Mapping[str,Mapping[str,str... |
""" Looper version of NGS project model. """
import itertools
import os
from jsonschema import ValidationError
from pandas.core.common import flatten
from logging import getLogger
from peppy import SAMPLE_NAME_ATTR, OUTDIR_KEY, CONFIG_KEY, \
Project as peppyProject
from eido import read_schema, PathAttrNotFoundE... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import itertools
import logging
import os
import re
import sys
import unittest
import urllib
# Setups environment.... |
import pickle
import os
import sys
from time import sleep
import random
import math
import mysql.connector
#Structure of the Direcotries to be used for storing the data
# C:\CMSTData
# --> \MissionID
# --> \--> Mission.txt
# --> \--> ReceivedDataMetaData.txt
# --> \--> \DetectionFolder
# --> \--> \--> \Video#
# ... |
# <codecell>
from selenium.common.exceptions import NoSuchElementException, NoSuchFrameException, ElementNotInteractableException, \
JavascriptException
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import functions as func
from video_class import Video
imp... |
from discord.utils import escape_mentions
from imports import hangmanDB, position_number
from discord import Embed
from discord.ext.commands import command, Cog, group, CommandInvokeError
from re import compile as re_compile
from random import choice as randchoice, randint
from asyncio import TimeoutError as AsyncioTim... |
import unittest
import numpy
from chocolate.space import *
class Obj1(object):
pass
class Obj2(object):
pass
class TestSpace(unittest.TestCase):
def test_numpy_array(self):
u = uniform(0.0005, 0.1)
l = log(1, 10, 2)
s = Space({"a" : u,
"b" : l})
x = ... |
""" Requires installment of ``Pandoc``.
Using json fileformat of Pandoc, Convert markdown to Textbox in Powerpoint.
### Reference
* [http://hackage.haskell.org/package/pandoc-types-1.17.5.1/docs/Text-Pandoc-Definition.html](http://hackage.haskell.org/package/pandoc-types-1.17.5.1/docs/Text-Pandoc-Definition.html)
... |
# coding=utf-8
# Copyright (C) 2020 NumS Development Team.
#
# 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, modif... |
import cv2
import math
import csv
import numpy as np
import random
import os
import glob
from PIL import Image
from nudenet import NudeDetector #from NudeNet_edited import Detector
detector = NudeDetector() #detector = Detector()
#You can change those folder paths
rootdir = "./decensor_input"
outdir_mosaics = ".... |
"""Interface for elasticesarch ltr plugin management api
Doesn't try too hard, simply wraps some url/method handling so we dont have to
duplicate it elsewhere. All responses are return as-is from the management API.
Responses from elasticsearch containing an 'error' key are converted to
exceptions.
FIXME: template pa... |
from . import SACTSubtype, SACTAction, ANIM
from .. import armature
import bpy
import bpy.path
import re
import struct
from mathutils import Vector, Quaternion, Euler
# Actor data class
class SACTData(bpy.types.PropertyGroup):
subtypes: bpy.props.CollectionProperty(type=SACTSubtype.SACTSubtype, name="Actor Subty... |
__author__ = 'jie'
# -*- coding: utf-8 -*-
import json
import io
from collections import defaultdict
from cadnano.document import Document
from cadnano.enum import LatticeType, StrandType
from cadnano.color import Color
import cadnano.preferences as prefs
from cadnano import setBatch, getReopen, setReopen
from cadnano... |
from collections import Counter
import numpy as np
import matplotlib as mp
import matplotlib.pyplot as plt
import sys
import os
font = {'family' : 'normal',
'weight' : 'normal',
'size' : 30}
mp.rc('font', **font)
if len(sys.argv) < 5:
sys.exit("Format python obtain_waecr_plot.py <test_file_path> <... |
"""
Overlay Message Widget
----------------------
A Widget to display a temporary dismissible message over another widget.
"""
import sys
import enum
import functools
import operator
from collections import namedtuple
from AnyQt.QtWidgets import (
QHBoxLayout,
QPushButton,
QLabel,
QSizePolicy,
Q... |
from __future__ import division
import sys, os, time
from datetime import datetime
from timeit import default_timer as timer
try:
from humanfriendly import format_timespan
except ImportError:
def format_timespan(seconds):
return "{:.2f} seconds".format(seconds)
import logging
logging.basicConfig(format... |
#!/usr/bin/env python
import os
import numpy as np
import matplotlib.pyplot as plt
from pylab import setp
from matplotlib.ticker import FuncFormatter
from datetime import datetime as date
from .filesystem_utils import ensure_dir
from evo.core import result
def find_step_of_base(x, base):
return base * 10**np.f... |
#!/usr/bin/env python3
import re
import os
import sys
import subprocess
from urllib.request import urlopen
from urllib.error import HTTPError
from argparse import ArgumentParser
from html.parser import HTMLParser
from collections import namedtuple
from distutils.version import LooseVersion
from configparser import Conf... |
from __future__ import print_function,division
import numpy as np
import random
from scipy import sparse
import scipy.sparse.linalg
from builtins import range
class DiscreteMDP:
"""Base class for a Markov Decision Problem. Subclasses should
overload, at a minimum,
- states()
- actions()
- transit... |
""" construct transition state z-matrices
"""
import functools
import numpy
from qcelemental import constants as qcc
import automol
from automol.graph._graph import atom_neighbor_keys as _atom_neighbor_keys
from automol.zmatrix import shift_row_to_end
from automol.zmatrix.newzmat._util import shifted_standard_zmas_gra... |
#!/usr/bin/env python3
'''
Keyboard description
Keys 1-9:
R(1), G(2), B(3) ambient
R(4), G(5), B(6) diffuse
R(7), G(8), B(9) specular
Change this values with arrows (up and down)
Key N - Toggle Normal vectors
'''
import sys
from typing import List, Union
from glfw.GLFW import *
from OpenGL.GL import *
from OpenGL.... |
import random
import time
import numpy as np
from .linear import find_lower_bound, solve_linear, T_MIN
from .limits import check_spline
from .discretize import time_discretize_curve, derivative_discretize_curve, distance_discretize_curve, sample_discretize_curve
from .parabolic import solve_multi_poly, solve_multivar... |
"""View class for editor"""
import tkinter as tk
from tkinter import ttk
from abc import ABC
# noinspection PyPackageRequirements
from PIL import Image, ImageTk, ImageOps
from .errors import DigitizeInternalError
from x7.geom.geom import BBox
from x7.geom.transform import Transform
from x7.geom.typing import *
from ... |
"""
idown_cmd的字段文件
"""
import json
from .iscancmd import StratagyScan
from .iscoutcmd import StratagyScout
from ..ecommandstatus import ECommandStatus
from ..outputdata import DataSeg, EStandardDataType, OutputData, OutputDataSeg
class Target(object):
def __init__(self, target_json: dict):
# 均无默认值
... |
# -*- coding: utf-8 -*-
import sys
from pathlib import Path
import vtk
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
from scipy.stats import lognorm, norm
from scipy import ndimage
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import Qt
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderW... |
import unittest
from typing import List
from sqlalchemy import inspect
from sqlalchemy import exc as sa_exc
from sqlalchemy.orm import Session, load_only
from sqlalchemy.orm.state import InstanceState, AttributeState
from .db import init_database, drop_all, create_all
from .models import Base, Number, Fruit
from .que... |
import numpy as np
import copy
import itertools
import collections
from collections import namedtuple
import mediapipe_utils as mpu
import depthai as dai
import cv2
from pathlib import Path
import time
import argparse
characters = ['A', 'B', 'C', 'D',
'E', 'F', 'G', 'H',
'I', 'K', 'L', 'M... |
#! /usr/bin/env python3
"""
test.py
Written by <NAME>
Licensed under GPLv3
Released 11 October 2009
"""
import unittest
from pypbc import *
stored_params = """type a
q 878071079966331252243778198475404981580688319941420821102865339926647563088022295707862517942266222142315585876958231745927771336731748132492512999... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys, io, textwrap
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.layout import LAParams, LTContainer, LTAnno, LTText, LTTextBox
from pdfminer.converter i... |
'''
contains DopaNetwork class as well as a DopaController Class for the actual motor simulation project.
'''
import numpy as np
from synapse import *
from Network import Network
from datetime import datetime
import pickle
from random import randint
import networkx as nx
import matplotlib.pyplot as plt
try:
import... |
import re
from ast import literal_eval
from dataclasses import dataclass
from . import operations
COMPREHENSION = 1
GEN_EXPR = 1 << 2
RAW_JUMPS = 1 << 3
@dataclass
class Instruction:
line_num: int
offset: int
opname: str
arg: int
argval: object
def get_code_obj_name(s):
match = re.match(r"<code object <?(.*?... |
#
# Gauss-Jordan elimination over any field (Python)
#
# Copyright (c) 2019 Project Nayuki
# All rights reserved. Contact Nayuki for licensing.
# https://www.nayuki.io/page/gauss-jordan-elimination-over-any-field
#
import fractions, numbers
# ---- Field abstract class ----
class Field(object):
"""An abstract ba... |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
#!/usr/bin/env python
"""
© 2018 <NAME>
Main entry point for 'Plain Old Calculator' (Poc) application
Todo:
* Add tooltips to controls
* Create a better application icon
* Create scripts to build Mac Os, Windows and Linux Executables
"""
import sys
from time import time
import math_core
from observable import Obse... |
# Copyright (c) 2011 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 ... |
# -*- coding: UTF-8 -*-
"""
A module to save a VoigtFit dataset to a file.
The files are saved in HDF5 format to allow easy portability.
The module also contains a function to sconvert
the older pickled datasets to the new HDF5 format.
"""
__author__ = '<NAME>'
import numpy as np
from os.path import splitext, basenam... |
import mne
import os
from mne.io import read_raw_fif
import numpy as np
import matplotlib.pyplot as plt
from hytools.meg_utils import get_ch_pos
from autoreject import AutoReject
from scipy.io import loadmat, savemat
from brainpipe import feature
from saflow_params import FOLDERPATH
from scipy.io import loadmat, savema... |
from datetime import datetime
import time
import numpy as np
from bluesky.plan_stubs import mv, mvr
from random import random
import json
from xas.ft_analysis import data_ft
def remove_pb_files(uid):
run = db[uid]
for i in run['descriptors']:
if i['name'] != 'primary':
os.remove(i['data_k... |
'''
The MIT License (MIT)
Copyright (c) 2017 <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, publi... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import constants
from scipy.optimize import curve_fit
from astropy.io import fits
from astropy.table import Table
import warnings
#import numba
from numba import jit
from scipy.interpolate import InterpolatedUnivariateSpline as ius
def nanpercentile(v,p,axi... |
"""
This file is part of Cytometer
Copyright 2021 Medical Research Council
SPDX-License-Identifier: Apache-2.0
Author: <NAME> <<EMAIL>>
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as stats
# imports for sped up hdquantiles_sd
from numpy import float_, int_, ndarray
imp... |
import dash
from app import app
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_table
import json, codecs
import numpy as np
from scipy.integrate import simps
import pandas as pd
import plotly.graph_ob... |
"""
tagging_2.py:
1.对文本做标注
使用"情绪-1/情绪-2"做子句级别的标签
情绪类比关系,表示由1子句导致2子句的某种情感
role1、role2表示对应的两个实体(1---情绪词(所在子句)、2---原因子句)
2.获得模型的训练输入三元组:(doc_idx, clause_idx, tag_idx)
doc_idx: num_clause*1
代表文档索引
单个数据对应clause_set.txt
clause_idx: num_clause*num_word
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.