def add_node(
    counter, graph, manufacturer, type, type_name, tags, data
):
    """
    Function for adding a node with attributes to a graph.

    Parameters
    ----------
    counter: Counter object
    graph: (Di)Graph object
    manufacturer: str
        The manufacturer of the item being added as a node.
    type: str
        The type of item being added as a node.
    type_name: str
        The (product) name of the item being added as a node.
    tags: list of str
        The attribute tags (headers) of the attributes of the item.
    data: list or array of floats
        The data for each of the attributes of the item.

    Returns
    -------
    graph: (Di)Graph object
        Returns the (Di)Graph object with the addition of a new node.
    """
    # we'll first create a dictionary with all the node attributes
    node = {
        'manufacturer': manufacturer,
        'type': type,
        'name': type_name
    }
    # loop through the tags and data
    for t, d in zip(tags, data):
        node[t] = d
    # get a UID and assign it
    uid = counter.count()
    node['uid'] = uid

    # overwrite the size - in case it didn't import properly from the pdf
    size = (
        node['pipe_body_inside_diameter']
        + 2 * node['pipe_body_wall_thickness']
    )
    # use the class method to add the node, unpacking the node dictionary
    # and naming the node with its UID
    graph.add_node(uid, **node)
    
    return graph