class_docstr: A data object composed by a stream of events describing a temporal
  graph.
  The :class:`~torch_geometric.data.TemporalData` object can hold a list of
  events (that can be understood as temporal edges in a graph) with
  structured messages.
  An event is composed by a source node, a destination node, a timestamp
  and a message. Any *Continuous-Time Dynamic Graph* (CTDG) can be
  represented with these four values.
  
  In general, :class:`~torch_geometric.data.TemporalData` tries to mimic
  the behavior of a regular :python:`Python` dictionary.
  In addition, it provides useful functionality for analyzing graph
  structures, and provides basic PyTorch tensor functionalities.
  
  .. code-block:: python
  
      from torch import Tensor
      from torch_geometric.data import TemporalData
  
      events = TemporalData(
          src=Tensor([1,2,3,4]),
          dst=Tensor([2,3,4,5]),
          t=Tensor([1000,1010,1100,2000]),
          msg=Tensor([1,1,0,0])
      )
  
      # Add additional arguments to `events`:
      events.y = Tensor([1,1,0,0])
  
      # It is also possible to set additional arguments in the constructor
      events = TemporalData(
          ...,
          y=Tensor([1,1,0,0])
      )
  
      # Get the number of events:
      events.num_events
      >>> 4
  
      # Analyzing the graph structure:
      events.num_nodes
      >>> 5
  
      # PyTorch tensor functionality:
      events = events.pin_memory()
      events = events.to('cuda:0', non_blocking=True)
  
  Args:
      src (torch.Tensor, optional): A list of source nodes for the events
          with shape :obj:`[num_events]`. (default: :obj:`None`)
      dst (torch.Tensor, optional): A list of destination nodes for the
          events with shape :obj:`[num_events]`. (default: :obj:`None`)
      t (torch.Tensor, optional): The timestamps for each event with shape
          :obj:`[num_events]`. (default: :obj:`None`)
      msg (torch.Tensor, optional): Messages feature matrix with shape
          :obj:`[num_events, num_msg_features]`. (default: :obj:`None`)
      **kwargs (optional): Additional attributes.
  
  .. note::
      The shape of :obj:`src`, :obj:`dst`, :obj:`t` and the first dimension
      of :obj`msg` should be the same (:obj:`num_events`).
class_docstr_tok: ["A","data","object","composed","by","a","stream","of","events","describing","a","temporal","graph",".","The",":","class",":","`","~torch_geometric.data.TemporalData","`","object","can","hold","a","list","of","events","(","that","can","be","understood","as","temporal","edges","in","a","graph",")","with","structured","messages",".","An","event","is","composed","by","a","source","node",",","a","destination","node",",","a","timestamp","and","a","message",".","Any","*","Continuous-Time","Dynamic","Graph","*","(","CTDG",")","can","be","represented","with","these","four","values",".","In","general",",",":","class",":","`","~torch_geometric.data.TemporalData","`","tries","to","mimic","the","behavior","of","a","regular",":","python",":","`","Python","`","dictionary",".","In","addition",",","it","provides","useful","functionality","for","analyzing","graph","structures",",","and","provides","basic","PyTorch","tensor","functionalities",".","..","code-block",":",":","python","from","torch","import","Tensor","from","torch_geometric.data","import","TemporalData","events","=","TemporalData","(","src=Tensor","(","[","1,2,3,4","]",")",",","dst=Tensor","(","[","2,3,4,5","]",")",",","t=Tensor","(","[","1000,1010,1100,2000","]",")",",","msg=Tensor","(","[","1,1,0,0","]",")",")","#","Add","additional","arguments","to","`","events","`",":","events.y","=","Tensor","(","[","1,1,0,0","]",")","#","It","is","also","possible","to","set","additional","arguments","in","the","constructor","events","=","TemporalData","(","...",",","y=Tensor","(","[","1,1,0,0","]",")",")","#","Get","the","number","of","events",":","events.num_events",">",">",">","4","#","Analyzing","the","graph","structure",":","events.num_nodes",">",">",">","5","#","PyTorch","tensor","functionality",":","events","=","events.pin_memory","(",")","events","=","events.to","(","'cuda:0","'",",","non_blocking=True",")","Args",":","src","(","torch.Tensor",",","optional",")",":","A","list","of","source","nodes","for","the","events","with","shape",":","obj",":","`","[","num_events","]","`",".","(","default",":",":","obj",":","`","None","`",")","dst","(","torch.Tensor",",","optional",")",":","A","list","of","destination","nodes","for","the","events","with","shape",":","obj",":","`","[","num_events","]","`",".","(","default",":",":","obj",":","`","None","`",")","t","(","torch.Tensor",",","optional",")",":","The","timestamps","for","each","event","with","shape",":","obj",":","`","[","num_events","]","`",".","(","default",":",":","obj",":","`","None","`",")","msg","(","torch.Tensor",",","optional",")",":","Messages","feature","matrix","with","shape",":","obj",":","`","[","num_events",",","num_msg_features","]","`",".","(","default",":",":","obj",":","`","None","`",")","*","*","kwargs","(","optional",")",":","Additional","attributes",".","..","note",":",":","The","shape","of",":","obj",":","`","src","`",",",":","obj",":","`","dst","`",",",":","obj",":","`","t","`","and","the","first","dimension","of",":","obj","`","msg","`","should","be","the","same","(",":","obj",":","`","num_events","`",")","."]
docstr: Creates a :class:`~torch_geometric.data.TemporalData` object from
  a Python dictionary.
docstr_tok: ["Creates","a",":","class",":","`","~torch_geometric.data.TemporalData","`","object","from","a","Python","dictionary","."]
code: def from_dict(cls, mapping: Dict[str, Any]) -> "TemporalData":
      r"""Creates a :class:`~torch_geometric.data.TemporalData` object from
      a Python dictionary.
      """
      return cls(**mapping)
  
imports: import copy
  from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from torch_geometric.data.data import BaseData, size_repr
  from torch_geometric.data.storage import BaseStorage, EdgeStorage, GlobalStorage, NodeStorage
label_desc: Use image node_id 2 for calling the TemporalData obj's underlying member method code with example usage: obj.from_dict(cls, mapping) and returns: cls