human
Complete this python program:
def countedArray(expr):
assistant
#Here is the Python program you requested.

    """Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
    integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    """
    arrayExpr = Forward()
    def countFieldParseAction(s, l, t):
        n = int(t[0])
        (arrayExpr << ((n and Group(And(([expr] * n)))) or Group(empty)))
        return []
    return (Word(nums).setName('arrayLen').setParseAction(countFieldParseAction, callDuringTry=True) + arrayExpr)