class_docstr: A `DAGRepr` represents a complete DAG.
  
  Args:
      nodes (`Dict[str, NodeRepr]`): All nodes in the dag, which start with _input and end with _output node.
      edges (`Dict[int, List]`): The edges about data queue schema, such as:
                          { 0: {'data': [(a, ColumnType.SCALAR), (b, ColumnType.SCALAR)], 'schema': {'a', SchemaRepr, 'b', SchemaRepr}}
                            1: {'data': [(b, ColumnType.SCALAR), (c, ColumnType.SCALAR)], 'schema': {'b', SchemaRepr, 'c', SchemaRepr}}
                            2: {'data': [(a, ColumnType.SCALAR), (c, ColumnType.SCALAR)], 'schema': {'a', SchemaRepr, 'c', SchemaRepr}}
                          }
      dag_dict(`Dict`): The dag dict.
class_docstr_tok: ["A","`","DAGRepr","`","represents","a","complete","DAG",".","Args",":","nodes","(","`","Dict","[","str",",","NodeRepr","]","`",")",":","All","nodes","in","the","dag",",","which","start","with","_input","and","end","with","_output","node",".","edges","(","`","Dict","[","int",",","List","]","`",")",":","The","edges","about","data","queue","schema",",","such","as",":","{","0",":","{","'data","'",":","[","(","a",",","ColumnType.SCALAR",")",",","(","b",",","ColumnType.SCALAR",")","]",",","'schema","'",":","{","'","a","'",",","SchemaRepr",",","'","b","'",",","SchemaRepr","}","}","1",":","{","'data","'",":","[","(","b",",","ColumnType.SCALAR",")",",","(","c",",","ColumnType.SCALAR",")","]",",","'schema","'",":","{","'","b","'",",","SchemaRepr",",","'","c","'",",","SchemaRepr","}","}","2",":","{","'data","'",":","[","(","a",",","ColumnType.SCALAR",")",",","(","c",",","ColumnType.SCALAR",")","]",",","'schema","'",":","{","'","a","'",",","SchemaRepr",",","'","c","'",",","SchemaRepr","}","}","}","dag_dict","(","`","Dict","`",")",":","The","dag","dict","."]
docstr: Return a DAGRepr from a dag dictionary.
  
  Args:
      dag (`str`): The dag dictionary.
  
  Returns:
      DAGRepr
docstr_tok: ["Return","a","DAGRepr","from","a","dag","dictionary",".","Args",":","dag","(","`","str","`",")",":","The","dag","dictionary",".","Returns",":","DAGRepr"]
code: def from_dict(dag: Dict[str, Any]):
      """Return a DAGRepr from a dag dictionary.
  
      Args:
          dag (`str`): The dag dictionary.
  
      Returns:
          DAGRepr
      """
      dag_dict = deepcopy(dag)
      for uid, node in dag_dict.items():
          if node["op_info"]["type"] == OPType.PIPELINE:
              DAGRepr.rebuild_dag(
                  dag,
                  uid,
                  node["op_info"],
                  node["iter_info"],
                  node["inputs"],
                  node["outputs"],
              )
  
      def _get_name(val):
          if val["op_info"]["type"] == OPType.CALLABLE:
              if isinstance(
                  val["op_info"]["operator"], types.FunctionType
              ):
                  name = val["op_info"]["operator"].__name__
              else:
                  name = type(val["op_info"]["operator"]).__name__
          elif val["op_info"]["type"] == OPType.LAMBDA:
              name = "lambda"
          elif val["op_info"]["type"] in [OPType.HUB, OPType.BUILTIN]:
              fn = val["op_info"]["operator"]
              if isinstance(fn, str):
                  name = fn
              else:
                  name = fn.__class__.__name__
  
          return name
  
      nodes = {}
      node_index = 0
      for key, val in dag.items():
          # Deal with AutoConfig
          if (
              "config" in val
              and val["config"] is not None
              and isinstance(val["config"], TowheeConfig)
          ):
              val["config"] = val["config"].config
              assert isinstance(val["config"], dict)
  
          # Deal with input and output.
          if key in [InputConst.name, OutputConst.name]:
              val["config"] = {"name": key}
  
          # Concat nodes does not have op_info.
          elif val["iter_info"]["type"] == ConcatConst.name:
              val["config"] = {"name": "concat-" + str(node_index)}
              node_index += 1
  
          # If config does not specified.
          elif "config" not in val or not val["config"]:
              name = _get_name(val)
              val["config"] = {"name": name + "-" + str(node_index)}
              node_index += 1
  
          # Process dict config.
          elif isinstance(val["config"], dict):
              if "name" not in val["config"]:
                  name = _get_name(val)
                  val["config"]["name"] = name + "-" + str(node_index)
              elif val["config"]["name"] in [
                  InputConst.name,
                  OutputConst.name,
              ]:
                  val["config"]["name"] = (
                      val["config"]["name"] + "-" + str(node_index)
                  )
              node_index += 1
  
          nodes[key] = NodeRepr(uid=key, **val)
      top_sort = DAGRepr.get_top_sort(nodes)
      DAGRepr.check_nodes(nodes, top_sort)
      dag_nodes, schema_edges = DAGRepr.set_edges(nodes, top_sort)
      return DAGRepr(
          nodes=dag_nodes,
          edges=schema_edges,
          dag_dict=dag,
          top_list=top_sort,
      )
  
imports: import types
  import uuid
  import json
  from copy import deepcopy
  from typing import Dict, Any, Set, List, Tuple, Optional
  from pydantic import BaseModel
  from towhee.runtime.check_utils import check_set, check_node_iter
  from towhee.runtime.node_repr import NodeRepr
  from towhee.runtime.schema_repr import SchemaRepr
  from towhee.runtime.node_config import TowheeConfig
  from towhee.runtime.constants import WindowAllConst, WindowConst, ConcatConst, MapConst, ReduceConst, FilterConst, TimeWindowConst, FlatMapConst, InputConst, OutputConst, OPType
label_desc: Use image node_id 11 for calling the DAGRepr obj's underlying member method code with example usage: obj.from_dict(dag) and returns: DAGRepr, name