def METHOD_NAME(
    path: str, subfolder: Optional[str], filename: Optional[str], create: bool
) -> str:
    if subfolder:
        path = osp.join(path, subfolder)
    if create:
        os.makedirs(path, exist_ok=True)
    if filename:
        path = osp.join(path, filename)
    return path