class_docstr: Manages a configuration file store based on a
  remote repository with local caching
docstr: Downloads data using the configuration file
  if it is not already up to date.
  Returns True if no update was required and no errors occurred
docstr_tok: ["Downloads","data","using","the","configuration","file","if","it","is","not","already","up","to","date",".","Returns","True","if","no","update","was","required","and","no","errors","occurred"]
code: def update_if_required(
      self, example_id, download_if_already_existing=False
  ):
      """
      Downloads data using the configuration file
      if it is not already up to date.
      Returns True if no update was required and no errors occurred
      """
  
      try:
          self._remote.update(example_id)
          remote_update_failed = False
      except Exception as fail_msg:
          print(
              "Warning: updating the examples file "
              "from the server caused an error: {}".format(fail_msg)
          )
          remote_update_failed = True
  
      current_config, current_entries = self._local.get_download_params(
          example_id
      )
      remote_config, remote_entries = self._remote.get_download_params(
          example_id
      )
  
      if not remote_entries:
          if remote_update_failed:
              print(example_id + ": FAIL.")
              print(
                  "Cannot download the examples configuration file. "
                  "Is the server down?"
              )
          else:
              print(example_id + ": FAIL. Nothing to download")
          return False
  
      else:
          # Always download if the local file is empty, or force by arguments
          force_download = download_if_already_existing or (
              not current_config and not current_entries
          )
          data_missing = self._are_data_missing(
              remote_entries, example_id
          )
          if (
              force_download
              or data_missing
              or self._is_update_required(current_config, remote_config)
          ):
              self._check_minimum_versions(remote_config)
              self._download(remote_entries, example_id)
              self._replace_local_with_remote(example_id)
          else:
              print(example_id + ": OK. ")
              print(
                  "Already downloaded. "
                  "Use the -r option to download again."
              )
  
      return True
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  import argparse
  import math
  import os
  import re
  import shutil
  import tarfile
  import tempfile
  from distutils.version import LooseVersion
  from six.moves.urllib.parse import urlparse
  from six.moves.urllib.request import urlopen
  from six.moves.urllib.request import urlretrieve
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities import NiftyNetLaunchConfig
  from niftynet.utilities.util_common import print_progress_bar
  from niftynet.utilities.versioning import get_niftynet_version, get_niftynet_version_string
label_desc: Use image node_id 3 for calling the ConfigStore obj's underlying member method code with example usage: obj.update_if_required(example_id, download_if_already_existing) and returns: True, False