def METHOD_NAME(
    data: pd.DataFrame,
    graph: nx.Graph,
    column: str,
    attrib_cols: Optional[Iterable[str]],
    node_role: NodeRole,
):
    """Set node attributes from column values."""
    all_cols = [column, *attrib_cols] if attrib_cols else [column]
    # Create an 'agg' dictionary to apply to DataFrame
    agg_dict: Dict[str, Union[str, Callable]] = (
        {col: _pd_unique_list for col in attrib_cols} if attrib_cols else {}
    )
    # Add these two items as attributes
    agg_dict.update({"node_role": "first", "node_type": "first"})
    # Group by the column value and apply the agg dictionary
    # to_dict(orient="index") produces a dict like
    # { column_val: { attrib_name: attrib_val, attrib2_name: ....}}
    source_attrib_dict = (
        data[all_cols]
        .assign(node_role=node_role, node_type=column)
        .groupby(column)
        .agg(agg_dict)
        .to_dict(orient="index")
    )
    # we can use the dict to directly set the attributes for all graph items.
    nx.set_node_attributes(graph, source_attrib_dict)