code: def configure_options(pattern="*"):
      """
      Queries ImageMagick library for configurations options given at
      compile-time.
  
      Example: Find where the ImageMagick documents are installed::
  
          >>> from wand.version import configure_options
          >>> configure_options('DOC*')
          {'DOCUMENTATION_PATH': '/usr/local/share/doc/ImageMagick-6'}
  
      :param pattern: A term to filter queries against. Supports wildcard '*'
                      characters. Default patterns '*' for all options.
      :type pattern: :class:`basestring`
      :returns: Directory of configuration options matching given pattern
      :rtype: :class:`collections.defaultdict`
      """
      if not isinstance(pattern, string_type):
          raise TypeError(
              "pattern must be a string, not " + repr(pattern)
          )
      # We must force init environment to load user config paths.
      library.MagickWandGenesis()
      pattern_p = ctypes.create_string_buffer(binary(pattern))
      config_count = ctypes.c_size_t(0)
      configs = {}
      configs_p = library.MagickQueryConfigureOptions(
          pattern_p, ctypes.byref(config_count)
      )
      for cursor in range(config_count.value):
          config = ctypes.string_at(configs_p[cursor])
          val_p = library.MagickQueryConfigureOption(config)
          if val_p:
              configs[text(config)] = text(ctypes.string_at(val_p))
              val_p = library.MagickRelinquishMemory(val_p)
      if configs_p:
          configs_p = library.MagickRelinquishMemory(configs_p)
      return configs
  
file_path: wand/wand/version.py
imports: from __future__ import print_function
  import ctypes
  import datetime
  import re
  import sys
  from .compat import binary, string_type, text
label_desc: Use image node_id 1 for calling a global function with example usage: configure_options(pattern) and returns: configs