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

    """Pre-process incoming queue attributes before setting them
    """
    if isinstance(attributes, six.string_types):
        attributes = json.loads(attributes)
    def stringified(val):
        if isinstance(val, dict):
            return json.dumps(val)
        return val
    return dict(((attr, stringified(val)) for (attr, val) in six.iteritems(attributes)))