code: def _dir_or_none(path):
      """Returns None if path does not exist."""
      if os.path.isdir(path):
          return path
      return None
  
file_path: cupy/cupyx/_runtime.py
imports: import inspect
  import io
  import os
  import platform
  import warnings
  import numpy
  import cupy
  import cupy_backends
label_desc: Use image node_id 4 for calling a global function with example usage: _dir_or_none(path) and returns: None, path