class_docstr: A basic Rect class. Assumes tl <= br.
class_docstr_tok: ["A","basic","Rect","class",".","Assumes","tl","<","=","br","."]
code: def __new__(cls, *args):
      if len(args) == 1 or (len(args) == 2 and args[1] is None):
          args = (origin, args[0])
      if len(args) == 2:
          p1, p2 = args
          if not isinstance(p1, Point) or not isinstance(p2, Point):
              raise TypeError("Rect expected Points")
          return super(Rect, cls).__new__(
              cls,
              min(p1.y, p2.y),
              min(p1.x, p2.x),
              max(p1.y, p2.y),
              max(p1.x, p2.x),
          )
      if len(args) == 4:
          if args[0] > args[2] or args[1] > args[3]:
              raise TypeError("Rect requires: t <= b and l <= r")
          # TODO(b/117657518): Remove the disable once the pytype bug is fixed.
          return super(Rect, cls).__new__(
              cls, *args
          )  # pytype: disable=missing-parameter
      raise TypeError(
          "Unexpected arguments to Rect. Takes 1 or 2 Points, or 4 coords."
      )
  
imports: import collections
  import math
  import random
label_desc: Use image node_id 1 for calling the Rect obj's underlying member method code with example usage: obj.__new__(cls) and returns: super, super