code: def make_tar_stream(build_context, buffer):
      
      tf = tarfile.TarFile(fileobj=buffer, mode='w')
      for context_path, fileobj in build_context.items():
          if getattr(fileobj, 'localpath', None) is not None:
              tf.add(fileobj.localpath, arcname=context_path)
          else:
              tar_add_bytes(tf, context_path, fileobj.read('rb'))
      tf.close()
docs: Write a tar stream of the build context to the provided buffer
  
      Args:
          build_context (Mapping[str, pyccc.FileReferenceBase]): dict mapping filenames to file references
          buffer (io.BytesIO): writable binary mode buffer