code: def get_models(url):
      """
      Function to retrieve all models from paginated endpoint
      :param url: base url to make GET request
      :return: list of all models
      """
      models = []
      while url:
          response = requests.get(url)
          if response.status_code != 200:
              print(
                  f"Failed to retrieve data. Status code: {response.status_code}"
              )
              return models
          payload = response.json()
          url = get_next_url(response)
          models.extend(payload)
      return models
  
imports: import requests
  from urllib.parse import urlparse, parse_qs
label_desc: Use image node_id 2 for calling a global function with example usage: get_models(url) and returns: models, models