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: Get file lists by action and phase.
  
  This function returns file lists for training/validation/inference
  based on the phase or action specified by the user.
  
  ``phase`` has a higher priority:
  If `phase` specified, the function returns the corresponding
  file list (as a list).
  
  otherwise, the function checks ``action``:
  it returns train and validation file lists if it's training action,
  otherwise returns inference file list.
  
  :param action: an action
  :param phase: an element from ``{TRAIN, VALID, INFER, ALL}``
  :return:
docstr_tok: ["Get","file","lists","by","action","and","phase",".","This","function","returns","file","lists","for","training\/validation\/inference","based","on","the","phase","or","action","specified","by","the","user",".","``","phase","``","has","a","higher","priority",":","If","`","phase","`","specified",",","the","function","returns","the","corresponding","file","list","(","as","a","list",")",".","otherwise",",","the","function","checks","``","action","``",":","it","returns","train","and","validation","file","lists","if","it","'s","training","action",",","otherwise","returns","inference","file","list",".",":","param","action",":","an","action",":","param","phase",":","an","element","from","``","{","TRAIN",",","VALID",",","INFER",",","ALL","}","``",":","return",":"]
code: def get_file_lists_by(self, phase=None, action="train"):
      """
      Get file lists by action and phase.
  
      This function returns file lists for training/validation/inference
      based on the phase or action specified by the user.
  
      ``phase`` has a higher priority:
      If `phase` specified, the function returns the corresponding
      file list (as a list).
  
      otherwise, the function checks ``action``:
      it returns train and validation file lists if it's training action,
      otherwise returns inference file list.
  
      :param action: an action
      :param phase: an element from ``{TRAIN, VALID, INFER, ALL}``
      :return:
      """
      if phase:
          try:
              return [self.get_file_list(phase=phase)]
          except (ValueError, AttributeError):
              tf.logging.warning("phase `parameter` %s ignored", phase)
  
      if action and TRAIN.startswith(action):
          file_lists = [self.train_files]
          if self.has_validation:
              file_lists.append(self.validation_files)
          return file_lists
  
      return [self.inference_files]
  
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 17 for calling the ImageSetsPartitioner obj's underlying member method code with example usage: obj.get_file_lists_by(phase, action) and returns: list, file_lists, list