import six


def text_type(string, encoding='utf-8'):
    """
    Given text, or bytes as input, return text in both python 2/3
    
    This is needed because the arguments to six.binary_type and six.text_type change based on
    if you are passing it text or bytes, and if you simply pass bytes to 
    six.text_type without an encoding you will get output like: ``six.text_type(b'hello-world')``
    which is not desirable.
    """
    if isinstance(string, six.text_type):
        return six.text_type(string)
    else:
        return six.text_type(string, encoding)