code: def _normalize(obj):
      
      if isinstance(obj, list):
          return [_normalize(item) for item in obj]
      elif isinstance(obj, dict):
          return {k: _normalize(v) for k, v in obj.items() if v is not None}
      elif hasattr(obj, 'to_python'):
          return obj.to_python()
      return obj
docs: Normalize dicts and lists
  
      :param obj:
      :return: normalized object