<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform_around(matrix, point):
 """ Given a transformation matrix, apply its rotation around a point in space. Parameters matrix: (4,4) or (3, 3) float, transformation matrix point: (3,) or (2,) float, point in space Returns --------- result: (4,4) transformation matrix """

    point = np.asanyarray(point)
    matrix = np.asanyarray(matrix)
    dim = len(point)
    if matrix.shape != (dim + 1,
                        dim + 1):
        raise ValueError('matrix must be (d+1, d+1)')

    translate = np.eye(dim + 1)
    translate[:dim, dim] = -point
    result = np.dot(matrix, translate)
    translate[:dim, dim] = point
    result = np.dot(translate, result)

    return result