#NEWLINE# def gauss( dims , sigma ) : #NEWLINE# #INDENT# '\n    Generate Gaussian function in 2D or 3D.\n\n    Parameters\n    ----------\n    dims : list or tuple\n        shape of the data\n    sigma : float\n        standard deviation of gaussian function\n\n    Returns\n    -------\n    arr : array\n        ND gaussian\n    ' #NEWLINE# x = _dist ( dims ) #NEWLINE# y = np . exp ( ( ( - ( ( x / sigma ) ** 2 ) ) / 2 ) ) #NEWLINE# return ( y / np . sum ( y ) )