code: def model_parameters(model, exclude_head=False):
      if exclude_head:
          # FIXME this a bit of a quick and dirty hack to skip classifier head params based on ordering
          return [p for p in model.parameters()][:-2]
      else:
          return model.parameters()
  
imports: import logging
  import os
  import math
  from collections import OrderedDict
  from copy import deepcopy
  from typing import Any, Callable, Optional, Tuple
  import torch
  import torch.nn
  from torch.hub import load_state_dict_from_url
  from timm.models.features import FeatureListNet, FeatureDictNet, FeatureHookNet
  from timm.models.fx_features import FeatureGraphNet
  from timm.models.hub import has_hf_hub, download_cached_file, load_state_dict_from_hf
  from timm.models.layers import Conv2dSame, Linear
  from timm.models.vision_transformer import VisionTransformer, resize_pos_embed
  import tutel.impls.moe_layer
label_desc: Use image node_id 18 for calling a global function with example usage: model_parameters(model, exclude_head) and returns: unknown, model