code: def circulant(c):
      """
      Construct a circulant matrix.
  
      Parameters
      ----------
      c : (N,) array_like
          1-D array, the first column of the matrix.
  
      Returns
      -------
      A : (N, N) ndarray
          A circulant matrix whose first column is `c`.
  
      See Also
      --------
      toeplitz : Toeplitz matrix
      hankel : Hankel matrix
      solve_circulant : Solve a circulant system.
  
      Notes
      -----
      .. versionadded:: 0.8.0
  
      Examples
      --------
      >>> from scipy.linalg import circulant
      >>> circulant([1, 2, 3])
      array([[1, 3, 2],
             [2, 1, 3],
             [3, 2, 1]])
  
      """
      c = np.asarray(c).ravel()
      # Form an extended array that could be strided to give circulant version
      c_ext = np.concatenate((c[::-1], c[:0:-1]))
      L = len(c)
      n = c_ext.strides[0]
      return as_strided(
          c_ext[L - 1 :], shape=(L, L), strides=(-n, n)
      ).copy()
  
file_path: scipy/scipy/linalg/_special_matrices.py
imports: import math
  import numpy
  from numpy.lib.stride_tricks import as_strided
label_desc: Use image node_id 2 for calling a global function with example usage: circulant(c) and returns: as_strided