<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def r_sa_check(template, tag_type, is_standalone):
 """Do a final checkto see if a tag could be a standalone"""


    # Check right side if we might be a standalone
    if is_standalone and tag_type not in ['variable', 'no escape']:
        on_newline = template.split('\n', 1)

        # If the stuff to the right of us are spaces we're a standalone
        if on_newline[0].isspace() or not on_newline[0]:
            return True
        else:
            return False

    # If we're a tag can't be a standalone
    else:
        return False