code: def has_sources(self, extension=None):
      
      source_paths = self._sources_field.source_paths
      if not source_paths:
        return False
      if not extension:
        return True
      return any(source.endswith(extension) for source in source_paths)
docs: Return `True` if this target owns sources; optionally of the given `extension`.
  
      :API: public
  
      :param string extension: Optional suffix of filenames to test for.
      :return: `True` if the target contains sources that match the optional extension suffix.
      :rtype: bool