code: def generate_structure_dynamic(  # pylint: disable=too-many-arguments
      num_nodes: int,
      p: int,
      degree_intra: float,
      degree_inter: float,
      graph_type_intra: str = "erdos-renyi",
      graph_type_inter: str = "erdos-renyi",
      w_min_intra: float = 0.5,
      w_max_intra: float = 0.5,
      w_min_inter: float = 0.5,
      w_max_inter: float = 0.5,
      w_decay: float = 1.0,
  ) -> StructureModel:
      """
      Generates a dynamic DAG at random.
  
      Args:
          num_nodes: Number of nodes
          p: maximum lag to be considered in the structure
          degree_intra: expected degree on nodes from the current state
          degree_inter: expected degree on nodes from the lagged nodes
          graph_type_intra:
              - erdos-renyi: constructs a graph such that the probability of any given edge is degree / (num_nodes - 1)
              - barabasi-albert: constructs a scale-free graph from an initial connected graph of (degree / 2) nodes
              - full: constructs a fully-connected graph - degree has no effect
          graph_type_inter:
              - erdos-renyi: constructs a graph such that the probability of any given edge is degree / (num_nodes - 1)
              - full: connect all past nodes to all present nodes
          w_min_intra: minimum weight for intra-slice nodes
          w_max_intra: maximum weight for intra-slice nodes
          w_min_inter: minimum weight for inter-slice nodes
          w_max_inter: maximum weight for inter-slice nodes
          w_decay: exponent of weights decay for slices that are farther apart. Default is 1.0, which implies no decay
  
      Raises:
          ValueError: if graph type unknown or `num_nodes < 2`
  
      Returns:
          StructureModel containing all simulated nodes and edges (intra- and inter-slice)
      """
      sm_intra = generate_structure(
          num_nodes=num_nodes,
          degree=degree_intra,
          graph_type=graph_type_intra,
          w_min=w_min_intra,
          w_max=w_max_intra,
      )
      sm_inter = _generate_inter_structure(
          num_nodes=num_nodes,
          p=p,
          degree=degree_inter,
          graph_type=graph_type_inter,
          w_min=w_min_inter,
          w_max=w_max_inter,
          w_decay=w_decay,
      )
      res = StructureModel()
      res.add_nodes_from(sm_inter.nodes)
      res.add_nodes_from([f"{u}_lag0" for u in sm_intra.nodes])
      res.add_weighted_edges_from(sm_inter.edges.data("weight"))
      res.add_weighted_edges_from(
          [
              (f"{u}_lag0", f"{v}_lag0", w)
              for u, v, w in sm_intra.edges.data("weight")
          ]
      )
      return res
  
file_path: causalnex/causalnex/structure/data_generators/wrappers.py
imports: import warnings
  from typing import List, Optional, Tuple
  import networkx
  import numpy
  import pandas
  from scipy.sparse import csr_matrix
  from sklearn.gaussian_process.kernels import Kernel
  from causalnex.structure.data_generators import generate_structure, nonlinear_sem_generator, sem_generator
  from causalnex.structure.structuremodel import StructureModel
label_desc: Use image node_id 7 for calling a global function with example usage: generate_structure_dynamic(num_nodes, p, degree_intra, degree_inter, graph_type_intra, graph_type_inter, w_min_intra, w_max_intra, w_min_inter, w_max_inter, w_decay) and returns: res