code: def convert_param_to_dirname(param):
      
      if type(param) == types.StringType:
          return param
      else:
          return re.sub("0+$", '0', '%f'%param)
docs: Helper function to convert a parameter value to a valid directory name.