code: def get_weights_list(
      cat_seq: torch.Tensor,
      features: KeyedJaggedTensor,
      position_weights: Dict[str, nn.Parameter],
  ) -> Optional[torch.Tensor]:
      weights_list = []
      seqs = torch.split(cat_seq, features.length_per_key())
      for key, seq in zip(features.keys(), seqs):
          if key in position_weights.keys():
              weights_list.append(
                  torch.gather(position_weights[key], dim=0, index=seq)
              )
          else:
              weights_list.append(
                  torch.ones(
                      seq.shape[0], device=features.values().device
                  )
              )
      return (
          torch.cat(weights_list)
          if weights_list
          else features.weights_or_none()
      )
  
imports: import abc
  from typing import Dict, Optional
  import torch
  from torch import nn
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
label_desc: Use image node_id 1 for calling a global function with example usage: get_weights_list(cat_seq, features, position_weights) and returns: unknown