code: def create_sample_data(dtype, n_pts=25, add_noise=False):
      # grid of equidistant points in 2D, n_components = n_dim
      n_per_side = int(math.sqrt(n_pts))
      X = np.array(list(product(range(n_per_side), repeat=2))).astype(
          dtype, copy=False
      )
      if add_noise:
          # add noise in a third dimension
          rng = np.random.RandomState(0)
          noise = 0.1 * rng.randn(n_pts, 1).astype(dtype, copy=False)
          X = np.concatenate((X, noise), 1)
      return X
  
imports: import math
  from itertools import product
  import numpy
  import pytest
  from scipy.sparse import rand
  from sklearn import clone, datasets, manifold, neighbors, pipeline, preprocessing
  from sklearn.datasets import make_blobs
  from sklearn.metrics.pairwise import pairwise_distances
  from sklearn.utils._testing import assert_allclose, assert_allclose_dense_sparse, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 1 for calling a global function with example usage: create_sample_data(dtype, n_pts, add_noise) and returns: X