code: def get_sources(self):
      
      source = getattr(self, 'source', None)
      sources = getattr(self, 'sources', None)
  
      if source is not None and sources is not None:
        raise Target.IllegalArgument(
          self.address.spec,
          'Cannot specify both source and sources attribute.'
        )
  
      if source is not None:
        if not isinstance(source, string_types):
          raise Target.IllegalArgument(
            self.address.spec,
            'source must be a string containing a path relative to the target, but got {} of type {}'
              .format(source, type(source))
          )
        sources = [source]
  
      # N.B. Here we check specifically for `sources is None`, as it's possible for sources
      # to be e.g. an explicit empty list (sources=[]).
      if sources is None:
        if self.default_sources_globs is not None:
          globs = Globs(*self.default_sources_globs,
                        spec_path=self.address.spec_path,
                        exclude=self.default_sources_exclude_globs or [])
          conjunction_globs = GlobsWithConjunction(globs, GlobExpansionConjunction.any_match)
        else:
          globs = None
          conjunction_globs = None
      else:
        globs = BaseGlobs.from_sources_field(sources, self.address.spec_path)
        conjunction_globs = GlobsWithConjunction(globs, GlobExpansionConjunction.all_match)
  
      return conjunction_globs
docs: Returns target's non-deferred sources if exists or the default sources if defined.
  
      :rtype: :class:`GlobsWithConjunction`
  
      NB: once ivy is implemented in the engine, we can fetch sources natively here, and/or
      refactor how deferred sources are implemented.
        see: https://github.com/pantsbuild/pants/issues/2997