class_docstr: A list of files built by on exploring the filesystem and filtered by
  applying various patterns to what we find there.
  
  Instance attributes:
    dir
      directory from which files will be taken -- only used if
      'allfiles' not supplied to constructor
    files
      list of filenames currently being built/filtered/manipulated
    allfiles
      complete list of files under consideration (ie. without any
      filtering applied)
class_docstr_tok: ["A","list","of","files","built","by","on","exploring","the","filesystem","and","filtered","by","applying","various","patterns","to","what","we","find","there",".","Instance","attributes",":","dir","directory","from","which","files","will","be","taken","--","only","used","if","'allfiles","'","not","supplied","to","constructor","files","list","of","filenames","currently","being","built\/filtered\/manipulated","allfiles","complete","list","of","files","under","consideration","(","ie",".","without","any","filtering","applied",")"]
docstr: Select strings (presumably filenames) from 'self.files' that
  match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
  are not quite the same as implemented by the 'fnmatch' module: '*'
  and '?'  match non-special characters, where "special" is platform-
  dependent: slash on Unix; colon, slash, and backslash on
  DOS/Windows; and colon on Mac OS.
  
  If 'anchor' is true (the default), then the pattern match is more
  stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
  'anchor' is false, both of these will match.
  
  If 'prefix' is supplied, then only filenames starting with 'prefix'
  (itself a pattern) and ending with 'pattern', with anything in between
  them, will match.  'anchor' is ignored in this case.
  
  If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
  'pattern' is assumed to be either a string containing a regex or a
  regex object -- no translation is done, the regex is just compiled
  and used as-is.
  
  Selected strings will be added to self.files.
  
  Return True if files are found, False otherwise.
docstr_tok: ["Select","strings","(","presumably","filenames",")","from","'self.files","'","that","match","'pattern","'",",","a","Unix-style","wildcard","(","glob",")","pattern",".","Patterns","are","not","quite","the","same","as","implemented","by","the","'fnmatch","'","module",":","'","*","'","and","'","?","'","match","non-special","characters",",","where","``","special","''","is","platform-","dependent",":","slash","on","Unix",";","colon",",","slash",",","and","backslash","on","DOS\/Windows",";","and","colon","on","Mac","OS",".","If","'anchor","'","is","true","(","the","default",")",",","then","the","pattern","match","is","more","stringent",":","``","*",".py","''","will","match","``","foo.py","''","but","not","``","foo\/bar.py","''",".","If","'anchor","'","is","false",",","both","of","these","will","match",".","If","'prefix","'","is","supplied",",","then","only","filenames","starting","with","'prefix'","(","itself","a","pattern",")","and","ending","with","'pattern","'",",","with","anything","in","between","them",",","will","match",".","'anchor","'","is","ignored","in","this","case",".","If","'is_regex","'","is","true",",","'anchor","'","and","'prefix","'","are","ignored",",","and","'pattern","'","is","assumed","to","be","either","a","string","containing","a","regex","or","a","regex","object","--","no","translation","is","done",",","the","regex","is","just","compiled","and","used","as-is",".","Selected","strings","will","be","added","to","self.files",".","Return","True","if","files","are","found",",","False","otherwise","."]
code: def include_pattern(self, pattern, anchor=1, prefix=None, is_regex=0):
      """Select strings (presumably filenames) from 'self.files' that
      match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
      are not quite the same as implemented by the 'fnmatch' module: '*'
      and '?'  match non-special characters, where "special" is platform-
      dependent: slash on Unix; colon, slash, and backslash on
      DOS/Windows; and colon on Mac OS.
  
      If 'anchor' is true (the default), then the pattern match is more
      stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
      'anchor' is false, both of these will match.
  
      If 'prefix' is supplied, then only filenames starting with 'prefix'
      (itself a pattern) and ending with 'pattern', with anything in between
      them, will match.  'anchor' is ignored in this case.
  
      If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
      'pattern' is assumed to be either a string containing a regex or a
      regex object -- no translation is done, the regex is just compiled
      and used as-is.
  
      Selected strings will be added to self.files.
  
      Return True if files are found, False otherwise.
      """
      # XXX docstring lying about what the special chars are?
      files_found = False
      pattern_re = translate_pattern(pattern, anchor, prefix, is_regex)
      self.debug_print(
          "include_pattern: applying regex r'%s'" % pattern_re.pattern
      )
  
      # delayed loading of allfiles list
      if self.allfiles is None:
          self.findall()
  
      for name in self.allfiles:
          if pattern_re.search(name):
              self.debug_print(" adding " + name)
              self.files.append(name)
              files_found = True
      return files_found
  
imports: import os
  import re
  import fnmatch
  import functools
  from .util import convert_path
  from .errors import DistutilsTemplateError, DistutilsInternalError
  from ._log import log
label_desc: Use image node_id 11 for calling the FileList obj's underlying member method code with example usage: obj.include_pattern(pattern, anchor, prefix, is_regex) and returns: files_found