def add_node(self, node: dict):
    "\n        add node method. Runs basic validation before adding.\n\n        :param dict node: dictionary of node's data\n        "
    if (node.get('id') is not None):
        if (node['id'] in self._nodes):
            raise ValueError(('tried to override node %s' % node['id']))
    else:
        raise ValueError('no id for node provided')
    id_ = node['id']
    del node['id']
    node['player'] = ('0' if (node.get('player') is None) else node['player'])
    node['value'] = ([0, 0] if (node.get('value') is None) else node['value'])
    node['parents'] = ({} if (node.get('parents') is None) else node['parents'])
    node['children'] = ({} if (node.get('children') is None) else node['children'])
    node['probability'] = (1 if (node.get('probability') is None) else node['probability'])
    node['branch'] = ({} if (node.get('branch') is None) else node['branch'])
    node['branch']['probability'] = (1 if (node['branch'].get('probability') is None) else node['branch']['probability'])
    if (node['player'] not in self._players_list):
        self._players_list.append(node['player'])
    for parent in node['parents']:
        self._nodes[parent]['children'][id_] = str(node['parents'][parent])
    if node['parents']:
        node['depth'] = (self._nodes[str(list(node['parents'].keys())[0])]['depth'] + 1)
    else:
        node['depth'] = (0 if (node.get('depth') is None) else node['depth'])
    branch_probability = 0
    for parent in node['parents']:
        branch_probability += self._nodes[parent]['branch']['probability']
    node['branch']['probability'] = (branch_probability * node['probability'])
    if ((id_ is not 'root') and (not node['parents'])):
        raise ValueError(('node [%s] is not connected to the tree - parents are empty' % id_))
    self._nodes[id_] = node
add node method. Runs basic validation before adding.

:param dict node: dictionary of node's data
def add_node(self, node: dict):
    "\n        add node method. Runs basic validation before adding.\n\n        :param dict node: dictionary of node's data\n        "
    if (node.get('id') is not None):
        if (node['id'] in self._nodes):
            raise ValueError(('tried to override node %s' % node['id']))
    else:
        raise ValueError('no id for node provided')
    id_ = node['id']
    del node['id']
    node['player'] = ('0' if (node.get('player') is None) else node['player'])
    node['value'] = ([0, 0] if (node.get('value') is None) else node['value'])
    node['parents'] = ({} if (node.get('parents') is None) else node['parents'])
    node['children'] = ({} if (node.get('children') is None) else node['children'])
    node['probability'] = (1 if (node.get('probability') is None) else node['probability'])
    node['branch'] = ({} if (node.get('branch') is None) else node['branch'])
    node['branch']['probability'] = (1 if (node['branch'].get('probability') is None) else node['branch']['probability'])
    if (node['player'] not in self._players_list):
        self._players_list.append(node['player'])
    for parent in node['parents']:
        self._nodes[parent]['children'][id_] = str(node['parents'][parent])
    if node['parents']:
        node['depth'] = (self._nodes[str(list(node['parents'].keys())[0])]['depth'] + 1)
    else:
        node['depth'] = (0 if (node.get('depth') is None) else node['depth'])
    branch_probability = 0
    for parent in node['parents']:
        branch_probability += self._nodes[parent]['branch']['probability']
    node['branch']['probability'] = (branch_probability * node['probability'])
    if ((id_ is not 'root') and (not node['parents'])):
        raise ValueError(('node [%s] is not connected to the tree - parents are empty' % id_))
    self._nodes[id_] = node