def _load_passwords(names, length=20, generate=False):
    """Retrieve password from the user's home directory, or generate a new random one if none exists"""
    for name in names:
        filename = ''.join([env.home, name])
        if generate:
            passwd = _random_password(length=length)
            sudo(filename % 'touch %s', user=env.project_user)
            sudo('chmod 600 %s' % filename, user=env.project_user)
            with hide('running'):
                sudo('echo "%s">%s' % (passwd, filename), user=env.project_user)
        if env.host_string and files.exists(filename):
            with hide('stdout'):
                passwd = sudo('cat %s' % filename).strip()
        else:
            passwd = getpass('Please enter %s: ' % name)
        setattr(env, name, passwd)
dataset/ETHPy150Open python/raspberryio/fabfile.py/_load_passwords/swapped operands of `%`