parameters: (cls, file_name)
return_statement: return instance
docstring: r"""
          Open MindRecord file and get ready to append data.
  
          Args:
              file_name (str): String of MindRecord file name.
  
          Returns:
              FileWriter, file writer object for the opened MindRecord file.
  
          Raises:
              ParamValueError: If file_name is invalid.
              FileNameError: If path contains invalid characters.
              MRMOpenError: If failed to open MindRecord file.
              MRMOpenForAppendError: If failed to open file for appending data.
  
          Examples:
              >>> from mindspore.mindrecord import FileWriter
              >>> schema_json = {"file_name": {"type": "string"}, "label": {"type": "int32"}, "data": {"type": "bytes"}}
              >>> data = [{"file_name": "1.jpg", "label": 0,
              ...          "data": b"\x10c\xb3w\xa8\xee$o&<q\x8c\x8e(\xa2\x90\x90\x96\xbc\xb1\x1e\xd4QER\x13?\xff"}]
              >>> writer = FileWriter(file_name="test.mindrecord", shard_num=1)
              >>> writer.add_schema(schema_json, "test_schema")
              0
              >>> writer.write_raw_data(data)
              MSRStatus.SUCCESS
              >>> writer.commit()
              MSRStatus.SUCCESS
              >>> write_append = FileWriter.open_for_append("test.mindrecord")
              >>> write_append.write_raw_data(data)
              MSRStatus.SUCCESS
              >>> write_append.commit()
              MSRStatus.SUCCESS
docstring_summary: r"""
          Open MindRecord file and get ready to append data.
docstring_tokens: r Open MindRecord file and get ready to append data .
function: def open_for_append(cls, file_name):
          r"""
          Open MindRecord file and get ready to append data.
  
          Args:
              file_name (str): String of MindRecord file name.
  
          Returns:
              FileWriter, file writer object for the opened MindRecord file.
  
          Raises:
              ParamValueError: If file_name is invalid.
              FileNameError: If path contains invalid characters.
              MRMOpenError: If failed to open MindRecord file.
              MRMOpenForAppendError: If failed to open file for appending data.
  
          Examples:
              >>> from mindspore.mindrecord import FileWriter
              >>> schema_json = {"file_name": {"type": "string"}, "label": {"type": "int32"}, "data": {"type": "bytes"}}
              >>> data = [{"file_name": "1.jpg", "label": 0,
              ...          "data": b"\x10c\xb3w\xa8\xee$o&<q\x8c\x8e(\xa2\x90\x90\x96\xbc\xb1\x1e\xd4QER\x13?\xff"}]
              >>> writer = FileWriter(file_name="test.mindrecord", shard_num=1)
              >>> writer.add_schema(schema_json, "test_schema")
              0
              >>> writer.write_raw_data(data)
              MSRStatus.SUCCESS
              >>> writer.commit()
              MSRStatus.SUCCESS
              >>> write_append = FileWriter.open_for_append("test.mindrecord")
              >>> write_append.write_raw_data(data)
              MSRStatus.SUCCESS
              >>> write_append.commit()
              MSRStatus.SUCCESS
          """
  
          check_filename(file_name)
          # construct ShardHeader
          reader = ShardReader()
          reader.open(file_name, False)
          header = ShardHeader(reader.get_header())
          reader.close()
  
          instance = cls("append")
          instance.init_append(file_name, header)
          return instance
function_tokens: def open_for_append ( cls , file_name ) : check_filename ( file_name ) # construct ShardHeader reader = ShardReader ( ) reader . open ( file_name , False ) header = ShardHeader ( reader . get_header ( ) ) reader . close ( ) instance = cls ( "append" ) instance . init_append ( file_name , header ) return instance