class_docstr: This class provides functionality to store and load activation vectors
  generated for pre-defined neural network layers.
  It also provides functionality to check if activation vectors already
  exist in the manifold and other auxiliary functions.
  
  This class also defines a torch `Dataset`, representing Activation Vectors,
  which enables lazy access to activation vectors and layer stored in the manifold.
class_docstr_tok: ["This","class","provides","functionality","to","store","and","load","activation","vectors","generated","for","pre-defined","neural","network","layers",".","It","also","provides","functionality","to","check","if","activation","vectors","already","exist","in","the","manifold","and","other","auxiliary","functions",".","This","class","also","defines","a","torch","`","Dataset","`",",","representing","Activation","Vectors",",","which","enables","lazy","access","to","activation","vectors","and","layer","stored","in","the","manifold","."]
docstr: Returns a search string that can be used by glob to search `source_dir/model_id`
  for the desired layer/identifier pair. Leaving `layer` as None will search ids
  over all layers, and leaving `identifier` as none will search layers over all
  ids.  Leaving both as none will return a path to glob for every activation.
  Assumes identifier is always specified when saving activations, so that
  activations live at source_dir/model_id/identifier/layer
  (and never source_dir/model_id/layer)
docstr_tok: ["Returns","a","search","string","that","can","be","used","by","glob","to","search","`","source_dir\/model_id","`","for","the","desired","layer\/identifier","pair",".","Leaving","`","layer","`","as","None","will","search","ids","over","all","layers",",","and","leaving","`","identifier","`","as","none","will","search","layers","over","all","ids",".","Leaving","both","as","none","will","return","a","path","to","glob","for","every","activation",".","Assumes","identifier","is","always","specified","when","saving","activations",",","so","that","activations","live","at","source_dir\/model_id\/identifier\/layer","(","and","never","source_dir\/model_id\/layer",")"]
code: def _construct_file_search(
      source_dir: str,
      model_id: str,
      identifier: Optional[str] = None,
      layer: Optional[str] = None,
      num_id: Optional[str] = None,
  ) -> str:
      r"""
      Returns a search string that can be used by glob to search `source_dir/model_id`
      for the desired layer/identifier pair. Leaving `layer` as None will search ids
      over all layers, and leaving `identifier` as none will search layers over all
      ids.  Leaving both as none will return a path to glob for every activation.
      Assumes identifier is always specified when saving activations, so that
      activations live at source_dir/model_id/identifier/layer
      (and never source_dir/model_id/layer)
      """
  
      av_filesearch = AV._assemble_model_dir(source_dir, model_id)
  
      av_filesearch = os.path.join(
          av_filesearch, "*" if identifier is None else identifier
      )
  
      av_filesearch = os.path.join(
          av_filesearch, "*" if layer is None else layer
      )
  
      av_filesearch = os.path.join(
          av_filesearch, "*.pt" if num_id is None else "%s.pt" % num_id
      )
  
      return av_filesearch
  
imports: import glob
  import os
  import re
  import warnings
  from typing import Any, List, Optional, Tuple, Union
  import captum._utils.common
  import torch
  from captum.attr import LayerActivation
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 4 for calling the AV obj's underlying member method code with example usage: obj._construct_file_search(source_dir, model_id, identifier, layer, num_id) and returns: av_filesearch