def parse_qiime_parameters(lines):
 result = defaultdict(dict)
 for line in lines:
  line = line.strip()
  if (line and (not line.startswith('#'))):
   pound_pos = line.find('#')
   if ((pound_pos > 0) and line[(pound_pos - 1)].isspace()):
    line = line[:pound_pos].rstrip()
   fields = line.split(None, 1)
   (script_id, parameter_id) = fields[0].split(':')
   try:
    value = fields[1]
   except IndexError:
    continue
   if ((value.upper() == 'FALSE') or (value.upper() == 'NONE')):
    continue
   elif (value.upper() == 'TRUE'):
    value = None
   else:
    pass
   result[script_id][parameter_id] = value
 return result

def parse_qiime_parameters ( lines ) : result = defaultdict ( dict ) for line in lines : line = line . strip ( ) if ( line and ( not line . startswith ( '#' ) ) ) : pound_pos = line . find ( '#' ) if ( ( pound_pos > 0 ) and line [ ( pound_pos - 1 ) ] . isspace ( ) ) : line = line [ : pound_pos ] . rstrip ( ) fields = line . split ( None , 1 ) ( script_id , parameter_id ) = fields [ 0 ] . split ( ':' ) try : value = fields [ 1 ] except IndexError : continue if ( ( value . upper ( ) == 'FALSE' ) or ( value . upper ( ) == 'NONE' ) ) : continue elif ( value . upper ( ) == 'TRUE' ) : value = None else : pass result [ script_id ] [ parameter_id ] = value return result
return 2d dict of params which should be on .