human
I wrote the below code

    def encode_str(item):
        if isinstance(item, six.text_type):
            return item.encode('utf8')
        return item
    return dict(((encode_str(k), encode_str(v)) for (k, v) in metadata.items()))

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

def _encode_metadata(metadata):