content
stringlengths
5
1.05M
#!/usr/bin/env python # coding=utf-8 from flask import Flask from app.asset import asset from app.user import user app = Flask(__name__) app.register_blueprint(asset, url_prefix='/asset') app.register_blueprint(user, url_prefix='/user')
#! /usr/bin/env python # -*- coding: utf-8 -*- """ @version: @author: li @file: factor_cash_flow.py @time: 2019-05-30 """ import gc, six import json import numpy as np import pandas as pd from utilities.calc_tools import CalcTools from utilities.singleton import Singleton # from basic_derivation import app # from u...
# !usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2018-10-11 17:51:43 # @Last modified by: Brian Cherinka # @Last Modified time: 2018-11-29 17:23:15 # Trying to update for DR17 - Karen Masters, 7th July 2021. from __future__ import print_...
from typing import Callable, Iterator, NamedTuple, Any, Optional, Union from itertools import tee import operator def repeat_f(f: Callable[[float], float], a: float) -> Iterator[float]: """Infinite iterator: [a, f(a), f(f(a)), f(f(f(a))) ...]""" acc: float = a while True: yield acc acc = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from rdflib import Graph, Literal from rdflib.namespace import SKOS, DC import sys TYPEMAP = { u'vakavesi' : { 'fi': u'järvi', 'sv': u'sjö'}, u'kylä, kaupunginosa tai kulmakunta' : { 'fi': u'kylä', 'sv': u'by'}, u'virtavesi' : { 'fi': u'virta', 'sv': u'ström'} } d...
from datetime import datetime class GeneyJob: def __init__(self, pid, path, email=None, name=None): self.pid = pid self.path = path self.email = email self.name = name self.date = datetime.utcnow()
__version__ = '1.2.9'
from abc import ABC, abstractmethod class Animal(ABC): def __init__(self): pass @abstractmethod def make_sound(self): pass class Cat(Animal): def __init__(self, species): self.sound = 'meow' def make_sound(self): pass class Dog(Animal): def __init__(self):...
import unittest import Queue from slogging import log_common from slogging import log_processor class DumbLogger(object): def __getattr__(self, n): return self.foo def foo(self, *a, **kw): pass class DumbInternalProxy(object): def __init__(self, code=200, timeout=False, bad_compressed=...
from base import BaseDataLoader from dataset.acdc_dataset import ACDC_dataset class AcdcDataLoader(BaseDataLoader): def __init__(self, data_root, batch_size, shuffle=True, validation_split=0.0, num_workers=1, training=True, transforms=None): # if training: # trsfm = my_transfo...
import pytest from api.base.settings.defaults import API_BASE from api_tests.requests.mixins import NodeRequestTestMixin @pytest.mark.django_db class TestNodeRequestDetail(NodeRequestTestMixin): @pytest.fixture() def url(self, node_request): return '/{}requests/{}/'.format(API_BASE, node_request._id) ...
import csv import erdos import sys import time from absl import app, flags import pylot.component_creator import pylot.drivers.sensor_setup import pylot.flags import pylot.operator_creator import pylot.utils from pylot.drivers.drive_by_wire_operator import DriveByWireOperator from pylot.drivers.grasshopper3_driver_op...
from validation import vworkspace with vworkspace("include/p4a_stubs.c") as w: w.props.linearize_array_use_pointers = True w.props.linearize_array_cast_at_call_site = True w.props.isolate_statement_even_non_local = True # Transform for GPU w.all_functions.privatize_module() w.all_functions.coarse_grain_p...
"""This container module contains improvements to Python's stdlib."""
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ReplicationRecordGet: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The k...
from .uvm_get_to_lock_dap import * from .uvm_set_before_get_dap import * from .uvm_set_get_dap_base import * from .uvm_simple_lock_dap import *
#!/usr/bin/env python3 """Print rangoli of size NUM""" def print_rangoli(size): alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] alphabet_slice = alphabet[:size] elements = alphab...
import json import os import glob import csv from natsort import natsort import re import numpy as np from numpy import linalg as LA import matplotlib.pyplot as plt def main(path, root): os.chdir(path) def joint_angle(point1, point2, point3): def point_x(number): return number * 3...
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2021 # # 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 # r...
# Test data of test case A006 name = 'testuser02' mail = 'tuser02@gmail.com' passw = 'TestUser02' title = 'UserTagsTest' what = 'UserTagsTest articel-1' write = 'Ez User01 teszt bejegyzése a tag funkció vizsgálatához.' tags = ['abel', 'ego', 'ipsum'] ta_nu = int(len(tags))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 06 09:13:14 2021 @author: sudhir """ # ============================================================================= # Import libary # ============================================================================= import os import gc import pandas ...
#! /usr/bin/python3 ''' see usage of ds18b20 here https://www.circuitbasics.com/raspberry-pi-ds18b20-temperature-sensor-tutorial/#:~:text=The%20DS18B20%20temperature%20sensor%20is,wire%20for%20the%20data%20signal. ''' # this file is diffferent for each use case #one_wire_file = '/sys/bus/w1/devices/28-3c01a8168ea2/...
from djangobench.base_settings import * # NOQA INSTALLED_APPS = ['query_iterator']
from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class GroupCreateActionTest(BaseActionTestCase): def test_create(self) -> None: self.create_model( "meeting/22", {"name": "name_vJxebUwo", "is_active_in_organization_id": ...
from pydantic import BaseModel from .utils import BaseEvent class MainPublisherEvent(BaseEvent): pass class CheckStatus(MainPublisherEvent): channel: str class WaitLiveVideo(MainPublisherEvent): pass class WaitStream(MainPublisherEvent): time: int class DownloaderEvent(BaseEvent): pass ...
import time from jose import jwk, jwt from jose.utils import base64url_decode from werkzeug.security import safe_str_cmp from flask_cognito_extended.exceptions import CSRFError, JWTDecodeError try: from flask import _app_ctx_stack as ctx_stack except ImportError: # pragma: no cover from flask import _request_c...
from .lstm import LSTM, LSTMCell from .gru import GRU, GRUCell from .tpgru import TPGRUCell
import dataset import requests import time db = dataset.connect('sqlite:///databse.db') table = db['history'] key = "XAI2eQAhITGGep9PYpBj7ZQM90NtKSpd" baseUrl = "http://www.mapquestapi.com/geocoding/v1/address?street=%s&city=Magdeburg&country=Germany&maxResults=1&key=" + key def geocode(row): address = row['ans...
# -*- coding:utf-8 -*- # --------------------------------------------- # @file BubbleSort.py # @description Bubble Sort # @author WcJun # @date 2020/06/21 # --------------------------------------------- # 时间复杂度: 最好:O(n) 最坏:(n^2) # 稳定性: 稳定 # bubble_sort def bubble_sort(origin_list): length = len(origin_list) ...
import pandas as pd import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.colors as clr import numpy as np from matplotlib.colors import ListedColormap import numpy as np import matplotlib.pyplot as plt from m...
import socket from unittest import TestCase try: from unittest import mock except ImportError: import mock from routeros_api import api_socket from routeros_api import exceptions class TestSocketWrapper(TestCase): def test_socket(self): inner = mock.Mock() wrapper = api_socket.SocketWrapp...
from .logger import BuildSimLogger
from pylabber.utils.utils import CharNullField, ChoiceEnum # flake8: noqa: E501
# Generated by Django 2.2.5 on 2019-12-03 15:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("structures", "0004_auto_20191129_0308"), ] operations = [ migrations.AddField( model_name="notification", name="crea...
from django.db import models # Create your models here. class Category(models.Model): title = models.CharField(max_length=255) url_clean = models.CharField(max_length=255) def __str__(self): return self.title class Type(models.Model): title = models.CharField(max_length=255) url_clean = ...
import numpy as np class SearchWindowsFactory: @staticmethod def _get_min_max(min_max_array, default_max): return [0 if min_max_array[0] is None else min_max_array[0], default_max if min_max_array[1] is None else min_max_array[1]] @staticmethod def _get_search_regi...
#!/usr/bin/env python2.3 # # Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesse...
N = int(input()) S = input() result = [None] * N t = [None] * (N // 2) c = 0 for i in range(N): if S[i] == '(': t[c] = i + 1 c += 1 elif S[i] == ')': c -= 1 result[t[c] - 1] = i + 1 result[i] = t[c] print(*result, sep='\n')
from ..game import Game, Situation from ..utils import get_rng import numpy as np # TODO: Update this to new Game API class SparseSGDLinearValueLearning: def __init__(self, game, feature_extractor, value_store, infosetsampler, rng=None, seed=None): self.rng = get_rng(rng=rng, seed=seed) self.game...
from __future__ import division import sys,os,random,glob from physicsTable import * import pygaze from pygaze import libscreen, libinput, liblog, libtime from constants import * from setup import * from runTrial import drawTable, run from textParse import * # Load in the trials trialdir = os.path.join(os.path.dirname...
import re # text = "b'RT @: $BTC update \xf0\x80\x94 all hail the queen. #nodip #BTCUSD #bitcoin #crypto #cryptos #cryptocurrencies #HODL #HODLgang #cryptom\xe2\x80\xa6'" # m1 = re.sub(r"'","",text) # m2 = re.findall(r"xf0",text) # m3 = re.sub('\\xef','',text) # print(text) # print(m2) import csv csvFile = open(...
import string import pke from transformers.file_utils import tf_required from prep_crossling import create_valid_config from bert_crossling_prep import file_to_df import multiprocessing as mp import numpy as np import stopwordsiso as stopwords import string from keybert import KeyBERT from mrakun import RakunDetector ...
import vcr from contentpacks.khanacademy import retrieve_kalite_data, \ retrieve_translations cvcr = vcr.VCR( serializer="json", cassette_library_dir="tests/fixtures/cassettes/", ) @cvcr.use_cassette() def generate_node_list(): return retrieve_kalite_data() @cvcr.use_cassette(serializer="yaml", ...
#!/usr/bin/env python3 from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from src.main.utils.Logger import Logger class Wait: global logger logger = Logger(__name__) ''' [Description] __init__ :param driver -...
import os import glob import argparse import time from PIL import Image import numpy as np import PIL import gc import multiprocessing as mp # Kerasa / TensorFlow os.environ['TF_CPP_MIN_LOG_LEVEL'] = '5' from keras.models import load_model from layers import BilinearUpSampling2D from loss import depth_loss_function f...
class Trie: def __init__(self): # character:next_tree self.children = {} def insert(self, word: str) -> None: if len(word) == 0: self.children['*'] = None else: ch = word[0] if ch not in self.children: self.children[ch] = Trie...
import argparse import tensorflow as tf from config import get_config from models.build import build_model def parse_option(): parser = argparse.ArgumentParser('Swin Transformer weight conversion from PyTorch to TensorFlow', add_help=False) parser.add_argument( '--cfg', type=str, met...
""" test parallel tools ------------------- testing num """ import numpy as np from pySpatialTools.utils.util_external import distribute_tasks,\ reshape_limits, generate_split_array, split_parallel def test(): distribute_tasks(100, 1000) lims = distribute_tasks(100, 10) reshape_limits(lims, [0, 20]) ...
# Generated by Django 3.0.2 on 2020-02-12 17:36 from django.db import migrations import matrix_field.fields class Migration(migrations.Migration): dependencies = [ ('hash', '0005_auto_20200212_1713'), ] operations = [ migrations.AddField( model_name='hash', name=...
# from accounts.models import Account # from django.db.models.signals import post_save # from django.dispatch import receiver # from .models import Cart # @receiver(post_save, sender=Account) # def create_user_cart(sender, instance, created, **kwargs): # if created: # Cart.objects.create(user=instance)
import discord import asyncio from discord.ext import commands from evs import default config = default.get("config.json") downloaddir = config.ytmp3_upload_dir import os import youtube_dl import random import time class ytmusic_downloader(commands.Cog): def __init__(self, client): self.client = client ...
__author__ = 'meli'
import torch from torch.utils.data import Dataset, DataLoader import pytorch_lightning as pl from dataset import RiddleSenseDataset import argparse from transformers import ( AdamW, T5ForConditionalGeneration, T5Tokenizer, get_linear_schedule_with_warmup ) def get_dataset(tokenizer, type_...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Name: testDocumentation.py # Purpose: tests from or derived from the Documentation # # Authors: Michael Scott Cuthbert # # Copyright: Copyright © 2010-2012 Michael Scott Cuthbert and the music...
import logging from logging.handlers import TimedRotatingFileHandler import os import time class log(object): def __init__(self, func): self.func = func self.logger = logging.getLogger(__name__) self.logger.setLevel(logging.DEBUG) formatter = logging.Formatter("%(message)s") ...
# an implementation of the convolutional lstm in pytorch taken from # https://github.com/ndrplz/ConvLSTM_pytorch/blob/master/convlstm.py from __future__ import print_function, division import torch import torch.nn as nn from torch.autograd import Variable import numpy as np class ConvLSTMCell(nn.Module): def _...
import gc import os import re import threading import webbrowser from tempfile import TemporaryDirectory from gtts import gTTS from playsound import playsound from .canvas import CANVAS_SZ, Canvas from .config import * from .vocab_pick import (SES_WIN_POS, VOCAB_CONFIG, VOCAB_NAME, VOCAB_WORDS, ...
#!/usr/bin/env python # coding: utf-8 import numpy as np import cv2 def generate_images(size): """ generate depth image """ images = [] # image 0 image = np.zeros((4*size, 6*size)) + 0.3 grid = np.zeros((4*size, 6*size)) for i in range(image.shape[0]): for j in range(image.sha...
from pathlib import Path import select class GPIOPin: def __init__(self, pin_number): self.pin_number = pin_number self._do_unexport = False def __enter__(self): self._export() self._set_direction() self._set_edge() return self def __exit__(self, *args, **...
from typing import Iterable import torch from ppq.core import (ChannelwiseTensorQuantizationConfig, QuantizationProperty, QuantizationStates) from ppq.executor import BaseGraphExecutor, TorchExecutor from ppq.IR import GraphCommandProcesser, QuantableOperation from ppq.quantization.observer impor...
from django import forms from django.core.exceptions import ValidationError from mytravelblog.common.helpers import BootstrapFormMixin from mytravelblog.common.validators import validate_file_content_type from mytravelblog.main_app.models import TravelPicture def _validate_travel_picture_name(user, title, located_ci...
# %% # VScodeで入力をテキストから読み込んで標準入力に渡す import sys import os file_path = __file__.rsplit('/',1)[0] f=open(file_path + '/input.txt', 'r', encoding="utf-8") # inputをフルパスで指定 # win10でファイルを作るとs-jisで保存されるため、読み込みをutf-8へエンコードする必要あり # VScodeでinput file開くとutf8になってるんだけど中身は結局s-jisになっているらしい sys.stdin=f # # 入力スニペット # num = int(input()...
MIN_RATING_STAR_VALUE = 1 MAX_RATING_STAR_VALUE = 5
import sys from setuptools import setup, find_packages if len(sys.argv) > 1 and sys.argv[1] == "fatpack": import glob import io import zipfile zipdata = io.BytesIO() z = zipfile.ZipFile(zipdata, mode="w", compression=zipfile.ZIP_DEFLATED) for filename in glob.iglob("termcast_client/*.py"): ...
# -*- coding: utf-8 -*- import requests import xmltodict from datetime import datetime import re session = 151 url = 'http://www.althingi.is/altext/xml/raedulisti/?lthing=' def calc_speech(start, end, speech): time1 = datetime.strptime(start, '%Y-%m-%dT%H:%M:%S') time2 = datetime.strptime(end, '%Y-%m-%dT%H:%M:%S')...
#!../../anaconda2/bin/python import os #import shutil #import random #import re #import json #import pickle import reader dir1 = "/uufs/chpc.utah.edu/common/home/conway-group1/TRIANGULUM_ANNOTATION/AnnotationDataset/userBasedData/4-10/Adjudication/" dir2 = "/uufs/chpc.utah.edu/common/home/conway-group1/TRIANGULUM_AN...
import re import unicodedata from urllib.parse import quote from .base import Base class Id(Base): def __init__(self, id_replacements, markdown_preview, lowercase): super().__init__() self.id_replacements = id_replacements self.markdown_preview = markdown_preview sel...
"""Repository service""" from git_plan.exceptions import AlreadyInitialized from git_plan.model.repository import Repository class RepositoryService: # pylint: disable=too-few-public-methods """Administrative functionality for repositories""" @staticmethod def initialize(repo: Repository): """C...
from torchvision.ops.feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool from typing import Dict from torch import nn import warnings from torchvision.ops import misc as misc_nn_ops from torchvision.models import resnet from collections import OrderedDict from torchvision.models.utils import load_sta...
# 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 # d...
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
from rozental_as_a_service.text_utils import is_camel_case_word, split_camel_case_words def test_is_camel_case_word(): assert is_camel_case_word('Notcamelcase') is False assert is_camel_case_word('IsCamelCase') is True def test_split_camel_case_words(): assert split_camel_case_words('ReturnNormalWorlds'...
import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMainWindow, QApplication, QDialog, QTextBrowser, QCheckBox, QDialogButtonBox from PyQt5 import uic #from X_askpinWindow import AskPinWindowClass from X_askconfirmPIN import AskConfrimPinWindowClass class ConfirmDialog(QDialog): de...
#import libraries import somtimes import numpy as np import warnings ############################## # author: Ali Javed # October 14 2020 # email: ajaved@uvm.edu ############################# warnings.filterwarnings("ignore") np.random.seed(0) #set window size for DTW --- using zero in this example and this...
#/********************************************************************** #** This program is part of 'MOOSE', the #** Messaging Object Oriented Simulation Environment. #** Copyright (C) 2003-2014 Upinder S. Bhalla. and NCBS #** It is made available under the terms of the #** GNU Lesser General Public License ...
#------------------------------------------------------------------------------ # Copyright (c) 2008, Riverbank Computing Limited # Copyright (c) 2009, Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwar...
import os from pyrogram import filters from wbb.utils import nekobin from wbb import app from wbb.utils.errors import capture_err __MODULE__ = "Paste" __HELP__ = "/paste - To Paste Replied Text Or Document To Neokobin" @app.on_message(filters.command("paste") & ~filters.edited) @capture_err async def paste(_, messag...
from .plot import plot from .pull import pull from .scale import scale
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: beam_provision_api.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflectio...
import numpy as np # using sympy because it can correctly work with values of trigonometric functions # from box, when numpy gives us only closer number, so here used the same function like in numpy import sympy as sp import matplotlib.pyplot as plt from mpl_toolkits import mplot3d from mpl_toolkits.mplot3d import Axes...
#!/usr/bin/python # # Non-interactive (full cached) publisher for market price domain # import pyrfa import time p = pyrfa.Pyrfa() p.createConfigDb("./pyrfa.cfg") p.setDebugMode(True) p.acquireSession("Session4") p.createOMMProvider() p.login() p.dictionaryRequest() # add RICs to symbollist SYMBOLLIST = {'ACTION':'AD...
# -*- encoding: utf-8 -*- from django.conf.urls.defaults import patterns from django.conf.urls.defaults import url from django.views.generic.simple import direct_to_template from cal import views urlpatterns = patterns('', url(r'^$', views.index, name='cal.index'), url(r'^search/patient/for/(?P<action>(\w...
#File Analysis # #This program reads the contents of two text files and compares them. #1. It displays a list of all the unique words contained in both files. #2. It displays a list of the words that appear in both files. #3. It displays a list of words that appear in the first file but not the second #4. It displays a...
__author__ = 'sibirrer' import lenstronomy.Util.class_creator as class_creator from lenstronomy.LensModel.lens_model import LensModel import numpy.testing as npt import pytest class TestClassCreator(object): def setup(self): self.kwargs_model = {'lens_model_list': ['SIS'], 'source_light_model_list': [...
# Generated by Django 3.1.5 on 2021-04-20 01:23 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('academic_information', '0005_auto_20200522_1851'), ('academic_procedures', '0017_auto_20210303_2238'), ] op...
import pandas as pd # Access a single value for a row/column pair by integer position. # Similar to iloc, in that both provide integer-based lookups. Use iat if you only # need to get or set a single value in a DataFrame or Series. # iAt based indexing can only have integer indexers df = pd.DataFrame(data = [[10,20,3...
from school.models.student_list_model import StudentList from school.models.class_model import Class from country.models.city_model import City from country.models.country_model import Country from school.models.school_model import School from account.models.child_list_model import ChildList from account.models.child_p...
# EJ (Mercy) Emelike # May 26, 2016 # Homework 2 #LISTS # 0) make list numbers = [22, 90, 0, -10, 3, 22, 48] # 1) print list print(numbers) # 2) print 4th element of list print(numbers[3]) # 3) print sum of 2nd and 4th element print(numbers[1] + numbers[3]) # 4) print 2nd largest value numbers_sorted = sorted(numb...
from setuptools import setup setup(name="snb", version="0.0.1", install_requires=["gym"] )
import logging from yapsy.IPlugin import IPlugin from modules.common.Downloads import Downloads from modules.common import create_output_dir from modules.common.Riot import Riot import os logger = logging.getLogger(__name__) """ """ class SO(IPlugin): def __init__(self): self._logger = logging.getLogg...
import cv2 import pickle import numpy as np from PIL import Image from pathlib import Path import torch from dataloaders.common.bbox import get_bbox_from_verts, get_square_bbox, scale_bbox from dataloaders.common.utils import update_smplifyx_after_crop_and_resize, ltrb2ijhw, get_masked_mesh from utils.img import crop...
# Read a string: # s = input() # Print a string: # print(s)
import pandas as pd import numpy as np import os def filter_data(label_path, data_path, num): label = pd.read_csv(label_path, header=None) label[1] = label[0].map(lambda x: x.split('/')[0]) label[2] = label[0].map(lambda x: x.split('/')[1]) data_label = label[1].value_counts()[label[1].value_counts() <...
import argparse import logging from core_generate_product_ids import get_random_product_ids DEFAULT_OUTPUT_FILENAME = 'product_ids.txt' if __name__ == '__main__': logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') parser = argparse.ArgumentParser() parser.add_argu...
if __name__ == '__main__': import os import pytest pytest.main(os.path.dirname(__file__))
# @Author: Landers1037 # @Github: github.com/landers1037 # @File: __init__.py.py # @Date: 2020-05-12 # 配置文件处理函数,默认还是使用json作为配置文件 from .init_config import init_config from .read_config import read_config from .check_config import check_config from .flask_config import flask_config
import copy def get_reverse_triples_by_triples(triples, property_reverse_dict): def _get_reverse_property_from_lexcion(property, property_reverse_dict): '''get reverse property''' reverse_property = None if property in property_reverse_dict.keys(): reverse_property = property_...
import logging import re import secrets import django from django.contrib.auth import authenticate from django.core.mail import send_mail from django.http import HttpResponse from django.shortcuts import render, redirect from app.views import validate_user_email from .models import CustomUser def get_logger(): ...
import argparse import sys import time import numpy import paramiko args = None class bcolors: HEADER = "\033[95m" OKBLUE = "\033[94m" OKGREEN = "\033[92m" WARNING = "\033[93m" FAIL = "\033[91m" ENDC = "\033[0m" BOLD = "\033[1m" UNDERLINE = "\033[4m" def get_args(): parser = ar...
import numpy as np from scipy import stats from sklearn import metrics import torch def d_prime(auc): standard_normal = stats.norm() d_prime = standard_normal.ppf(auc) * np.sqrt(2.0) return d_prime def calculate_stats(output, target): """Calculate statistics including mAP, AUC, etc. Args: o...