<｜begin▁of▁sentence｜>### Instruction:
If you need to create a 3x3 matrix where all elements are the number 7, how would you use a function to fill it with the given value?
### Response:
import numpy as np

# Fill a 3x3 matrix with the number 7
def fill_matrix(value, shape):
    if isinstance(shape, int):
        shape = (shape, shape)
    return np.full(shape, value)

# Create a 3x3 matrix filled with 7s
filled_matrix = fill_matrix(7, 3)
print(filled_matrix)
<|EOT|>
