class_docstr: The classic Sugiyama layout aka layered layout.
  
  - See https://en.wikipedia.org/wiki/Layered_graph_drawing
  - Excellent explanation: https://www.youtube.com/watch?v=Z0RGCWxvCxA
  
  
  **Attributes**
      - dirvh (int): the current aligment state for alignment policy:
               dirvh=0 -> dirh=+1, dirv=-1: leftmost upper
               dirvh=1 -> dirh=-1, dirv=-1: rightmost upper
               dirvh=2 -> dirh=+1, dirv=+1: leftmost lower
               dirvh=3 -> dirh=-1, dirv=+1: rightmost lower
      - order_iter (int): the default number of layer placement iterations
      - order_attr (str): set attribute name used for layer ordering
      - xspace (int): horizontal space between vertices in a layer
      - yspace (int): vertical space between layers
      - dw (int): default width of a vertex
      - dh (int): default height of a vertex
      - g (GraphBase): the graph component reference
      - layers (list[sugiyama.layer.Layer]): the list of layers
      - layoutVertices (dict): associate vertex (possibly dummy) with their sugiyama attributes
      - ctrls (dict): associate edge with all its vertices (including dummies)
      - dag (bool): the current acyclic state
      - init_done (bool): True if things were initialized
  
  **Example**
  
      ::
  
          g = nx.generators.connected_watts_strogatz_graph(1000, 2, 0.3)
          # render
          SugiyamaLayout.draw(g)
          # positions
          positions_dictionary = SugiyamaLayout.arrange(g)
docstr: Returns the positions from a Sugiyama layout iteration.
  
  :param layout_direction:
      - 0: top-to-bottom
      - 1: right-to-left
      - 2: bottom-to-top
      - 3: left-to-right
  
  :param     obj: can be a Sugiyama graph or a Pandas frame.
  :param     iteration_count: increase the value for diminished crossings
  :param     source_column: if a Pandas frame is given, the name of the column with the source of the edges
  :param     target_column: if a Pandas frame is given, the name of the column with the target of the edges
  :param     topological_coordinates: whether to use coordinates with the x-values in the [0,1] range and the y-value equal to the layer index.
  :param     include_levels: whether the tree-level is included together with the coordinates. If so, you get a triple (x,y,level).
  :param     root: optional list of roots.
  
  **Returns**
      a dictionary of positions.
docstr_tok: ["Returns","the","positions","from","a","Sugiyama","layout","iteration",".",":","param","layout_direction",":","-","0",":","top-to-bottom","-","1",":","right-to-left","-","2",":","bottom-to-top","-","3",":","left-to-right",":","param","obj",":","can","be","a","Sugiyama","graph","or","a","Pandas","frame",".",":","param","iteration_count",":","increase","the","value","for","diminished","crossings",":","param","source_column",":","if","a","Pandas","frame","is","given",",","the","name","of","the","column","with","the","source","of","the","edges",":","param","target_column",":","if","a","Pandas","frame","is","given",",","the","name","of","the","column","with","the","target","of","the","edges",":","param","topological_coordinates",":","whether","to","use","coordinates","with","the","x-values","in","the","[","0,1","]","range","and","the","y-value","equal","to","the","layer","index",".",":","param","include_levels",":","whether","the","tree-level","is","included","together","with","the","coordinates",".","If","so",",","you","get","a","triple","(","x",",","y",",","level",")",".",":","param","root",":","optional","list","of","roots",".","*","*","Returns","*","*","a","dictionary","of","positions","."]
code: def arrange(
      obj: typing.Union[pd.DataFrame, Graph],
      iteration_count=1.5,
      source_column="source",
      target_column="target",
      layout_direction=0,
      topological_coordinates=False,
      root=None,
      include_levels=False,
  ):
      """
      Returns the positions from a Sugiyama layout iteration.
  
      :param layout_direction:
          - 0: top-to-bottom
          - 1: right-to-left
          - 2: bottom-to-top
          - 3: left-to-right
  
      :param     obj: can be a Sugiyama graph or a Pandas frame.
      :param     iteration_count: increase the value for diminished crossings
      :param     source_column: if a Pandas frame is given, the name of the column with the source of the edges
      :param     target_column: if a Pandas frame is given, the name of the column with the target of the edges
      :param     topological_coordinates: whether to use coordinates with the x-values in the [0,1] range and the y-value equal to the layer index.
      :param     include_levels: whether the tree-level is included together with the coordinates. If so, you get a triple (x,y,level).
      :param     root: optional list of roots.
  
      **Returns**
          a dictionary of positions.
  
      """
      if isinstance(obj, pd.DataFrame):
          gg = SugiyamaLayout.graph_from_pandas(
              obj, source_column, target_column
          )
      elif isinstance(obj, Graph):
          gg = obj
      else:
          raise TypeError
  
      for v in gg.vertices():
          v.view = Rectangle()
  
      sug = SugiyamaLayout(gg.components[0])
      root_vertices = SugiyamaLayout.ensure_root_is_vertex(gg, root)
  
      sug.initialize(root=root_vertices)
      sug.layout(
          iteration_count,
          topological_coordinates=topological_coordinates,
          layout_direction=layout_direction,
      )
  
      positions = SugiyamaLayout._get_positions(
          sug,
          gg.components[0].verticesPoset,
          layout_direction,
          topological_coordinates=topological_coordinates,
          include_levels=include_levels,
      )
      return positions
  
imports: import pandas, typing
  from sys import getrecursionlimit, setrecursionlimit
  from graphistry.layout.graph import Vertex, GraphBase, Graph, Edge
  from graphistry.layout.utils import DummyVertex, LayoutVertex, Rectangle, size_median
  from graphistry.layout.utils.layer import Layer
label_desc: Use image node_id 9 for calling the SugiyamaLayout obj's underlying member method code with example usage: obj.arrange(obj, iteration_count, source_column, target_column, layout_direction, topological_coordinates, root, include_levels) and returns: positions