code: def calc_basis_periodic(
      Xs: TensorLike,
      period: TensorLike,
      m: int,
      tl: ModuleType = np,
  ):
      """
      Calculate basis vectors for the cosine series expansion of the periodic covariance function.
      These are derived from the Taylor series representation of the covariance.
      """
      w0 = (
          2 * np.pi
      ) / period  # angular frequency defining the periodicity
      m1 = tl.tile(w0 * Xs, m)
      m2 = tl.diag(tl.arange(0, m, 1))
      mw0x = m1 @ m2
      phi_cos = tl.cos(mw0x)
      phi_sin = tl.sin(mw0x)
      return phi_cos, phi_sin
  
imports: import numbers
  import warnings
  from types import ModuleType
  from typing import Optional, Sequence, Union
  import numpy
  import pytensor.tensor
  import pymc
  from pymc.gp.cov import Covariance, Periodic
  from pymc.gp.gp import Base
  from pymc.gp.mean import Mean, Zero
label_desc: Use image node_id 4 for calling a global function with example usage: calc_basis_periodic(Xs, period, m, tl) and returns: phi_cos,  phi_sin