code: def list_files(dir_path, recursive=True):
      
  
      for root, dirs, files in os.walk(dir_path):
          file_list = [os.path.join(root, f) for f in files]
          if recursive:
              for dir in dirs:
                  dir = os.path.join(root, dir)
                  file_list.extend(list_files(dir, recursive=True))
          return file_list
docs: Return a list of files in dir_path.