human
I wrote the below code

    method = (method or 'both')
    def dictify(fs):
        if (fs.list is None):
            fs.list = []
        return dict([(k, fs[k]) for k in fs.keys()])
    e = ctx.env.copy()
    a = b = {}
    if (method.lower() in ['both', 'post', 'put']):
        if (e['REQUEST_METHOD'] in ['POST', 'PUT']):
            if e.get('CONTENT_TYPE', '').lower().startswith('multipart/'):
                a = ctx.get('_fieldstorage')
                if (not a):
                    fp = e['wsgi.input']
                    a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
                    ctx._fieldstorage = a
            else:
                d = data()
                if (PY2 and isinstance(d, unicode)):
                    d = d.encode('utf-8')
                fp = BytesIO(d)
                a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
            a = dictify(a)
    if (method.lower() in ['both', 'get']):
        e['REQUEST_METHOD'] = 'GET'
        b = dictify(cgi.FieldStorage(environ=e, keep_blank_values=1))
    def process_fieldstorage(fs):
        if isinstance(fs, list):
            return [process_fieldstorage(x) for x in fs]
        elif (fs.filename is None):
            return fs.value
        else:
            return fs
    return storage([(k, process_fieldstorage(v)) for (k, v) in dictadd(b, a).items()])

What's a good function header?
assistant
#Here's a good function header.

def rawinput(method=None):