How to use not_me method in Molotov

Best Python code snippet using molotov_python

main.py

Source:main.py Github

copy

Full Screen

1#!/usr/bin/env python2# -*- coding: utf-8 -*-3import sys4sys.setrecursionlimit(10**7)5from pprint import pprint as pp6from pprint import pformat as pf7# @pysnooper.snoop()8#import pysnooper # debug9import math10#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder11import bisect12# Queue is very slow13# use global: counts14# use global: not_connected: 15# yet: bit set of yet determined16# this is fast enough for 72 vertex17def independent_set_count(yet):18 if yet in counts:19 return counts[yet]20 youngest = yet & -1 * yet21 not_me = yet ^ youngest22 yes_me = yet & not_connected[youngest.bit_length() - 1]23 #print("yet", bin(yet)[2:]) # debug24 #print("not_me", bin(not_me)[2:]) # debug25 #print("yes_me", bin(yes_me)[2:]) # debug26 counts[yet] = independent_set_count(not_me) + independent_set_count(yes_me)27 return counts[yet]28if __name__ == '__main__':29 n = 330 not_connected = [ # graph size 3 e 0 231 int("010", 2),32 int("101", 2),33 int("010", 2),34 ]35 #print("not_connected", not_connected) # debug36 counts = {0: 1}37 ans = independent_set_count((1 << n) - 1)38 #print('ans') # debug39 print(ans)...

Full Screen

Full Screen

other_func.py

Source:other_func.py Github

copy

Full Screen

1# - *- coding: utf- 8 - *-2import requests3from aiogram import Dispatcher4from data import config5from data.config import admins6from loader import bot7# Уведомление и проверка обновления при запуске скрипта8async def on_startup_notify(dp: Dispatcher):9 if len(admins) >= 1:10 await send_all_admin(f"<b>✅ Бот был успешно запущен</b>")11# Рассылка сообщения всем администраторам12async def send_all_admin(message, markup=None, not_me=0):13 if markup is None:14 for admin in admins:15 try:16 if str(admin) != str(not_me):17 await bot.send_message(admin, message, disable_web_page_preview=True)18 except:19 pass20 else:21 for admin in admins:22 try:23 if str(admin) != str(not_me):24 await bot.send_message(admin, message, reply_markup=markup, disable_web_page_preview=True)25 except:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Molotov automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful