def _ensure_absolute(self, maybe_relpath):
if not isinstance(maybe_relpath, str):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>".<EOL>format(maybe_relpath, type(maybe_relpath)))<EOL><DEDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>", maybe_relpath)<EOL>if os.path.isabs(maybe_relpath) or is_url(maybe_relpath):<EOL><INDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>")<EOL>return maybe_relpath<EOL><DEDENT>expanded = os.path.expanduser(os.path.expandvars(maybe_relpath))<EOL>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>", expanded)<EOL>if os.path.isabs(expanded):<EOL><INDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>")<EOL>return expanded<EOL><DEDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>",<EOL>maybe_relpath)<EOL>config_dirpath = os.path.dirname(self.config_file)<EOL>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>", config_dirpath)<EOL>abs_path = os.path.join(config_dirpath, maybe_relpath)<EOL>return abs_path<EOL>
Ensure that a possibly relative path is absolute.