code: def unflatten_dict(
      data: Dict[str, Any],
      sep: str = ".",
      stop_keys: Optional[List[str]] = None,
  ) -> Dict[str, Any]:
      """
      Given a flat dictionary keys, build a hierarchical version by grouping keys
  
      Parameters
      ----------
      data:
          The data dictionary
      sep:
          The key separator. Default "."
      stop_keys
          List of dictionary first level keys where hierarchy will stop
  
      Returns
      -------
  
      """
      resultDict = {}
      stop_keys = stop_keys or []
      for key, value in data.items():
          if key is not None:
              parts = key.split(sep)
              if parts[0] in stop_keys:
                  parts = [parts[0], sep.join(parts[1:])]
              d = resultDict
              for part in parts[:-1]:
                  if part not in d:
                      d[part] = {}
                  d = d[part]
              d[parts[-1]] = value
      return resultDict
  
file_path: argilla/src/argilla/server/helpers.py
imports: import logging
  from typing import Any, Dict, List, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: unflatten_dict(data, sep, stop_keys) and returns: resultDict