code: def _calculate_isortable_python_sources(self, targets):
      
      sources = set()
      for target in targets:
        sources.update(
          source for source in target.sources_relative_to_buildroot()
          if os.path.splitext(source)[1] == self._PYTHON_SOURCE_EXTENSION
        )
      return list(sources)
docs: Generate a set of source files from the given targets.