code: def get_urls_from_dir(
      url: str,
      repo: str,
      branch: str,
      commit: Optional[str] = None,
  ) -> List[str]:
      notebooks = []
      slug = commit if commit else branch
  
      gh_api_call = (
          "https://api.github.com/repos/"
          + repo
          + "/git/trees/"
          + slug
          + "?recursive=1"
      )
      r = requests.get(gh_api_call)  # nosec
      if r.status_code != 200:
          print(
              f"Failed to fetch notebook from: {gh_api_call}.\n"
              + "Please try again with the correct parameters!"
          )
          sys.exit(1)
  
      res = r.json()
  
      for file in res["tree"]:
          if file["path"].startswith(
              "notebooks/quickstart/" + url
          ) or file["path"].startswith("notebooks/" + url):
              if file["path"].endswith(".ipynb"):
                  temp_url = (
                      "https://raw.githubusercontent.com/"
                      + repo
                      + "/"
                      + slug
                      + "/"
                      + file["path"]
                  )
                  notebooks.append(temp_url)
  
      if len(notebooks) == 0:
          for file in res["tree"]:
              if file["path"].startswith("notebooks/" + url):
                  if file["path"].endswith(".ipynb"):
                      temp_url = (
                          "https://raw.githubusercontent.com/"
                          + repo
                          + "/"
                          + slug
                          + "/"
                          + file["path"]
                      )
                      notebooks.append(temp_url)
      return notebooks
  
imports: from dataclasses import dataclass
  import os
  from pathlib import Path
  import sys
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Tuple
  from urllib.parse import urlparse
  import zipfile
  import click
  import requests
  from tqdm import tqdm
  from .cache import DEFAULT_BRANCH
  from .cache import DEFAULT_REPO
  from .cache import arg_cache
  from .nb_output import NBOutput
label_desc: Use image node_id 5 for calling a global function with example usage: get_urls_from_dir(url, repo, branch, commit) and returns: notebooks