code: def as_set(obj):
      
      if obj is None or isinstance(obj, collections.Set):
          return obj
  
      if not isinstance(obj, collections.Iterable):
          return set((obj,))
      else:
          return set(obj)
docs: Convert obj into a set, returns None if obj is None.
  
      >>> assert as_set(None) is None and as_set(1) == set([1]) and as_set(range(1,3)) == set([1, 2])