code: def validate_minibatch_size_str(minibatch_size_str):
      """Validate a minibatch-size string (returns bool).
      A minibatch-size string might either be an integer, like '256',
      a comma-separated set of integers or ranges like '128,256' or
      '64:128,256',  or a rule like '128=64:128/256=32,64', whose format
      is: eg-length1=size-range1/eg-length2=size-range2/....
      where a size-range is a comma-separated list of either integers like '16'
      or ranges like '16:32'.  An arbitrary eg will be mapped to the size-range
      for the closest of the listed eg-lengths (the eg-length is defined
      as the number of input frames, including context frames)."""
      if not isinstance(minibatch_size_str, str):
          return False
      a = minibatch_size_str.split("/")
      assert len(a) != 0  # would be code error
  
      for elem in a:
          b = elem.split("=")
          # We expect b to have length 2 in the normal case.
          if len(b) != 2:
              # one-element 'b' is OK if len(a) is 1 (so there is only
              # one choice)... this would mean somebody just gave "25"
              # or something like that for the minibatch size.
              if len(a) == 1 and len(b) == 1:
                  return validate_range_str(elem)
              else:
                  return False
          # check that the thing before the '=' sign is a positive integer
          try:
              if int(b[0]) <= 0:
                  return False
          except:
              return False  # not an integer at all.
  
          if not validate_range_str(b[1]):
              return False
      return True
  
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 9 for calling a global function with example usage: validate_minibatch_size_str(minibatch_size_str) and returns: True, False, False, validate_range_str, False, False, False