code: def _style_mixture(which_styles, num_styles):
      """Returns a 1-D array mapping style indexes to weights."""
      if not isinstance(which_styles, dict):
          raise ValueError("Style mixture must be a dictionary.")
      mixture = np.zeros([num_styles], dtype=np.float32)
      for index in which_styles:
          mixture[index] = which_styles[index]
      return mixture
  
file_path: magenta/magenta/models/image_stylization/image_stylization_transform.py
imports: import ast
  import os
  from magenta.models.image_stylization import image_utils
  from magenta.models.image_stylization import model
  from magenta.models.image_stylization import ops
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: _style_mixture(which_styles, num_styles) and returns: mixture