original_docstring: 
      Puts desired image files into a list
      :param dir: (string) root directory of files
      :param recursive: (boolean) If true, search subdirectories as well
      :return: list of strings containing filepaths/names
      
docstring: Puts desired image files into a list
docstring_tokens: Puts desired image files into a list
code: def grab_images(dir, recursive):
      """
      Puts desired image files into a list
      :param dir: (string) root directory of files
      :param recursive: (boolean) If true, search subdirectories as well
      :return: list of strings containing filepaths/names
      """
      imageList = []
      root = dir
      exts = ('.jpg', '.jpeg', '.jpe', '.tif', '.tiff')
  
      if recursive:
          for path, subdirs, files in os.walk(root):
              for fname in files:
                  if fname.lower().endswith(exts):
                      imageList.append(os.path.join(path, fname))
      else:
          for fname in os.listdir(root):
              if fname.lower().endswith(exts):
                  imageList.append(root + '\\' + fname)
  
      return imageList
code_tokens: def grab_images ( dir , recursive ) : imageList = [ ] root = dir exts = ( '.jpg' , '.jpeg' , '.jpe' , '.tif' , '.tiff' ) if recursive : for path , subdirs , files in os . walk ( root ) : for fname in files : if fname . lower ( ) . endswith ( exts ) : imageList . append ( os . path . join ( path , fname ) ) else : for fname in os . listdir ( root ) : if fname . lower ( ) . endswith ( exts ) : imageList . append ( root + '\\' + fname ) return imageList
short_docstring: Puts desired image files into a list
short_docstring_tokens: Puts desired image files into a list
comment: """
      Puts desired image files into a list
      :param dir: (string) root directory of files
      :param recursive: (boolean) If true, search subdirectories as well
      :return: list of strings containing filepaths/names
      """