code: def _calculate_python_sources(self, targets):
      
      python_eval_targets = filter(self.is_non_synthetic_python_target, targets)
      sources = set()
      for target in python_eval_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.