def METHOD_NAME(
    client: Client, code_block_list: List[str], stdout: str
) -> List[str]:
    """
    If you have a notebook that is publishing a workflow, but you don't know the flow id of the flow beforehand,
    or you know and don't want to hard code it in some automated system, this method will attempt to figure out
    the published flow by looking at the notebook's standard output.
    The means that you must print the id of the published workflow in the notebook. Otherwise, this method will
    complain.
    """
    import re
    UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
    CELL_HEADER_OUTPUT_TEMPLATE = "Cell %d"
    PUBLISH_CODE_SNIPPET = ".publish_flow("
    cell_num_to_publish_freq = {
        i: code_block.count(PUBLISH_CODE_SNIPPET) for i, code_block in enumerate(code_block_list)
    }
    # For convenience, lets just restrict to one publish max per cell.
    if any(count > 1 for count in cell_num_to_publish_freq.values()):
        raise Exception("Multiple publish_flow() calls in the same cell. Can we split them up?")
    cells_that_publish = sorted([i for i, count in cell_num_to_publish_freq.items() if count > 0])
    print(
        "There are flows that have been published by this notebook in cells: %s"
        % ", ".join([str(x) for x in cells_that_publish])
    )
    flow_ids = []
    for cell_num in cells_that_publish:
        start_idx = stdout.find(CELL_HEADER_OUTPUT_TEMPLATE % cell_num)
        end_idx = stdout.find(CELL_HEADER_OUTPUT_TEMPLATE % (cell_num + 1))
        if end_idx < 0:
            end_idx = len(stdout)
        # Isolate the output of the cell and extract any printed UUIDs.
        cell_output = stdout[start_idx:end_idx]
        candidate_flow_ids = re.findall(UUID_REGEX, cell_output)
        if len(candidate_flow_ids) == 0:
            raise Exception(
                "Cell %d had a publish_flow() call but did not print out out uuid." % cell_num
            )
        print(
            "Found uuids %s in output of cell number %d. Checking that at least one corresponds to a flow. \n"
            % (", ".join(candidate_flow_ids), cell_num)
        )
        # Check if any of these ids correspond to existing flows.
        validated_flow_ids = []
        for candidate_flow_id in candidate_flow_ids:
            try:
                _ = client.flow(candidate_flow_id)
            except InvalidUserArgumentException:
                pass
            else:
                print("Flow %s corresponds to an actual workflow." % candidate_flow_id)
                validated_flow_ids.append(candidate_flow_id)
        if len(validated_flow_ids) == 0:
            raise Exception(
                "Cell %d had a publish_flow() call but did not print any valid flow ids for us to track."
                % cell_num
            )
        flow_ids.extend(validated_flow_ids)
    # Deduplicate before returning
    return list(set(flow_ids))