text
stringlengths
1
927k
"""Test the auth script to manage local users.""" from unittest.mock import Mock, patch import pytest from homeassistant.scripts import auth as script_auth from homeassistant.auth.providers import homeassistant as hass_auth from tests.common import register_auth_provider @pytest.fixture def provider(hass): """...
print("test1")
import sqlite3 with sqlite3.connect("accounts.db") as connection: c = connection.cursor() c.execute('CREATE TABLE accounts(firstName TEXT, lastName TEXT, email TEXT, groupName TEXT)') c.execute('INSERT INTO accounts VALUES("Ram", "Muthukumaran", "rammk1999@gmail.com", "group")') c.execute('INSERT INTO...
# 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 ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import sys def does_exist(cur_list, start_loc, end_loc): for s, e, _ in cur_list: if (s >= start_loc and s <= end_loc) or (start_loc >= s and start_loc <= e): return True return False def read_fimo(fimo_input): fimo_dict = {} with open(fimo_input, "r") as f: for line in f: line = line.strip() if line...
""" @author: mjs @based: JiXuan Xu, Jun Wang """ import yaml import cv2 import numpy as np from .logFile import logger from ..core.model_loader.face_recognition.FaceRecModelLoader import FaceRecModelLoader from ..core.model_handler.face_recognition.FaceRecModelHandler import FaceRecModelHandler with open('config/mod...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: iso2022_jp_3.py import _codecs_iso2022 import codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_3') class Codec(code...
from vstruct import VStruct from vstruct.primitives import v_bytes from vstruct.primitives import v_uint32 from vstruct.primitives import v_wstr from vstruct.primitives import v_enum PATCH_ACTIONS = v_enum() PATCH_ACTIONS.PATCH_REPLACE = 0x2 PATCH_ACTIONS.PATCH_MATCH = 0x4 MAX_MODULE = 32 # from: https://github.co...
# coding: utf-8 # Copyright 2015 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 requir...
import logging from tenacity import retry, stop_after_attempt, wait_fixed, before_log, after_log from app.db.external_session import db_session from app.db.init_db import init_db logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) max_tries = 60 * 5 # 5 minutes wait_seconds = 1 @retry( ...
import random import unittest import numpy as np from mmabm.shared import Side, OType from mmabm.learner import MarketMakerL class TestTrader(unittest.TestCase): def setUp(self): self.l1 = self._makeMML(3001, 1) self.q1 = {'order_id': 1, 'timestamp': 1, 'type': OType.ADD, 'quantit...
#!/usr/bin/python3.7 from time import time from string import ascii_lowercase as letters polymer = open("inputs/5.txt").read().strip() def reactPolymer(x): stack = [] for i in x: if stack and stack[-1].swapcase() == i: stack.pop() else: stack.append(i) return stack ...
#!/usr/bin/python3 import sys import sqlite3 from .session import PylitePromptSession from .commands import handle_dot_command def main(database): session = PylitePromptSession(connection=sqlite3.connect(database)) while True: try: text = session.prompt() if text.startswith(...
from shutil import rmtree import json from flask import Flask, request, Response, render_template, jsonify, make_response from flask_cors import CORS import boto3 import json import time from helpers import get_bucketed_utterances, score_emotion_utterances from flag_sentences import detect_nuggets from botocore.config ...
from django.contrib import admin from .models import Article,tags # from .models import Editor # Register your models here. class ArticleAdmin(admin.ModelAdmin): ''' Customise model in admin page ''' filter_horizontal = ('tags',) # admin.site.register(Editor) admin.site.register(Article,ArticleAdmin) ...
import itertools as itt import pathlib as pl import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.io import loadmat import src.data.rasters from src.data import dPCA as cdPCA from src.metrics import dprime as cDP from src.data.load import load, get_site_ids from src.data.cache import make...
#!/usr/bin/env python #coding:utf-8 import os import sys import string import time import datetime import MySQLdb import pymongo import bson import logging import logging.config logging.config.fileConfig("etc/logger.ini") logger = logging.getLogger("wlblazers") path='./include' sys.path.insert(0,path) import functions ...
# Parallel Python Software: http://www.parallelpython.com # Copyright (c) 2005-2012, Vitalii Vanovschi # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must reta...
""" The code was written by a me, Phani Rithvij """ import zipfile from tqdm import tqdm def extract(filename: str): with zipfile.ZipFile(filename) as zf: member = zipfile.ZipInfo() for member in tqdm(zf.infolist(), desc='Extracting '): try: zf.extract(member, "data") ...
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # # Copyright 2015 (c) Lei Xu <eddyxu@gmail.com> from __future__ import absolute_import from builtins import str import argparse import hashlib import io import os import re import subprocess import sys from . import gitrepo _CPP_EXTENSIONS = ['.h', '.hh', '.hp...
import asyncio class MockMessage: def __init__(self, value): self.value = value class MockReceive: def __init__(self, messages=None): self.messages = messages or [] self.index = 0 async def __call__(self): try: message = self.messages[self.index] exce...
# model settings model = dict( type='CascadeRCNN', num_stages=3, pretrained='open-mmlab://resnext101_64x4d', backbone=dict( type='ResNeXt', depth=101, groups=64, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='...
#------------------------------------------------------------------------------ # Copyright (c) 2017, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------------------------------...
""" Reads from the database and produces html/js files. """ from cubed_tube.lib.common import filter_video from cubed_tube.lib.models import Video, Channel, Series, init_database from cubed_tube.lib import schema from cubed_tube.lib.util import sha1, load_config, load_credentials from cubed_tube.frontend import templa...
''' Salt-Based Web Crawler ''' # Import python libs import logging import urllib2 import random import time log = logging.getLogger(__name__) def __virtual__(): ''' Basic Python libs are all that are needed ''' return 'crawler' def fetch(urls=None, wait=0, random_wait=False): ''' Fetch a U...
import argparse import logging import os import re import statistics import sys import time from datetime import timedelta, datetime from threading import Thread from typing import Dict, Tuple, Optional, List, Iterable from tqdm import tqdm from .env import H2TestEnv, H2Conf from pyhttpd.result import ExecResult log...
"""Example games module.""" class Game(object): """Base game class.""" def __init__(self, player1, player2): """Initializer.""" self.player1 = player1 self.player2 = player2 def play(self): """Play game.""" print('{0} and {1} are playing {2}'.format( s...
# Copyright (c) 2015 SUSE Linux GmbH. 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 la...
from snake.scale import FileType, scale NAME = "nist_nsrl" VERSION = "1.0" AUTHOR = "Matt Watkins" AUTHOR_EMAIL = "matthew.watkins@countercept.com" DESCRIPTION = "a module to search files within the Nation Software Reference Library" LICENSE = "https://github.com/countercept/snake-scales/blob/master/LICENSE" URL ...
# Generated by Django 2.1 on 2018-09-24 22:11 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('login', '0001_initial'), ] operations = [ migrations.AlterField( ...
# String Concatenation (Title) # Reading message = 'Hello' + 'World' print(message) # This program demonstrates string concatenation. first_name = input('Enter your first name: ') last_name = input('Enter your last name: ') # Combine the names with a space between them. full_name = first_name + ' ' + last_name # D...
"""ObservableObjectMixin definition.""" from dataclasses import dataclass from typing import Any, Callable, TypeVar from ass_parser.observable import Event, Observable TItem = TypeVar("TItem") @dataclass class ObservableObjectChangeEvent(Event): """Observable object property change event.""" class ObservableO...
""" N170 Analysis Only =============================== This notebook runs only the data analysis part of N170 notebook. Look at the notes to see how this can be run on the web with binder or google collab. All of the additional notes are removed; only the code cells are kept. """ ##################################...
"""users table Revision ID: 1bd480e682e0 Revises: Create Date: 2020-12-29 22:37:15.050661 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1bd480e682e0' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto genera...
""" pygments.formatter ~~~~~~~~~~~~~~~~~~ Base formatter class. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import codecs from pipenv.patched.notpip._vendor.pygments.util import get_bool_opt from pipenv.patched.notpip._vendor.pyg...
# coding=utf-8 """ @author: 长风 @contact: xugang_it@126.com @license: Apache Licence @file: script.py @time: 2021/4/29 5:05 下午 """ import os from loguru import logger def run(job): file_name = job.env.HDFS_NFS_PREFIX + job.script_path args = job.script_args cmd = '' if file_name != '' and file_name.en...
import yt import matplotlib.pyplot as plt import numpy as np # Enable parallelism in the script (assuming it was called with # `mpirun -np <n_procs>` ) yt.enable_parallelism() # By using wildcards such as ? and * with the load command, we can load up a # Time Series containing all of these datasets simultaneously. ts...
# Copyright (c) 2016-present, Facebook, 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...
"""General configuration for respy.""" from pathlib import Path # Obtain the root directory of the package. Do not import respy which creates a circular # import. ROOT_DIR = Path(__file__).parent # Directory with additional resources for the testing harness TEST_RESOURCES_DIR = ROOT_DIR / "tests" / "resources" HUGE_...
import time import logging import traceback from slack_clients import SlackClients from messenger import Messenger from event_handler import RtmEventHandler logger = logging.getLogger(__name__) def spawn_bot(): return SlackBot() class SlackBot(object): def __init__(self, pipedrive_api_key, db_api_url, tok...
# -*- coding: utf-8 -*- # Copyright 2020 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...
# *** WARNING: this file was generated by the Kulado Kubernetes codegen tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import kulado import kulado.runtime import warnings from ... import tables, version class PodTemplateList(kulado.CustomResource): """ PodTemplate...
#!/usr/bin/env python # # Copyright 2013 Red Hat # 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...
""" Implements the standard Ivy API. You can refer to the example code ``pyhello.py`` for an example of use. All methods in this module are frontends to a `ivy.IvyServer` instance, stored in the module's attributes `_IvyServer`. :group Connecting to/disconnecting from the Ivy bus: IvyInit, IvyStart,IvyMainLoop, Iv...
# def lengthLongestPath(input): # maxlen = 0 # pathlen = {0: 0} # for line in input.splitlines(): # print("---------------") # print("line:", line) # name = line.strip('\t') # print("name:", name) # depth = len(line) - len(name) # print("depth:", depth) ...
# Owner(s): ["oncall: aiacc"] import torch import torch.fx.experimental.fx_acc.acc_ops as acc_ops from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec from torch.testing._internal.common_utils import run_tests class TestBatchNormConverter(AccTestCase): def test_batchnorm(self): ...
""" examples.basic_usage ~~~~~~~~~~~~~~~~~~~~ Common usage patterns for the yaspin spinner. """ import signal import time from yaspin import Spinner, yaspin from yaspin.signal_handlers import fancy_handler from yaspin.spinners import Spinners def context_manager_default(): with yaspin(text="Braille"): ...
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
from columnar import columnar from click import style from packaging import version import os, re, time, requests, json, csv class Output: RED = '\033[31m' GREEN = '\033[32m' YELLOW = '\033[33m' CYAN = '\033[36m' RESET = '\033[0m' BOLD = '\033[1;30m' # u'\u2717' means values is None or not ...
"""Module contains the version of dag-factory""" __version__ = "0.7.2"
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.AlipayPassInstanceUpdateModel import AlipayPassInstanceUpdateModel class AlipayPassInstanceUpdateRequest(object): def __init__(...
import click from colorama import Fore from .transactions import print_transaction class ClickProgressBarUpdater: def __init__(self, bar): self.bar = bar self.progress = 0 def __call__(self, progress): self.bar.update(progress - self.progress) self.progress = progress @clic...
import unittest from FixedWidthTextParser.Parser import Parser definition = { 'FIELD_1': [0, 1, 'string'], 'FIELD_2': [1, 10, 'float'], 'FIELD_3': [11, 10, 'float'], 'FIELD_4': [23, 1, 'integer'], 'FIELD_5': [24, 2, 'string'], 'FIELD_6': [26, 4, 'integer', 0], 'FIELD_7': [30, 4, 'integer', ...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class ArpackNg(Package): """ARPACK-NG is a collection of Fortran77 subroutines designed to solve...
# 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 ...
#!/usr/bin/python import unittest import os import sys import shutil sys.path.append(".") from io import StringIO import annogesiclib.get_input as get_input class Mock_func(object): def mock_wget(self, ftp, input_folder, file_type, log): pass def modify_header(self): pass class TestGetFile...
""" :mod:`compound_jsonapi.fields` ============================== Provides the :class:`~compound_jsonapi.fields.Relationship` custom field for defining relationships between :class:`~compound_jsonapi.schema.Schema`\ s. .. moduleauthor:: Mark Hall <mark.hall@work.room3b.eu> """ import marshmallow as ma _RECURSIVE_NES...
# Longest Substring Without Repeating Characters # Medium class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ # DP Solution based on record_start. str.index比str.find快很多 if not s: return 0 counts = [0] * ...
# -*- coding: utf-8 -*- ''' Save json files of isomophric configurations ''' from set_ce_lattice import mother, dz from set_config_constants import config, Ec import lattice_functions as lf #%% ''' Create Configurations in graphs ''' batch_i = 3 # Initialize the cluster object and isomorphs object Clusters = lf.in...
# Copyright © 2019 Province of British Columbia # # 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 agr...
import csv from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException import time import socket import exceptions import math import argparse from pymavlink import mavutil import ugv_functions as ugv vehicle = ugv.connectMyCopter() ugv.paramSetup(vehicle) ugv.arm(vehicle) with open('ringroadcoords....
import numpy as np from nibabel.affines import from_matvec from nibabel.eulerangles import euler2mat from ..patched import obliquity def test_obliquity(): """Check the calculation of inclination of an affine axes.""" from math import pi aligned = np.diag([2.0, 2.0, 2.3, 1.0]) aligned[:-1, -1] = [-10, -...
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" import io from setuptools import find_packages, setup with io.open("README.rst", encoding="UTF-8") as readme_file: readme = readme_file.read() with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file: history = changelog_file.rea...
from django.shortcuts import render, redirect from .forms import NewUserForm from django.contrib.auth import login as auth_login, login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.decorators import login_required from djan...
# Python3 TLE # PyPy3 AC class fenwick_tree: def __init__(self, n): self.data = [0 for _ in range(n+1)] self.n = n def add(self, p, x): p += 1 while p <= self.n: self.data[p-1] += x p += p & -p def sum(self, l, r): return self._sum(r) - ...
import bpy, struct, math from mathutils import Quaternion def draw(layout, context): if bpy.context.active_object: obj = bpy.context.active_object layout.label(text="Widget Settings:", icon='OBJECT_DATA') layout.prop_menu_enum(obj, 'retro_widget_type', text='Widget Type') #layout.pr...
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import, print_function, unicode_literals import sys sys.modules['pkg_resources'] = None import os # Import Salt libs import salt.defaults.exitcodes import salt.utils.job import salt.utils.parsers import salt.utils.stringutils import salt.log...
# ------------------------------------------------------------------------ # Copyright (c) 2021 megvii-model. All Rights Reserved. # ------------------------------------------------------------------------ # Modified from BasicSR (https://github.com/xinntao/BasicSR) # Copyright 2018-2020 BasicSR Authors # -------------...
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 with...
"""Test prediction. Test target: - :py:meth:`lmp.model._lstm_1997.LSTM1997.pred`. """ import torch from lmp.model._lstm_1997 import LSTM1997 def test_prediction_result(lstm_1997: LSTM1997, batch_cur_tkids: torch.Tensor) -> None: """Return float tensor with correct shape and range.""" lstm_1997 = lstm_1997.eval...
import unittest from list.palindrome import is_palindrome_1, is_palindrome_2 class TestIsPalindrome(unittest.TestCase): def test_is_palindrome_1(self): self.assertTrue(is_palindrome_1('abcdcba')) self.assertTrue(is_palindrome_1('abcddcba')) self.assertFalse(is_palindrome_1('acddcba')) ...
#! /opt/conda/envs/env/bin/python import argparse import os from sklearn.ensemble import RandomForestClassifier import pandas as pd import joblib from sklearn.metrics import accuracy_score if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--model-dir", default="/opt/...
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from app import app header = dbc.Col( dcc.Markdown( '# Process', className='mb-5', style=...
from __future__ import print_function import argparse import io import os import subprocess from tqdm import trange parser = argparse.ArgumentParser(description='Merges all manifest CSV files in specified folder.') parser.add_argument('--merge_dir', default='manifests/', help='Path to all manifest files you want to ...
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 req...
from flask import Flask, request, flash, redirect from rest.v1.user import app as user_api_v1 from rest.v1.transcripe_and_translate import app as tat_api_v1 from flask_socketio import SocketIO, emit import json from helpers import converter as converter_helper, user as user_helper from flask_cors import CORS, cross_ori...
# https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python # https://www.udemy.com/data-science-supervised-machine-learning-in-python # Decision Tree for continuous-vector input, binary output from __future__ import print_function, division from future.utils import iteritems from builtins im...
import pandas as pd from math import exp def LoopAnchor(df_peak_motif, df_loop): # constants w_ori = 3 w_ctcf = 8.5 lambda_ = 3000000 #### load peak file n = len(df_peak_motif) ctcf = df_peak_motif[['h', 'anchor']].apply(lambda s: s[0] * s[1], axis=1).mean() peak_dict = ...
# 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 t...
# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
import os import sys import re import json import platform try: from pathlib import Path from colorclass import Color from terminaltables import SingleTable import semver except ImportError: print("ERROR: Need to install required modules.") print("python3 -m pip install colorclass terminaltable...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class Encoder(nn.Module): def __init__(self): super(Encoder, self).__init__() # first shared mlp self.conv1 = nn.Conv1d(3, 128, 1) self.conv2 = nn.Conv1d(128, 256, 1) self.bn1 = nn.BatchN...
#!/usr/bin/env python """ Downloads the data for a longitudinal REDCap project, with each event as a separate file. Also allows filtering by standard REDCap logic, so you can, for example, exclude non-enrolled participants from your data. Requires an instrument_download_list_file, which is a CSV file containing the ...
from flask import Flask from flask_bootstrap import Bootstrap from config import config_options # from app import views # from app import error # def create_app(config_name): # app=Flask(__name__) # bootstrap=Bootstrap(app) # app.config.from_object(config_options[config_name]) # from .main import mai...
# -*- coding: utf-8 -*- # # 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 ...
from datetime import datetime from math import floor from django.contrib.auth.mixins import LoginRequiredMixin from django.http import JsonResponse from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic.detail import DetailView from django.views.generic.e...
from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView from django.views.generic.edit import UpdateView from django.views.generic import ListView from django.urls import reverse from myapp.models import Bike class BikeDetailView(DetailView): model = Bike template_n...
from django.urls import path from . import views urlpatterns = [ # path() для страницы регистрации нового пользователя # её полный адрес будет auth/signup/, но префикс auth/ обрабатывется в головном urls.py path("signup/", views.SignUp.as_view(), name="signup"), #login раздел...
"""Various widgets. License: MIT License 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...
""" pv.py Phase Vocoder implementation in Python The MIT License (MIT) Copyright (c) 2015 multivac61 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 limit...
# coding: utf-8 """ Notification API The eBay Notification API enables management of the entire end-to-end eBay notification experience by allowing users to:<ul><li>Browse for supported notification topics and retrieve topic details</li><li>Create, configure, and manage notification destination endpionts</li>...
import tensorflow as tf class TFServer(object): def __init__(self, config): tf.reset_default_graph() self.in_progress = False self.prediction = None self.session = None self.graph = None self.frozen = False self.feed_dict = {} self.output_ops = [] self.input_ops = [] self.model_fp = config.model...
"""Support for DoorBird devices.""" import asyncio import logging import urllib from urllib.error import HTTPError from doorbirdpy import DoorBird import voluptuous as vol from homeassistant.components.http import HomeAssistantView from homeassistant.components.logbook import log_entry from homeassistant.config_entri...
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
""" Mask R-CNN The main Mask R-CNN model implementation. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by Waleed Abdulla """ import os import random import datetime import re import math import logging from collections import OrderedDict import multiprocessing im...
from datetime import datetime import mongoengine as me from unittest import TestCase from bson import objectid from rest_framework_mongoengine.serializers import DocumentSerializer from rest_framework import serializers as s class Job(me.Document): title = me.StringField() status = me.StringField(choices=(...
""" @Description: TextCNN 网络 @Author: 吕明伟 @Date: 2021-4-6 """ from tensorflow.keras import Input, Model from tensorflow.keras.layers import Embedding, Dense, Conv1D, GlobalMaxPooling1D, Concatenate, Dropout class TextCNN(object): def __init__(self, maxlen, max_features, embedding_dims, class_num=5...