code: def _next_version(version: str) -> str:
      cur = parse(version)
      assert isinstance(cur, Version)
      if cur.is_devrelease:
          prefix = "dev"
          assert cur.dev is not None
          num = cur.dev + 1
          new_version = (
              f"{cur.major}.{cur.minor}.{cur.micro}.{prefix}{num}"
          )
      elif cur.is_prerelease:
          assert cur.pre is not None
          prefix = cur.pre[0]
          num = cur.pre[1] + 1
          new_version = (
              f"{cur.major}.{cur.minor}.{cur.micro}.{prefix}{num}"
          )
      elif cur.is_postrelease:
          assert cur.post is not None
          num = cur.post + 1
          new_version = f"{cur.major}.{cur.minor}.{cur.micro}.{num}"
      else:
          micro = cur.micro + 1
          new_version = f"{cur.major}.{cur.minor}.{micro}"
  
      return str(new_version)
  
imports: import logging
  import os
  import re
  import shutil
  from dataclasses import dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import Dict, List, Tuple
  import hydra
  import requests
  from hydra.core.config_store import ConfigStore
  from hydra.test_utils.test_utils import find_parent_dir_containing, run_python_script
  from omegaconf import II, MISSING, SI, DictConfig, OmegaConf
  from packaging.version import Version, parse
label_desc: Use image node_id 6 for calling a global function with example usage: _next_version(version) and returns: str