docstr: Given a directory with:
  * an ``.arrow_file``
  * a ``.stream``
  associated to the json integration file at ``test_case.path``
  
  verify that the consumer can read both and agrees with
  what the json file contains; also run ``stream_to_file`` and
  verify that the consumer produces an equivalent file from the
  IPC stream.
docstr_tok: ["Given","a","directory","with",":","*","an","``",".arrow_file","``","*","a","``",".stream","``","associated","to","the","json","integration","file","at","``","test_case.path","``","verify","that","the","consumer","can","read","both","and","agrees","with","what","the","json","file","contains",";","also","run","``","stream_to_file","``","and","verify","that","the","consumer","produces","an","equivalent","file","from","the","IPC","stream","."]
code: def _run_gold(
      self, gold_dir: str, consumer: Tester, test_case: datagen.File
  ) -> None:
      """
      Given a directory with:
      * an ``.arrow_file``
      * a ``.stream``
      associated to the json integration file at ``test_case.path``
  
      verify that the consumer can read both and agrees with
      what the json file contains; also run ``stream_to_file`` and
      verify that the consumer produces an equivalent file from the
      IPC stream.
      """
      json_path = test_case.path
  
      # Validate the file
      log("-- Validating file")
      producer_file_path = os.path.join(
          gold_dir, "generated_" + test_case.name + ".arrow_file"
      )
      consumer.validate(
          json_path, producer_file_path, quirks=test_case.quirks
      )
  
      log("-- Validating stream")
      consumer_stream_path = os.path.join(
          gold_dir, "generated_" + test_case.name + ".stream"
      )
      file_id = guid()[:8]
      name = os.path.splitext(os.path.basename(json_path))[0]
  
      consumer_file_path = os.path.join(
          self.temp_dir,
          file_id + "_" + name + ".consumer_stream_as_file",
      )
  
      consumer.stream_to_file(consumer_stream_path, consumer_file_path)
      consumer.validate(
          json_path, consumer_file_path, quirks=test_case.quirks
      )
  
imports: from collections import namedtuple
  from concurrent.futures import ThreadPoolExecutor
  from functools import partial
  import glob
  import gzip
  import itertools
  import os
  import sys
  import tempfile
  import traceback
  from typing import Callable, List, Optional
  from .None import cdata
  from .scenario import Scenario
  from .tester import Tester, CDataExporter, CDataImporter
  from .tester_cpp import CppTester
  from .tester_go import GoTester
  from .tester_rust import RustTester
  from .tester_java import JavaTester
  from .tester_js import JSTester
  from .tester_csharp import CSharpTester
  from .util import guid, printer
  from .util import SKIP_C_ARRAY, SKIP_C_SCHEMA, SKIP_FLIGHT, SKIP_IPC
  from ..utils.source import ARROW_ROOT_DEFAULT
  from .None import datagen
label_desc: Use image node_id 10 for calling the IntegrationRunner obj's underlying member method code with example usage: obj._run_gold(gold_dir, consumer, test_case) without return types