code: def from_sources_field(sources, spec_path):
      
      if sources is None:
        return Files(spec_path=spec_path)
      elif isinstance(sources, BaseGlobs):
        return sources
      elif isinstance(sources, string_types):
        return Files(sources, spec_path=spec_path)
      elif isinstance(sources, (MutableSet, MutableSequence, tuple)) and \
           all(isinstance(s, string_types) for s in sources):
        return Files(*sources, spec_path=spec_path)
      else:
        raise ValueError('Expected either a glob or list of literal sources: got: {}'.format(sources))
docs: Return a BaseGlobs for the given sources field.
  
      `sources` may be None, a list/tuple/set, a string or a BaseGlobs instance.