Best Python code snippet using localstack_python
kinesis_util.py
Source:kinesis_util.py
...13 self.events_file = events_file14 self.callback = callback15 self.ready_mutex = ready_mutex16 self.fh_d_stream = fh_d_stream17 def retrieve_loop(self, params):18 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)19 sock.bind(self.events_file)20 sock.listen(1)21 if self.ready_mutex:22 self.ready_mutex.release()23 while self.running:24 try:25 conn, client_addr = sock.accept()26 thread = FuncThread(self.handle_connection, conn)27 thread.start()28 except Exception as e:29 LOGGER.error('Error dispatching client request: %s %s' % (e, traceback.format_exc()))30 sock.close()31 def handle_connection(self, conn):...
webscrap.py
Source:webscrap.py
...9 def __init__(self, bot):10 self.bot = bot11 time = datetime.time(hour=11, tzinfo=datetime.timezone.utc)12 @tasks.loop(time=time)13 async def retrieve_loop(self):14 15 url = 'https://www.electrosacavem.com/info.php?identif=22444'16 page = urlopen(url)17 html = page.read().decode("ISO-8859-1")18 soup = BeautifulSoup(html, "html.parser")19 modelo = "SONY TV OLED XR65A90JAEP"20 price_line = soup.find_all(color="#CC0000")21 price = price_line[0].text22 img="https://www.electrosacavem.com/images/fotos/f22444foto1.jpg"23 guild = self.bot.get_guild(872127299854680124)24 channel = discord.utils.get(guild.channels, id=872127299854680127)25 nuno=guild.get_member(760089560595562508)26 embed=discord.Embed(27 color=0xf2f2f2,...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!