<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _calc_density( x: np.ndarray, y: np.ndarray, ):
 """ Function to calculate the density of cells in an embedding. """
    

    # Calculate the point density
    xy = np.vstack([x,y])
    z = gaussian_kde(xy)(xy)

    min_z = np.min(z)
    max_z = np.max(z)

    # Scale between 0 and 1
    scaled_z = (z-min_z)/(max_z-min_z)

    return(scaled_z)