def METHOD_NAME(obj):
    """Attempt to convert numpy.ma.core.masked"""
    numpy = get_module("numpy")
    if not numpy:
        raise NotEncodable
    if obj is numpy.ma.core.masked:
        return float("nan")
    else:
        raise NotEncodable