code: def __call__(
      self,
      list_id_score_list_features: List[Dict[int, Dict[int, float]]],
  ) -> Dict[int, Tuple[torch.Tensor, torch.Tensor, torch.Tensor]]:
      ## sparse format https://fburl.com/code/8nsjsw29  as WEIGHTED_MULTI_CATEGORICAL
  
      ret: Dict[
          int, Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
      ] = {}
      feature_dict: Dict[int, Tuple[List, List, List]] = {
          feature_id: ([], [], [])
          for feature_id in self.id_score_list_feature_ids
      }
      offset_dict = {
          feature_id: [0]
          for feature_id in self.id_score_list_feature_ids
      }
  
      for row in list_id_score_list_features:
          # offset = 0
          if row:
              for feature_id in self.id_score_list_feature_ids:
                  keys_weights_dict = row.get(feature_id, {})
                  offset = 0
                  if keys_weights_dict:
                      # for feature_id, keys_weights_dict in row.items():
                      offset = offset_dict[feature_id][-1] + len(
                          keys_weights_dict.keys()
                      )
                      feature_dict[feature_id][0].append(
                          offset_dict[feature_id][-1]
                      )
  
                      offset_dict[feature_id].append(offset)
  
                      feature_dict[feature_id][1].extend(
                          list(keys_weights_dict.keys())
                      )
                      feature_dict[feature_id][2].extend(
                          keys_weights_dict.values()
                      )
                  else:
                      feature_dict[feature_id][0].append(
                          offset_dict[feature_id][-1]
                      )
          elif not row:
              # empty sparse
              offset = 0
              for feature_id in offset_dict:
                  feature_dict[feature_id][0].append(
                      offset_dict[feature_id][-1]
                  )
  
      for feature_id in feature_dict:
          ret[feature_id] = (
              torch.tensor(feature_dict[feature_id][0]).long(),
              torch.tensor(feature_dict[feature_id][1]).long(),
              torch.tensor(feature_dict[feature_id][2]),
          )
  
      return ret
  
file_path: ReAgent/reagent/preprocessing/sparse_to_dense.py
imports: from collections import defaultdict
  from typing import Dict, List, Tuple
  import torch
  from reagent.preprocessing import normalization
label_desc: Use image node_id 2 for calling the PythonIdScoreListToTensorProcessor obj's underlying member method code with example usage: obj.__call__(list_id_score_list_features) and returns: ret