class_docstr: Base class for structure models, which are an extension of ``networkx.DiGraph``.
  
  A ``StructureModel`` stores nodes and edges with optional data, or attributes.
  
  Edges have one required attribute, "origin", which describes how the edge was created.
  Origin can be one of either unknown, learned, or expert.
  
  StructureModel hold directed edges, describing a cause -> effect relationship.
  Cycles are permitted within a ``StructureModel``.
  
  Nodes can be arbitrary (hashable) Python objects with optional key/value attributes.
  By convention None is not used as a node.
  
  Edges are represented as links between nodes with optional key/value attributes.
class_docstr_tok: ["Base","class","for","structure","models",",","which","are","an","extension","of","``","networkx.DiGraph","``",".","A","``","StructureModel","``","stores","nodes","and","edges","with","optional","data",",","or","attributes",".","Edges","have","one","required","attribute",",","``","origin","''",",","which","describes","how","the","edge","was","created",".","Origin","can","be","one","of","either","unknown",",","learned",",","or","expert",".","StructureModel","hold","directed","edges",",","describing","a","cause","-",">","effect","relationship",".","Cycles","are","permitted","within","a","``","StructureModel","``",".","Nodes","can","be","arbitrary","(","hashable",")","Python","objects","with","optional","key\/value","attributes",".","By","convention","None","is","not","used","as","a","node",".","Edges","are","represented","as","links","between","nodes","with","optional","key\/value","attributes","."]
docstr: Adds a bunch of causal relationships, u -> v.
  
  If u or v do not currently exists in the ``StructureModel`` then they will be created.
  
  By default relationships will be given origin="unknown",
  but may also be given "learned" or "expert" origin.
  
  Notes:
      Adding an edge that already exists will replace the existing edge.
      See :func:`networkx.DiGraph.add_edges_from`.
  
  Args:
      ebunch_to_add: container of edges.
                     Each edge given in the container will be added to the graph.
                     The edges must be given as 2-tuples (u, v) or
                     3-tuples (u, v, d) where d is a dictionary containing edge data.
      origin: label for how the edges were created. One of:
                  - unknown: edges exist for an unknown reason.
                  - learned: edges were created as the output of a machine-learning process.
                  - expert: edges were created by a domain expert.
      **attr:  Attributes to add to edge as key/value pairs (no attributes by default).
docstr_tok: ["Adds","a","bunch","of","causal","relationships",",","u","-",">","v.","If","u","or","v","do","not","currently","exists","in","the","``","StructureModel","``","then","they","will","be","created",".","By","default","relationships","will","be","given","origin=","''","unknown","''",",","but","may","also","be","given","``","learned","''","or","``","expert","''","origin",".","Notes",":","Adding","an","edge","that","already","exists","will","replace","the","existing","edge",".","See",":","func",":","`","networkx.DiGraph.add_edges_from","`",".","Args",":","ebunch_to_add",":","container","of","edges",".","Each","edge","given","in","the","container","will","be","added","to","the","graph",".","The","edges","must","be","given","as","2-tuples","(","u",",","v",")","or","3-tuples","(","u",",","v",",","d",")","where","d","is","a","dictionary","containing","edge","data",".","origin",":","label","for","how","the","edges","were","created",".","One","of",":","-","unknown",":","edges","exist","for","an","unknown","reason",".","-","learned",":","edges","were","created","as","the","output","of","a","machine-learning","process",".","-","expert",":","edges","were","created","by","a","domain","expert",".","*","*","attr",":","Attributes","to","add","to","edge","as","key\/value","pairs","(","no","attributes","by","default",")","."]
code: def add_edges_from(
      self,
      ebunch_to_add: Union[Set[Tuple], List[Tuple]],
      origin: str = "unknown",
      **attr,
  ):
      """
      Adds a bunch of causal relationships, u -> v.
  
      If u or v do not currently exists in the ``StructureModel`` then they will be created.
  
      By default relationships will be given origin="unknown",
      but may also be given "learned" or "expert" origin.
  
      Notes:
          Adding an edge that already exists will replace the existing edge.
          See :func:`networkx.DiGraph.add_edges_from`.
  
      Args:
          ebunch_to_add: container of edges.
                         Each edge given in the container will be added to the graph.
                         The edges must be given as 2-tuples (u, v) or
                         3-tuples (u, v, d) where d is a dictionary containing edge data.
          origin: label for how the edges were created. One of:
                      - unknown: edges exist for an unknown reason.
                      - learned: edges were created as the output of a machine-learning process.
                      - expert: edges were created by a domain expert.
          **attr:  Attributes to add to edge as key/value pairs (no attributes by default).
      """
      _validate_origin(origin)
  
      attr.update({"origin": origin})
      super().add_edges_from(ebunch_to_add, **attr)
  
file_path: causalnex/causalnex/structure/structuremodel.py
imports: from typing import Any, Hashable, List, Set, Tuple, Union
  import networkx
  import numpy
  from networkx.exception import NodeNotFound
label_desc: Use image node_id 5 for calling the StructureModel obj's underlying member method code with example usage: obj.add_edges_from(ebunch_to_add, origin) without return types