<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def guard_submit(analysis_request):
 """Return whether the transition "submit" can be performed or not. Returns True if there is at least one analysis in a non-detached state and all analyses in a non-detached analyses have been submitted. """

    analyses_ready = False
    for analysis in analysis_request.getAnalyses():
        analysis = api.get_object(analysis)
        analysis_status = api.get_workflow_status_of(analysis)
        if analysis_status in ANALYSIS_DETACHED_STATES:
            continue
        if analysis_status in ['assigned', 'unassigned', 'registered']:
            return False
        analyses_ready = True
    return analyses_ready