code: def _redact_secret(
          data: Union[Dict, List],
  ) -> Union[Dict, List]:
      
  
      if isinstance(data, dict):
          stack = [data]
      else:
          stack = []
  
      while stack:
          current = stack.pop()
  
          if 'secret' in current:
              current['secret'] = '<redacted>'
          else:
              stack.extend(
                  value
                  for value in current.values()
                  if isinstance(value, dict)
              )
  
      return data
docs: Modify `data` in-place and replace keys named `secret`.