<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalized_nodes_on_bdry(nodes_on_bdry, length):
 """Return a list of 2-tuples of bool from the input parameter. This function is intended to normalize a ``nodes_on_bdry`` parameter that can be given as a single boolean (global) or as a sequence (per axis). Each entry of the sequence can either be a single boolean (global for the axis) or a boolean sequence of length 2. Parameters nodes_on_bdry : bool or sequence Input parameter to be normalized according to the above scheme. length : positive int Desired length of the returned list. Returns ------- normalized : list of 2-tuples of bool Normalized list with ``length`` entries, each of which is a 2-tuple of boolean values. Examples -------- Global for all axes: [(True, True), (True, True)] Global per axis: [(True, True), (False, False)] Mixing global and explicit per axis: [(True, False), (False, False), (True, True)] """

    shape = np.shape(nodes_on_bdry)
    if shape == ():
        out_list = [(bool(nodes_on_bdry), bool(nodes_on_bdry))] * length
    elif length == 1 and shape == (2,):
        out_list = [(bool(nodes_on_bdry[0]), bool(nodes_on_bdry[1]))]
    elif len(nodes_on_bdry) == length:
        out_list = []

        for i, on_bdry in enumerate(nodes_on_bdry):
            shape_i = np.shape(on_bdry)
            if shape_i == ():
                out_list.append((bool(on_bdry), bool(on_bdry)))
            elif shape_i == (2,):
                out_list.append((bool(on_bdry[0]), bool(on_bdry[1])))
            else:
                raise ValueError('in axis {}: `nodes_on_bdry` has shape {}, '
                                 'expected (2,)'
                                 .format(i, shape_i))
    else:
        raise ValueError('`nodes_on_bdry` has shape {}, expected ({},)'
                         ''.format(shape, length))

    return out_list