<gh_stars>0
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

"""
utilities for our experiments
"""

def byteify(input):
    if isinstance(input, dict):
        return {byteify(key):byteify(value) for key,value in input.iteritems()}
    elif isinstance(input, list):
        return [byteify(element) for element in input]
    elif isinstance(input, unicode):
        return input.encode('utf-8')
    else:
        return input
