def define_models(self, ic, leaves=None, N=<NUM_LIT:1>, index=<NUM_LIT:0>):
self.clear_models()<EOL>if leaves is None:<EOL><INDENT>leaves = self._get_leaves()<EOL><DEDENT>elif type(leaves)==type('<STR_LIT>'):<EOL><INDENT>leaves = self.select_leaves(leaves)<EOL><DEDENT>if np.isscalar(N):<EOL><INDENT>N = (np.ones(len(leaves))*N)<EOL><DEDENT>N = np.array(N).astype(int)<EOL>if np.isscalar(index):<EOL><INDENT>index = (np.ones_like(N)*index)<EOL><DEDENT>index = np.array(index).astype(int)<EOL>for s,n,i in zip(leaves, N, index):<EOL><INDENT>s.remove_children()<EOL>s.add_model(ic, n, i)<EOL><DEDENT>self._fix_labels()<EOL>self._N = N<EOL>self._index = index<EOL>self._clear_all_leaves()<EOL>
N, index are either integers or lists of integers.

N : number of model stars per observed star
index : index of physical association

leaves: either a list of leaves, or a pattern by which
the leaves are selected (via `select_leaves`)

If these are lists, then they are defined individually for
each leaf.

If `index` is a list, then each entry must be either
an integer or a list of length `N` (where `N` is the corresponding
    entry in the `N` list.)

This bugs up if you call it multiple times.  If you want
to re-do a call to this function, please re-define the tree.