code: def register_all_files_handler(self, callback, name='all_files'):
      
      self.register_handler(
        name,
        dict(
          fields=['name'],
          # Request events for all file types.
          # NB: Touching a file invalidates its parent directory due to:
          #   https://github.com/facebook/watchman/issues/305
          # ...but if we were to skip watching directories, we'd still have to invalidate
          # the parents of any changed files, and we wouldn't see creation/deletion of
          # empty directories.
          expression=[
            'allof',  # All of the below rules must be true to match.
            ['not', ['dirname', 'dist', self.ZERO_DEPTH]],  # Exclude the ./dist dir.
            # N.B. 'wholename' ensures we match against the absolute ('x/y/z') vs base path ('z').
            ['not', ['pcre', r'^\..*', 'wholename']],  # Exclude files in hidden dirs (.pants.d etc).
            ['not', ['match', '*.pyc']]  # Exclude .pyc files.
            # TODO(kwlzn): Make exclusions here optionable.
            # Related: https://github.com/pantsbuild/pants/issues/2956
          ]
        ),
        callback
      )
docs: Registers a subscription for all files under a given watch path.
  
      :param func callback: the callback to execute on each filesystem event
      :param str name:      the subscription name as used by watchman