code: def _generate_assignments(
      splittable_dimensions, mesh_dimension_to_size
  ):
      """Generates all ways to map splittable dimensions to mesh dimensions.
  
      Args:
        splittable_dimensions: a frozenset of the names of splittable dimensions.
        mesh_dimension_to_size: a dictionary from mesh dimension name to size.
  
      Returns:
        A list of the valid assignments. Each assignment is a dict keyed by every
            splittable dimension, whose value is either a mesh dimension or None.
      """
      assignments = []
      for assignment_size in six.moves.xrange(
          1
          + min(len(splittable_dimensions), len(mesh_dimension_to_size))
      ):
          for s_dims_chosen in itertools.combinations(
              splittable_dimensions, assignment_size
          ):
              for m_dims_chosen in itertools.permutations(
                  mesh_dimension_to_size, assignment_size
              ):
                  assignments.append(
                      dict(zip(s_dims_chosen, m_dims_chosen))
                  )
      return assignments
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl import logging
  from mesh_tensorflow.auto_mtf import print_cp_model_solution
  from mesh_tensorflow.auto_mtf import scheduler
  import six
  from ortools.sat.python import cp_model
label_desc: Use image node_id 3 for calling a global function with example usage: _generate_assignments(splittable_dimensions, mesh_dimension_to_size) and returns: assignments