# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .robot
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: RobotFramework (XRobot)
#     language: robotframework
#     name: xrobot
# ---

# + magic_args="module XKCDLibrary" language="python"
#
# import requests
# from random import randint
#
# LATEST_URL = 'https://xkcd.com/info.0.json'
# URL = 'https://xkcd.com/{number}/info.0.json'
#
#
# class XKCDLibrary:
#     def get_latest_strip_url(self):
#         """Return URL of the latest XKCD strip"""
#         response = requests.get(LATEST_URL)
#         return response.json()['img']
#
#     def get_random_strip_url(self):
#         """Return URL of the latest XKCD strip"""
#         response = requests.get(URL.format(number=randint(1, 3000)))
#         return response.json()['img']
#
#     def get_strip_url(self, number):
#         """Return URL of the latest XKCD strip"""
#         response = requests.get(URL.format(number=number))
#         return response.json()['img']

# +
*** Settings ***

Library  XKCDLibrary

# +
*** Tasks ***

Show the latest XKCD
    Get Latest Strip URL

# +
*** Tasks ***

Show A Random XKCD
    Get Random Strip URL

# +
*** Tasks ***

Show A Random XKCD
    Get Strip URL  1

StarcoderdataJupyterScriptsDedupFiltered