code: def filter_none(data: Dict[str, Any],
                  keys: OptKeys = None) -> Dict[str, Any]:
      
  
      def limited_filter(k: str, v: Any) -> bool:
          return k not in keys or v is not None  # type: ignore
  
      def full_filter(k: str, v: Any) -> bool:
          return v is not None
  
      f = limited_filter if keys is not None else full_filter
      return {k: v for k, v in data.items() if f(k, v)}
docs: Filter keys from dict with None values.
  
      Check occurs only on root level. If list of keys specified, filter
      works only for selected keys