def to_bytestring(value):
    if isinstance(value, six.text_type):
        return value.encode('utf8')
    if isinstance(value, six.binary_type):
        return value
    if six.PY2:
        return str(value)
    return bytes(str(value), 'utf8')
Remove all directories, databases, etc. associated with the application.
dataset/ETHPy150Open codeinthehole/django-cacheback/cacheback/base.py/to_bytestring--crossover with--dataset/ETHPy150Open ireapps/census/censusweb/fabfile.py/shiva_the_destroyer