<｜begin▁of▁sentence｜>### Instruction:
Given the Condensed Matter collaborations graph from the year 2005, can you use the threshold clustering algorithm in cdlib to perform community detection based on a threshold defined by the mean of out-ties of nodes? And can you provide a mapping of each node to the communities it belongs to?
### Response:
import networkx as nx
from cdlib import algorithms
import numpy as np
G = nx.read_gml('cond-mat-2005.gml')
coms = algorithms.threshold_clustering(G, threshold_function=np.mean)
thresh_coms = coms.to_node_community_map()
print(thresh_coms)
<|EOT|>
