code: def list_files(
      directory: str,
      contains: list = [".json"],
      verbose: int = 1,
  ) -> list:
      """
      Walk given directory and return a list of file path with desired extension
  
      Args:
          directory: str
              "data/coco/"
          contains: list
              A list of strings to check if the target file contains them, example: ["coco.png", ".jpg", "jpeg"]
          verbose: int
              0: no print
              1: print number of files
  
      Returns:
          filepath_list : list
              List of file paths
      """
      # define verboseprint
      verboseprint = print if verbose else lambda *a, **k: None
  
      filepath_list = []
  
      for file in os.listdir(directory):
          # check if filename contains any of the terms given in contains list
          if any(strtocheck in file.lower() for strtocheck in contains):
              filepath = os.path.join(directory, file)
              filepath_list.append(filepath)
  
      number_of_files = len(filepath_list)
      folder_name = Path(directory).name
  
      verboseprint(
          f"There are {str(number_of_files)} listed files in folder: {folder_name}/"
      )
  
      return 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 4 for calling a global function with example usage: list_files(directory, contains, verbose) and returns: filepath_list