<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_across_paths_textnodes(paths_nodes, dbg=False):

 """Given a list of parent paths tupled with children textnodes, plus
 initialized feature values, we calculate the total and average string
 length of the parent's children textnodes.
 """


    # for (path, [textnodes],
    #           num. of tnodes,
    #           ttl strlen across tnodes,
    #           avg strlen across tnodes.])
    for path_nodes in paths_nodes:
        cnt = len(path_nodes[1][0])
        ttl = sum([len(s) for s in paths_nodes[1][0]])  # calculate total
        path_nodes[1][1] = cnt                          # cardinality
        path_nodes[1][2] = ttl                          # total
        path_nodes[1][3] = ttl/ cnt                     # average
        if dbg:
            print(path_nodes[1])