Best Python code snippet using molecule_python
playbooks.py
Source:playbooks.py
...106 embed.set_thumbnail(url=img)107 embed.set_footer(text=" ")108 response = embed109 return response110def get_playbooks(lang):111 json_array = get_moves(lang)112 playbooks = get_translation(lang, 'playbooks.playbooks')113 embed = discord.Embed(title=playbooks)114 available = get_translation(lang, 'playbooks.available')115 embed.set_author(name=available)116 for s in json_array['sources']:117 line = ""118 for p in json_array['playbooks']:119 if s['source'] == p['source']:120 line = line + p['name'].capitalize() + ", "121 line = line.rstrip(', ')122 embed.add_field(name=f"{s['name']}", value=f"{line}", inline=False)123 embed.set_footer(text=" ")124 response = embed125 return response126embed_commands_dict = {127 "mot": lambda msg, lang: get_playbook_component('mot', msg, lang),128 "playbooks": lambda _msg, lang: get_playbooks(lang),129 "celebrate": lambda msg, lang: get_playbook_component('celebrate', msg, lang),130 "weakness": lambda msg, lang: get_playbook_component('weakness', msg, lang)...
urls.py
Source:urls.py
1from django.conf.urls import url2from . import views, views_mac, views_playbooks, views_reports, views_templify, views_pa, views_netmagis3from . import api4ASSET_NAME_RE = r'[a-z0-9._-]+'5GROUP_NAME_RE = r'[a-z0-9.-_]+'6VARIABLE_RE = r'[a-z0-9.-_]+'7urlpatterns = [8 # Authentication9 url(r'^login/$', views.login_form, name='login_form'),10 url(r'^logout/$', views.logout_user, name='logout_user'),11 url(r'^auth/$', views.auth_and_login, name='auth_and_login'),12 # Assets13 url(r'^$', views.index, name='index'),14 url(r'^assets/$', views.assets, name='assets'),15 url(r'^assets/(?P<page>[0-9]+)$', views.assets, name='assets'),16 url(r'^assets/(?P<asset_name>%s)/$' % ASSET_NAME_RE, views.asset, name='asset'),17 url(r'^addvariable/$', views.addvariable, name='addvariable'),18 url(r'^deletevariable/asset/(?P<asset_name>%s)/(?P<variable>%s)$' % (ASSET_NAME_RE, VARIABLE_RE), views.deletevariable, name='deletevariable'),19 url(r'^addasset/$', views.addasset, name='addasset'),20 url(r'^insertasset/$', views.insertasset, name='insertasset'),21 url(r'^deleteasset/(?P<asset_name>%s)$' % ASSET_NAME_RE, views.deleteasset, name='deleteasset'),22 # Search23 url(r'^assets/search$', views.search, name='search'),24 # Groups25 url(r'^addgroup/$', views.addgroup, name='addgroup'),26 url(r'^insertgroup/$', views.insertgroup, name='insertgroup'),27 url(r'^groups/$', views.groups, name='groups'),28 url(r'^groups/(?P<group_name>%s)/$' % GROUP_NAME_RE, views.group, name='group'),29 url(r'^deletevariable/group/(?P<group_name>%s)/(?P<variable>%s)$' % (GROUP_NAME_RE, VARIABLE_RE), views.deletevariable, name='deletevariable'),30 url(r'^deletegroup/(?P<group_name>%s)$' % GROUP_NAME_RE, views.deletegroup, name='deletegroup'),31 # Reports32 url(r'^reports/$', views_reports.reports, name='reports'),33 url(r'^reports/models$', views_reports.report_model, name='report_model'),34 url(r'^reports/junosversions$', views_reports.report_junos_version, name='report_junos_version'),35 url(r'^reports/playbookruns$', views_reports.report_playbook_runs, name='report_playbook_runs'),36 # MAC-ARP / IP usage37 url(r'^macs/$', views_mac.macs, name='macs'),38 url(r'^macs/(?P<start>[0-9.-]+)$', views_mac.macs, name='macs'),39 url(r'^macsearch$', views_mac.macsearch, name='macsearch'),40 url(r'^ipusage$', views_mac.ipusage, name='ipusage'),41 url(r'^ipusagesearch$', views_mac.ipusagesearch, name='ipusagesearch'),42 # Playbooks43 url(r'^playbooks/playbooklog$', views_playbooks.playbook_log, name='playbook_log'),44 url(r'^playbooks/logdetails/(?P<log_id>[a-z0-9]+)$', views_playbooks.playbook_log_details, name='playbook_log_details'),45 url(r'^playbooks/$', views_playbooks.playbooks, name='playbooks'),46 url(r'^playbooks/runplaybook', views_playbooks.run_playbook, name='run_playbook'),47 url(r'^playbooks/playbookredirector$', views_playbooks.playbookredirector, name='playbookredirector'),48 url(r'^playbooks/(?P<playbook_id>[0-9]+)', views_playbooks.playbook_input, name='playbook_input'),49 # Deploy ports50 url(r'^deployport/$', views_playbooks.deployport, name='deployport'),51 # Templates / templify52 url(r'^templify/$', views_templify.index, name='templify'),53 url(r'^templify/download/(?P<filename>[0-9a-z/-]+)$', views_templify.download, name='download'),54 url(r'^templify/template/(?P<template_id>[0-9]+)/$', views_templify.template_input, name='template_input'),55 url(r'^templify/template/genconfig$', views_templify.generate_config, name='generate_config'),56 # Ansible jobs57 url(r'^ansibletasks/$', views_playbooks.ansibletasks, name='ansibletasks'),58 url(r'^deletetask/(?P<task_id>[0-9]+)$', views_playbooks.deletetask, name='deletetask'),59 url(r'^retry_task/(?P<log_id>[0-9\w]+)$', views_playbooks.retry_task, name='retry_task'),60 # API version 161 url(r'^api/v1/getmac/(?P<ip_address>[0-9.-]+)/$', api.api_get_mac, name='api_get_mac'),62 url(r'^api/v1/netmagis_search/(?P<search_keyword>[\w\d.-]+)/$', api.api_netmagis_search, name='api_netmagis_search'),63 # Port automation64 url(r'^pa/port$', views_pa.pa_port, name='pa_port'),65 url(r'^pa/prepare$', views_pa.pa_prepare, name='pa_prepare'),66 url(r'^pa/tsport$', views_pa.pa_ts_port, name='pa_ts_port'),67 url(r'^pa/pa_troubleshoot$', views_pa.pa_troubleshoot, name='pa_troubleshoot'),68 url(r'^pa/dhcp_search$', views_pa.dhcp_search, name='dhcp_search'),69 # NetMagis70 url(r'^nm/nm$', views_netmagis.netmagis, name='netmagis'),71 url(r'^nm/networks$', views_netmagis.networks, name='nm_networks'),72 url(r'^nm/searchhost$', views_netmagis.searchhost, name='nm_searchhost'),...
test_playbooks_schema.py
Source:test_playbooks_schema.py
1# Copyright (c) 2022, Juniper Networks, Inc.2# All rights reserved.3# coding: utf-84"""5 Healthbot APIs6 API interface for Healthbot application # noqa: E5017 OpenAPI spec version: 1.0.08 Contact: healthbot-hackers@juniper.net9 Generated by: https://github.com/swagger-api/swagger-codegen.git10"""11from __future__ import absolute_import12import unittest13import swagger_client14from swagger_client.models.playbooks_schema import PlaybooksSchema # noqa: E50115from swagger_client.rest import ApiException16class TestPlaybooksSchema(unittest.TestCase):17 """PlaybooksSchema unit test stubs"""18 def setUp(self):19 pass20 def tearDown(self):21 pass22 def testPlaybooksSchema(self):23 """Test PlaybooksSchema"""24 # FIXME: construct object with mandatory attributes with example values25 # model = swagger_client.models.playbooks_schema.PlaybooksSchema() # noqa: E50126 pass27if __name__ == '__main__':...
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!!