def _get_scheme_func(ns, scheme):
    """Return a function specified by the given scheme."""
    if isinstance(scheme, str):
        scheme = ns.ALIASES_MAP[scheme.lower()]
    return ns.FUNC_MAP[scheme]