code: def make_input_tuple(input_str, element_type=string_types):
      """
      converting input into a tuple of input
  
      :param input_str:
      :param element_type:
      :return:
      """
      assert input_str, "invalid input {} for type {}".format(
          input_str, element_type
      )
      if isinstance(input_str, element_type):
          new_tuple = (input_str,)
      else:
          try:
              new_tuple = tuple(input_str)
          except TypeError:
              raise ValueError(
                  "can't cast to tuple of {}".format(element_type)
              )
      assert all(
          [isinstance(item, element_type) for item in new_tuple]
      ), "the input should be a tuple of {}".format(element_type)
      return new_tuple
  
file_path: NiftyNet/niftynet/utilities/user_parameters_helper.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import re
  from six import string_types
  from niftynet.utilities.user_parameters_regex import match_array
label_desc: Use image node_id 5 for calling a global function with example usage: make_input_tuple(input_str, element_type) and returns: new_tuple