Is there a way to populate a full matrix given only an octant segment, with symmetry?

I have an octant of a symmetric matrix which looks like this:

arr_in = [[1],
           [0, 0],
           [0, 0, 1],
           [0, 0, 0, 0],
           [0, 1, 0, 1, 0]]

I need to convert this into the full array, is there a way to do this with numpy? The full matrix end product should be:

0 1 0 1 0 1 0 1 0
1 0 0 0 0 0 0 0 1
0 0 1 0 0 0 1 0 0
1 0 0 0 0 0 0 0 1
0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 1
0 0 1 0 0 0 1 0 0 
1 0 0 0 0 0 0 0 1
0 1 0 1 0 1 0 1 0

Answer

I used np.clip and np.rot90:

import numpy as np


arr_in = [[1],
          [0, 0],
          [0, 0, 1],
          [0, 0, 0, 0],
          [0, 1, 0, 1, 0]]

x = np.zeros((5, 5), dtype="uint8")

for idx, row in enumerate(arr_in):
    x[idx, :len(row)] = row

np.clip(x + x.T, 0, 1, out=x)

final = np.zeros((9, 9), dtype="uint8")
final[:5, :5] = np.rot90(x, 2)  # NW corner
final[:5, 4:] = np.rot90(x, 1)  # NE corner
final[4:, :5] = np.rot90(x, 3)  # SW corner
final[4:, 4:] = x               # SE corner

Output:

array([[0, 1, 0, 1, 0, 1, 0, 1, 0],
       [1, 0, 0, 0, 0, 0, 0, 0, 1],
       [0, 0, 1, 0, 0, 0, 1, 0, 0],
       [1, 0, 0, 0, 0, 0, 0, 0, 1],
       [0, 0, 0, 0, 1, 0, 0, 0, 0],
       [1, 0, 0, 0, 0, 0, 0, 0, 1],
       [0, 0, 1, 0, 0, 0, 1, 0, 0],
       [1, 0, 0, 0, 0, 0, 0, 0, 1],
       [0, 1, 0, 1, 0, 1, 0, 1, 0]], dtype=uint8)