code: def halve_range_str(range_str):
      """Helper function used inside halve_minibatch_size_str().
      returns half of a range [but converting resulting zeros to
      ones], e.g. '16'->'8', '16,32'->'8,16', '64:128'->'32:64'.
      Returns true if range_str is a a comma-separated list of
      positive integers and ranges of integers, like '128',
      '128,256', or '64-128,256'."""
  
      ranges = range_str.split(",")
      halved_ranges = []
      for r in ranges:
          # a range may be either e.g. '64', or '128:256'
          c = [str(max(1, int(x) // 2)) for x in r.split(":")]
          halved_ranges.append(":".join(c))
      return ",".join(halved_ranges)
  
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 10 for calling a global function with example usage: halve_range_str(range_str) and returns: str