text
stringlengths
2
999k
from __future__ import print_function import os import subprocess import time import socket import argparse import random import uuid import base64 import hashlib import urllib import tornado.web import tornado.websocket import tornado.ioloop import tornado.options import tornado.httpserver import tornado.gen import ...
# Copyright 2013 NEC Corporation # 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 ...
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Ingredient from recipe.serializers import IngredientSerializer INGREDIENTS_URL = reverse('recipe:ingredien...
#!/usr/bin/python3 -i # # Copyright 2013-2022 The Khronos Group Inc. # # SPDX-License-Identifier: Apache-2.0 """Types and classes for manipulating an API registry.""" import copy import re import sys import xml.etree.ElementTree as etree from collections import defaultdict, deque, namedtuple from generator import Out...
from setuptools import find_namespace_packages, setup setup( name="metadefender-scan", description="Command line tool which allows to send files to MetaDefender server and fetch scannig results.", author="mkot02", url="https://github.com/mkot02/metadefender_scan", version="0.1.0", packa...
from django.urls import path from . import views urlpatterns = [ path('login/', views.loginUser, name='login'), path('home/', views.home, name='home'), path('logout/', views.logoutUser, name='logout'), ]
"""Common dependencies for rules_proto_grpc grpc-gateway rules.""" load( "//:repositories.bzl", "bazel_gazelle", "grpc_ecosystem_grpc_gateway", "io_bazel_rules_go", "rules_proto_grpc_repos", ) load("@bazel_gazelle//:deps.bzl", "go_repository") def gateway_repos(**kwargs): # buildifier: disable=fu...
import sys sys.path.append('../') import numpy as np import math import copy import os from circuits.elements import ele_C, ele_L from IS.IS import IS_0 from IS.IS_criteria import cal_ChiSquare_0 from utils.file_utils.pickle_utils import pickle_file from utils.visualize_utils.IS_plots.ny import nyquist_multiPlots_1, n...
from ninja import NinjaAPI api = NinjaAPI(title="product-shop")
# Copyright 2018 The TensorFlow Hub 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 app...
import numpy as np import pandas as pd from pandas_datareader import data import matplotlib.pyplot as plt def load_data(ticker, start_date, end_date, output_file): """ a data loading function, using the Yahoo Finance API """ try: df = pd.read_pickle(output_file) print('found Data file ....
"""mBuild atom library for tetravalent nitrogen.""" import numpy as np import mbuild as mb class N4(mb.Compound): """A tetravalent nitrogen atom.""" def __init__(self): super(N4, self).__init__() self.add( mb.Particle(name="N", pos=[0, 0, 0], element="N"), label="N[$]" ) ...
from operator import le, gt from typing import Callable, List, Mapping, Optional, Tuple import numpy as np from bartpy.errors import NoSplittableVariableException, NoPrunableNodeException from bartpy.mutation import TreeMutation, GrowMutation, PruneMutation from bartpy.node import LeafNode, DecisionNode, split_node f...
from __future__ import unicode_literals from itertools import chain import re import six from six.moves.urllib.parse import urlparse from xml.sax.saxutils import unescape from bleach import html5lib_shim from bleach.utils import alphabetize_attributes, force_unicode #: List of allowed tags ALLOWED_TAGS = [ 'a'...
import pickle from springfield import Entity, fields from springfield.timeutil import utcnow class SampleEntity(Entity): id = fields.IntField() name = fields.StringField() slug = fields.StringField() url = fields.UrlField() bool = fields.BooleanField() entity = fields.EntityField('self') co...
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
import threading from .file_updater import FileUpdater, UpdatePromise class AsyncUpdatePromise(UpdatePromise, threading.Thread): """A thread that runs the file update in the background""" def __init__(self, file_updater: FileUpdater, file_name: str) -> None: super().__init__() self._file_nam...
request_headers = ['Accept', 'Accept-Charset', 'Accept-Encoding', 'Accept-Language', 'Accept-Datetime', 'Access-Control-Request-Method', 'Access-Control-Request-Headers', 'Authorization',...
#!/usr/bin/env python3 import xml import urllib.request import xml.etree.ElementTree as ET BLOG_URL = "http://www.xkyle.com" RSS_URL = f"{BLOG_URL}/index.xml" def get_blog_rssxml(): with urllib.request.urlopen(RSS_URL) as response: return response.read() def print_blog_posts(): rssxml = get_blog_rs...
from make import make
# Future Imports for py2/3 backwards compat. from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import object from nexpose.nexpose import NexposeSession, NexposeConnectionException from nexpose.xml_utils import as_xml from future import standard_li...
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # 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 derivative wo...
import numpy as np from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid from bokeh.models.glyphs import Bezier from bokeh.io import curdoc, show N = 9 x = np.linspace(-2, 2, N) y = x**2 source = ColumnDataSource(dict( x=x, y=y, xp02=x+0.4, xp01=x+0.1, xm01=x-0.1, ...
############################################################## # # Example script demonstrating clipping paths # # Export the diagram via commandline: # >>> py -m pinout.manager -e pinout_diagram.py diagram.svg # ############################################################## from pinout.core import Circle, Group, Ima...
from __future__ import with_statement import logging from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config...
# # Copyright 2008 the Melange 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 agreed to i...
import re from steps.abstractstep import * class CheckDeleteRuleInDbmlStep( AbstractStep ): def __init__( self, dbml ): AbstractStep.__init__( self, "Check Delete Rule In Dbml" ) self.__dbml = dbml def build( self ): f = open( self.__dbml, 'r' ) content = f.read() f.cl...
import base64 from abc import ABCMeta, abstractmethod from enum import IntEnum from typing import List, Union, Dict, Optional, TypeVar, TYPE_CHECKING, Type, Callable import dataclasses from aenum import Enum, MultiValue from dataclasses import dataclass from cose.attributes.algorithms import CoseAlgorithms, CoseEllip...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test merkleblock fetch/validation # from test_framework.test_framework import BitcoinTestFramework f...
import logging import time import threading import scpidev FORMAT = "%(levelname)s: %(message)s" logging.basicConfig(format=FORMAT, level=logging.DEBUG) # logging.basicConfig(format=FORMAT, level=logging.INFO) # Define our callback functions def test_function(*args, **kwargs): print("## Execute. ##") i = 0 ...
# Author: b1tank # Email: b1tank@outlook.com #================================= ''' 102_binary_tree_level_order_traversal on LeetCode Solution: - BFS using deque ''' from collections import deque # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = ...
import os import cv2 import dlib import numpy as np import argparse import inception_resnet_v1 import tensorflow as tf from imutils.face_utils import FaceAligner from imutils.face_utils import rect_to_bb def get_args(): parser = argparse.ArgumentParser(description="This script detects faces from web cam input, " ...
from tree import * if __name__=='__main__': dogs = getDogData() #Testing '''#for dog in dogs: # print(dog) genders = getAlphabet(dogs, DOG_GENDER) e = getEntropy(getColumn(dogs, DOG_GENDER), genders) print(e) #print(genders) breeds = getAlphabet(dogs, BREED) e = getEntropy...
from Crypto.Cipher import AES import base64 iv = '1' * 16 class AESCipher: def __init__( self, key, mode ): self.key = key self.mode = mode def encrypt( self, raw ): cipher = AES.new( self.key, self.mode, iv ) return base64.b64encode( iv + cipher.encrypt( raw ) ) def de...
#!/usr/bin/env python3 import requests from requests.auth import HTTPBasicAuth target = 'http://target:5984' command = '"id > /tmp/success"' version = 1 session = requests.session() session.headers = { 'Content-Type': 'application/json' } # session.proxies = { # 'http': 'http://127.0.0.1:8085' # } session.put...
#! /usr/bin/python2 import pefile import os import array import math import pickle from sklearn.externals import joblib import sys import argparse def get_entropy(data): if len(data) == 0: return 0.0 occurences = array.array('L', [0]*256) for x in data: occurences[x if isinstance(x, int) el...
# coding: utf-8 """ FINBOURNE Drive API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.1.185 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ import six class OpenApiException(Exception): """The base exception class for all OpenAPIExc...
# Generated by Django 2.1.2 on 2018-10-03 09:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('textis', '0001_initial'), ] operations = [ migrations.CreateModel( name='Syllables', fields=[ ('id',...
import gensim import numpy as np from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils import to_categorical from keras.layers import Embedding from keras.layers import Input, Dense, Bidirectional, LSTM, Activation, MaxPooling1D, Conv1D, Dropout, Embeddin...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: anaalmonte """ import io from typing import Tuple, Union class Parser: """ Base Class for Parsing Algorithms """ def __init__(self, filename: str): """ Initialization to be shared by all inherited classes # ...
# Copyright (C) 2017 MinLab Ltd. from __future__ import print_function import json import os import urllib2 import socket def simplify(obj): keys = getattr(obj,'__slots__',None) or getattr(obj,'__dict__',None) if keys == None: return obj return {key: simplify(getattr(obj, key)) for key in keys} ...
"""Support for Rheem EcoNet water heaters.""" import logging from pyeconet.equipment import EquipmentType from pyeconet.equipment.water_heater import WaterHeaterOperationMode from homeassistant.components.water_heater import ( STATE_ECO, STATE_ELECTRIC, STATE_GAS, STATE_HEAT_PUMP, STATE_HIGH_DEMAN...
# encoding: utf-8 """ environment.py Created by Thomas Mangin on 2011-11-29. Copyright (c) 2011-2015 Exa Networks. All rights reserved. """ # XXX: raised exception not caught # XXX: reloading mid-program not possible # XXX: validation for path, file, etc not correctly test (ie surely buggy) import os import sys imp...
# Copyright 2019 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 applica...
""" https://www.codewars.com/kata/5a15a4db06d5b6d33c000018/train/python Sum of a nested list Implement a function to calculate the sum of the numerical values in a nested list. For example : sum_nested([1, [2, [3, [4]]]]) -> 10 """ def sum_nested(lst): if isinstance(lst, int): return lst return sum...
# -*- 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...
"""The base command.""" from abc import ABCMeta, abstractmethod from pathlib import Path class Command(metaclass=ABCMeta): ''' A base command''' def __init__(self, options, *args, **kwargs): self.options = options self.bundle_id = self.options['<bundle_id>'] self.args = args ...
import os import random import torch from PIL import Image from torch.utils import data class CelebA(data.Dataset): """Dataset class for the CelebA dataset.""" def __init__(self, image_dir, selected_attrs, transform, mode): """Initialize and preprocess the CelebA dataset.""" self.image_dir = ...
def chromosoneCheck(sperm): """ chromosome_check == PEP8 (forced mixedCase by Codewars) Spelling mistake courtesy of Codewars as well """ return "Congratulations! You're going to have a {}.".format( 'son' if 'Y' in sperm else 'daughter' )
# Copyright 2015-2016 Stanford University # # 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 ...
import json import os.path import pytest from fixture.application import Application import importlib fixture = None target = None @pytest.fixture def app(request): global fixture global target browser = request.config.getoption("--browser") if target is None: config_file = os.path.join(os.pat...
def makeCpGLocationDict(CpGLocationFileName): # Make a dictionary that maps Illumina IDs to CpG Locations CpGLocationFile = open(CpGLocationFileName) CpGToLocationDict = {} for line in CpGLocationFile: # Iterate through the lines of the CpG file and enter the location for the CpG on each line in the file ...
#from django.shortcuts import render from django.http import JsonResponse from django.views.decorators.http import require_GET from .models import District def district_model2dict(district): """ convert a district record to a dict """ return dict(code=district.code, name=district.name, parent=district...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018-2019 Snowflake Computing Inc. All right reserved. # import logging from threading import Lock logger = logging.getLogger(__name__) class TelemetryField(object): """ Fields which can be logged to telemetry """ TIME_CONSUME_FIRST_RESU...
# # 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 us...
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
"""Download files with progress indicators. """ import email.message import logging import mimetypes import os from typing import Iterable, Optional, Tuple from pip._vendor.requests.models import CONTENT_CHUNK_SIZE, Response from pip._internal.cli.progress_bars import get_download_progress_renderer from pip._internal...
import boto3 s3 = boto3.resource('s3') source_bucket = 'aii-pipeline'j:q copy_source = { 'Bucket': 'aii-pipeline', 'Key': 'mykey' } s3.meta.client.copy(copy_source, 'otherbucket', 'otherkey')
# File: radio_autoencoder.py # Brief: Simulates a radio link over AWGN channel for Uncoded, Hamming # coded and Neural network autoencoded radio links. # Reproduces the results obtained in # "An Introduction to Deep Learning for the Physical Layer", # Timothy J. O'Shea, Jakob Hoydis...
import logging logger = logging.getLogger('aiohttp_json_rpc.protocol') class classproperty(object): def __init__(self, fget): self.fget = fget def __get__(self, owner_self, owner_cls): return self.fget(owner_cls) class RpcError(Exception): MESSAGE = '' ERROR_CODE = None _lookup...
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, Allegro.pl, Facebook Inc. and the HuggingFace Inc. team. # # 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://ww...
import xml.etree.ElementTree as ET from os import getcwd import sys,os sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test')] classes = ["gun","nata","umbrella"] if len(sys.argv) > 1: classes = sys.argv[1:] with open('model_data/voc_classes.txt','w') as f: f.write('\n'.join(classes)) def...
# -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com> # # Copyright (c) 2017 Tom Kralidis # Copyright (c) 2016 James F. Dickens # Copyright (c) 2017 Ricardo Garcia Sil...
# # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 Raphael Michel and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by ...
# convert shapefile to specified CRS, where a CRS is indicated in EPSG format import os import sys args = sys.argv def err(m): print("Error: " + m); sys.exit(1) dst_EPSG = 32609 # default CRS: EPSG 32609 if len(args) < 2: err("python3 shapefile_enforce_crs.py [input shapefile] [optional argument: destinatio...
import boto3 from pythiam.lib.decorators import boto3_client class IAMManager(object): def __init__(self): self._client = None @property def client(self): if self._client is None: self._client = boto3.client('iam') return self._client def user_exists(self, user_na...
from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient from azure.cognitiveservices.vision.customvision.training.models import ImageFileCreateEntry from pathlib import Path ENDPOINT = "https://YOURCOGNITIVESRVICESNAME.cognitiveservices.azure.com/" training_key = "YOURTRAININGID" tr...
import testUtils import p2p_test_peers import random import time import copy import threading from core_symbol import CORE_SYMBOL class StressNetwork: speeds=[1,5,10,30,60,100,500] sec=10 maxthreads=100 trList=[] def maxIndex(self): return len(self.speeds) def randAcctName(self): ...
import tensorflow as tf import numpy as np from colored import fg, bg, stylize from .const import EPSILON import math import networkx as nx TARGET_CHAR_WIDTH = 80 def hr_text(text): t_len = len(text) + 2 pad_len = (TARGET_CHAR_WIDTH - t_len) // 2 padding = '-'.join(["" for i in range(pad_len)]) s = padding + ...
#!/usr/bin/env python #coding=utf-8 from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.exceptions import ClientException from aliyunsdkcore.acs_exception.exceptions import ServerException from aliyunsdkiot.request.v20180120.QueryDeviceGroupTagListRequest import QueryDeviceGroupTagListRequest ...
import cv2 import os import time goz_bulma = False bekleme = 5 yakınlık = 150 face_cascade = cv2.CascadeClassifier('haarcascade_face.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') def seslendir(): os.system("say Merhabalar! Sizi görebiliyorum. Sesim Var! projesi konuşma engellilere ses sağlamak...
# model settings model = dict( type='Recognizer2D', backbone=dict( type='ResNet', pretrained='torchvision://resnet50', depth=50, norm_eval=False), cls_head=dict( type='TSNHead', num_classes=339, in_channels=2048, spatial_type='avg', con...
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 233628351 """ """ random actions, total chaos """ board = gamma_new(4, 4, 2, 5) assert board is...
from setuptools import setup, find_packages version = {} with open("plasmid_assessor/version.py") as fp: exec(fp.read(), version) setup( name="plasmid_assessor", version=version["__version__"], author="Peter Vegh", author_email="egf-software@ed.ac.uk", description="Plasmid assessment for Golde...
from selenium import webdriver import time import unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__))) #import HtmlTestRunner import HTMLTestRunner from SampleProject.Page.loginPage import LoginPage from SampleProject.Page.homePage import HomePage class LoginTest(unittest.T...
# -*- coding: utf-8 -*- """ Created on Thu Dec 10 13:57:10 2020 @author: Philipe_Leal """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import os, sys import geopandas as gpd import cartopy.crs as ccrs pd.set_option('display.max_rows', 5000) pd.set_option('display.max_columns', 5000) import ...
class Solution: def cellsInRange(self, s: str) -> List[str]: alphabet = [c for c in string.ascii_uppercase] digit = [str(i) for i in range(1, 10)] from_row = alphabet.index(s[0]) from_col = digit.index(s[1]) to_row = alphabet.index(s[3]) to_col = digit.index(s[4]) ...
import argparse import os import threading from sklearn.model_selection import KFold if not os.path.exists('tmp'): os.makedirs('tmp') if not os.path.exists('tmp_sh'): os.makedirs('tmp_sh') if not os.path.exists('outputs'): os.makedirs('outputs') if not os.path.exists('models'): os.makedirs('models') i...
# Copyright (c) 2019 PaddlePaddle 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 appl...
import torch import gym import random import numpy as np torch.backends.cudnn.deterministic=True class Environment: def __init__(self, render=False, seed=None): self.render = render self.env_seed = seed def set_seed(self): if self.env_seed is not None: self.env.seed(self...
# -*- coding: utf-8 -*- """ Created on Wed Dec 16 09:20:41 2020 @author: wantysal """ import sys sys.path.append('../../..') #Standard imports import numpy as np import pytest # Local application imports from mosqito.functions.shared.load import load from mosqito.functions.sharpness.comp_sharpness import comp_sharp...
from app.model.models import User from flask import Flask import json from app.model.models import Parcel, User from tests.test_base import TestsStart class TestAuth(TestsStart): def signup_user(self, fullname, username, email, phone_number, password): """ Method to define user registration detai...
#!/usr/bin/env python3 """ This file calculates various feature statistics for a list of game titles. From the results it can be decided, which features in the titles are should be considered in a linking process and which are corner cases not to be considered. """ import json import click from re import escape from ...
import random from random import randrange template = '''#!/bin/sh # Job name #$ -N %(hd)s%(label)s%(a)s # Shell #$ -S /bin/bash mkdir %(DATA)s cd data.$JOB_ID export GRAPHITE_ROOT=%(CSCRATCHS)s export BENCHMARKS_ROOT=%(CSCRATCH)s ln -s %(CSCRATCH)s sniper ./sniper/run-sniper -s mytrace:stats.out -g --scheduler/type=...
import graphene from django.db.utils import IntegrityError from django.utils.translation import ugettext_lazy as _ from graphene_django.types import DjangoObjectType from graphql import GraphQLError from graphql_jwt.decorators import login_required from .consts import SERVICE_TYPES from .models import Service class ...
import numpy as np from pymodaq.daq_utils.gui_utils.custom_app import CustomApp from pymodaq.daq_utils.gui_utils.dock import Dock, DockArea from pymodaq.daq_utils.gui_utils.file_io import select_file from pymodaq.daq_utils.gui_utils.widgets.table import TableModel, SpinBoxDelegate from qtpy import QtWidgets, QtCore, Q...
import sys import argparse import readline from env import * from mal_types import * import core import reader import printer import utils class ItemNotCallable(Exception): pass # Instantiate core function Env initial_repl_env = Env() core.import_core_functions(initial_repl_env) def READ(program): return re...
# generated by datamodel-codegen: # filename: testapi4.yaml # timestamp: 2022-02-10T13:42:58+00:00 from __future__ import annotations from enum import Enum from typing import Any, Dict, List, Optional, Union from openapi_server.models.base_model_ import Model class AnyOfobjectobject(Model): __root__: Unio...
""" Django settings for flamesproject project. Generated by 'django-admin startproject' using Django 3.2.6. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from p...
#!/usr/bin/python # -*- coding: utf-8 -*- # FUNDAHOG - Django 1.4 - Python 2.7.3 # Universidad Católica Andrés Bello Guayana # Desarrollado por José Cols - josecolsg@gmail.com - @josecols - (0414)8530463 from django import forms from portal.models import Evento, Seccion, Imagen, Categoria, Libro, \ Programa, Mens...
# coding: utf-8 """ Cloudsmith API The API to the Cloudsmith Service OpenAPI spec version: v1 Contact: support@cloudsmith.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class PackagesValidateuploadP2(objec...
import lru import requests from client_sdk_python.utils.caching import ( generate_cache_key, ) def _remove_session(key, session): session.close() _session_cache = lru.LRU(8, callback=_remove_session) def _get_session(*args, **kwargs): cache_key = generate_cache_key((args, kwargs)) if cache_key no...
# -*- coding:utf-8 -*- # Copyright xmuspeech (Author: Snowdar 2020-02-20) import math import logging import numpy as np import progressbar from torch.utils.data import DataLoader from torch.optim.optimizer import Optimizer from .reporter import LRFinderReporter import libs.support.utils as utils # Wrap stderr befo...
import os import curses import textwrap import random import AppCommon COLOR_MENU = None COLOR_BODY = None COLOR_BLOCKTEXT = None SCREEN_CURRENT = None OBJ_TOPBAR = None OBJ_BOTTOMBAR = None def renderTopBar(stdscr): global OBJ_TOPBAR height, width = stdscr.getmaxyx() authorTag = "(C) 2016 ...
from os import sep from equipment.framework.Mail.Email.Email import Email from equipment.framework.Mail.Email.EmailFactory import EmailFactory from jinja2 import Environment, FileSystemLoader, select_autoescape from jinja_markdown import MarkdownExtension from premailer import transform from html2text import html2text ...
from model.group import Group from random import randrange def test_modify_group_name(app): # предусловия (если нет ни одной группы то создаем группу) if app.group.count() == 0: app.group.create(Group(name="test")) old_groups = app.group.get_group_list() # добавляем случайность, генерируется це...
from resources.base import NeutronResource # from neutronclient.v2_0 import client class Networks(NeutronResource): def __init__(self, options): super(Networks, self).__init__(options) try: self.data = self.nc.list_networks(tenant_id=self.options.tenant_id) self.data = sel...
from flask import Blueprint from flask import render_template from flask import request from flask import flash from flask import redirect from flask import url_for from flask_login import login_user from flask_login import logout_user from emr.extensions import login_manager from emr.extensions import db from .forms...
# This file is for backward compatibility. # Module wrappers for empty tensor have been moved to mmcv.cnn.bricks. import warnings from ..cnn.bricks.wrappers import Conv2d, ConvTranspose2d, Linear, MaxPool2d class Conv2d_deprecated(Conv2d): def __init__(*args, **kwargs): super().__init__(*args, **kwargs)...
import time from django.contrib.auth.models import User from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium import webdriver from seleniumlogin import force_login from ..models import NewsPost class Test_Functionnal_App_Main_News(StaticLiveServerTestCase): """Test for read a ne...