code: def AddPoly(self, poly, smart_duplicate_handling=True):
      
      inserted_name = poly.GetName()
      if poly.GetName() in self._name_to_shape:
        if not smart_duplicate_handling:
          raise ShapeError("Duplicate shape found: " + poly.GetName())
  
        print ("Warning: duplicate shape id being added to collection: " +
               poly.GetName())
        if poly.GreedyPolyMatchDist(self._name_to_shape[poly.GetName()]) < 10:
          print("  (Skipping as it apears to be an exact duplicate)")
        else:
          print("  (Adding new shape variant with uniquified name)")
          inserted_name = "%s-%d" % (inserted_name, len(self._name_to_shape))
      self._name_to_shape[inserted_name] = poly
docs: Adds a new polyline to the collection.