code: def test_similarity_init():
      # init with implicit parameters
      scale = 0.1
      rotation = 1
      translation = (1, 1)
      tform = SimilarityTransform(
          scale=scale, rotation=rotation, translation=translation
      )
      assert_almost_equal(tform.scale, scale)
      assert_almost_equal(tform.rotation, rotation)
      assert_almost_equal(tform.translation, translation)
  
      # init with transformation matrix
      tform2 = SimilarityTransform(tform.params)
      assert_almost_equal(tform2.scale, scale)
      assert_almost_equal(tform2.rotation, rotation)
      assert_almost_equal(tform2.translation, translation)
  
      # test special case for scale if rotation=0
      scale = 0.1
      rotation = 0
      translation = (1, 1)
      tform = SimilarityTransform(
          scale=scale, rotation=rotation, translation=translation
      )
      assert_almost_equal(tform.scale, scale)
      assert_almost_equal(tform.rotation, rotation)
      assert_almost_equal(tform.translation, translation)
  
      # test special case for scale if rotation=90deg
      scale = 0.1
      rotation = np.pi / 2
      translation = (1, 1)
      tform = SimilarityTransform(
          scale=scale, rotation=rotation, translation=translation
      )
      assert_almost_equal(tform.scale, scale)
      assert_almost_equal(tform.rotation, rotation)
      assert_almost_equal(tform.translation, translation)
  
      # test special case for scale where the rotation isn't exactly 90deg,
      # but very close
      scale = 1.0
      rotation = np.pi / 2
      translation = (0, 0)
      params = np.array(
          [
              [0, -1, 1.33226763e-15],
              [1, 2.22044605e-16, -1.33226763e-15],
              [0, 0, 1],
          ]
      )
      tform = SimilarityTransform(params)
      assert_almost_equal(tform.scale, scale)
      assert_almost_equal(tform.rotation, rotation)
      assert_almost_equal(tform.translation, translation)
  
imports: import re
  import textwrap
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal
  from skimage.transform import AffineTransform, EssentialMatrixTransform, EuclideanTransform, FundamentalMatrixTransform, PiecewiseAffineTransform, PolynomialTransform, ProjectiveTransform, SimilarityTransform, estimate_transform, matrix_transform
  from skimage.transform._geometric import _GeometricTransform, _affine_matrix_from_vector, _center_and_normalize_points, _euler_rotation_matrix
label_desc: Use image node_id 8 for calling a global function with example usage: test_similarity_init() without return types