def METHOD_NAME(ns_g_mass, ns_sequence, extrapolate=False):
    """
    Determines the dimensionless compactness parameter of an NS given
    its gravitational mass and an NS equilibrium sequence.
    Parameters
    -----------
    ns_g_mass : float
        NS gravitational mass (in solar masses)
    ns_sequence : numpy.array
        Contains the sequence data in the form NS gravitational
        mass (in solar masses), NS baryonic mass (in solar
        masses), NS compactness (dimensionless)
    extrapolate : boolean, optional
        Invoke extrapolation in scipy.interpolate.interp1d.
        Default is False (so ValueError is raised for ns_g_mass out of bounds)
    Returns
    ----------
    float
    """
    x = ns_sequence[:, 0]
    y = ns_sequence[:, 2]
    fill_value = "extrapolate" if extrapolate else np.nan
    f = interp1d(x, y, fill_value=fill_value)
    return f(ns_g_mass)