original_docstring: 
      Renames all sura files in a given directory
      gets the new names from the provided dict
      name_only specifies whether to include numbers or not
      
docstring: Renames all sura files in a given directory
  gets the new names from the provided dict
  name_only specifies whether to include numbers or not
docstring_tokens: Renames all sura files in a given directory gets the new names from the provided dict name_only specifies whether to include numbers or not
code: def rename_in_dir(directory, names, name_only=False):
      """
      Renames all sura files in a given directory
      gets the new names from the provided dict
      name_only specifies whether to include numbers or not
      """
      for curfile in get_mp3_files(directory):
          parent, curname = split(curfile)
          index = splitext(curname)[0]
          basename = names[curname]
          newname = "%s%s.mp3" % (
              '' if name_only else str(index)+' - ', basename)
          newname = join(parent, newname)
          try:
              rename(curfile, newname)
          except FileNotFoundError:
              continue
code_tokens: def rename_in_dir ( directory , names , name_only = False ) : for curfile in get_mp3_files ( directory ) : parent , curname = split ( curfile ) index = splitext ( curname ) [ 0 ] basename = names [ curname ] newname = "%s%s.mp3" % ( '' if name_only else str ( index ) + ' - ' , basename ) newname = join ( parent , newname ) try : rename ( curfile , newname ) except FileNotFoundError : continue
short_docstring: Renames all sura files in a given directory
  gets the new names from the provided dict
  name_only specifies whether to include numbers or not
short_docstring_tokens: Renames all sura files in a given directory gets the new names from the provided dict name_only specifies whether to include numbers or not
comment: """
      Renames all sura files in a given directory
      gets the new names from the provided dict
      name_only specifies whether to include numbers or not
      """