class_docstr: A class for updating Python (``*.py``) files.
class_docstr_tok: ["A","class","for","updating","Python","(","``","*",".py","``",")","files","."]
docstr: Writes abstract syntax tree (AST) to output file.
  
  Creates the directories for the output path, if needed.
  
  Args:
      output (ast.Module): AST to save as the output file.
docstr_tok: ["Writes","abstract","syntax","tree","(","AST",")","to","output","file",".","Creates","the","directories","for","the","output","path",",","if","needed",".","Args",":","output","(","ast.Module",")",":","AST","to","save","as","the","output","file","."]
code: def _write_output_file(self, output):
      """Writes abstract syntax tree (AST) to output file.
  
      Creates the directories for the output path, if needed.
  
      Args:
          output (ast.Module): AST to save as the output file.
      """
      self._make_output_dirs_if_needed()
  
      with open(self.output_path, "w") as output_file:
          output_file.write(pasta.dump(output))
  
imports: from __future__ import absolute_import
  from abc import abstractmethod
  import json
  import logging
  import os
  import pasta
  from sagemaker.cli.compatibility.v2.ast_transformer import ASTTransformer
label_desc: Use image node_id 4 for calling the PyFileUpdater obj's underlying member method code with example usage: obj._write_output_file(output) without return types