def METHOD_NAME(self, var):
    """Get vertical code name for obs / var combination"""
    vc = self["obs_vert_type"]
    if isinstance(vc, str):
        val = vc
    elif isinstance(vc, dict) and var in vc:
        val = vc[var]
    else:
        raise ValueError(f"invalid value for obs_vert_type: {vc}")
    if not val in self.SUPPORTED_VERT_CODES:
        raise ValueError(
            f"invalid value for obs_vert_type: {val}. Choose from "
            f"{self.SUPPORTED_VERT_CODES}."
        )
    return val