class_docstr: Base class for Dynamic Bayesian Network
  
  This is a time variant model of the static Bayesian model, where each
  time-slice has some static nodes and is then replicated over a certain
  time period.
  
  The nodes can be any hashable python objects.
  
  Parameters
  ----------
  ebunch: Data to initialize graph.  If data=None (default) an empty
        graph is created.  The data can be an edge list, or any NetworkX
        graph object
  
  Examples
  --------
  Create an empty Dynamic Bayesian Network with no nodes and no edges:
  >>> from pgmpy.models import DynamicBayesianNetwork as DBN
  >>> dbn = DBN()
  
  Adding nodes and edges inside the Dynamic Bayesian Network. A single
  node can be added using the method below. For adding edges we need to
  specify the time slice since edges can be across different time slices.
  
  For example for a network as [image](http://s8.postimg.org/aaybw4x2t/Blank_Flowchart_New_Page_1.png),
  we will need to add all the edges in the 2-TBN as:
  
  >>> dbn.add_edges_from([(('D', 0), ('G', 0)), (('I', 0), ('G', 0)),
  ...                     (('G', 0), ('L', 0)), (('D', 0), ('D', 1)),
  ...                     (('I', 0), ('I', 1)), (('G', 0), ('G', 1)),
  ...                     (('G', 0), ('L', 1)), (('L', 0), ('L', 1))])
  
  We can query the edges and nodes in the network as:
  >>> dbn.nodes()
  ['G', 'D', 'I', 'L']
  >>> dbn.edges()
  [(('D', 1), ('G', 1)), (('I', 0), ('G', 0)), (('I', 0), ('I', 1)),
   (('I', 1), ('G', 1)), (('G', 0), ('L', 0)), (('G', 0), ('G', 1)),
   (('G', 0), ('L', 1)), (('D', 0), ('G', 0)), (('D', 0), ('D', 1)),
   (('L', 0), ('L', 1)), (('G', 1), ('L', 1))]
  
  If any variable is not present in the network while adding an edge,
  pgmpy will automatically add that variable to the network.
  
  But for adding nodes to the model we don't need to specify the time
  slice as it is common in all the time slices. And therefore pgmpy
  automatically replicated it all the time slices. For example, for
  adding a new variable `S` in the above network we can simply do:
  >>> dbn.add_node('S')
  >>> dbn.nodes()
  ['S', 'G', 'D', 'I', 'L']
  
  Public Methods
  --------------
  add_node
  add_nodes_from
  add_edges
  add_edges_from
  add_cpds
  initialize_initial_state
  inter_slice
  intra_slice
  copy
class_docstr_tok: ["Base","class","for","Dynamic","Bayesian","Network","This","is","a","time","variant","model","of","the","static","Bayesian","model",",","where","each","time-slice","has","some","static","nodes","and","is","then","replicated","over","a","certain","time","period",".","The","nodes","can","be","any","hashable","python","objects",".","Parameters","--","--","--","--","--","ebunch",":","Data","to","initialize","graph",".","If","data=None","(","default",")","an","empty","graph","is","created",".","The","data","can","be","an","edge","list",",","or","any","NetworkX","graph","object","Examples","--","--","--","--","Create","an","empty","Dynamic","Bayesian","Network","with","no","nodes","and","no","edges",":",">",">",">","from","pgmpy.models","import","DynamicBayesianNetwork","as","DBN",">",">",">","dbn","=","DBN","(",")","Adding","nodes","and","edges","inside","the","Dynamic","Bayesian","Network",".","A","single","node","can","be","added","using","the","method","below",".","For","adding","edges","we","need","to","specify","the","time","slice","since","edges","can","be","across","different","time","slices",".","For","example","for","a","network","as","[","image","]","(","http",":","\/\/s8.postimg.org\/aaybw4x2t\/Blank_Flowchart_New_Page_1.png",")",",","we","will","need","to","add","all","the","edges","in","the","2-TBN","as",":",">",">",">","dbn.add_edges_from","(","[","(","(","'D","'",",","0",")",",","(","'","G","'",",","0",")",")",",","(","(","'","I","'",",","0",")",",","(","'","G","'",",","0",")",")",",","...","(","(","'","G","'",",","0",")",",","(","'","L","'",",","0",")",")",",","(","(","'D","'",",","0",")",",","(","'D","'",",","1",")",")",",","...","(","(","'","I","'",",","0",")",",","(","'","I","'",",","1",")",")",",","(","(","'","G","'",",","0",")",",","(","'","G","'",",","1",")",")",",","...","(","(","'","G","'",",","0",")",",","(","'","L","'",",","1",")",")",",","(","(","'","L","'",",","0",")",",","(","'","L","'",",","1",")",")","]",")","We","can","query","the","edges","and","nodes","in","the","network","as",":",">",">",">","dbn.nodes","(",")","[","'","G","'",",","'D","'",",","'","I","'",",","'","L","'","]",">",">",">","dbn.edges","(",")","[","(","(","'D","'",",","1",")",",","(","'","G","'",",","1",")",")",",","(","(","'","I","'",",","0",")",",","(","'","G","'",",","0",")",")",",","(","(","'","I","'",",","0",")",",","(","'","I","'",",","1",")",")",",","(","(","'","I","'",",","1",")",",","(","'","G","'",",","1",")",")",",","(","(","'","G","'",",","0",")",",","(","'","L","'",",","0",")",")",",","(","(","'","G","'",",","0",")",",","(","'","G","'",",","1",")",")",",","(","(","'","G","'",",","0",")",",","(","'","L","'",",","1",")",")",",","(","(","'D","'",",","0",")",",","(","'","G","'",",","0",")",")",",","(","(","'D","'",",","0",")",",","(","'D","'",",","1",")",")",",","(","(","'","L","'",",","0",")",",","(","'","L","'",",","1",")",")",",","(","(","'","G","'",",","1",")",",","(","'","L","'",",","1",")",")","]","If","any","variable","is","not","present","in","the","network","while","adding","an","edge",",","pgmpy","will","automatically","add","that","variable","to","the","network",".","But","for","adding","nodes","to","the","model","we","do","n't","need","to","specify","the","time","slice","as","it","is","common","in","all","the","time","slices",".","And","therefore","pgmpy","automatically","replicated","it","all","the","time","slices",".","For","example",",","for","adding","a","new","variable","`","S","`","in","the","above","network","we","can","simply","do",":",">",">",">","dbn.add_node","(","'S","'",")",">",">",">","dbn.nodes","(",")","[","'S","'",",","'","G","'",",","'D","'",",","'","I","'",",","'","L","'","]","Public","Methods","--","--","--","--","--","--","--","add_node","add_nodes_from","add_edges","add_edges_from","add_cpds","initialize_initial_state","inter_slice","intra_slice","copy"]
docstr: Returns the intra slice edges present in the 2-TBN.
  
  Parameters
  ----------
  time_slice: int (whole number)
          The time slice for which to get intra edges. The timeslice
          should be a positive value or zero.
  
  Examples
  --------
  >>> from pgmpy.models import DynamicBayesianNetwork as DBN
  >>> dbn = DBN()
  >>> dbn.add_nodes_from(['D', 'G', 'I', 'S', 'L'])
  >>> dbn.add_edges_from([(('D', 0), ('G', 0)), (('I', 0), ('G', 0)),
  ...                     (('G', 0), ('L', 0)), (('D', 0), ('D', 1)),
  ...                     (('I', 0), ('I', 1)), (('G', 0), ('G', 1)),
  ...                     (('G', 0), ('L', 1)), (('L', 0), ('L', 1))])
  >>> dbn.get_intra_edges()
  [(('D', 0), ('G', 0)), (('G', 0), ('L', 0)), (('I', 0), ('G', 0))]
docstr_tok: ["Returns","the","intra","slice","edges","present","in","the","2-TBN",".","Parameters","--","--","--","--","--","time_slice",":","int","(","whole","number",")","The","time","slice","for","which","to","get","intra","edges",".","The","timeslice","should","be","a","positive","value","or","zero",".","Examples","--","--","--","--",">",">",">","from","pgmpy.models","import","DynamicBayesianNetwork","as","DBN",">",">",">","dbn","=","DBN","(",")",">",">",">","dbn.add_nodes_from","(","[","'D","'",",","'","G","'",",","'","I","'",",","'S","'",",","'","L","'","]",")",">",">",">","dbn.add_edges_from","(","[","(","(","'D","'",",","0",")",",","(","'","G","'",",","0",")",")",",","(","(","'","I","'",",","0",")",",","(","'","G","'",",","0",")",")",",","...","(","(","'","G","'",",","0",")",",","(","'","L","'",",","0",")",")",",","(","(","'D","'",",","0",")",",","(","'D","'",",","1",")",")",",","...","(","(","'","I","'",",","0",")",",","(","'","I","'",",","1",")",")",",","(","(","'","G","'",",","0",")",",","(","'","G","'",",","1",")",")",",","...","(","(","'","G","'",",","0",")",",","(","'","L","'",",","1",")",")",",","(","(","'","L","'",",","0",")",",","(","'","L","'",",","1",")",")","]",")",">",">",">","dbn.get_intra_edges","(",")","[","(","(","'D","'",",","0",")",",","(","'","G","'",",","0",")",")",",","(","(","'","G","'",",","0",")",",","(","'","L","'",",","0",")",")",",","(","(","'","I","'",",","0",")",",","(","'","G","'",",","0",")",")","]"]
code: def get_intra_edges(self, time_slice=0):
      """
      Returns the intra slice edges present in the 2-TBN.
  
      Parameters
      ----------
      time_slice: int (whole number)
              The time slice for which to get intra edges. The timeslice
              should be a positive value or zero.
  
      Examples
      --------
      >>> from pgmpy.models import DynamicBayesianNetwork as DBN
      >>> dbn = DBN()
      >>> dbn.add_nodes_from(['D', 'G', 'I', 'S', 'L'])
      >>> dbn.add_edges_from([(('D', 0), ('G', 0)), (('I', 0), ('G', 0)),
      ...                     (('G', 0), ('L', 0)), (('D', 0), ('D', 1)),
      ...                     (('I', 0), ('I', 1)), (('G', 0), ('G', 1)),
      ...                     (('G', 0), ('L', 1)), (('L', 0), ('L', 1))])
      >>> dbn.get_intra_edges()
      [(('D', 0), ('G', 0)), (('G', 0), ('L', 0)), (('I', 0), ('G', 0))]
      """
      if not isinstance(time_slice, int) or time_slice < 0:
          raise ValueError(
              "The timeslice should be a positive value greater than or equal to zero"
          )
  
      return [
          tuple(DynamicNode(x[0], time_slice) for x in edge)
          for edge in self.edges()
          if edge[0][1] == edge[1][1] == 0
      ]
  
imports: import typing
  from collections import defaultdict
  from dataclasses import dataclass
  from itertools import chain, combinations
  import networkx
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from pgmpy import config
  from pgmpy.base import DAG
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 8 for calling the DynamicBayesianNetwork obj's underlying member method code with example usage: obj.get_intra_edges(time_slice) and returns: unknown