code: def _stage_from_version(version):
      
      if version:
          m = re.match(r"^(?P<xyz>\d+\.\d+\.\d+)(?P<extra>.*)", version)
          if m:
              return "stg" if m.group("extra") else "prd"
      return "dev"
docs: return "prd", "stg", or "dev" for the given version string.  A value is always returned