parameters: (contents, dest, mode="wb", description=None)
return_statement: return dest
docstring: Writes text or binary data to the specified destination path or file-like object.
  
      Args:
          contents (bytes):
                  A bytes-like object that can be written to disk.
          dest (Union[str, file-like]):
                  The path or file-like object to write to.
  
  
          mode (str): The mode to use when writing. Defaults to "wb".
          description (str): A description of what is being written.
  
      Returns:
          Union[str, file-like, None]: The complete file path or file-like object.
  
      Raises:
          Exception: If the path could not be written to, or if the file-like object could not be written to.
docstring_summary: Writes text or binary data to the specified destination path or file-like object.
docstring_tokens: Writes text or binary data to the specified destination path or file - like object .
function: def save_file(contents, dest, mode="wb", description=None):
      """
      Writes text or binary data to the specified destination path or file-like object.
  
      Args:
          contents (bytes):
                  A bytes-like object that can be written to disk.
          dest (Union[str, file-like]):
                  The path or file-like object to write to.
  
  
          mode (str): The mode to use when writing. Defaults to "wb".
          description (str): A description of what is being written.
  
      Returns:
          Union[str, file-like, None]: The complete file path or file-like object.
  
      Raises:
          Exception: If the path could not be written to, or if the file-like object could not be written to.
      """
      if description is not None:
          G_LOGGER.info("Saving {:} to {:}".format(description, dest))
  
      if is_file_like(dest):
          warn_if_wrong_mode(dest, mode)
          bytes_written = dest.write(contents)
          dest.flush()
          try:
              content_bytes = len(contents.encode())
          except:
              pass
          else:
              if bytes_written != content_bytes:
                  G_LOGGER.warning(
                      "Could not write entire file. Note: file contains {:} bytes, but only "
                      "{:} bytes were written".format(content_bytes, bytes_written)
                  )
      else:
          makedirs(dest)
          with open(dest, mode) as f:
              f.write(contents)
      return dest
function_tokens: def save_file ( contents , dest , mode = "wb" , description = None ) : if description is not None : G_LOGGER . info ( "Saving {:} to {:}" . format ( description , dest ) ) if is_file_like ( dest ) : warn_if_wrong_mode ( dest , mode ) bytes_written = dest . write ( contents ) dest . flush ( ) try : content_bytes = len ( contents . encode ( ) ) except : pass else : if bytes_written != content_bytes : G_LOGGER . warning ( "Could not write entire file. Note: file contains {:} bytes, but only " "{:} bytes were written" . format ( content_bytes , bytes_written ) ) else : makedirs ( dest ) with open ( dest , mode ) as f : f . write ( contents ) return dest