@staticmethod
def __analyze_neighbors(neighbors, excluded_nodes, weight):
    """
        Analyzes a node dict for the frequency of nodes and gives them
        a weight. An upper bound of the weights is set.

        :param neighbors: list of node_pub_keys
        :param excluded_nodes: excluded node_pub_keys for analysis
        :param weight: float, weight for each individual appearance of a node
        :return: dict, keys: node_pub_keys, values: node weights
        """
    node_weights = {}
    for n in neighbors:
        if n not in excluded_nodes:
            if n in node_weights.keys():
                node_weights[n] = min(node_weights[n] + weight, 1.0)
            else:
                node_weights[n] = weight
    return node_weights
