code: def _filter_from_dict(current: Dict[str, Any]) -> Dict[str, Any]:
      
      filter_ = dict()
  
      for k, v in current.items():
          if isinstance(v, dict):
              for sub, v2 in _filter_from_dict(v).items():
                  filter_[f'{k}.{sub}'] = v2
          else:
              filter_[k] = v
  
      return filter_
docs: Takes in a nested dictionary as a filter and returns a flattened filter dictionary