code: def sample_cnn_hyperparameters(random_state, num):
      space = {
          "n_iter": N_ITER,
          "batch_size": BATCH_SIZE,
          "l2": L2,
          "learning_rate": LEARNING_RATES,
          "loss": LOSSES,
          "embedding_dim": EMBEDDING_DIM,
          "kernel_width": [3, 5, 7],
          "num_layers": list(range(1, 10)),
          "dilation_multiplier": [1, 2],
          "nonlinearity": ["tanh", "relu"],
          "residual": [True, False],
      }
  
      sampler = ParameterSampler(
          space, n_iter=num, random_state=random_state
      )
  
      for params in sampler:
          params["dilation"] = list(
              params["dilation_multiplier"] ** (i % 8)
              for i in range(params["num_layers"])
          )
  
          yield params
  
imports: import hashlib
  import json
  import os
  import shutil
  import sys
  import numpy
  from sklearn.model_selection import ParameterSampler
  from spotlight.datasets.movielens import get_movielens_dataset
  from spotlight.cross_validation import user_based_train_test_split
  from spotlight.sequence.implicit import ImplicitSequenceModel
  from spotlight.sequence.representations import CNNNet
  from spotlight.evaluation import sequence_mrr_score
label_desc: Use image node_id 1 for calling a global function with example usage: sample_cnn_hyperparameters(random_state, num) without return types