human
Complete this python program:
def _serialize_hstore(val):
assistant
#Here is the Python program you requested.

    """Serialize a dictionary into an hstore literal.  Keys and values must
    both be strings (except None for values).
    """
    def esc(s, position):
        if ((position == 'value') and (s is None)):
            return 'NULL'
        elif isinstance(s, util.string_types):
            return ('"%s"' % s.replace('\\', '\\\\').replace('"', '\\"'))
        else:
            raise ValueError(('%r    in    %s    position    is    not    a    string.' % (s, position)))
    return ',    '.join((('%s=>%s' % (esc(k, 'key'), esc(v, 'value'))) for (k, v) in val.items()))