def METHOD_NAME(name):
    import ctypes as C
    if isdarwin and not os.getenv('DYLD_LIBRARY_PATH'):
        if os.getenv('MDSPLUS_DIR'):
            os.environ['DYLD_LIBRARY_PATH'] = os.path.join(
                os.getenv('MDSPLUS_DIR'), 'lib')
        else:
            os.environ['DYLD_LIBRARY_PATH'] = '/usr/local/mdsplus/lib'
    try:
        if iswin:
            if ispy38:
                return C.CDLL(name, winmode=C.RTLD_GLOBAL)
            else:
                return C.CDLL(name)
        if isdarwin:
            return C.CDLL('lib%s.dylib' % name)
        return C.CDLL('lib%s.so' % name)
    except Exception:
        pass
    print("Issues loading %s, trying find_library" % name)
    from ctypes.util import find_library
    try:
        libnam = find_library(name)
    except Exception:
        raise ImportError("Could not find library: %s" % (name,))
    if libnam is None:
        raise ImportError("Could not find library: %s" % (name,))
    try:
        return C.CDLL(libnam)
    except Exception:
        pass
    try:
        return C.CDLL(os.path.basename(libnam))
    except Exception:
        raise ImportError('Could not load library: %s' % (name,))