def METHOD_NAME() -> float:
    memory_limits = [
        available_memory_bytes(),
        ulimit_memory_limit(),
        cgroup_memory_limit(),
    ]
    memory_limits_in_gigabytes = [
        float(ml.m_as(ureg.gigabytes)) for ml in memory_limits if ml is not None
    ]
    METHOD_NAME = (
        min(memory_limits_in_gigabytes) * 0.9
    )  # nipype uses 90% of max as a safety precaution
    process = psutil.Process(pid=os.getpid())
    resident_set_size = process.memory_info().rss * ureg.bytes
    METHOD_NAME -= resident_set_size.m_as(
        ureg.gigabytes
    )  # subtract memory used by current process
    return METHOD_NAME