code: def getfirst(self, key, default=None):
          
          
          values = self.getlist(key)
          return values[0] if values else default
docs: Returns the first value of a list or the value itself when given a
          `request.vars` style key.
  
          If the value is a list, its first item will be returned;
          otherwise, the value will be returned as-is.
  
          Example output for a query string of `?x=abc&y=abc&y=def`::
  
              >>> request = Storage()
              >>> request.vars = Storage()
              >>> request.vars.x = 'abc'
              >>> request.vars.y = ['abc', 'def']
              >>> request.vars.getfirst('x')
              'abc'
              >>> request.vars.getfirst('y')
              'abc'
              >>> request.vars.getfirst('z')