def parse_method_flag(method_flag):
  """Parse a method FLAG value and get a list of methods."""
  if method_flag == 'all':
    return [
        'l1_linear', 'l2_linear', 'random_forest', 'l1_gbdt', 'l2_gbdt',
        'l1_dnn', 'l2_dnn'
    ]
  elif method_flag == 'all_except_dnn':
    return ['l1_linear', 'l2_linear', 'random_forest', 'l1_gbdt', 'l2_gbdt']
  elif method_flag == 'linear':
    return ['l1_linear', 'l2_linear']
  elif method_flag == 'gbdt':
    return ['l1_gbdt', 'l2_gbdt']
  elif method_flag == 'dnn':
    return ['l1_dnn', 'l2_dnn']
  else:
    return [method_flag]