code: def _set_filepicker_kwargs(fileDlg, **kwargs):
      """Applies a dict of enum/flag kwarg opts to a file dialog"""
      NO_MATCH = object()
  
      for kk, vv in kwargs.items():
          # Convert string or list representations into true flags
          # 'fileMode' -> 'FileMode'
          formattedName = kk[0].upper() + kk[1:]
          # Edge case: "Options" has enum "Option"
          if formattedName == "Options":
              enumCls = fileDlg.Option
          else:
              enumCls = getattr(fileDlg, formattedName, NO_MATCH)
          setFunc = getattr(fileDlg, f"set{formattedName}", NO_MATCH)
          if enumCls is NO_MATCH or setFunc is NO_MATCH:
              continue
          if enumCls is fileDlg.Option:
              builder = fileDlg.Option(0)
              # This is the only flag enum, all others can only take one value
              if isinstance(vv, str):
                  vv = [vv]
              for flag in vv:
                  curVal = getattr(enumCls, flag)
                  builder |= curVal
              # Some Qt implementations turn into ints by this point
              outEnum = enumCls(builder)
          else:
              outEnum = getattr(enumCls, vv)
          setFunc(outEnum)
  
file_path: pyqtgraph/pyqtgraph/parametertree/parameterTypes/file.py
imports: import os
  import re
  from ...Qt import QtCore, QtGui, QtWidgets
  from ..Parameter import Parameter
  from .str import StrParameterItem
label_desc: Use image node_id 1 for calling a global function with example usage: _set_filepicker_kwargs(fileDlg) without return types