def _scale_moment(magnitude, in_nm=False):
    """Returns the moment for a given magnitude.
    :param float magnitude:
        Earthquake magnitude
    :param bool in_nm:
        To return the value in newton metres set to true - otherwise in
        dyne-cm
    """
    if in_nm:
        return 10.0 ** (1.5 * magnitude + 9.05)
    else:
        return 10.0 ** (1.5 * magnitude + 16.05)
