class_docstr: GDELT dataset for event-based temporal graph
  
  The Global Database of Events, Language, and Tone (GDELT) dataset.
  This contains events happend all over the world (ie every protest held
  anywhere in Russia on a given day is collapsed to a single entry).
  This Dataset consists ofevents collected from 1/1/2018 to 1/31/2018
  (15 minutes time granularity).
  
  Reference:
  
      - `Recurrent Event Network for Reasoning over Temporal Knowledge Graphs <https://arxiv.org/abs/1904.05530>`_
      - `The Global Database of Events, Language, and Tone (GDELT) <https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/28075>`_
  
  Statistics:
  
  - Train examples: 2,304
  - Valid examples: 288
  - Test examples: 384
  
  Parameters
  ----------
  mode : str
      Must be one of ('train', 'valid', 'test'). Default: 'train'
  raw_dir : str
      Raw file directory to download/contains the input data directory.
      Default: ~/.dgl/
  force_reload : bool
      Whether to reload the dataset. Default: False
  verbose : bool
      Whether to print out progress information. Default: True.
  transform : callable, optional
      A transform that takes in a :class:`~dgl.DGLGraph` object and returns
      a transformed version. The :class:`~dgl.DGLGraph` object will be
      transformed before every access.
  
  Attributes
  ----------
  start_time : int
      Start time of the temporal graph
  end_time : int
      End time of the temporal graph
  is_temporal : bool
      Does the dataset contain temporal graphs
  
  Examples
  ----------
  >>> # get train, valid, test dataset
  >>> train_data = GDELTDataset()
  >>> valid_data = GDELTDataset(mode='valid')
  >>> test_data = GDELTDataset(mode='test')
  >>>
  >>> # length of train set
  >>> train_size = len(train_data)
  >>>
  >>> for g in train_data:
  ....    e_feat = g.edata['rel_type']
  ....    # your code here
  ....
  >>>
class_docstr_tok: ["GDELT","dataset","for","event-based","temporal","graph","The","Global","Database","of","Events",",","Language",",","and","Tone","(","GDELT",")","dataset",".","This","contains","events","happend","all","over","the","world","(","ie","every","protest","held","anywhere","in","Russia","on","a","given","day","is","collapsed","to","a","single","entry",")",".","This","Dataset","consists","ofevents","collected","from","1\/1\/2018","to","1\/31\/2018","(","15","minutes","time","granularity",")",".","Reference",":","-","`","Recurrent","Event","Network","for","Reasoning","over","Temporal","Knowledge","Graphs","<","https",":","\/\/arxiv.org\/abs\/1904.05530",">","`","_","-","`","The","Global","Database","of","Events",",","Language",",","and","Tone","(","GDELT",")","<","https",":","\/\/dataverse.harvard.edu\/dataset.xhtml","?","persistentId=doi:10.7910\/DVN\/28075",">","`","_","Statistics",":","-","Train","examples",":","2,304","-","Valid","examples",":","288","-","Test","examples",":","384","Parameters","--","--","--","--","--","mode",":","str","Must","be","one","of","(","'train","'",",","'valid","'",",","'test","'",")",".","Default",":","'train'","raw_dir",":","str","Raw","file","directory","to","download\/contains","the","input","data","directory",".","Default",":","~\/.dgl\/","force_reload",":","bool","Whether","to","reload","the","dataset",".","Default",":","False","verbose",":","bool","Whether","to","print","out","progress","information",".","Default",":","True",".","transform",":","callable",",","optional","A","transform","that","takes","in","a",":","class",":","`","~dgl.DGLGraph","`","object","and","returns","a","transformed","version",".","The",":","class",":","`","~dgl.DGLGraph","`","object","will","be","transformed","before","every","access",".","Attributes","--","--","--","--","--","start_time",":","int","Start","time","of","the","temporal","graph","end_time",":","int","End","time","of","the","temporal","graph","is_temporal",":","bool","Does","the","dataset","contain","temporal","graphs","Examples","--","--","--","--","--",">",">",">","#","get","train",",","valid",",","test","dataset",">",">",">","train_data","=","GDELTDataset","(",")",">",">",">","valid_data","=","GDELTDataset","(","mode='valid","'",")",">",">",">","test_data","=","GDELTDataset","(","mode='test","'",")",">",">",">",">",">",">","#","length","of","train","set",">",">",">","train_size","=","len","(","train_data",")",">",">",">",">",">",">","for","g","in","train_data",":","....","e_feat","=","g.edata","[","'rel_type","'","]","....","#","your","code","here","....",">",">",">"]
docstr: Get graph by with events before time `t + self.start_time`
  
  Parameters
  ----------
  t : int
      Time, its value must be in range [0, `self.end_time` - `self.start_time`]
  
  Returns
  -------
  :class:`dgl.DGLGraph`
  
      The graph contains:
  
      - ``edata['rel_type']``: edge type
docstr_tok: ["Get","graph","by","with","events","before","time","`","t","+","self.start_time","`","Parameters","--","--","--","--","--","t",":","int","Time",",","its","value","must","be","in","range","[","0",",","`","self.end_time","`","-","`","self.start_time","`","]","Returns","--","--","--","-",":","class",":","`","dgl.DGLGraph","`","The","graph","contains",":","-","``","edata","[","'rel_type","'","]","``",":","edge","type"]
code: def __getitem__(self, t):
      r"""Get graph by with events before time `t + self.start_time`
  
      Parameters
      ----------
      t : int
          Time, its value must be in range [0, `self.end_time` - `self.start_time`]
  
      Returns
      -------
      :class:`dgl.DGLGraph`
  
          The graph contains:
  
          - ``edata['rel_type']``: edge type
      """
      if t >= len(self) or t < 0:
          raise IndexError("Index out of range")
      i = t + self.start_time
      row_mask = self.time_index <= i
      edges = self.data[row_mask][:, [0, 2]]
      rate = self.data[row_mask][:, 1]
      g = dgl_graph((edges[:, 0], edges[:, 1]))
      g.edata["rel_type"] = F.tensor(
          rate.reshape(-1, 1), dtype=F.data_type_dict["int64"]
      )
      if self._transform is not None:
          g = self._transform(g)
      return g
  
file_path: dgl/python/dgl/data/gdelt.py
imports: import os
  import numpy
  from ..None import backend
  from ..convert import graph
  from .dgl_dataset import DGLBuiltinDataset
  from .utils import _get_dgl_url, load_info, loadtxt, save_info
label_desc: Use image node_id 9 for calling the GDELTDataset obj's underlying member method code with example usage: obj.__getitem__(t) and returns: g