code: def _pad_along_last_axis(X, m):
      """Pad the data for computing the rolling window difference."""
      # scales a  bit better than method in _vasicek_like_entropy
      shape = np.array(X.shape)
      shape[-1] = m
      Xl = np.broadcast_to(
          X[..., [0]], shape
      )  # [0] vs 0 to maintain shape
      Xr = np.broadcast_to(X[..., [-1]], shape)
      return np.concatenate((Xl, X, Xr), axis=-1)
  
file_path: catboost/contrib/python/scipy/py3/scipy/stats/_entropy.py
imports: from __future__ import annotations
  import math
  import numpy
  from scipy import special
  from typing import Optional, Union
label_desc: Use image node_id 3 for calling a global function with example usage: _pad_along_last_axis(X, m) and returns: np