def _NormalizePath(path):
  """Returns the normalized path of the given one.

  Normalization include:
  * Convert '\\' to '/'
  * Convert '\\\\' to '/'
  * Resolve '../' and './'

  Example:
  '..\\a/../b/./c/test.cc' --> 'b/c/test.cc'
  """
  path = path.replace('\\', '/')
  path = path.replace('//', '/')

  filtered_parts = []
  for part in path.split('/'):
    if part == '..':
      if filtered_parts:
        filtered_parts.pop()
    elif part == '.':
      continue
    else:
      filtered_parts.append(part)

  return '/'.join(filtered_parts)