import six


def to_unicodestr(string):
    """If input string is a byte string convert to Unicode string."""
    if isinstance(string, six.binary_type):
        return string.decode('utf8')

    return string