def start_snap(name, snapshot_id, size=None, script=None):
    output = terminal.start_snapshot(snapshot_id, size, None, name, None, script)
    time.sleep(int(int(args.quantity) * 0.04) + 1)
    request_id = output['request_id']
    output = terminal.request_progress(request_id)
    try:
        if output['status'] != 'success':
            pass
    except:
        time.sleep(int(int(args.quantity) * 0.03) + 1)
        output = terminal.request_progress(request_id)

    state = 'None'
    while output['status'] != 'success':
        try:
            time.sleep(int(args.quantity) * 0.03 + 1)
            output = terminal.request_progress(request_id)
            if output['state'] != state:
                state = output['state']
                print('%s - (%s)' % (name, state))
        except:
            print "Retrying %s" % name
            time.sleep(int(args.quantity * 0.02) + 2)
    done = False
    while done is False:
        try:
            output = terminal.request_progress(request_id)
            container_key = output['result']['container_key']
            subdomain = output['result']['subdomain']
            container_ip = output['result']['container_ip']
            done = True
        except:
            print "Retrying %s" % name
            time.sleep(int(int(args.quantity) * 0.02) + 1)
            done = False
    return container_key, container_ip, subdomain
dataset/ETHPy150Open terminalcloud/terminal-tools/script-terminals.py/start_snap/original