code: def search(self, term: str, case_sensitive: bool = False) -> 'PrettyDir':
          
          if case_sensitive:
              return PrettyDir(
                  self.obj, [pattr for pattr in self.pattrs if term in pattr.name]
              )
          else:
              term = term.lower()
              return PrettyDir(
                  self.obj, [pattr for pattr in self.pattrs if term in pattr.name.lower()]
              )
docs: Searches for names that match some pattern.
  
          Args:
              term: String used to match names. A name is returned if it matches
                the whole search term.
              case_sensitive: Boolean to match case or not, default is False
                (case insensitive).
  
          Return:
              A PrettyDir object with matched names.