def set_env(env):
    """Returns a series of lines to set all the environment variables to their
    corresponding values in env.

    """
    lines = []
    for key, value in env.iteritems():
        lines.append("export {0}={1}".format(key, value))
    return '\n'.join(lines)