def METHOD_NAME(graph, partition: Mapping[int, int], node: int) -> Tuple[int, int]:
    """
    Simultaneously computes the weighted degree (without self-edges) between `node` and
    members of `node_community` (without counting self-edge) as well as `neighbor_community`.
    """
    degrees = {}
    for neighbor, data in graph[node].items():
        if neighbor != node:
            degrees[partition[neighbor]] = degrees.get(
                partition[neighbor], 0) + data.get('weight', 1)
    return degrees