def generate_vagrant(image, builder, installProfile, api=None, login=None):
    installProfile = get_memory_amount(builder, installProfile, True)
    if installProfile == 2:
        return None, None, None

    if "publicBaseBox" in builder and builder["publicBaseBox"] == "true":
        # private vagrant
        if not "osUser" in builder:
            printer.out("osUser not found in vagrant builder", printer.ERROR)
            return None, None, None
        if not "sshKey" in builder:
            printer.out("sshKey not found in vagrant builder", printer.ERROR)
            return None, None, None

        # create ssh key for the user
        sshkey = generics_utils.create_user_ssh_key(self.api, self.login, builder["sshKey"])
        if sshkey == 2:
            return None, None, None

        sshKeys = sshKeys()
        sshKeys.add_sshKey(sshkey)
        vagrantUser = osUser()
        vagrantUser.name = builder["osUser"]
        vagrantUser.sshKeys = sshKeys
        installProfile.osusers.add_osUser(vagrantUser)
    else:
        pass

    image.compress = True
    return image, installProfile
dataset/ETHPy150Open usharesoft/hammr/src/hammr/utils/generate_utils.py/generate_vagrant/original