human
I wrote the below code

    import base64
    from datetime import timedelta
    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_posterous_posts(api_token, email, password, page=1):
        base64string = base64.encodestring((u'%s:%s' % (email, password)).encode(u'utf-8')).replace(u'\n', u'')
        url = (u'http://posterous.com/api/v2/users/me/sites/primary/posts?api_token=%s&page=%d' % (api_token, page))
        request = urllib_request.Request(url)
        request.add_header(u'Authorization', (u'Basic    %s' % base64string.decode()))
        handle = urllib_request.urlopen(request)
        posts = json.loads(handle.read().decode(u'utf-8'))
        return posts
    page = 1
    posts = get_posterous_posts(api_token, email, password, page)
    while (len(posts) > 0):
        posts = get_posterous_posts(api_token, email, password, page)
        page += 1
        for post in posts:
            slug = post.get(u'slug')
            if (not slug):
                slug = slugify(post.get(u'title'))
            tags = [tag.get(u'name') for tag in post.get(u'tags')]
            raw_date = post.get(u'display_date')
            date_object = SafeDatetime.strptime(raw_date[:(-6)], u'%Y/%m/%d    %H:%M:%S')
            offset = int(raw_date[(-5):])
            delta = timedelta(hours=(offset / 100))
            date_object -= delta
            date = date_object.strftime(u'%Y-%m-%d    %H:%M')
            kind = u'article'
            status = u'published'
            (yield (post.get(u'title'), post.get(u'body_cleaned'), slug, date, post.get(u'user').get(u'display_name'), [], tags, status, kind, u'html'))

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

def posterous2fields(api_token, email, password):