<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tag_builder(parser, token, cls, flow_type):
 """Helper function handling flow form tags."""

    tokens = token.split_contents()
    tokens_num = len(tokens)

    if tokens_num == 1 or (tokens_num == 3 and tokens[1] == 'for'):
        flow_name = None
        if tokens_num == 3:
            flow_name = tokens[2]
        return cls(flow_name)
    else:
        raise template.TemplateSyntaxError(
            '"sitegate_%(type)s_form" tag requires zero or two arguments. '
            'E.g. {%% sitegate_%(type)s_form %%} or '
            '{%% sitegate_%(type)s_form for ClassicSignup %%}.' % {'type': flow_type})