<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def basic_network(cm=False):
 """A 3-node network of logic gates. Diagram:: +~~~~~~~~+ +~~~~>| A |<~~~~+ | | (OR) +~~~+ | | +~~~~~~~~+ | | | | | | v | +~+~~~~~~+ +~~~~~+~+ | B |<~~~~~~+ C | | (COPY) +~~~~~~>| (XOR) | +~~~~~~~~+ +~~~~~~~+ TPM: | Previous state | Current state | | A, B, C | A, B, C | +================+===============+ | 0, 0, 0 | 0, 0, 0 | | 1, 0, 0 | 0, 0, 1 | | 0, 1, 0 | 1, 0, 1 | | 1, 1, 0 | 1, 0, 0 | | 0, 0, 1 | 1, 1, 0 | | 1, 0, 1 | 1, 1, 1 | | 0, 1, 1 | 1, 1, 1 | | 1, 1, 1 | 1, 1, 0 | Connectivity matrix: +---+---+---+---+ | . | A | B | C | +---+---+---+---+ | A | 0 | 0 | 1 | +---+---+---+---+ | B | 1 | 0 | 1 | +---+---+---+---+ | C | 1 | 1 | 0 | +---+---+---+---+ .. note:: |CM[i][j] = 1| means that there is a directed edge |(i,j)| from node |i| to node |j| and |CM[i][j] = 0| means there is no edge from |i| to |j|. """

    tpm = np.array([
        [0, 0, 0],
        [0, 0, 1],
        [1, 0, 1],
        [1, 0, 0],
        [1, 1, 0],
        [1, 1, 1],
        [1, 1, 1],
        [1, 1, 0]
    ])
    if cm is False:
        cm = np.array([
            [0, 0, 1],
            [1, 0, 1],
            [1, 1, 0]
        ])
    else:
        cm = None
    return Network(tpm, cm=cm, node_labels=LABELS[:tpm.shape[1]])