class_docstr: A data iterator object to contain a dynamic heterogeneous graph with a
  changing edge set and weights. The feature set and node labels
  (target) are also dynamic. The iterator returns a single discrete temporal
  snapshot for a time period (e.g. day or week). This single snapshot is a
  Pytorch Geometric HeteroData Batch object. Between two temporal snapshots the edges,
  edge weights, the feature matrix, target matrices and optionally passed
  attributes might change.
  
  Args:
      edge_index_dicts (Sequence of dictionaries where keys=Tuples and values=Numpy arrays):
       Sequence of relation type tuples and their edge index tensors.
      edge_weight_dicts (Sequence of dictionaries where keys=Tuples and values=Numpy arrays):
       Sequence of relation type tuples and their edge weight tensors.
      feature_dicts (Sequence of dictionaries where keys=Strings and values=Numpy arrays):
       Sequence of node types and their feature tensors.
      target_dicts (Sequence of dictionaries where keys=Strings and values=Numpy arrays):
       Sequence of node types and their label (target) tensors.
      batch_dicts (Sequence of dictionaries where keys=Strings and values=Numpy arrays):
       Sequence of batch index tensor for each node type.
      **kwargs (optional Sequence of dictionaries where keys=Strings and values=Numpy arrays):
       Sequence of node types and their additional attributes.
class_docstr_tok: ["A","data","iterator","object","to","contain","a","dynamic","heterogeneous","graph","with","a","changing","edge","set","and","weights",".","The","feature","set","and","node","labels","(","target",")","are","also","dynamic",".","The","iterator","returns","a","single","discrete","temporal","snapshot","for","a","time","period","(","e.g",".","day","or","week",")",".","This","single","snapshot","is","a","Pytorch","Geometric","HeteroData","Batch","object",".","Between","two","temporal","snapshots","the","edges",",","edge","weights",",","the","feature","matrix",",","target","matrices","and","optionally","passed","attributes","might","change",".","Args",":","edge_index_dicts","(","Sequence","of","dictionaries","where","keys=Tuples","and","values=Numpy","arrays",")",":","Sequence","of","relation","type","tuples","and","their","edge","index","tensors",".","edge_weight_dicts","(","Sequence","of","dictionaries","where","keys=Tuples","and","values=Numpy","arrays",")",":","Sequence","of","relation","type","tuples","and","their","edge","weight","tensors",".","feature_dicts","(","Sequence","of","dictionaries","where","keys=Strings","and","values=Numpy","arrays",")",":","Sequence","of","node","types","and","their","feature","tensors",".","target_dicts","(","Sequence","of","dictionaries","where","keys=Strings","and","values=Numpy","arrays",")",":","Sequence","of","node","types","and","their","label","(","target",")","tensors",".","batch_dicts","(","Sequence","of","dictionaries","where","keys=Strings","and","values=Numpy","arrays",")",":","Sequence","of","batch","index","tensor","for","each","node","type",".","*","*","kwargs","(","optional","Sequence","of","dictionaries","where","keys=Strings","and","values=Numpy","arrays",")",":","Sequence","of","node","types","and","their","additional","attributes","."]
code: def __getitem__(self, time_index: Union[int, slice]):
      if isinstance(time_index, slice):
          snapshot = DynamicHeteroGraphTemporalSignalBatch(
              self.edge_index_dicts[time_index],
              self.edge_weight_dicts[time_index],
              self.feature_dicts[time_index],
              self.target_dicts[time_index],
              self.batch_dicts[time_index],
              **{
                  key: getattr(self, key)[time_index]
                  for key in self.additional_feature_keys
              },
          )
      else:
          x_dict = self._get_feature(time_index)
          edge_index_dict = self._get_edge_index(time_index)
          edge_weight_dict = self._get_edge_weight(time_index)
          batch_dict = self._get_batch_index(time_index)
          y_dict = self._get_target(time_index)
          additional_features = self._get_additional_features(
              time_index
          )
  
          snapshot = Batch.from_data_list([HeteroData()])
          if x_dict:
              for key, value in x_dict.items():
                  snapshot[key].x = value
          if edge_index_dict:
              for key, value in edge_index_dict.items():
                  snapshot[key].edge_index = value
          if edge_weight_dict:
              for key, value in edge_weight_dict.items():
                  snapshot[key].edge_attr = value
          if y_dict:
              for key, value in y_dict.items():
                  snapshot[key].y = value
          if batch_dict:
              for key, value in batch_dict.items():
                  snapshot[key].batch = value
          if additional_features:
              for (
                  feature_name,
                  feature_dict,
              ) in additional_features.items():
                  if feature_dict:
                      for key, value in feature_dict.items():
                          snapshot[key][feature_name] = value
      return snapshot
  
file_path: pytorch_geometric_temporal/torch_geometric_temporal/signal/dynamic_hetero_graph_temporal_signal_batch.py
imports: import torch
  import numpy
  from typing import Sequence, Dict, Union, Tuple
  from torch_geometric.data import HeteroData, Batch
label_desc: Use image node_id 11 for calling the DynamicHeteroGraphTemporalSignalBatch obj's underlying member method code with example usage: obj.__getitem__(time_index) and returns: snapshot