<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_sources(self, extension=None):
 """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 """

    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)