code: def list_files_recursively(
      directory: str, contains: list = [".json"], verbose: str = True
  ) -> (list, list):
      """
      Walk given directory recursively and return a list of file path with desired extension
  
      Arguments
      -------
          directory : str
              "data/coco/"
          contains : list
              A list of strings to check if the target file contains them, example: ["coco.png", ".jpg", "jpeg"]
          verbose : bool
              If true, prints some results
      Returns
      -------
          relative_filepath_list : list
              List of file paths relative to given directory
          abs_filepath_list : list
              List of absolute file paths
      """
  
      # define verboseprint
      verboseprint = print if verbose else lambda *a, **k: None
  
      # walk directories recursively and find json files
      abs_filepath_list = []
      relative_filepath_list = []
  
      # r=root, d=directories, f=files
      for r, _, f in os.walk(directory):
          for file in f:
              # check if filename contains any of the terms given in contains list
              if any(
                  strtocheck in file.lower() for strtocheck in contains
              ):
                  abs_filepath = os.path.join(r, file)
                  abs_filepath_list.append(abs_filepath)
                  relative_filepath = abs_filepath.split(directory)[-1]
                  relative_filepath_list.append(relative_filepath)
  
      number_of_files = len(relative_filepath_list)
      folder_name = directory.split(os.sep)[-1]
  
      verboseprint(
          "There are {} listed files in folder {}.".format(
              number_of_files, folder_name
          )
      )
  
      return relative_filepath_list, abs_filepath_list
  
imports: import glob
  import json
  import ntpath
  import os
  import pickle
  import re
  import urllib.request
  import zipfile
  from pathlib import Path
  from typing import Optional
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: list_files_recursively(directory, contains, verbose) and returns: relative_filepath_list,  abs_filepath_list