human
Here's a good function header given the following:
I wrote the below code

    from time import strftime, localtime
    try:
        import json
    except ImportError:
        import simplejson as json
    try:
        import urllib.request as urllib_request
    except ImportError:
        import urllib2 as urllib_request
    def get_tumblr_posts(api_key, blogname, offset=0):
        url = (u'http://api.tumblr.com/v2/blog/%s.tumblr.com/posts?api_key=%s&offset=%d&filter=raw' % (blogname, api_key, offset))
        request = urllib_request.Request(url)
        handle = urllib_request.urlopen(request)
        posts = json.loads(handle.read().decode(u'utf-8'))
        return posts.get(u'response').get(u'posts')
    offset = 0
    posts = get_tumblr_posts(api_key, blogname, offset)
    while (len(posts) > 0):
        for post in posts:
            title = (post.get(u'title') or post.get(u'source_title') or post.get(u'type').capitalize())
            slug = (post.get(u'slug') or slugify(title))
            tags = post.get(u'tags')
            timestamp = post.get(u'timestamp')
            date = strftime(u'%Y-%m-%d    %H:%M:%S', localtime(int(timestamp)))
            slug = (strftime(u'%Y-%m-%d-', localtime(int(timestamp))) + slug)
            format = post.get(u'format')
            content = post.get(u'body')
            type = post.get(u'type')
            if (type == u'photo'):
                if (format == u'markdown'):
                    fmtstr = u'![%s](%s)'
                else:
                    fmtstr = u'<img    alt="%s"    src="%s"    />'
                content = u''
                for photo in post.get(u'photos'):
                    content += u'\n'.join((fmtstr % (photo.get(u'caption'), photo.get(u'original_size').get(u'url'))))
                content += (u'\n\n' + post.get(u'caption'))
            elif (type == u'quote'):
                if (format == u'markdown'):
                    fmtstr = u'\n\n&mdash.
   %s'
                else:
                    fmtstr = u'<p>&mdash.
   %s</p>'
                content = (post.get(u'text') + (fmtstr % post.get(u'source')))
 ...

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

def tumblr2fields(api_key, blogname):