def CreateRoadFrom(
    lane: Union["AbstractLane", "StraightLane", "CircularLane"],
    lane_num: int,
    road: "Road",
    roadnet_to_add_lanes: "NodeRoadNetwork",  # mostly, block network
    roadnet_to_check_cross: "NodeRoadNetwork",  # mostly, previous global_network
    toward_smaller_lane_index: bool = True,
    ignore_start: str = None,
    ignore_end: str = None,
    center_line_type=None,  # Identical to Block.CENTER_LINE_TYPE
    detect_one_side=True,
    side_lane_line_type=None,
    inner_lane_line_type=None,
    center_line_color=None,
    ignore_intersection_checking=None,
    metadrive_lane_type=None,
) -> bool:
    """
    Give the far left lane, then create lane_num lanes including the far left lane itself.
        | | | |
        | | | |
        | | | |
        | | | |

    Args:
        lane:
        lane_num:
        road:
        roadnet_to_add_lanes: The block network
        roadnet_to_check_cross: Existing global network
        toward_smaller_lane_index:
        ignore_start:
        ignore_end:
        center_line_type:
        detect_one_side:
        side_lane_line_type:
        inner_lane_line_type:
        center_line_color:
        ignore_intersection_checking:
        metadrive_lane_type:

    Return:
        A Boolean indicator saying whether the road is constructed successfully.
    """
    center_line_type = center_line_type or PGLineType.CONTINUOUS
    side_lane_line_type = side_lane_line_type or PGLineType.SIDE
    side_lane_line_type = side_lane_line_type or PGLineType.SIDE
    inner_lane_line_type = inner_lane_line_type or PGLineType.BROKEN
    center_line_color = center_line_color or PGLineColor.YELLOW

    lane_num -= 1  # include lane itself
    origin_lane = lane
    lanes = []
    lane_width = lane.width_at(0)
    for i in range(lane_num, 0, -1):
        side_lane = copy.copy(lane)
        if isinstance(lane, StraightLane):
            width = -lane_width if toward_smaller_lane_index else lane_width
            start = side_lane.position(0, width)
            end = side_lane.position(side_lane.length, width)
            side_lane.start = start
            side_lane.end = end
        elif isinstance(lane, CircularLane):
            new_lane_clockwise = True if lane.is_clockwise() else False
            radius1 = lane.radius
            if not toward_smaller_lane_index:
                radius2 = radius1 - lane_width if new_lane_clockwise else radius1 + lane_width
            else:
                radius2 = radius1 + lane_width if new_lane_clockwise else radius1 - lane_width
            side_lane.radius = radius2
            side_lane.update_properties()
        if i == 1:
            side_lane.line_types = [center_line_type, inner_lane_line_type] if toward_smaller_lane_index else \
                [inner_lane_line_type, side_lane_line_type]
        else:
            side_lane.line_types = [inner_lane_line_type, inner_lane_line_type]
        lanes.append(side_lane)
        lane = side_lane
    if toward_smaller_lane_index:
        lanes.reverse()
        lanes.append(origin_lane)
        origin_lane.line_types = [inner_lane_line_type if len(lanes) > 1 else center_line_type, side_lane_line_type]
    else:
        lanes.insert(0, origin_lane)
        if len(lanes) > 1:
            line_type = origin_lane.line_types[0], lanes[-1].line_types[0]
            origin_lane.line_types = line_type
    # check the left lane and right lane
    ignore = (ignore_start, ignore_end)
    factor = (
        PGDrivableAreaProperty.SIDEWALK_WIDTH + PGDrivableAreaProperty.SIDEWALK_LINE_DIST + lane_width / 2.0
    ) * 2.0 / lane_width
    if not detect_one_side:
        # Because of side walk, the width of side walk should be consider
        no_cross = not (
            check_lane_on_road(
                roadnet_to_check_cross,
                origin_lane,
                factor,
                ignore,
                ignore_intersection_checking=ignore_intersection_checking
            ) or check_lane_on_road(
                roadnet_to_check_cross,
                lanes[0],
                -0.95,
                ignore,
                ignore_intersection_checking=ignore_intersection_checking
            )
        )
    else:
        no_cross = not check_lane_on_road(
            roadnet_to_check_cross,
            origin_lane,
            factor,
            ignore,
            ignore_intersection_checking=ignore_intersection_checking
        )
    for l in lanes:
        roadnet_to_add_lanes.add_lane(road.start_node, road.end_node, l)
        if metadrive_lane_type is not None:
            assert MetaDriveType.is_lane(metadrive_lane_type)
            l.set_metadrive_type(metadrive_lane_type)
    if lane_num == 0:
        lanes[-1].line_types = [center_line_type, side_lane_line_type]
    lanes[0].line_colors = [center_line_color, PGLineColor.GREY]
    return no_cross

    Give the far left lane, then create lane_num lanes including the far left lane itself.
        | | | |
        | | | |
        | | | |
        | | | |

    Args:
        lane:
        lane_num:
        road:
        roadnet_to_add_lanes: The block network
        roadnet_to_check_cross: Existing global network
        toward_smaller_lane_index:
        ignore_start:
        ignore_end:
        center_line_type:
        detect_one_side:
        side_lane_line_type:
        inner_lane_line_type:
        center_line_color:
        ignore_intersection_checking:
        metadrive_lane_type:

    Return:
        A Boolean indicator saying whether the road is constructed successfully.
    
metadrive/component/pgblock/create_pg_block_utils.py