code: def generate_1d_rf_responses(
      rfs,
      trial_list,
      feature_resolution,
      feature_range,
      trial_noise=0.25,
  ):
      """
      Generates trial-wise data for a given set of receptive fields (RFs) and
      a 1d array of features presented across trials.
  
      Parameters
      ----------
  
      voxel_rfs : 2d numpy array (float)
          The receptive fields in feature space. Dimensions must be n_voxels
          by feature_resolution.
  
      trial_list : 1d numpy array (numeric)
          The feature value of the stimulus presented on individual trials.
          Array size be n_trials.
  
      feature_resolution : int
          Number of points along the feature axis.
  
      feature_range : tuple (numeric)
          A tuple indicating the start and end values of the feature range. e.g.
          (0, 359) for motion directions.
  
      trial_noise : float [default 0.25]
          Amount of uniform noise to inject into the synthetic data. This is
          generated independently for every trial and voxel.
  
      Returns
      ----------
  
      trial_data : 2d numpy array (float)
          The synthetic data for each voxel and trial. Dimensions are n_voxels by
          n_trials.
  
      """
      range_start, range_stop = feature_range
      stim_axis = np.linspace(
          range_start, range_stop, feature_resolution
      )
      if range_start > 0:
          trial_list = trial_list + range_start
      elif range_start < 0:
          trial_list = trial_list - range_start
      one_hot = np.eye(feature_resolution)
      indices = [np.argmin(abs(stim_axis - x)) for x in trial_list]
      stimulus_mask = one_hot[:, indices]
      trial_data = rfs @ stimulus_mask
      trial_data += np.random.rand(rfs.shape[0], trial_list.size) * (
          trial_noise * np.max(trial_data)
      )
  
      return trial_data
  
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 29 for calling a global function with example usage: generate_1d_rf_responses(rfs, trial_list, feature_resolution, feature_range, trial_noise) and returns: trial_data