class_docstr: Class representing a rectangle.
class_docstr_tok: ["Class","representing","a","rectangle","."]
docstr: Expands the rectangle by the given margins.
  
  @return: a new L{Rectangle} object.
docstr_tok: ["Expands","the","rectangle","by","the","given","margins",".","@","return",":","a","new","L","{","Rectangle","}","object","."]
code: def expand(self, margins):
      """Expands the rectangle by the given margins.
  
      @return: a new L{Rectangle} object.
      """
      if isinstance(margins, int) or isinstance(margins, float):
          return self.contract(-float(margins))
      return self.contract([-float(margin) for margin in margins])
  
imports: from collections import defaultdict
  from math import atan2, cos, hypot, sin
  from typing import NamedTuple
  from igraph.utils import consecutive_pairs
label_desc: Use image node_id 23 for calling the Rectangle obj's underlying member method code with example usage: obj.expand(margins) and returns: self, self