def METHOD_NAME(self, uri: str, location: Optional[str], content: str):
    """
    Write the given uri and it's content according to the base path and if
    the uri is relative to first requested uri.
    Keep track of all the written file paths, in case we have to
    modify the location attribute in an upcoming schema/definition
    import.
    """
    common_path = os.path.commonpath((self.base_path or "", uri))
    if common_path:
        file_path = self.output.joinpath(Path(uri).relative_to(common_path))
    else:
        file_path = self.output.joinpath(Path(uri).name)
    content = self.adjust_imports(file_path.parent, content)
    file_path.parent.mkdir(parents=True, exist_ok=True)
    file_path.write_text(content, encoding="utf-8")
    logger.info("Writing %s", file_path)
    self.downloaded[uri] = file_path
    if location:
        self.downloaded[location] = file_path