text
stringlengths
2
999k
import base64 import functools import json from klein import Klein from twisted.internet import defer from paradrop.base import nexus from paradrop.base.output import out from paradrop.core.agent.http import PDServerRequest from paradrop.core.auth.user import User from paradrop.core.chute.chute_storage import ChuteSt...
""" disnake.ext.commands ~~~~~~~~~~~~~~~~~~~~~ An extension module to facilitate creation of bot commands. :copyright: (c) 2015-present Rapptz :license: MIT, see LICENSE for more details. """ from .bot import * from .context import * from .core import * from .base_core import * from .slash_core import * from .ctx_me...
import urllib.request import random from bs4 import BeautifulSoup from requests import get import mysql.connector conn = mysql.connector.connect(user="root", passwd="",host="localhost", database="product") cursor = conn.cursor() sql = """INSERT INTO oilymoist (image, name, price, rating) VALUES (%s, %s, %s, %s)""" ...
#!/usr/bin/env python """Upload a set of next-gen sequencing data files to a data library in Galaxy. Usage: upload_to_galaxy.py <config file> <flowcell directory> <analysis output dir> [<YAML run information>] The optional <YAML run information> file specifies details about the flowcell la...
import numpy as np brand_color = { 'ASUS': '#696969', 'Acer': '#4d9c49', 'Lenovo': '#ff1805', 'Apple': '#000000', 'Surface': '#003dbd', 'MSI': '#ff7589', 'HP': '#9ed3ff', 'Dell': '#1a97ff', 'TOSHIBA': '#d1002a', 'Gigabyte': '#060094', 'CJS': '#7a000f', 'Sony': '#5100b8',...
# coding: utf-8 """ Pure Storage FlashBlade REST 1.6 Python SDK Pure Storage FlashBlade REST 1.6 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.6 Contact: i...
import unittest from cbs.utils import as_bool, as_list, as_tuple class UtilsEnv(unittest.TestCase): def test_as_bool(self): yes = ('Y', 'yes', 'ON', 't', 'TrUe', '1', True) no = ('N', 'no', 'OFF', 'f', 'FaLsE', '0', False) for value in yes: self.assertTrue(as_bool(value)) ...
import os import torch from detecto.core import Model, Dataset from detecto.utils import xml_to_csv, read_image def get_dataset(**kwargs): path = os.path.dirname(__file__) input_folder = os.path.join(path, 'static') labels_path = os.path.join(path, 'static/labels.csv') xml_to_csv(input_folder, label...
# Copyright (c) OpenMMLab. All rights reserved. from __future__ import division import argparse import copy import os import time import warnings from os import path as osp import mmcv import torch import torch.distributed as dist from mmcv import Config, DictAction from mmcv.runner import get_dist_info, init_dist fr...
ARGS_TO_SCRIPT = ( "python >/dev/null /c/Users/Matt/dotfiles/dotbot/bin/dotbot -d /c/Users/Matt/dotfiles -c install.conf.yaml" ) # These arguments are only linux/ bash safe """Script port from /c/Users/Matt/dotfiles/dotbot/bin/dotbot""" import sys, os DOTFILE_DIR = os.path.normpath(os.path.expandvars("%USERPRO...
import unittest from pathlib import Path from unittest.mock import patch, MagicMock import pandas as pd from bazema_linker.utils.file_io import FileReader, FileWriter class TestFileReader(unittest.TestCase): """ Unit tests of file utils """ def test_reader_constructor(self): file_reader = F...
from django.core.exceptions import ImproperlyConfigured import pytest from pretix_eth.network.tokens import IToken from pretix_eth.network import helpers def create_token(): class Test(IToken): NETWORK_IDENTIFIER = "Test" NETWORK_VERBOSE_NAME = "Test Network" TOKEN_SYMBOL = "T" CHA...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from gaiatest import GaiaTestCase from gaiatest.apps.music.app import Music class TestPlay3GPMusic(GaiaTestCase): ...
from pytest import raises from numpy import arange from hypothesis import given, assume from hypothesis.strategies import integers, one_of from ..slice import Slice from ..tuple import Tuple from ..integer import Integer from .helpers import check_same, slices, prod, shapes, iterslice def test_slice_args(): # T...
# Add the upper directory (where the nodebox module is) to the search path. import os, sys; sys.path.insert(0, os.path.join("..","..")) from nodebox.graphics import * # On Mac OS X, you can access the built-in iSight camera with PySight + CocoaSequenceGrabber: # http://livingcode.blogspot.com/2005/10/pysight-preview....
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Denis Engemann <denis.engemann@gmail.com> # Andrew Dykstra <andrew.r.dykstra@gmail.com> # Teon Brooks <teon.brooks@gmail.com> # Daniel McCloy <dan.mccloy@gmail.com> # #...
# Copyright (c) OpenMMLab. All rights reserved. from functools import partial from typing import List, Sequence, Tuple, Union import mmcv import numpy as np import torch import torch.nn.functional as F from mmcv.utils import Registry from mmdet.core import bbox2result from mmdet.datasets import DATASETS from mmdet.mod...
"""Provide the Subreddit class.""" # pylint: disable=too-many-lines import socket from copy import deepcopy from csv import writer from io import StringIO from json import dumps, loads from os.path import basename, dirname, isfile, join from typing import TYPE_CHECKING, Any, Dict, Generator, Iterator, List, Optional, ...
import astropy.units as u from astropy.coordinates import SkyCoord, AltAz from ctapipe.io import event_source from ctapipe.calib import CameraCalibrator from ctapipe.image.cleaning import tailcuts_clean, number_of_islands from ctapipe.image import leakage, hillas_parameters from ctapipe.image.timing_parameters import ...
# @DjEdu28 - Licença MIT - Copyright (c) 2022 @DjEdu28 (Luis Eduardo Silva dos Santos) """ Criado por @DjEdu28 EM: 01/2022 Atualizado em: 01/2022 Monitor da bateria versão 2.1 Objetivo da ferramenta: Observar a porcentagem da bateria e informar se tá descarregando ou carregando Ainda aletar caso chegue em um ...
import os from . import const, exception class Notebook: """ Manager of cmdnote notebook """ def __init__(self, notebook_file=const.NOTEBOOK_FILE, capacity=const.CONFIG_DEFAULT_CAPACITY): if not os.path.isfile(notebook_file): raise exception.NotebookFileNotFoundError('Notebook fil...
import itertools import logging from abc import ABC, abstractmethod, ABCMeta from copy import copy from networkx import DiGraph, topological_sort from networkx.drawing.nx_agraph import to_agraph from lib.utils import powerset, format_dict, powerdict logger = logging.getLogger("halpern_pearl") logging.basicConfig(le...
t=int(input()) while(t): t-=1 n=int(input()) if(n%6==0): print("Misha") else: print("Chef")
import unittest from robot.utils.asserts import * from robot.parsing.model import * from robot.parsing.settings import * from robot.parsing.settings import _Import class TestTestCaseFile(unittest.TestCase): def setUp(self): self.tcf = TestCaseFile() def test_init(self): assert_none(self.tcf...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # # Asena UserBot - Yusuf Usta """ Internet ile alakalı bilgileri edinmek için kullanılan UserBot modülüdür. """ from...
from django.test import TestCase from django.contrib.auth.models import AnonymousUser from rest_framework.test import APIRequestFactory from api.address import ResidentialAddressViewSet # Test double for geocode function: always returns the same point def mock_geocode(postcode, sleep): return { 'wgs84_lon...
""" cyclic_mesh_expansion =============== Autogenerated DPF operator classes. """ from warnings import warn from ansys.dpf.core.dpf_operator import Operator from ansys.dpf.core.inputs import Input, _Inputs from ansys.dpf.core.outputs import Output, _Outputs from ansys.dpf.core.operators.specification import PinSpecific...
import numpy as np from .CalculatePADs import CalculatePADs from ..Tools.SavePAD import SavePAD from .. import Globals from .ReadIndex import ReadIndex from .. import MGF from ..MGF.DownloadData import DownloadData as DownloadMGF from .DownloadData import DownloadData from .DeleteDate import DeleteDate from ..Tools.Lis...
import os import yaml from launch import LaunchDescription from launch_ros.actions import Node from launch.actions import ExecuteProcess from ament_index_python.packages import get_package_share_directory import xacro def load_file(package_name, file_path): package_path = get_package_share_directory(package_name)...
from typing import Sequence, Tuple, Union import numpy as np from pydantic import root_validator, validator from typing_extensions import Literal # Added to typing in 3.8 from ..utils.events import EventedModel from ..utils.translations import trans class Dims(EventedModel): """Dimensions object modeling slici...
# -*- coding: utf-8 -*- """Setup tests for this package.""" from plone import api from plone.app.testing import setRoles from plone.app.testing import TEST_USER_ID from visaplan.js.urlsplit.testing import VISAPLAN_JS_URLSPLIT_INTEGRATION_TESTING # noqa import unittest class TestSetup(unittest.TestCase): """Test...
import json from hashlib import sha256 from collections import Counter from inputimeout import inputimeout, TimeoutOccurred import tabulate, copy, time, datetime, requests, sys, os, random from captcha import captcha_builder BOOKING_URL = "https://cdn-api.co-vin.in/api/v2/appointment/schedule" BENEFICIARIES_URL = "htt...
# -*- coding: utf-8 -*- #from urlparse import urlparse from urllib.parse import urljoin from flask import Markup class Project(object): def __init__(self, name, url, description, source=None): self.name = name self.url = url self.description = Markup(description) self.source = sour...
# -*- coding: utf-8 -*- # ======================================================================== # # Copyright © Khepry Quixote # # 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...
import torch import itertools from util.image_pool import ImagePool from .base_model import BaseModel from data import aux_dataset from . import networks class AttnCycleGANModel(BaseModel): @staticmethod def modify_commandline_options(parser, is_train=True): parser.set_defaults(no_dropout=True) # def...
from keyword import iskeyword from collections import defaultdict from django.apps import apps from django.apps.config import MODELS_MODULE_NAME from django.db.models.fields.files import ImageField from .exceptions import InvalidKeyError, InvalidValueError from .const import CONFIG_NAME, nonsense_values_together from...
import os """2 - 14 - hearts 17 - 29 - spades 32 - 44 - clubs 47 - 59 - diamonds e.g. 2 = 2 of hearts, ..., 9 = 9H, 10 = 10H, 11 = 12H, 12 = 13H, 13 - 14H, 14 - ace of hearts (AH) 17 = 2 of spades etc. The deck is set up in this way so that mod(15) can be used effectively. """ DECK = list(range(2, 1...
#* pyx509 - Python library for parsing X.509 #* Copyright (C) 2009-2010 CZ.NIC, z.s.p.o. (http://www.nic.cz) #* #* This library is free software; you can redistribute it and/or #* modify it under the terms of the GNU Library General Public #* License as published by the Free Software Foundation; either...
from enum import Enum from typing import Tuple class Direction(Enum): NORTH = 1 EAST = 2 SOUTH = 4 WEST = 8 def parse_data() -> list[(str, int)]: data = [] with open("input.txt") as file: for line in file: char, *number = line.rstrip() data.append((char, int("...
# -*- coding: utf-8 -*- """ Created on Fri Jan 23 08:16:00 2015 @author: marc """ #import copy import numpy as np import matplotlib.pyplot as plt #from hgp import HGP #from hgp import BCM #from hgp import GP from hgp import gBCM # from hgp import gPoE N = 1000 # no of training inputs d = 1 # no of input dimensi...
import dataclasses import logging import os import re import subprocess logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) commands_md_path = os.path.join(os.path.dirname(__file__), "../docs/commands.md") @dataclasses.dataclass class Section: start: int end: int command: str ...
"""Analytics Admin classes.""" from django.contrib import admin from .models import PageView class PageViewAdmin(admin.ModelAdmin): raw_id_fields = ('project', 'version') list_display = ('project', 'version', 'path', 'view_count', 'date') search_fields = ('project__slug', 'version__slug', 'path') re...
import craedl profile = craedl.auth() profile.get_project("Testing").get_data().get("experiments").create_directory("results") profile.get_project("Testing").get_data().get("experiments").create_file("outputs") # profile.get_project("Testing").get_data().get("experiments").create_file("/home/dylan/src/pdpdpd/src/config...
import _sk_fail; _sk_fail._("trace")
import vectorbt as vbt import numpy as np import pandas as pd from numba import njit from datetime import datetime import pytest from vectorbt.generic.enums import range_dt, drawdown_dt from vectorbt.portfolio.enums import order_dt, trade_dt, log_dt from tests.utils import record_arrays_close day_dt = np.timedelta64...
#!/usr/bin/python3 import argparse import clickhouse_driver import itertools import functools import math import os import pprint import random import re import statistics import string import sys import time import traceback import xml.etree.ElementTree as et from scipy import stats def tsv_escape(s): return s.r...
n, x, y = map(int, input().split()) n //= 2 print('NO' if n <= x <= n + 1 and n <= y <= n + 1 else 'YES')
from musicscore.dtd.dtd import Sequence, Element, GroupReference from musicscore.musicxml.groups.common import Editorial from musicscore.musicxml.types.complextypes.complextype import ComplexType, Empty from musicscore.musicxml.types.complextypes.groupbarline import ComplexTypeGroupBarline from musicscore.musicxml.type...
from django.shortcuts import render from .models import File from .forms import FileForm # Create your views here. def SaveFile(request): saved = False if request.method == "POST": #get the posted form MyFileForm = FileForm(request.POST, request.FILES) if MyFileForm.is_valid(): ...
# -*- coding: utf-8 -*- """ Created on Thu Oct 04 17:53:55 2018 @author: Quantum Engineer """ import sys sys.path.append("X:\\") import labscript_utils.h5_lock import time import zprocess import h5py import numpy as np import matplotlib.pyplot as plt import os class DeviceServer(zprocess.ZMQServer): def __init_...
import os,time,cv2,argparse,multiprocessing import numpy as np import requests,json,time,csv from requests.utils import quote from mvnc import mvncapi as mvnc from skimage.transform import resize from utils.app_utils import FPS, WebcamVideoStream from multiprocessing import Queue, Pool classes = ["aeroplane", "bicycle...
import unittest from nose.suite import LazySuite from helpers import iter_compat def gen(): for x in range(0, 10): yield TestLazySuite.TC('test') class TestLazySuite(unittest.TestCase): class TC(unittest.TestCase): def test(self): pass def test_basic_iteration(self): ...
from pyrosim import PYROSIM ARM_LENGTH = 0.5 ARM_RADIUS = ARM_LENGTH / 10.0 sim = PYROSIM(playPaused = False , evalTime = 1000) sim.Send_Cylinder(objectID = 0 , x=0, y=0, z=ARM_LENGTH/2.0 + ARM_RADIUS, r1=0, r2=0, r3=1, length=ARM_LENGTH, radius=ARM_RADIUS) sim.Send_Cylinder(objectID = 1 , x=0, y=ARM_LENGTH/2.0, z...
from sqlalchemy import Column, UnicodeText, LargeBinary, Numeric, String from telebot.plugins.sql_helper import SESSION, BASE class Filters(BASE): __tablename__ = "filters" chat_id = Column(String(14), primary_key=True) keyword = Column(UnicodeText, primary_key=True) reply = Column(UnicodeText) sn...
from django.db import models from django.core.urlresolvers import reverse # Create your models here. class Post(models.Model): title = models.CharField(max_length=120) content = models.TextField() updated = models.DateTimeField(auto_now=True, auto_now_add=False) timestamp = models.DateTimeField(auto_no...
import click class OptionEatAll(click.Option): def __init__(self, *args, **kwargs): self.save_other_options = kwargs.pop('save_other_options', True) nargs = kwargs.pop('nargs', -1) assert nargs == -1, 'nargs, if set, must be -1 not {}'.format(nargs) super(OptionEatAll, self).__ini...
# stdlib import functools from typing import Any as TypeAny from typing import List as TypeList from typing import Tuple as TypeTuple # third party from packaging import version import pandas as pd # syft relative from . import frame # noqa: 401 from . import series # noqa: 401 from ...ast import add_classes from ....
# Copyright 2018,2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group 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 #...
# 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 re import spacy from geopy.geocoders import Nominatim ''' More info: https://geopy.readthedocs.io/en/stable/#geopy.location.Location.address ''' class TweetUserLocatorUtils(): def __init__(self, locator_user_agent='random_user') -> None: self.locator = Nominatim(user_agent=locator_user_agent)...
import nspkg1.m1 print(ns<caret>pkg1)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2018 D. de Vries 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...
#!/opt/libreoffice5.2/program/python # -*- coding: utf-8 -*- import os import sys import subprocess import glob from settings import getDIC, createBK def deployOXT(DIC=None): if DIC is None: DIC = getDIC() print("Do not start LibreOffice until Extension Manager is displayed.") os.chdir(os.path.join(...
""" Create a function that reverses a string: 'Hi My name is Andrei' should be: 'ierdnA si eman yM iH' """ import unittest def reverse_string(string): # Check input if not isinstance(string, str) or len(string) < 2: return "Hmmm there seems to be a problem" split_string = list(string) new_str...
import re from prompt_toolkit import prompt, print_formatted_text, shortcuts, HTML from prompt_toolkit.completion import WordCompleter from hermit.wordlists import WalletWords, ShardWords from hermit.errors import HermitError from typing import List, Dict, Optional, Tuple class ShardWordUserInterface(object): """...
import re import itertools with open('day-14/input.txt', 'r') as file: puzzle_input = [i.strip() for i in file.readlines()] def apply_mask(value, mask, no_change='X'): mask = list(mask) value = list(bin(int(value))[2:].rjust(36, '0')) for i in range(36): if mask[i] != no_change: ...
""" Unit tests for shapes.py module """ __author__ = "Abhijit Kale" import unittest import sys from .context import gjk from gjk.geometry_shapes import * class TestCircleMethods(unittest.TestCase): def setUp(self): self.circ = Circle(radius=3, normal=Point(0,0,2)) def test...
import codecs import contextlib import io import locale import sys import unittest import encodings from unittest import mock from test import support try: import _testcapi except ImportError as exc: _testcapi = None try: import ctypes except ImportError: ctypes = None SIZEOF_WCHAR_T = -1 else: ...
# qubit number=5 # total number=49 import cirq import qiskit from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2,floor, sqrt, pi import numpy as np import networkx as ...
# Copyright (c) 2015-2019, Activision Publishing, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of ...
#! -*- coding:utf-8 -*- # 语义相似度任务:数据集xnli, 从train中切分了valid # loss: concat后走3分类,CrossEntropyLoss from bert4torch.tokenizers import Tokenizer from bert4torch.models import build_transformer_model, BaseModel from bert4torch.snippets import sequence_padding, Callback, ListDataset import torch.nn as nn import torch import ...
import os import logging logger = logging.getLogger(__name__) from collections import OrderedDict import numpy import pyopencl from pyopencl import array as cla class OclMultiAnalyzer: NUM_CRYSTAL = numpy.int32(13) def __init__(self, L, L2, pixel, center, tha, thd, psi, rollx, rolly, device=None): ""...
"""Handle different kinds of events""" import json import logging import os from abc import ABC, abstractmethod from ..machine import types as mt HARK_CLI_VERSION_KEY = "hark_ver" LOG = logging.getLogger(__name__) class HarkEventHandler(ABC): """An event handler. Designed so new event handlers can be buil...
import pyecog if __name__ == '__main__': pyecog.pyecog_main_gui.main()
username = "**********" password = "**********" kurum = "Öğrenci Belgesi Sorgulama"
def from_openmm_PDBFile (item, molecular_system=None, atom_indices='all', frame_indices='all'): from molsysmt.native.molsys import MolSys from molsysmt.native.io.topology.classes import from_openmm_PDBFile as molsysmt_topology_from_openmm_PDBFile from molsysmt.native.io.trajectory.classes import from_openm...
# 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 ...
# -*- coding: utf-8 -*- import torch class Config: ''' Chatbot模型参数 ''' corpus_data_path = 'corpus.pth' #已处理的对话数据 use_QA_first = True #是否载入知识库 max_input_length = 100 #输入的最大句子长度 max_generate_length = 300 #生成的最大句子长度 prefix = 'checkpoints/chatbot' #模型断点路径前缀 model_ck...
from homeassistant.components.climate.const import ( HVAC_MODE_HEAT_COOL, HVAC_MODE_COOL, HVAC_MODE_DRY, HVAC_MODE_FAN_ONLY, HVAC_MODE_HEAT, HVAC_MODE_OFF, SUPPORT_FAN_MODE, SUPPORT_SWING_MODE, SUPPORT_TARGET_TEMPERATURE, ) from homeassistant.const import STATE_UNAVAILABLE...
gui = True try: from tkinter import filedialog, Toplevel, Tk from tkinter import * except ImportError: # 2.7 support block try: from Tkinter import Toplevel, Tk from Tkinter import * import Tkinter import Tkconstants import tkFileDialog except ImportError as e...
#!C:/Users/Kushang Darbar/AppData/Local/Programs/Python/Python38-32/python #print("Content-Type:text/html; charset=utf-8\n\n") print() import cgi #!/usr/bin/env python # coding: utf-8 import cv2 import os import numpy as np import FaceRecognition as fr import retrieve as rt import cgitb cgitb.enable() form = cgi.Fiel...
# Copyright 2017 AT&T Intellectual Property. All other 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 http.server import BaseHTTPRequestHandler from http.server import HTTPServer import json import datetime import time import os from urllib.parse import urlparse, parse_qs from azure.storage.blob import BlobClient import base64 from apscheduler.schedulers.background import BackgroundScheduler conn_str = os.enviro...
import copy import os import tempfile from functools import wraps from itertools import groupby from typing import List, Optional, Tuple, TypeVar, Union import numpy as np import pyarrow as pa import pyarrow.compute as pc from . import config from .utils.logging import get_logger logger = get_logger(__name__) def...
# Copyright 2017-present Adtran, 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 wri...
from django.db import models from django.conf import settings from django.db.models.signals import pre_save, post_save from .utils import MailChimp # Create your models here. class MarketingPreference(models.Model): user = models.OneToOneField(to=settings.AUTH_USER_MODEL) subscribed = models.BooleanField(defa...
import os import traceback from flask import Flask, render_template, request, url_for, redirect, g, abort from flask_login import LoginManager, login_required, login_user, logout_user, current_user from postmarker.core import PostmarkClient from email_confirmations.models import db, User, Note from email_confirmation...
#!/usr/bin/env python3 from game import Game def main(): game = Game() # If the main thread has begun, call the "main()" method. # This starts the program. if __name__ == "__main__": main()
"""coupling module Provides classes for couplings. Note that a coupling consists of two elements. The active element (called coupling element here) affects the passive element (called coupled element here). """ import math class coupling: """Abstract class for coupling of two tipping_elements Class should n...
# Copyright (c) 2018, Lehrstuhl für Angewandte Mechanik, Technische Universität München. # # Distributed under BSD-3-Clause License. See LICENSE-File for more information # """ Forces module of AMfe. In this module you can find some examples for force-functions. You can apply them to your model as Neumann-conditions....
number = input() def is_unlucky_digit(d): return d != '4' and d != '7' all_digits_number = len(number) unlucky_digits_number = len(list(filter(is_unlucky_digit, number))) lucky_digits_number = all_digits_number - unlucky_digits_number if lucky_digits_number == 4 or lucky_digits_number == 7: print('YES') el...
import requests from bs4 import BeautifulSoup from selenium import webdriver from pyvirtualdisplay import Display import os def send_mail(content): import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart gmailUser = os.environ['sender'] gmailPassword = o...
from rest_framework import serializers from .models import Skills class SkillsSerializer(serializers.ModelSerializer): class Meta: model = Skills fields = '__all__'
from random import randint from sanic import Sanic from sanic.response import json, HTTPResponse from pony.orm import db_session from sanic_jwt import initialize, exceptions from sanic_restplus import fields, Api, Resource from .settings import * from .utils import send_tg_message from .models import db, User, Note,...
import typing from .implementation import CopyWriteMetadataKey, Key, sfn, copy_write_metadata_sfn def copy_sfn_event( source_bucket: str, source_key: str, destination_bucket: str, destination_key: str ) -> typing.MutableMapping[str, str]: """Returns the initial event object to start the s3-s3 cop...
import numpy as np from manimlib.mobject.mobject import Mobject class ValueTracker(Mobject): """ Note meant to be displayed. Instead the position encodes some number, often one which another animation or continual_animation uses for its update function, and by treating it as a mobject it can sti...
from __future__ import print_function from miscc.config import cfg, cfg_from_file from datasets import TextDataset from trainer import condGANTrainer as trainer import os import sys import time import random import pprint import datetime import dateutil.tz import argparse import numpy as np import torch import torch...
import torch from ...dataset import SequenceBatch from ._abstract import ImportanceMeasureModule class InputTimesGradientImportanceMeasure(ImportanceMeasureModule): def forward(self, batch: SequenceBatch) -> torch.Tensor: # Prepear a compact embedding matrix for doing sum(x * dy/dz @ W.T) efficently. ...
# coding=utf-8 # Copyright 2018 The Microsoft Research Asia LayoutLM Team Authors 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://www.apache.org/...
import supportlib as lib # from supportlib import (one, two) print(lib.one()) print(lib.two())