code: def write_ders_file(ref_rttm, DER, out_der_file):
      """Write the final DERs for individual recording.
  
      Arguments
      ---------
      ref_rttm : str
          Reference RTTM file.
      DER : array
          Array containing DER values of each recording.
      out_der_file : str
          File to write the DERs.
      """
  
      rttm = read_rttm(ref_rttm)
      spkr_info = list(
          filter(lambda x: x.startswith("SPKR-INFO"), rttm)
      )
  
      rec_id_list = []
      count = 0
  
      with open(out_der_file, "w") as f:
          for row in spkr_info:
              a = row.split(" ")
              rec_id = a[1]
              if rec_id not in rec_id_list:
                  r = [rec_id, str(round(DER[count], 2))]
                  rec_id_list.append(rec_id)
                  line_str = " ".join(r)
                  f.write("%s\n" % line_str)
                  count += 1
          r = ["OVERALL ", str(round(DER[count], 2))]
          line_str = " ".join(r)
          f.write("%s\n" % line_str)
  
imports: import csv
  import numbers
  import warnings
  import scipy
  import pytest
  import numpy
  from scipy import sparse
  from scipy.sparse.linalg import eigsh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.csgraph import laplacian
label_desc: Use image node_id 2 for calling a global function with example usage: write_ders_file(ref_rttm, DER, out_der_file) without return types