def METHOD_NAME(table: Table, cols: List[str] = None) -> np.ndarray:
    """  Produces a numpy array from a table.
    Note that the **entire table** is going to be cloned into memory, so the total number of entries in the table
    should be considered before blindly doing this. For large tables, consider using the Deephaven query language to
    select a subset of the table **before** using this method.
    Args:
        table (Table): the source table
        cols (List[str]): the source column names, default is None which means include all columns
    Returns:
        a numpy ndarray
    Raise:
        DHError
    """
    try:
        if table.is_refreshing:
            table = table.snapshot()
        col_def_dict = {col.name: col for col in table.columns}
        if not cols:
            cols = list(col_def_dict.keys())
        else:
            diff_set = set(cols) - set(col_def_dict.keys())
            if diff_set:
                raise DHError(message=f"columns - {list(diff_set)} not found")
        col_defs = [col_def_dict[col] for col in cols]
        if len(set([col_def.data_type for col_def in col_defs])) != 1:
            raise DHError(message="columns must be of the same data type.")
        j_arrays = []
        for col_def in col_defs:
            data_col = _JDataAccessHelpers.getColumn(table.j_table, col_def.name)
            j_arrays.append(data_col.getDirect())
        return _columns_to_2d_numpy_array(col_defs[0], j_arrays)
    except DHError:
        raise
    except Exception as e:
        raise DHError(e, "failed to create a numpy array from the table column.") from e