code: def halve_minibatch_size_str(minibatch_size_str):
      """Halve a minibatch-size string, as would be validated by
      validate_minibatch_size_str (see docs for that).  This halves
      all the integer elements of minibatch_size_str that represent minibatch
      sizes (as opposed to chunk-lengths) and that are >1."""
  
      if not validate_minibatch_size_str(minibatch_size_str):
          raise Exception(
              "Invalid minibatch-size string '{0}'".format(
                  minibatch_size_str
              )
          )
  
      a = minibatch_size_str.split("/")
      ans = []
      for elem in a:
          b = elem.split("=")
          # We expect b to have length 2 in the normal case.
          if len(b) == 1:
              return halve_range_str(elem)
          else:
              assert len(b) == 2
              ans.append("{0}={1}".format(b[0], halve_range_str(b[1])))
      return "/".join(ans)
  
imports: from __future__ import division
  import argparse
  import glob
  import logging
  import os
  import math
  import re
  import shutil
  import libs.common
  from libs.nnet3.train.dropout_schedule import *
  import unittest
label_desc: Use image node_id 11 for calling a global function with example usage: halve_minibatch_size_str(minibatch_size_str) and returns: str, halve_range_str