class_docstr: Manage a collection of HTTP response headers
class_docstr_tok: ["Manage","a","collection","of","HTTP","response","headers"]
docstr: Return first matching header value for 'name', or 'value'
  
  If there is no header named 'name', add a new header with name 'name'
  and value 'value'.
docstr_tok: ["Return","first","matching","header","value","for","'name","'",",","or","'value'","If","there","is","no","header","named","'name","'",",","add","a","new","header","with","name","'name'","and","value","'value","'","."]
code: def setdefault(self, name, value):
      """Return first matching header value for 'name', or 'value'
  
      If there is no header named 'name', add a new header with name 'name'
      and value 'value'."""
      result = self.get(name)
      if result is None:
          self._headers.append(
              (
                  self._convert_string_type(name),
                  self._convert_string_type(value),
              )
          )
          return value
      else:
          return result
  
file_path: cpython/Lib/wsgiref/headers.py
imports: import re
label_desc: Use image node_id 16 for calling the Headers obj's underlying member method code with example usage: obj.setdefault(name, value) and returns: value, result