def _create_u_turn(self, attach_road, part_idx):
        """
        Create a U turn.

        Args:
            attach_road: the road where the U turn starts.
            part_idx: in [0, 1, 2, 3]. When part_idx!=0, we grab the lanes from road network. Otherwise we use the
                initial lanes (positive_lanes).

        Returns:
            None.
        """
        # set to CONTINUOUS to debug
        line_type = PGLineType.NONE
        lanes = attach_road.get_lanes(self.block_network) if part_idx != 0 else self.positive_lanes
        attach_left_lane = lanes[0]
        lane_num = len(lanes)
        left_turn_radius = self.lane_width / 2
        left_bend, _ = create_bend_straight(
            attach_left_lane, 0.1, left_turn_radius, np.deg2rad(180), False, attach_left_lane.width_at(0),
            (PGLineType.NONE, PGLineType.NONE)
        )
        left_road_start = (-attach_road).start_node
        CreateRoadFrom(
            left_bend,
            lane_num,
            Road(attach_road.end_node, left_road_start),
            self.block_network,
            self._global_network,
            toward_smaller_lane_index=False,
            center_line_type=line_type,
            side_lane_line_type=line_type,
            inner_lane_line_type=line_type,
            ignore_intersection_checking=self.ignore_intersection_checking,
            metadrive_lane_type=MetaDriveType.LANE_SURFACE_UNSTRUCTURE
        )

        Create a U turn.

        Args:
            attach_road: the road where the U turn starts.
            part_idx: in [0, 1, 2, 3]. When part_idx!=0, we grab the lanes from road network. Otherwise we use the
                initial lanes (positive_lanes).

        Returns:
            None.
        
metadrive/component/pgblock/intersection.py