code: def applies(self, src, dst):
          
          if self._src_pattern and (src is None or re.search(self._src_pattern, src) is None):
              return False
          elif self._dst_pattern and (dst is None or re.search(self._dst_pattern, dst) is None):
              return False
          return True
docs: Checks if this rule applies to the given src and dst paths, based on the src pattern and
          dst pattern given in the constructor.
  
          If src pattern was None, this rule will apply to any given src path (same for dst).