class_docstr: Represents the layout of a graph.
  
  A layout is practically a list of coordinates in an n-dimensional
  space. This class is generic in the sense that it can store coordinates
  in any n-dimensional space.
  
  Layout objects are not associated directly with a graph. This is deliberate:
  there were times when I worked with almost identical copies of the same
  graph, the only difference was that they had different colors assigned to
  the vertices. It was particularly convenient for me to use the same layout
  for all of them, especially when I made figures for a paper. However,
  C{igraph} will of course refuse to draw a graph with a layout that has
  less coordinates than the node count of the graph.
  
  Layouts behave exactly like lists when they are accessed using the item
  index operator (C{[...]}). They can even be iterated through. Items
  returned by the index operator are only copies of the coordinates,
  but the stored coordinates can be modified by directly assigning to
  an index.
  
      >>> layout = Layout([(0, 1), (0, 2)])
      >>> coords = layout[1]
      >>> print(coords)
      [0, 2]
      >>> coords = (0, 3)
      >>> print(layout[1])
      [0, 2]
      >>> layout[1] = coords
      >>> print(layout[1])
      [0, 3]
docstr: Constructor.
  
  @param coords: the coordinates to be stored in the layout.
  @param dim: the number of dimensions. If C{None}, the number of
  dimensions is determined automatically from the length of the first
  item of the coordinate list. If there are no entries in the coordinate
  list, the default will be 2.  Generally, this should be given if the
  length of the coordinate list is zero, otherwise it should be left as
  is.
docstr_tok: ["Constructor",".","@","param","coords",":","the","coordinates","to","be","stored","in","the","layout",".","@","param","dim",":","the","number","of","dimensions",".","If","C","{","None","}",",","the","number","of","dimensions","is","determined","automatically","from","the","length","of","the","first","item","of","the","coordinate","list",".","If","there","are","no","entries","in","the","coordinate","list",",","the","default","will","be","2",".","Generally",",","this","should","be","given","if","the","length","of","the","coordinate","list","is","zero",",","otherwise","it","should","be","left","as","is","."]
code: def __init__(self, coords=None, dim=None):
      """Constructor.
  
      @param coords: the coordinates to be stored in the layout.
      @param dim: the number of dimensions. If C{None}, the number of
      dimensions is determined automatically from the length of the first
      item of the coordinate list. If there are no entries in the coordinate
      list, the default will be 2.  Generally, this should be given if the
      length of the coordinate list is zero, otherwise it should be left as
      is.
      """
      if coords is not None:
          self._coords = [list(coord) for coord in coords]
      else:
          self._coords = []
  
      if dim is None:
          if len(self._coords) == 0:
              self._dim = 2
          else:
              self._dim = len(self._coords[0])
      else:
          self._dim = int(dim)
          for row in self._coords:
              if len(row) != self._dim:
                  raise ValueError(
                      "all items in the coordinate list "
                      + "must have a length of %d" % self._dim
                  )
  
imports: from math import sin, cos, pi
  from igraph._igraph import GraphBase
  from igraph.drawing.utils import BoundingBox
  from igraph.statistics import RunningMean
label_desc: Use image node_id 1 to create a new Layout object  with example: obj = Layout(coords, dim)