code: def prepare_subset_csv(full_diary_csv, rec_id, out_csv_file):
      """Prepares csv for a given recording ID.
  
      Arguments
      ---------
      full_diary_csv : csv
          Full csv containing all the recordings
      rec_id : str
          The recording ID for which csv has to be prepared
      out_csv_file : str
          Path of the output csv file.
      """
  
      out_csv_head = [full_diary_csv[0]]
      entry = []
      for row in full_diary_csv:
          if row[0].startswith(rec_id):
              entry.append(row)
  
      out_csv = out_csv_head + entry
  
      with open(out_csv_file, mode="w") as csv_file:
          csv_writer = csv.writer(
              csv_file,
              delimiter=",",
              quotechar='"',
              quoting=csv.QUOTE_MINIMAL,
          )
          for r in out_csv:
              csv_writer.writerow(r)
  
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 3 for calling a global function with example usage: prepare_subset_csv(full_diary_csv, rec_id, out_csv_file) without return types