text
stringlengths
2
999k
"""Build metadata for a project using PEP 517 hooks. """ # Copyright (c) 2020 # Author: xiaoweixiang import argparse import logging import os import shutil import functools try: import importlib.metadata as imp_meta except ImportError: import importlib_metadata as imp_meta try: from zipfile import Path...
# coding: utf-8 import pandas as pd def named_series(*args, **kwargs): def wrapper(*args, **kwargs): return pd.Series(*args, **kwargs) return wrapper
import heapq class KthLargest(object): def __init__(self, k, nums): self.pool = nums self.k = k heapq.heapify(self.pool) while len(self.pool) > k: heapq.heappop(self.pool) def add(self, val): if len(self.pool) < self.k: heapq.heappush(self.pool...
''' This code validates the proposed folder structure and files against the schema required by the SPARC curation team. Note that since this code is separate from the code used the the SPARC curation team that automatically checks similar items, code passing this validator may not pass the official SPARC validator code...
from torch.hub import load_state_dict_from_url import torch.distributed as dist PRETRAINED_MODEL_URLS = { "pcqm4mv1_graphormer_base": "https://szheng.blob.core.windows.net/graphormer/modelzoo/pcqm4mv1/checkpoint_best_pcqm4mv1_full.pt", "pcqm4mv2_graphormer_base": "https://szheng.blob.core.windows.net/graphorme...
import os from unittest import TestCase from pathlib import Path from aibolit.patterns.array_as_argument.array_as_argument import ArrayAsArgument class TestArrayAsArgument(TestCase): dir_path = Path(os.path.realpath(__file__)).parent pattern = ArrayAsArgument() def test_NoArgument(self): file = P...
import tensorflow as tf tf.compat.v1.enable_eager_execution() # Weight Quantization - Input/Output=float32 converter = tf.lite.TFLiteConverter.from_saved_model('./saved_model') converter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE] tflite_quant_model = converter.convert() with open('./mobilenet_v2_pose_368_43...
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries # SPDX-FileCopyrightText: Copyright (c) 2020 Lee Nelson for nelnet.org # # SPDX-License-Identifier: MIT """ `configfile` ================================================================================ Utility class to read a JSON configur...
'''backported compatibility functions for Python's collections ''' from __future__ import absolute_import try: #python >= 2.7 from collections import OrderedDict except ImportError: #http://code.activestate.com/recipes/576693/ #author: Raymond Hettinger from .ordereddict import OrderedDict try: ...
# Copyright (c) 2018 Uber Technologies, Inc. # # 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...
from django.shortcuts import render, get_object_or_404, redirect from article.models import Article from .forms import CommentForm # Create your views here. def post_comment(request, article_pk): article = get_object_or_404(Article,pk=article_pk) if request.method == 'POST': form = CommentForm(reques...
# Generated by Django 3.0.6 on 2020-10-14 21:31 import datetime import django.contrib.postgres.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('postjob', '0001_initial'), ('users', '0001...
import networkx as nx from graphgym.register import register_feature_augment def example_node_augmentation_func(graph, **kwargs): ''' compute node clustering coefficient as feature augmentation :param graph: deepsnap graph. graph.G is networkx :param kwargs: required, in case additional kwargs are pr...
import sys # Find jVMC package sys.path.append("/Users/akhter/githesis-/jvmc/vmc_jax") import jax from jax.config import config config.update("jax_enable_x64", True) import jax.random as random import jax.numpy as jnp import numpy as np import jVMC import functools from typing import Any, Callable, Sequence, Opt...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
""" With these settings, tests run faster. """ from .base import * # https://docs.djangoproject.com/en/dev/ref/settings/#test-runner TEST_RUNNER = "django.test.runner.DiscoverRunner" # CACHES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref...
from rest_framework import serializers from dfirtrack_api.serializers.dfirtrack_artifacts_fk import ( ArtifactpriorityFkSerializer, ArtifactstatusFkSerializer, ArtifacttypeFkSerializer, ) from dfirtrack_api.serializers.dfirtrack_main_fk import ( CaseFkSerializer, SystemFkSerializer, TagFkSerial...
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-07-11 07:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('voting_intentions', '0002_auto_20180710_1805'), ] operations = [ migrations...
"""This module contains the meta information of ConfigResolveChildren ExternalMethod.""" import sys, os from ..ucscoremeta import MethodMeta, MethodPropertyMeta method_meta = MethodMeta("ConfigResolveChildren", "configResolveChildren", "Version142b") prop_meta = { "class_id": MethodPropertyMeta("ClassId", "class...
import json import pyodbc import logging import os import azure.functions as func import datetime import redis redisFeature = 'true'; # to handle datetime with JSON # It serialize datetime by converting it into string def default(dateHandle): if isinstance(dateHandle, (datetime.datetime, datetime....
from app import socketio, app PORT = app.config.get('PORT', 5000) app.logger.info('Starting port {port}'.format(port=PORT)) socketio.run(app, host="0.0.0.0", port=PORT)
from __future__ import print_function import tensorflow as tf import argparse import time import os from six.moves import cPickle from utils import TextLoader from model import Model import csv import itertools import operator import numpy as np import math as math import sys import os import time import tensorflow...
#!/usr/bin/python3 import os.path import sys import unittest import devpipeline_core.toolsupport sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "common")) import mockconfig _TOOL_FNS = {"bar": (lambda: None, "bar")} class TestToolBuilder(unittest.TestCase): def test_tool_exists(self): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 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-...
# import another_module # print(another_module.another_variable) from turtle import Turtle, Screen timmy = Turtle() # a new object print(timmy) # <turtle.Turtle object at 0x000001514F63A410> timmy.shape("turtle") # changes the center into a turtle timmy.color("coral") timmy.fd(100) my_screen = Screen() print(my_sc...
import logging import os import shutil from django.conf import settings from django.db import models from django import forms from django.db.models.signals import pre_delete from django.dispatch import receiver from django.utils.datetime_safe import datetime logger = logging.getLogger('web') class BooleanFieldExper...
N = int(input()) H = list(map(int, input().split())) for i in range(N - 2, 0, -1): if H[i] <= H[i + 1]: continue H[i] -= 1 if H[i] > H[i + 1]: print('No') exit() print('Yes')
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Support code for building a C extension with zstd files # # Copyright (c) 2016-present, Gregory Szorc # 2017-present, Thomas Waldmann (mods to make it more generic) # All rights reserved. # # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for det...
import responses from UnleashClient.constants import FEATURES_URL from UnleashClient.periodic_tasks import fetch_and_load_features from UnleashClient.features import Feature from tests.utilities.mocks.mock_features import MOCK_FEATURE_RESPONSE from tests.utilities.testing_constants import URL, APP_NAME, INSTANCE_ID, CU...
#_________MATH AND PLOT LIBRAY__________ import numpy as np from matplotlib.lines import Line2D import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy from matplotlib.pylab import * from mpl_toolkits.axes_grid1 import host_subplot import matplotlib.animation as animation ...
import pygame import numpy as np import logger cp_logger = logger.get_logger(__name__) class Joystick: def __init__(self, control_board_api): self._control_board_api = control_board_api if self._control_board_api: self._non_normalize_function = self._control_board_api.get_joystick_dir...
import boto3 from cloud_watch_logger import CloudWatchLogger import os region = os.environ['AWS_REGION'] def get_code_path(): return "/" + "/".join(__file__.split('/')[:-1]) class BaseWrapper(object): """ This class handles all anonymization for tabular data. It Uses Glue, S3, IAM and STS to detect ...
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2016 Julien LE CLEACH # # 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 Lice...
import os import numpy as np from demo_utils import plot_image import svmbir """ This file demonstrates the generation of a 3D microscopy phantom followed by sinogram projection and reconstruction using MBIR. The phantom, sinogram, and reconstruction are then displayed. """ # Simulated image parameters num_rows = 2...
import os import pandas as pd import numpy as np import environ import psycopg2 import logging import glob import datetime from django.core.management.base import BaseCommand from django.conf import settings from django.db import connection from volebni_kalkulacka.psp_data.models import * from dataImport.Logic.consts...
from dataclasses import dataclass, field from enum import Enum from typing import List __NAMESPACE__ = "SType/ST_facets" class S(Enum): VALUE_00 = "এ00" VALUE_0 = "এ-0" A0 = "ঐa0" VALUE_01 = "ও01" VALUE_1 = "ঝ-1" A1 = "নa1" VALUE_02 = "প02" VALUE_2 = "ভ-2" A2 = "রa2" VALUE_03 ...
import json import os import subprocess from file import temp_file from pg import connection, transaction from process import run_process def test_dump_sql(pg_database, snapshot): schema_sql = """ CREATE TABLE parent ( id int PRIMARY KEY ); CREATE TABLE child ( id...
# Copyright 2016 Red Hat, 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 # # Unless required by applicable law or agreed to in writin...
""" Calculates skew angle """ import os os.environ["CUDA_VISIBLE_DEVICES"] = "-1" import time import cv2 from math import fabs, sin, cos, radians import numpy as np import scipy from PIL import Image from skimage.transform import hough_line, hough_line_peaks class SkewDetect: piby4 = np.pi / 4 def __init__...
#!/usr/bin/python3 import sys import getopt import os from configobj import ConfigObj import xml.etree.ElementTree as ET import mysql.connector import datetime import kratoslib def delete_da_prices(connection, date): sql = ("DELETE FROM dayahead WHERE pricedate='%s'") data = (date.strftime('%Y-%m-%d')) print(dat...
# -*- coding: utf-8 -*- """ Name : interpolation.py Created on : 2018/11/24 08:57 Author : Steve Chen <chenshi@cea-igp.ac.cn> Affiliation : Institute of Geophysics, CEA. Version : 0.1.0 Copyright : Copyright (C) 2018-2020 GEOIST Development Team. All Rights Reserved. License : Distributed ...
import datetime import aiohttp import os import time import math from download_from_url import get_size, time_formatter async def progress(current, total, event, start): """Generic progress_callback for both upload.py and download.py""" now = time.time() diff = now - start if round(diff % 1.00) == ...
# _ __ ____ _ _ # | |/ / | _ \ | \ | | # | ' / | |_) | | \| | # | . \ | __/ | |\ | # |_|\_\ |_| |_| \_| # # (c) 2018 KPN # License: MIT license. # Author: Jan Bogaerts # # gateway actuators example # boot.py -- run on boot-up import os import machine uart = machine.UART(0, 115200) os.dupterm(uart...
import PIL.Image import itertools import random import subprocess import io import os.path from telegram import ( InlineKeyboardMarkup, InlineKeyboardButton, InputMediaPhoto, InputMediaVideo, User, Message, ) import cv2 import numpy IDSAMPLE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX...
from http.server import HTTPServer from remotecontrol import RemoteControlHander class TestHandler(RemoteControlHander): """testing handler""" keystring = 'ab:cd' def set_urls(self): self.urls = [ ('^/noget/andet/$', self.itester), ] def itester(self): print('runni...
#!/usr/bin/env python # ***************************************************************************** # Copyright (C) 2022 Thomas Touhey <thomas@touhey.fr> # # This software is licensed as described in the file LICENSE, which you # should have received as part of this distribution. # # THE SOFTWARE IS PROVIDED “AS IS”,...
# Copyright 2017 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. import os from cros.factory.probe import function from cros.factory.probe.lib import cached_probe_function def _ProbePCIOrUSB(path): path = os.path.a...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import time import pyrogram from pyrogram import Client from help.progress import progress from help.adds import clean_name, upload_file, get_share_link from config import Config from db_json import db_mod_status, file_add_delete from pyrogram.types import Message @Client.on_message(pyrogram.filters.video) ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals, print_function import json import glob import itertools import logging import math import os import re import warnings import xml.etree.cElementTree as ET fro...
# config.py - deals with loading configuration information. # Loads config data from a .cfg file. Also caches the compiled # data back into a .cfc file. # If you are wondering how to avoid needing .cfg files (eg, # if you are freezing Pythonwin etc) I suggest you create a # .py file, and put the config info in a doc...
import sys sys.path.append('./simple_crawler')
''' This case can not execute parallelly @author: Youyk ''' import os import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.host_operations as host_ops import zstackwoodpecker.operations.re...
from fabric.api import lcd, local from fabric.decorators import runs_once import os fabfile_dir = os.path.dirname(__file__) def i18n(): with lcd('readthedocs'): local('rm -rf rtd_tests/tests/builds/') local('tx pull') local('./manage.py makemessages --all') #local('tx push -s') ...
import abc import six import socket from oslo_config import cfg from oslo_log import log import oslo_messaging as om from oslo_service import service CONF = cfg.CONF LOG = log.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class ServiceManager(object): @abc.abstractproperty def service_name(self): ...
from enum import Enum class DataTypes(Enum): char = 'string' varchar = 'string' bit = 'boolean' int = 'int' decimal = 'decimal' money = 'decimal' date = 'DateTime' datetime = 'DateTime' varbinary = 'byte[]'
import os import appdirs import packaging.version from PartSeg import APP_LAB, APP_NAME, __version__ report_errors = False show_error_dialog = False custom_plugin_load = False check_for_updates = True develop = False save_suffix = "" save_folder = os.path.join( appdirs.user_data_dir(APP_NAME, APP_LAB), str(packa...
from django.urls import path from .views import TestModelListView urlpatterns = [ path( '', TestModelListView.as_view(), name='index' ), ]
import argparse import typing import logging import torch # Use GPU only if GPU is available and memory is more than 8GB if torch.cuda.is_available() and torch.cuda.get_device_properties(0).total_memory > 8e9: import torch.backends.cudnn as cudnn cudnn.benchmark = True device = torch.device("cuda") else: ...
#! /usr/bin/env python import asyncio import aiohttp import configparser import logging import time from urllib.parse import urljoin from pathlib import Path log = logging.getLogger('gbackup-async') # log.setLevel(logging.DEBUG) # Gitlab API v4 base URL. BASE_GITLAB_URL = 'https://gitlab.com/api/v4/' # Time to sle...
from typing import Union, Tuple from charset_normalizer import from_bytes from charset_normalizer.constant import TOO_SMALL_SEQUENCE UTF8 = 'utf-8' ContentBytes = Union[bytearray, bytes] def detect_encoding(content: ContentBytes) -> str: """ We default to UTF-8 if text too short, because the detection ...
import os import cv2 as cv import numpy as np import math from constants import constants def outerContour(contour, gray, margin=10): """ Given a contour and an image, returns the mean of the pixels around the contour. This is used to detect the rectangle fiducial pattern. """ # We create two mask...
import astroid from collections import defaultdict from python_ta.typecheck.base import parse_annotations, class_callable import os from typing import Any TYPE_SHED_PATH = os.path.join(os.path.dirname(__file__), 'typeshed', 'builtins.pyi') class TypeStore: def __init__(self, type_constraints): ...
""" These are the decorators used by the functions in the model file. functions.py """ from functools import wraps import inspect import xarray as xr def subs(dims, subcoords): """ This decorators returns the python object with the correct dimensions xarray.DataArray. The algorithm is a simple version of ...
from deepmerge import always_merger from langdetect import detect, detect_langs def taxonomy_reference(code, term): return dict( links=dict( self=f'/api/2.0/taxonomies/{code}/{term}' ) ) def try_name(nlist,record, default=None): for name in nlist: try: retur...
# Copyright 2021 NREL # 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 # distri...
# This code is part of Qiskit. # # (C) Copyright IBM 2019, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
# # This file is part of pySMT. # # Copyright 2015 Andrea Micheli and Marco Gario # # 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 ...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- # Copyright 2019 Hyde. All Rights Reserved. # # This file is licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. A copy of the # License is located at # # http://aws.amazon.com/apache2.0/ # # This ...
""" Module that contains a decorator generator function ``condition`` that can be used to conditionally execute functions based on the state of the global config. General Example --------------- Here's an example:: from pyppy.conditions import Exp, condition from pyppy.config import initialize_config impo...
"""A script to test the problem1 module""" import problem1 problem1.fasta('ecoli.fasta')
from math import dist import vk_orbwalker from valkyrie import * from helpers.flags import EvadeFlags from dMoveModule import CurrentTarget, MovePrediction from helpers.targeting import * from helpers.damages import calculate_raw_spell_dmg from helpers.spells import Slot from boku_no_orbwalker import target_selector, O...
import subprocess import time from selenium.webdriver import Chrome import pywebio import template import util from pywebio.input import * from pywebio.platform.flask import start_server from pywebio.utils import to_coroutine async def target(): template.basic_output() await template.coro_background_output(...
from train import train_model from examples.NIPS.CoinUrn.nets import colour_net, coin_net from data_loader import load from optimizer import SGD from model import Model queries = load('train.txt') test_queries = load('train.txt') with open('model.pl') as f: problog_string = f.read() def lr(self): if self.epo...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
from nmea_converter_proxy.test_tools.simulators import (run_dummy_sensor, run_dummy_concentrator) # noqa
import logging import time import threading from datetime import datetime import os from gps import * from conf import Conf try: import RPi.GPIO as GPIO except ImportError: import fakes.fakegpio as GPIO """ Helper class for bucket actions """ class BucketActions: STOPPED = 0 STARTED = 1 DRIV...
import logging import pickle from typing import Dict, List, Optional, Union import numpy as np import pandas as pd from ray.tune.result import DEFAULT_METRIC from ray.tune.sample import ( Categorical, Domain, Float, Integer, LogUniform, Quantized, Uniform, ) from ray.tune.suggest.suggestio...
import torch from liegroups.torch import _base from liegroups.torch import utils class SO2(_base.SpecialOrthogonalBase): """See :mod:`liegroups.SO2`""" dim = 2 dof = 1 def adjoint(self): if self.mat.dim() < 3: return self.mat.__class__([1.]) else: return self....
'''OpenGL extension ANGLE.d3d_share_handle_client_buffer This module customises the behaviour of the OpenGL.raw.EGL.ANGLE.d3d_share_handle_client_buffer to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/ANGLE/d3d_share_hand...
# GRPC Node gyp file # This currently builds the Node extension and dependencies # This file has been automatically generated from a template file. # Please look at the templates directory instead. # This file can be regenerated from the template by running # tools/buildgen/generate_projects.sh # Copyright 2015 gRPC a...
import _plotly_utils.basevalidators class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="sizesrc", parent_name="funnel.marker.pattern", **kwargs ): super(SizesrcValidator, self).__init__( plotly_name=plotly_name, parent_nam...
import os import csv import random import nltk from nltk import word_tokenize nltk.download('punkt') data_dir = './data' def analyze_dataset(): idxs = {} # debug iter = 0 with open(os.path.join(data_dir, 'all.csv'), 'r') as f: reader = csv.reader(f) for row in reader: i...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2018 University of Chicago. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Pre-configured remote application for enabling sign in/up with Globus....
""" WSGI config for epistomate_28860 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJA...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys if sys.version_info < (2, 6, 0): sys.stderr.write("Requires Python 2.6 or newer.\n") sys.exit(-1) from distutils.core import setup def get_version(): VERSIONFILE="../VERSION" return open(VERSIONFILE, "r").read().strip() setup( name='GenomeToo...
# Copyright 2015 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...
from .identity_encrypt import * from .key_ceremony_orchestrator import * from .sample_generator import * from .tally_ceremony_orchestrator import * from .tally_accumulate import *
import json import logging from abc import ABC from aiohttp import web from tellus.tell import Tell, InvalidAliasException from tellus.tells import Teller, TheresNoTellingException from tellus.tellus_utils import now_string, TellusException from hotsocket.timer import DurableTimer from tellus.configuration import TELL...
# encoding: utf-8 import unittest import datetime from timingsutil import Throttle import logging_helper logging = logging_helper.setup_logging() class TestConfiguration(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_throttle(self): t = Throttle(2)...
import uvicorn from fastapi import Depends, FastAPI, HTTPException from sqlalchemy.orm import Session from src.crud import crud from src.models import models from src.schemas import schemas from src.database.database import SessionLocal, engine models.Base.metadata.create_all(bind=engine) app = FastAPI() # Depende...
# -*- coding: utf-8 -*- import logging import os from easyjoblite import constants from easyjoblite import utils class ServiceState(object): def __init__(self, pid_file_path=constants.DEFAULT_PID_FILE_LOCATION): self.job_worker_pids = [] self.retry_worker_pids = [] self.dlq_worker_pids =...
import logging from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.core.exceptions import ValidationError from django.db.utils import IntegrityError from django.db.models import Q from django.db import connection from psa.models import Corvet from utils.con...
"""RAAR3DNet architecture. The model is introduced in: Regional Attention with Architecture-Rebuilt 3D Network for RGB-D Gesture Recognition Benjia Zhou, Yunan Li, Jun Wan https://arxiv.org/pdf/2102.05348.pdf """ import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd imp...
import unittest from vgio.quake2.tests.basecase import TestCase from vgio.quake2 import md2 significant_digits = 5 class TestMd2ReadWrite(TestCase): @unittest.skip("Missing test artifacts") def test_check_file_type(self): self.assertTrue(md2.is_md2file('./test_data/test.md2')) def test_st_verte...
import sys print(sys.path) sys.path.append("..") sys.path.append("../src") import matplotlib.pyplot as plt import pandas as pd import streamlit as st import seaborn as sns from keras.models import load_model, Sequential from keras.layers import LSTM, Dense, Flatten, Dropout import numpy as np import tensorflow as tf fr...
from RecSysFramework.Evaluation.Evaluator import EvaluatorMetrics from RecSysFramework.Utils.get_holdout import retrieve_train_validation_test_holdhout_dataset from RecSysFramework.Recommender.NonPersonalized import TopPop from RecSysFramework.Experiments.utils_experiments import get_results_latex_from_dict, round_all_...
from django.test.utils import override_settings from custom.icds_reports.const import ChartColors, MapColors from custom.icds_reports.messages import wasting_help_text from custom.icds_reports.reports.prevalence_of_severe import get_prevalence_of_severe_data_map, \ get_prevalence_of_severe_data_chart, get_prevalen...
import pytest import pandas as pd import numpy as np from linkalman.core.utils import Constant_M from copy import deepcopy # Test __init__ def test_wrong_M_type(): """ Test if raise exception if M is not a numpy array """ M = 2.1 T = 5 with pytest.raises(TypeError): Mt = Constant_M(M, ...