code: def open_dir_fd(path):
      """Open a file descriptor to a directory."""
      assert os.path.isdir(path)
      flags = os.O_RDONLY
      if hasattr(os, "O_DIRECTORY"):
          flags |= os.O_DIRECTORY
      dir_fd = os.open(path, flags)
      try:
          yield dir_fd
      finally:
          os.close(dir_fd)
  
imports: import collections.abc
  import contextlib
  import errno
  import os
  import re
  import stat
  import string
  import sys
  import time
  import unittest
  import warnings
  from test import support
label_desc: Use image node_id 18 for calling a global function with example usage: open_dir_fd(path) without return types