<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ToCategorizedPath(path_type, components):
 """Translates a path type and a list of components to a categorized path."""

  try:
    prefix = {
        PathInfo.PathType.OS: ("fs", "os"),
        PathInfo.PathType.TSK: ("fs", "tsk"),
        PathInfo.PathType.REGISTRY: ("registry",),
        PathInfo.PathType.TEMP: ("temp",),
    }[path_type]
  except KeyError:
    raise ValueError("Unknown path type: `%s`" % path_type)

  return "/".join(itertools.chain(prefix, components))