content
stringlengths
5
1.05M
""" @author : Hyunwoong @when : 2019-12-06 @homepage : https://github.com/gusdnd852 """ # -*- coding: utf-8 -*- from __future__ import print_function import os import numpy as np from keras.models import load_model from keras.preprocessing import image import matplotlib.pyplot as plt val_path = ...
# -*- coding: utf-8 -*- import json import os import os.path import random import socket # Get basic info from per-tier config file from serverdaemon.utils import get_tier_name, get_tags, get_repository, get_api_key, get_region from serverdaemon.utils import get_battledaemon_credentials, get_battleserver_credentials TI...
from django.contrib import messages from django.shortcuts import redirect, render from django.utils.translation import ugettext_lazy as _ from dof_conf.conference.models import Speaker, ScheduleItem from dof_conf.reservations.forms import ReservationForm def home(request): speakers = Speaker.objects.filter(is_ac...
""" Train agent with DQN method or ensemble with randomized prior functions method. This script should be called from the folder src, where the script is located. The parameters of the training are set in "parameters.py". The parameters of the highway driving environment are set in "parameters_simulation.py". Logfil...
from spaceone.core.error import * class ERROR_NOT_TITLE(ERROR_INVALID_ARGUMENT): _message = 'Title for Event message from AWS SNS is Missing (event = {event})' class ERROR_PARSE_EVENT(ERROR_BASE): _message = 'Failed to parse event (field)' class ERROR_GET_JSON_MESSAGE(ERROR_BASE): _message = 'Failed t...
import pytest import unittest.mock as mock import open_cp.gui.session as session @pytest.fixture def settings(): settings_mock = mock.MagicMock() settings_mock.data = {"theme":"default"} def getitem(self, key): return self.data[key] settings_mock.__getitem__ = getitem def setitem(self, key...
import PyPDF2 pdf = input(r"Enter the path of PDF file: ") n = int(input("Enter number of pages: ")) page = PyPDF2.PdfFileReader(pdf) for i in range(n): st="" st += page.getPage(i).extractText() with open(f'./PDF2Text/text{i}.txt','w') as f: f.write(st)
""" DJANGO MATERIAL WIDGETS TESTS MODELS material_widgets/tests/models.py """ # pylint: disable=too-few-public-methods from django.db import models class MaterialWidgetsForeignKeyTestModel(models.Model): """Secondary test model for ForeignKey.""" item = models.IntegerField() class Meta: """Meta se...
import time import threading import refresh import settings import mod def linker(): cnt = 0 while True: refresh.linksites() try: mod.main() except: pass cnt += 1 print(cnt) time.sleep(settings.refreshtime) def run(): d = thre...
from scipy import stats import numpy as np import matplotlib.pyplot as plt list1=["AnnotatedPDF-1","Remote-1","AnnotationList-1","Canvas-1","LastAnnotation-1","TextSummary-1","Hypothesis-1","AnnotationServer-1","WebAnnotationClient-1","ScienceDirect-1","Hosting-1","Springer-1","ACM-1","DOI-1","Dropbox-1","URL-1","URN-1...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Nov 7, 2015 Don't blink... @author: Juan_Insuasti ''' import sys import datetime import os.path import json from Shared import Logger class DataLogger: def __init__(self, initFile, storage, storageRoute, logPrefix = "", logs = True,logName='Data Logger'...
#!/usr/bin/env python # coding: utf-8 import os import logging import hubblestack.utils.signing as HuS log = logging.getLogger(__name__) __virtualname__ = 'signing' def __virtual__(): return True def msign(*targets, **kw): """ Sign a files and directories. Will overwrite whatever's already in MANIFEST....
# Copyright 2015 PerfKitBenchmarker 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 appli...
# # Copyright 2020 NVIDIA Corporation # # 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 w...
from pygears import GearDone, gear from pygears.typing import Float from .continuous import continuous import multiprocessing as mp from PySpice.Spice.Netlist import Circuit from PySpice.Spice.NgSpice.Shared import NgSpiceShared class PgNgSpice(NgSpiceShared): def __init__(self, qin, qout, x, outs, **kwargs): ...
# How many labels are at max put into the output # ranking, everything else will be cut off LABEL_RANKING_LENGTH = 10
iomapLocation = './template/map.csv'
import sys, os from json import JSONEncoder, loads, dumps from io import BytesIO import requests from flask import request, send_from_directory, make_response from werkzeug.utils import secure_filename from werkzeug.datastructures import FileStorage from urllib3.exceptions import MaxRetryError from minio.error import ...
# 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 the Li...
from torch import nn from modules.identity import Identity __nl_dict__ = {'Tanh': nn.Tanh, 'ReLU': nn.ReLU6, 'ReLU6': nn.ReLU, 'SELU': nn.SELU, 'LeakyReLU': nn.LeakyReLU, 'Sigmoid': nn.Sigmoid} def generate_dw_conv(in_channels, out_channels, ...
#!/usr/bin/env python from setuptools import setup required = [ 'astropy', 'chimenea', # use requirements.txt first. 'click', 'colorlog', 'drive-ami', 'drive-casa', 'simplejson', ] setup( name="amisurvey", version="0.5.1", packages=['amisurvey'], scripts=[ 'bin/am...
# Autogenerated from KST: please remove this line if doing any edits by hand! import unittest from recursive_one import RecursiveOne class TestRecursiveOne(unittest.TestCase): def test_recursive_one(self): with RecursiveOne.from_file('src/fixed_struct.bin') as r: self.assertEqual(r.one, 80) ...
# -*- coding: utf-8 -*- import flask, psycopg2, re from flask import request, json from config import config app = flask.Flask(__name__) @app.route('/', methods=['GET']) def home(): return "<h1>Open Bank API</h1><p></p>" @app.route('/clients/transactions', methods=['GET']) def api_id(): if 'id' in request.a...
# ----------------------------------------------------------------------------- # # Space Invaders # # Controls: # - Left and Right Keys to Move, Space to shoot # # ----------------------------------------------------------------------------- import pygame import sys import time # -------------- Initializa...
import socket, sys from struct import * from beans.PacketBean import Packet from services.LoggerService import logger from services.utils import Utilities from services import InterfaceService class Sniffer(): # first argument specifies communication domain i.e network interface communication_domain = sock...
import os # face_data (directory) represents the path component to be joined. DATASET_PATH = os.path.join(os.getcwd(), 'datasets/default_dataset/') ENCODINGS_PATH = os.path.join(os.getcwd(), 'encodings/encodings.pickle') CLUSTERING_RESULT_PATH = os.path.join(os.getcwd(), 'results/default_result/')
from django.contrib.sessions.serializers import JSONSerializer from hashid_field import Hashid class HashidJSONEncoder(JSONSerializer): def default(self, o): if isinstance(o, Hashid): return str(o) return super().default(o)
import io, nmrML
from eth.constants import ZERO_HASH32 from eth_typing import BLSSignature, Hash32 from eth_utils import humanize_hash import ssz from ssz.sedes import bytes32, bytes96, uint64 from eth2.beacon.constants import EMPTY_SIGNATURE, ZERO_SIGNING_ROOT from eth2.beacon.typing import SigningRoot, Slot from .defaults import de...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stages', '0006_student_supervisor_mentor'), ] operations = [ migrations.AddField( model_name='student', name='expert', field=models.ForeignKey(blank=True...
from dataclasses import dataclass from enum import Enum from fractions import Fraction from math import floor, ceil from typing import Optional, NamedTuple, Dict, Any, List, Tuple from logzero import logger from arbitrageur.items import Item, vendor_price, is_common_ascended_material from arbitrageur.listings import ...
class Contact: def __init__(self, firstname, initials, lastname, nickname, title, company, address, homephone, mobilephone, workphone, fax, email, email2, email3, homepage, bdayoption, bmonthoption, byear, adayoption, amonthoption, ayear, address2, phone2, notes, photopath): ...
from django.urls import path from ..views.professor import QuestionAPI urlpatterns = [ path("course/question/", QuestionAPI.as_view(), name="question_professor_api"), ]
# Open3D: www.open3d.org # The MIT License (MIT) # See license file or visit www.open3d.org for details import numpy as np import argparse import math import sys sys.path.append("../Utility") from open3d import * from common import * from opencv import * from optimize_posegraph import * def register_one_rgbd_pair(s,...
import enum from typing import Any, List, Optional, Tuple class ArmorType(enum.Enum): LIGHT = enum.auto() MEDIUM = enum.auto() HEAVY = enum.auto() def __repr__(self): return '%s.%s' % (self.__class__.__name__, self.name) class Armor: def __init__(self, name: str, armor_class: int, ...
from test_package.test1 import my_func from test_package.test2 import my_func2 __all__ = ['my_func', 'my_func2']
import numpy as np def read(filename): """ Reads in a DepthPic pick file and returns dict that contains the surface number, the speed of sound (m/s), draft, tide and a numpy array of depths in meters ordered by trace number. To convert depths into pixel space use the following equation pixels...
import librosa import librosa.display import os import numpy as np import matplotlib.pyplot as plt import time import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from sklearn import preprocessing import keras from skimage.transform import rescale,...
#!/usr/bin/env python # # Creates a data-object resource and associated data-record. # # The following environmenal variables can/must be defined: # # NUVLA_ENDPOINT: endpoint of Nuvla server, defaults to localhost # NUVLA_USERNAME: username to access Nuvla # NUVLA_PASSWORD: password to access Nuvla # # NUVLA_DATA_BUC...
from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest class AppTestBaseRepr(BaseNumpyAppTest): def test_base3(self): from numpypy import base_repr assert base_repr(3**5, 3) == '100000' def test_positive(self): from numpypy import base_repr assert base_repr(12, 10...
"""Zilch Recorder""" import time import signal try: import zmq except: pass from zilch.utils import loads class Recorder(object): """ZeroMQ Recorder The Recorder by itself has no methodology to record data recieved over ZeroMQ, a ``store`` instance should be provided that implements a ``...
import os import torch from model import NetVLAD, MoCo, NeXtVLAD, LSTMModule, GRUModule, TCA, CTCA import h5py from data import FIVR, FeatureDataset from torch.utils.data import DataLoader, BatchSampler import matplotlib.pyplot as plt from tqdm import tqdm from utils import resize_axis from sklearn.preprocessing impor...
#coding=utf-8 import cksdk from ctypes import * def save_image(): result = cksdk.CameraInit(0) if result[0] != 0: print("open camera failed") return hCamera = result[1] #设置为连续拍照模式 cksdk.CameraSetTriggerMode(hCamera, 0) #开启相机 cksdk.CameraPlay(hCamera) for i in range(10):...
# -*- coding:utf-8 -*- import requests from .ExtractedNoti import * from bs4 import BeautifulSoup from datetime import date from selenium import webdriver from selenium.webdriver.firefox.options import Options import time class NotiFinderElements: def __init__(self): self.attrKeyword = '' self.val...
import tkinter as tk from tkinter import ttk MAIN_FONT = 'Arial' XLARGE_FONT = (MAIN_FONT, 14) LARGE_FONT = (MAIN_FONT, 12) MEDIUM_FONT = (MAIN_FONT, 10) SMALL_FONT = (MAIN_FONT, 8) XSMALL_FONT = (MAIN_FONT, 6) class Page(ttk.Frame): title = '' def __init__(self, master): self.master = master ...
# coding: utf-8 # In[61]: import string import codecs enru = {} with codecs.open('en-ru.txt', 'r', 'utf-8') as f: for line in f: line = line.strip('\n') a = list(line.split('\t-\t')) enru[a[0]] = a[1] with open('input(4).txt', 'r') as q: output = open('output1.txt', 'w') for line...
""" Write a Python program to find the repeated items of a tuple. """ tuplex = 2, 4, 5, 6, 2, 3, 4, 4, 7 print(tuplex) count = tuplex.count(4) print(count)
"""Unit tests for JWTAuthenticator""" import datetime from pathlib import Path import pytest import jwt from karp.errors import ClientErrorCodes from karp.domain.errors import AuthError from karp.infrastructure.jwt.jwt_auth_service import JWTAuthenticator from . import adapters with open(Path(__file__).parent / "....
#! /usr/bin/env python3.6 import argparse import sys import lm_auth import logging from ldap3 import SUBTREE def main(): for ou, origin in lm_auth.ad_ou_tree.items(): if ou == 'all': continue logging.info(f'Get information from Active Directory for {ou}') user_list = get_inform...
from setuptools import setup setup( name="jsonutils", version="0.3.1", packages=['jsonutils', 'jsonutils.lws', 'jsonutils.jbro'], scripts=['jsonutils/bin/jbro'], tests_require=['pytest'], install_requires=[], package_data={}, author='Taro Kuriyama', author_email='taro@tarokuriyama....
from module import AbstractModule from twisted.python import log import json import redis from module_decorators import SkipHandler class TrafficReader(AbstractModule): """ Extension of AbstractModule class used to serialize traffic to a Redis pubsub channel. """ def _get_request_message(self, ht...
import subprocess def ignored_term_in_line(line, ignored_terms): for term in ignored_terms: if term in line: return True return False def process_key(key, preserved_words_dict): key = key.strip().lower() key = replace_separator_in_preserved_words(key, preserved_word...
# @Author : Peizhao Li # @Contact : peizhaoli05@gmail.com import numpy as np from typing import Sequence, Tuple, List from scipy import stats from sklearn.metrics import roc_auc_score, average_precision_score THRE = 0.5 def fair_link_eval( emb: np.ndarray, sensitive: np.ndarray, test_edges_...
import json import time import re import argparse from wikidata_linker_utils.wikipedia import iterate_articles from multiprocessing import Pool CATEGORY_PREFIXES = [ "Category:", "Catégorie:", "Categorie:", "Categoría:", "Categoria:", "Kategorie:", "Kategoria:", "Категория:", "Kat...
''' Gstplayer ========= .. versionadded:: 1.8.0 `GstPlayer` is an media player, implemented specifically for Kivy with Gstreamer 1.0. It doesn't use Gi at all, and are focused to do the work we want: ability to read video and stream the image in a callback, or read audio file. Don't use it directly, use our Core prov...
import torch import torch.utils.data as data import os import pickle5 as pk import matplotlib.pyplot as plt from pathlib import Path import numpy as np from torchvision import transforms as A from tqdm import tqdm, trange from pie_data import PIE class DataSet(data.Dataset): def __init__(self, path, pie_path, da...
import pandas as pd import pickle import time pd.options.mode.chained_assignment = None # default='warn' pd.options.display.max_columns = None pd.set_option('expand_frame_repr', False) def perform_processing( gt, temperature: pd.DataFrame, target_temperature: pd.DataFrame, valve_leve...
# -*- coding: utf-8 -*- # vim: set ts=4 # # Copyright 2019 Linaro Limited # # Author: Rémi Duraffort <remi.duraffort@linaro.org> # # SPDX-License-Identifier: MIT # fail after 10 minutes DOWNLOAD_TIMEOUT = 10 * 60 # See https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html DOWNLOAD_RETRY = 15 # A backoff...
import time from threading import Thread from rpyc.utils.registry import TCPRegistryServer, TCPRegistryClient from rpyc.utils.registry import UDPRegistryServer, UDPRegistryClient PRUNING_TIMEOUT = 5 class BaseRegistryTest(object): def _get_server(self): raise NotImplementedError def _get_client(se...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
"timing tests on short and long switch functions" import bswitch, time VALS = [1,3,2,10,12,16,42,100,8,7,9,60,61,62,63,66,1000] def flong(x): if x == 1: return x elif x == 3: return x elif x ==2: return x elif x == 10: return x elif x == 12: return x elif x == 16: return x elif x == 42: return x elif...
from setuptools import setup with open('README.md', 'r') as description: long_description = description.read() setup( name='markdown-alerts', version='0.1', author='gd', description='Python-Markdown Admonition alternative.', long_description=long_description, long_description_content_type...
from allennlp.data.dataset_readers.universal_dependencies import UniversalDependenciesDatasetReader from allennlp.models.biaffine_dependency_parser import BiaffineDependencyParser from allennlp.models.crf_tagger import CrfTagger from allennlp.models.esim import ESIM from allennlp.models.simple_tagger import SimpleTagge...
import sys import rospy import rosbag from ff_msgs.msg import FaultState from ff_msgs.msg import Fault def process(msg, start): for f in msg.faults: # Fault 21 is perching arm node missing --> ignore if f.id != 21: elapsed = f.time_of_fault - start print("secs_from_start=%...
from nba_py import _api_scrape, _get_json from nba_py.constants import * class ShotChart: _endpoint = 'shotchartdetail' def __init__(self, player_id, team_id=TeamID.Default, game_id=GameID.Default, league_id=League.Default, s...
class UnionFind: def __init__(self, grid): m, n = len(grid), len(grid[0]) self.count = 0 self.parent = [-1] * (m*n) self.rank = [0] * (m*n) for i in range(m): for j in range(n): if grid[i][j] == '1': self.parent[i*n + j] = i*n ...
from classify.scenario.bridge import HealthyDamage from classify.scenario.traffic import heavy_traffic_1, normal_traffic from config import Config from fem.run.opensees import OSRunner from model.response import ResponseType from model.scenario import to_traffic from plot.animate.traffic import animate_traffic_top_view...
from django.shortcuts import render, get_object_or_404,redirect from rest_framework import viewsets from .serializers import GameSerializer from .models import Game from .forms import GameForm def overview(request): #games = Game.objects.filter(published_date__lte=timezone.now()).order_by('published_date') ...
#!/usr/bin/env python3 # ----- ---- --- -- - # Copyright 2019 Oneiro NA, Inc. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https:...
import logging import random import re import shutil import string import subprocess from pathlib import Path from dotsecrets.clean import load_all_filters, get_clean_filter from dotsecrets.smudge import (load_all_secrets, get_smudge_filter, smudge_stream)...
from autobahn.twisted.component import Component from twisted.internet.defer import inlineCallbacks, Deferred from twisted.internet.endpoints import TCP4ServerEndpoint from twisted.web.server import Site from twisted.internet.task import react # pip install klein from klein import Klein class WebApplication(object)...
import Start as st import Source as s import json import os start = st.Start() start.render() sources = [] print("Write \"help\" in order to view all commands") running = True while(running): command = input('> ').lower() #shows all commands if(command == 'help' or command == 'h'): print("""..::...
from ..restful import RestfulConnectorBase from ...utils import sub_dict class Connector(RestfulConnectorBase): @classmethod def role_description(cls): return "Connector for Eaton DCIM." async def fetch_data(self, client, entities): r = await client.post("/mtemplates/resources/v3/list", ...
import threading import shutil import random from mock import Mock import time from unittest import TestCase import os import requests from samcli.local.lambda_service.local_lambda_invoke_service import LocalLambdaInvokeService from tests.functional.function_code import nodejs_lambda, HELLO_FROM_LAMBDA, ECHO_CODE, TH...
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # import numpy from pyscf import lib from pyscf.dft import numint, gen_grid ''' Gaussian cube file format ''' def density(mol, outfile, dm, nx=80, ny=80, nz=80): coord = mol.atom_coords() box = numpy.max(coord,axis=0) - numpy.min(coord,axis=...
from django.apps import AppConfig class MonsterapiConfig(AppConfig): name = 'monsterapi'
from django.db import models from django.db.models.fields import DateField from django.db.models.signals import pre_save, post_save from core.utils.constants import Constants MES = ( ('Jan', 'Janeiro'), ('Feb', 'Fevereiro'), ('Mar', 'Março'), ('Apr', 'Abril'), ('May', 'Maio'), ('Jun', 'Junho')...
import os import time import sys total = len(sys.argv) if (total < 2): print ("Usage: python cygwin_player_launcher.py <ICN_ENDPOINT> [MACHINE_USERNAME default: ccnx] [PLAYER_ID default: 1]") sys.exit(1) icn_endpoint = "" try: icn_endpoint = sys.argv[1]# Param 1 print "ICN endpoint set to: " + icn_end...
# -------------------------------------------------------- # Tensorflow iCAN # Licensed under The MIT License [see LICENSE for details] # Written by Chen Gao, based on code from Zheqi he and Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import from __future__ i...
# Generated by Django 3.0.3 on 2021-09-15 09:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workspaces', '0016_configuration_employee_field_mapping'), ] operations = [ migrations.AddField( model_name='configuration', ...
# Panther is a scalable, powerful, cloud-native SIEM written in Golang/React. # Copyright (C) 2020 Panther Labs Inc # # 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 the Free Software Foundation, either version 3 of t...
"""Load and link .pytd files.""" import logging import os from pytype import utils from pytype.pytd import utils as pytd_utils from pytype.pytd.parse import builtins from pytype.pytd.parse import visitors log = logging.getLogger(__name__) class Module(object): """Represents a parsed module. Attributes: m...
from __future__ import division from models import * from utils.utils import * from utils.datasets import * import os import sys import time import datetime import argparse from PIL import Image import torch from torch.utils.data import DataLoader from torchvision import datasets from torch.autograd import Variable...
# Copyright (c) 2017, IGLU consortium # 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 retain the above copyright notice, # this list of conditions ...
from .cursor import hide, show, HiddenCursor __all__ = ["hide", "show", "HiddenCursor"]
from .utils import remove_from_list, merge_lists from .loader import * def debug ( *unargs,**args ): print() for arg in args: if arg != 'pause': print('\t', arg,': ', args[arg], sep= '') for arg in unargs: print('\t', arg, sep= '') if 'pause' in args: input() clas...
"""Tests for the REST API.""" from datetime import datetime from concurrent.futures import Future import json import re import sys from unittest import mock from urllib.parse import urlparse, quote import uuid from async_generator import async_generator, yield_ from pytest import mark from tornado import gen import ...
from pymks.tools import draw_concentrations from scipy.io import loadmat micros = loadmat('data_more_step_4000.mat')['data'] for m in micros: draw_concentrations(m[None])
# --------------------------------------------------------------- Imports ---------------------------------------------------------------- # # System from enum import Enum # ---------------------------------------------------------------------------------------------------------------------------------------- # # ...
from dragonfly import Grammar, FuncContext from castervoice.lib.context import AppContext from castervoice.lib.ctrl.mgr.rule_maker.base_rule_maker import BaseRuleMaker class MappingRuleMaker(BaseRuleMaker): """ Creates a MappingRule instance from the rule's class and a RuleDetails object, then runs all tr...
""" @created_at 2015-05-16 @author Exequiel Fuentes Lettura <efulet@gmail.com> """
import factory from ietf.doc.models import Document, DocEvent, NewRevisionDocEvent, DocAlias, State, DocumentAuthor def draft_name_generator(type_id,group,n): return '%s-%s-%s-%s%d'%( type_id, 'bogusperson', group.acronym if group else 'netherwhere', 'm...
from typing import Dict, Text, Any, List, Union, Optional from rasa_sdk import Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk import Action from rasa_sdk.forms import FormAction class TripplanForm(FormAction): def name(self): return "trip_plan_form" def required_slots(self,tracker) ...
class Mycylinder: def __init__(self, myweight): self.myweight = myweight def __add__(self, other): return self.myweight + other.myweight myobj1 = Mycylinder(9) myobj2 = Mycylinder(14) print(myobj1 + myobj2)
from flask import Blueprint, render_template from functools import wraps from werkzeug.exceptions import abort from bisellium.lib.api_clients.ludus import LudusAPI from bisellium.lib.api_clients.exceptions import APIEndpointException bp = Blueprint("gladiatores", __name__) def api_call(func): @wraps(func) ...
"""logout tests""" from django.urls import reverse from authentik.core.tests.utils import create_test_admin_user, create_test_flow from authentik.flows.markers import StageMarker from authentik.flows.models import FlowDesignation, FlowStageBinding from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER, FlowPlan...
import os import ast import asyncio from distutils.util import strtobool import importlib import sys import types import logging from configparser import ConfigParser from pathlib import Path from dotenv import load_dotenv import redis from redis.exceptions import ( ConnectionError, RedisError, TimeoutError...
''' This file provides a wrapper class for Fast_AT (https://github.com/locuslab/fast_adversarial) model for CIFAR-10 dataset. ''' import sys import os import torch import torch.nn as nn import torch.nn.functional as F import tensorflow as tf from ares.model.pytorch_wrapper import pytorch_classifier_with_logits from ...
# -*- coding: utf-8 -*- from os import sys from os import getenv import argparse from foxha import __version__ from .print_format import print_warning from .query import Query from .utils import Utils from . import formatter from . import connection # Initializing global constants CIPHER_SUITE = None LOGGER = None CO...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-11-07 11:24 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('partner', '0085_auto_20181106_0852'), ('agency', '0013_auto_20180612_0625'), ('exte...