code: def _generate_noise_temporal_phys(
      timepoints,
      resp_freq=0.2,
      heart_freq=1.17,
  ):
      """Generate the physiological noise.
      Create noise representing the heart rate and respiration of the data.
      Default values based on Walvaert, Durnez, Moerkerke, Verdoolaege and
      Rosseel, 2011
  
      Parameters
      ----------
  
      timepoints : 1 Dimensional array
          What time points, in seconds, are sampled by a TR
  
      resp_freq : float
          What is the frequency of respiration (in Hz)
  
      heart_freq : float
          What is the frequency of heart beat (in Hz)
  
      Returns
      ----------
      noise_phys : one dimensional array, float
          Generates the physiological temporal noise timecourse
  
      """
  
      resp_phase = (np.random.rand(1) * 2 * np.pi)[0]
      heart_phase = (np.random.rand(1) * 2 * np.pi)[0]
  
      # Find the rate for each timepoint
      resp_rate = resp_freq * 2 * np.pi
      heart_rate = heart_freq * 2 * np.pi
  
      # Calculate the radians for each variable at this
      # given TR
      resp_radians = np.multiply(timepoints, resp_rate) + resp_phase
      heart_radians = np.multiply(timepoints, heart_rate) + heart_phase
  
      # Combine the two types of noise and append
      noise_phys = np.cos(resp_radians) + np.sin(heart_radians)
  
      # Normalize
      noise_phys = stats.zscore(noise_phys)
  
      return noise_phys
  
imports: import logging
  from itertools import product
  from statsmodels.tsa.arima.model import ARIMA
  import math
  import numpy
  from numpy.linalg import LinAlgError
  from pkg_resources import resource_stream
  from scipy import stats
  from scipy import signal
  import scipy.ndimage
  import copy
  from scipy import optimize
label_desc: Use image node_id 19 for calling a global function with example usage: _generate_noise_temporal_phys(timepoints, resp_freq, heart_freq) and returns: noise_phys