#NEWLINE# def s_NDregion( p , shape , ls_classes , n_peaks ) : #NEWLINE# #INDENT# '\n    Simulate an N-dimensional region with one or more peaks.\n\n    Parameters\n    ----------\n    p : list\n        List of parameters, must be a list, modified by function.\n    shape : tuple of ints\n        Shape of region.\n    ls_classes : list\n        List of lineshape classes.\n    n_peaks : int\n        Number of peaks in region.\n\n    Returns\n    -------\n    r : ndarray\n        Simulated region.\n\n    ' #NEWLINE# As = [ p . pop ( 0 ) for i in range ( n_peaks ) ] #NEWLINE# ps = split_list ( p , n_peaks ) #NEWLINE# ( A , curr_p ) = ( As . pop ( 0 ) , ps . pop ( 0 ) ) #NEWLINE# r = s_single_NDregion ( ( [ A ] + curr_p ) , ls_classes , ls_classes ) #NEWLINE# for ( A , curr_p ) in zip ( As , ps ) : #NEWLINE# #INDENT# r = ( r + s_single_NDregion ( ( [ A ] + curr_p ) , shape , ls_classes ) ) #NEWLINE# #UNINDENT# return r