Best Python code snippet using avocado_python
app_info.py
Source:app_info.py
...135 :type app_id: int136 """137 self._app_id = app_id138 @property139 def online_count(self):140 """Gets the online_count of this AppInfo.141 å¨çº¿æ¢éæ°142 :return: The online_count of this AppInfo.143 :rtype: int144 """145 return self._online_count146 @online_count.setter147 def online_count(self, online_count):148 """Sets the online_count of this AppInfo.149 å¨çº¿æ¢éæ°150 :param online_count: The online_count of this AppInfo.151 :type online_count: int152 """153 self._online_count = online_count154 @property155 def disable_count(self):156 """Gets the disable_count of this AppInfo.157 æå¨åæ¢æ¢éæ°158 :return: The disable_count of this AppInfo.159 :rtype: int160 """161 return self._disable_count...
list_env_instances_response.py
Source:list_env_instances_response.py
...90 :type total_count: int91 """92 self._total_count = total_count93 @property94 def online_count(self):95 """Gets the online_count of this ListEnvInstancesResponse.96 å¨çº¿å®ä¾æ»æ°97 :return: The online_count of this ListEnvInstancesResponse.98 :rtype: int99 """100 return self._online_count101 @online_count.setter102 def online_count(self, online_count):103 """Sets the online_count of this ListEnvInstancesResponse.104 å¨çº¿å®ä¾æ»æ°105 :param online_count: The online_count of this ListEnvInstancesResponse.106 :type online_count: int107 """108 self._online_count = online_count109 @property110 def offline_count(self):111 """Gets the offline_count of this ListEnvInstancesResponse.112 离线å®ä¾æ»æ°113 :return: The offline_count of this ListEnvInstancesResponse.114 :rtype: int115 """116 return self._offline_count...
mc_stats.py
Source:mc_stats.py
1import discord2from mcstatus import JavaServer3from discord.ext import commands4from logger import log_error, log_info, log_debug, log_warning5from config import get_color, config6class McStats(commands.Cog):7 def __init__(self, bot):8 self.bot = bot9 @commands.Cog.listener()10 async def on_ready(self):11 log_info("McStats Module successfully loaded!")12 @commands.command(name='online')13 async def online_command(self, ctx, *args):14 server = JavaServer.lookup(config['mc_server']['ip'])15 status = server.status()16 17 online_count = status.players.online18 latency = status.latency19 20 # Online count string21 online = ''22 if (online_count == 0):23 online = f'{online_count} игÑоков'24 elif (online_count == 1):25 online = f'{online_count} игÑок'26 elif (online_count > 1 and online_count < 5):27 online = f'{online_count} игÑока'28 else:29 online = f'{online_count} игÑоков'30 31 embed = discord.Embed()32 embed.title = 'Ðнлайн на ÑеÑвеÑе'33 embed.add_field(name='ÐÑего', value=online, inline=True)34 embed.add_field(name='Ðинг', value=f'{latency:.2f} мÑ', inline=True)35 36 embed.color = get_color('neutral')37 query = server.query()38 players = query.players.names39 players_string = None40 if (len(players) > 0):41 players_string = '`' + '`, `'.join(players) + '`'42 43 if (players_string != None):44 embed.add_field(name='СпиÑок игÑоков', value=players_string, inline=False)45 46 await ctx.send(embed=embed)47 48 async def get_online(self) -> list:49 server = JavaServer.lookup(config['mc_server']['ip'])50 query = server.query()51 return query.players.names52 53async def setup(bot):...
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!!