code: def getArguments(parser):
      "Provides additional validation of the arguments collected by argparse."
      args = parser.parse_args()
      # parse volume and adapt to zero-indexing
      try:
  
          def _to_int_or_none(string):
              if 0 == len(string):
                  return None
              return int(string)
  
          def _to_int_or_none_double(string):
              if 0 == len(string):
                  return [None, None]
              return list(map(_to_int_or_none, string.split(":")))
  
          args.volume = list(
              map(_to_int_or_none_double, args.volume.split(","))
          )
          args.volume = [(x[0], x[1]) for x in args.volume]
      except (ValueError, IndexError) as e:
          raise ArgumentError(
              'Maleformed volume parameter "{}", see description with -h flag.'.format(
                  args.volume
              ),
              e,
          )
  
      return args
  
file_path: medpy/bin/medpy_extract_sub_volume.py
imports: from argparse import RawTextHelpFormatter
  import argparse
  import logging
  import sys
  import os
  import scipy
  from medpy.core import ArgumentError, Logger
  from medpy.io import load, save
label_desc: Use image node_id 2 for calling a global function with example usage: getArguments(parser) and returns: args, int, list, None, list