def METHOD_NAME(matrix, pool_size=(3, 3), strides=(1, 1),
               padding='valid', value=0):
    """Pad an array
    # Arguments
        matrix: Array.
        padding: String. Type of padding
        value: Int. Value to be added in the padded area.
        poolsize: Int. How many rows and colums to be padded for 'same' padding
    """
    matrix = np.array(matrix)
    H, W = matrix.shape[:2]
    if padding == 'valid':
        padding = ((0, 0), (0, 0))
    if padding == 'square':
        if H > W:
            padding = ((0, 0), (0, H - W))
        else:
            padding = ((0, W - H), (0, 0))
    if padding == 'same':
        if isinstance(pool_size, int):
            pool_size = (pool_size, pool_size)
        if isinstance(strides, int):
            strides = (strides, strides)
        if H % strides[0] == 0:
            height_pad = np.max((pool_size[0] - strides[0]), 0)
        else:
            height_pad = np.max(pool_size[0] - (H % strides[0]), 0)
        if W % strides[1] == 0:
            width_pad = np.max((pool_size[1] - strides[1]), 0)
        else:
            width_pad = np.max(pool_size[1] - (W % strides[1]), 0)
        pad_top = height_pad // 2
        pad_bottom = height_pad - pad_top
        pad_left = width_pad // 2
        pad_right = width_pad - pad_left
        padding = ((pad_top, pad_bottom), (pad_left, pad_right))
    return np.pad(matrix, padding, mode='constant', constant_values=value)