code: def module_function(string):
      
      parts = string.split(':', 2)
      if len(parts) < 2:
          raise ValueError(
              "Illegal specification. Should be module:function[:parameter]")
      module_path, function_name = parts[:2]
  
      # Import the module
      module_vars = {}
      exec(compile(open(module_path).read(), module_path, 'exec'), module_vars)
  
      try:
          function = module_vars[function_name]
      except KeyError:
          raise argparse.ArgumentTypeError("{0} has no attribute '{1}'".format(
              module_path, function_name))
  
      if len(parts) == 3:
          old_function = function
          function = lambda r: old_function(r, parts[2])
  
      return function
docs: Load a function from a python module using a file name, function name
      specification of format:
          /path/to/x.py:function_name[:parameter]