original_docstring: 
          Converts a VGG Region configuration to a located object.
  
          :param region:      The region.
          :return:            The located object.
          
docstring: Converts a VGG Region configuration to a located object.
docstring_tokens: Converts a VGG Region configuration to a located object .
code: def to_located_object(region: Region) -> LocatedObject:
          """
          Converts a VGG Region configuration to a located object.
  
          :param region:      The region.
          :return:            The located object.
          """
          # Get the object label
          label: str = region.region_attributes.type
  
          # Get the shape attributes
          if isinstance(region.shape_attributes, PolygonShapeAttributes):
              x, y, width, height, polygon = from_polygon_shape_attributes(region.shape_attributes)
          else:
              x, y, width, height = from_rect_shape_attributes(region.shape_attributes)
              polygon = None
  
          # Create the located object
          located_object = LocatedObject(x, y, width, height)
          set_object_label(located_object, label)
  
          # Add the polygon if there is one
          if polygon is not None:
              located_object.set_polygon(polygon)
  
          return located_object
code_tokens: def to_located_object ( region : Region ) -> LocatedObject : label : str = region . region_attributes . type if isinstance ( region . shape_attributes , PolygonShapeAttributes ) : x , y , width , height , polygon = from_polygon_shape_attributes ( region . shape_attributes ) else : x , y , width , height = from_rect_shape_attributes ( region . shape_attributes ) polygon = None located_object = LocatedObject ( x , y , width , height ) set_object_label ( located_object , label ) if polygon is not None : located_object . set_polygon ( polygon ) return located_object
short_docstring: Converts a VGG Region configuration to a located object.
short_docstring_tokens: Converts a VGG Region configuration to a located object .
comment: """
          Converts a VGG Region configuration to a located object.
  
          :param region:      The region.
          :return:            The located object.
          """$SEP$# Get the object label$SEP$# Get the shape attributes$SEP$# Create the located object$SEP$# Add the polygon if there is one