<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def from_nodes(cls, nodes, new_nodes, max_slaves_limit=None):
        '''When this is used only for peeking reuslt
           `new_nodes` can be any type with `host` and `port` attributes
        '''
        param = gen_distribution(nodes, new_nodes)
        param['max_slaves_limit'] = max_slaves_limit
        return cls(**param)