class_docstr: This class maintains a pandas.dataframe of filenames for all input sections.
  The list of filenames are obtained by searching the specified folders
  or loading from an existing csv file.
  
  Users can query a subset of the dataframe by train/valid/infer partition
  label and input section names.
docstr: query number of images according to phase.
  
  :param phase:
  :return:
docstr_tok: ["query","number","of","images","according","to","phase",".",":","param","phase",":",":","return",":"]
code: def number_of_subjects(self, phase=ALL):
      """
      query number of images according to phase.
  
      :param phase:
      :return:
      """
      if self._file_list is None:
          return 0
      try:
          phase = look_up_operations(phase.lower(), SUPPORTED_PHASES)
      except (ValueError, AttributeError):
          tf.logging.fatal("Unknown phase argument.")
          raise
  
      if phase == ALL:
          return self._file_list[COLUMN_UNIQ_ID].count()
      if self._partition_ids is None:
          return 0
      selector = self._partition_ids[COLUMN_PHASE] == phase
      selected = self._partition_ids[selector][[COLUMN_UNIQ_ID]]
      subset = pandas.merge(
          self._file_list, selected, on=COLUMN_UNIQ_ID, sort=True
      )
      return subset.count()[COLUMN_UNIQ_ID]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import random
  import shutil
  import pandas
  import tensorflow
  from niftynet.engine.signal import TRAIN, VALID, INFER, ALL
  from niftynet.utilities.decorators import singleton
  from niftynet.utilities.filename_matching import KeywordsMatching
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities.util_common import look_up_operations
  from niftynet.utilities.util_csv import match_and_write_filenames_to_csv
  from niftynet.utilities.util_csv import write_csv
label_desc: Use image node_id 2 for calling the ImageSetsPartitioner obj's underlying member method code with example usage: obj.number_of_subjects(phase) and returns: subset, int, self, int