def _get_node_attributes(pydot_dot, node):
    """
    This function takes pydot's Dot object and a node name.
    It returns the attributes dict of the node.

    >>> import pydot
    >>> pd = pydot.Dot()
    >>> pd.add_node(pydot.Node("1", shape="egg"))
    >>> _get_node_attributes(pd, "1")
    {'shape': 'egg'}
    >>> _get_node_attributes(pd, "2")
    Traceback (most recent call last):
    ...
    KeyError: "2 is not in ['1']"
    """
    node = str(node)
    node_dict = pydot_dot.obj_dict['nodes']
    double_quote_node = '"' + node + '"'  # '"node"'
    if node in node_dict:
        return node_dict[node][0]['attributes']
    elif double_quote_node in node_dict:  # Sometimes there are keys like '"node"'
        return node_dict[double_quote_node][0]['attributes']
    else:
        raise KeyError(node + " is not in " + str(list(node_dict.keys())))