code: def create_tmp_extension_dir(
      file_contents, file_name="my_extension.py"
  ):
      """
      Create and return a temporary dir to be used as a dir containing extensions
      to be read by a cugraph_service server. file_contents is a string
      containing the contents of the extension file to write out.
      """
      tmp_extension_dir = TemporaryDirectory()
  
      graph_creation_extension_file = open(
          Path(tmp_extension_dir.name) / file_name, "w"
      )
      print(
          file_contents, file=graph_creation_extension_file, flush=True
      )
  
      return tmp_extension_dir
  
file_path: cugraph/python/cugraph-service/server/cugraph_service_server/testing/utils.py
imports: import sys
  import os
  import subprocess
  import time
  from tempfile import TemporaryDirectory
  from pathlib import Path
  from cugraph_service_client import CugraphServiceClient, defaults
  from cugraph_service_client.exceptions import CugraphServiceError
label_desc: Use image node_id 1 for calling a global function with example usage: create_tmp_extension_dir(file_contents, file_name) and returns: tmp_extension_dir