code: def generate_auth_certificates(path, overwrite=False, logging=False):
      """
      ## generate_auth_certificates
  
      Auto-Generates, and Auto-validates CURVE ZMQ key-pairs for NetGear API's Secure Mode.
  
      Parameters:
          path (string): path for generating CURVE key-pairs
          overwrite (boolean): overwrite existing key-pairs or not?
          logging (bool): enables logging for its operations
  
      **Returns:** A valid CURVE key-pairs path as string.
      """
      # import necessary lib
      import zmq.auth
  
      # check if path corresponds to vidgear only
      if os.path.basename(path) != ".vidgear":
          path = os.path.join(path, ".vidgear")
  
      # generate keys dir
      keys_dir = os.path.join(path, "keys")
      mkdir_safe(keys_dir, logging=logging)
  
      # generate separate public and private key dirs
      public_keys_dir = os.path.join(keys_dir, "public_keys")
      secret_keys_dir = os.path.join(keys_dir, "private_keys")
  
      # check if overwriting is allowed
      if overwrite:
          # delete previous certificates
          for dirs in [public_keys_dir, secret_keys_dir]:
              if os.path.exists(dirs):
                  shutil.rmtree(dirs)
              mkdir_safe(dirs, logging=logging)
  
          # generate new keys
          (
              server_public_file,
              server_secret_file,
          ) = zmq.auth.create_certificates(keys_dir, "server")
          (
              client_public_file,
              client_secret_file,
          ) = zmq.auth.create_certificates(keys_dir, "client")
  
          # move keys to their appropriate directory respectively
          for key_file in os.listdir(keys_dir):
              if key_file.endswith(".key"):
                  shutil.move(
                      os.path.join(keys_dir, key_file), public_keys_dir
                  )
              elif key_file.endswith(".key_secret"):
                  shutil.move(
                      os.path.join(keys_dir, key_file), secret_keys_dir
                  )
              else:
                  # clean redundant keys if present
                  redundant_key = os.path.join(keys_dir, key_file)
                  if os.path.isfile(redundant_key):
                      delete_file_safe(redundant_key)
      else:
          # otherwise validate available keys
          status_public_keys = validate_auth_keys(
              public_keys_dir, ".key"
          )
          status_private_keys = validate_auth_keys(
              secret_keys_dir, ".key_secret"
          )
  
          # check if all valid keys are found
          if status_private_keys and status_public_keys:
              return (keys_dir, secret_keys_dir, public_keys_dir)
  
          # check if valid public keys are found
          if not (status_public_keys):
              mkdir_safe(public_keys_dir, logging=logging)
  
          # check if valid private keys are found
          if not (status_private_keys):
              mkdir_safe(secret_keys_dir, logging=logging)
  
          # generate new keys
          (
              server_public_file,
              server_secret_file,
          ) = zmq.auth.create_certificates(keys_dir, "server")
          (
              client_public_file,
              client_secret_file,
          ) = zmq.auth.create_certificates(keys_dir, "client")
  
          # move keys to their appropriate directory respectively
          for key_file in os.listdir(keys_dir):
              if key_file.endswith(".key") and not (status_public_keys):
                  shutil.move(
                      os.path.join(keys_dir, key_file),
                      os.path.join(public_keys_dir, "."),
                  )
              elif key_file.endswith(".key_secret") and not (
                  status_private_keys
              ):
                  shutil.move(
                      os.path.join(keys_dir, key_file),
                      os.path.join(secret_keys_dir, "."),
                  )
              else:
                  # clean redundant keys if present
                  redundant_key = os.path.join(keys_dir, key_file)
                  if os.path.isfile(redundant_key):
                      delete_file_safe(redundant_key)
  
      # validate newly generated keys
      status_public_keys = validate_auth_keys(public_keys_dir, ".key")
      status_private_keys = validate_auth_keys(
          secret_keys_dir, ".key_secret"
      )
  
      # raise error is validation test fails
      if not (status_private_keys) or not (status_public_keys):
          raise RuntimeError(
              "[Helper:ERROR] :: Unable to generate valid ZMQ authentication certificates at `{}`!".format(
                  keys_dir
              )
          )
  
      # finally return valid key paths
      return (keys_dir, secret_keys_dir, public_keys_dir)
  
imports: import os
  import re
  import sys
  import cv2
  import types
  import errno
  import stat
  import shutil
  import importlib
  import requests
  import numpy
  import logging
  import platform
  import socket
  from tqdm import tqdm
  from contextlib import closing
  from pathlib import Path
  from colorlog import ColoredFormatter
  from pkg_resources import parse_version
  from requests.adapters import HTTPAdapter, Retry
  from ..version import __version__
label_desc: Use image node_id 32 for calling a global function with example usage: generate_auth_certificates(path, overwrite, logging) and returns: keys_dir,  secret_keys_dir,  public_keys_dir, keys_dir,  secret_keys_dir,  public_keys_dir