code: def OpenFileSystem(cls, path_spec_object, resolver_context=None):
      
      if not isinstance(path_spec_object, path_spec.PathSpec):
        raise TypeError('Unsupported path specification type.')
  
      if resolver_context is None:
        resolver_context = cls._resolver_context
  
      if path_spec_object.type_indicator == definitions.TYPE_INDICATOR_MOUNT:
        if path_spec_object.HasParent():
          raise errors.PathSpecError(
              'Unsupported mount path specification with parent.')
  
        mount_point = getattr(path_spec_object, 'identifier', None)
        if not mount_point:
          raise errors.PathSpecError(
              'Unsupported path specification without mount point identifier.')
  
        path_spec_object = mount_manager.MountPointManager.GetMountPoint(
            mount_point)
        if not path_spec_object:
          raise errors.MountPointError(
              'No such mount point: {0:s}'.format(mount_point))
  
      file_system = resolver_context.GetFileSystem(path_spec_object)
      if not file_system:
        resolver_helper = cls._GetResolverHelper(path_spec_object.type_indicator)
        file_system = resolver_helper.NewFileSystem(resolver_context)
  
      try:
        file_system.Open(path_spec_object)
      except (IOError, ValueError) as exception:
        raise errors.BackEndError(
            'Unable to open file system with error: {0!s}'.format(exception))
  
      return file_system
docs: Opens a file system object defined by path specification.
  
      Args:
        path_spec_object (PathSpec): path specification.
        resolver_context (Optional[Context]): resolver context, where None
            represents the built in context which is not multi process safe.
  
      Returns:
        FileSystem: file system or None if the path specification could not
            be resolved or has no file system object.
  
      Raises:
        AccessError: if the access to open the file system was denied.
        BackEndError: if the file system cannot be opened.
        MountPointError: if the mount point specified in the path specification
            does not exist.
        PathSpecError: if the path specification is incorrect.
        TypeError: if the path specification type is unsupported.