def _to_unicode(input_bytes, encoding='utf-8'):
    """Decodes input_bytes to text if needed."""
    if not isinstance(input_bytes, (str, )):
        input_bytes = input_bytes.decode(encoding)
    return input_bytes