Return an array with equal shape to the input, but all elements set to value 'set'

@param in  Input variable
@param set Value to set
@return Output variable
971745
public SDVariable scalarSet(SDVariable in, Number set) {
        return scalarSet(null, in, set);
    }
1161265
public static <T> Set<T> iterableToSet(Iterable<T> iterable) {
        if (iterable == null) {
            return Collections.emptySet();
        }
        if (iterable instanceof Set) {
            return (Set<T>) iterable;
        }
        Iterator<T> i = iterable.iterator();
        if (i.hasNext()) {
            Set<T> list = new HashSet<>();
            while (i.hasNext()) {
                list.add(i.next());
            }
            return list;
        }
        return Collections.emptySet();
    }
747844
function setToArray(set) {
  var array = new Array();
  set.forEach(function(value) {
    array.push(value);
  }, null);
  return array;
}
554073
public static <T> Set<T> toSet(final T[] array) {

    if (isNotEmpty(array)) {
      Set<T> set = new HashSet<T>(array.length);
      for (T element : array) {
        set.add(element);
      }
      return set;
    } else {
      return new HashSet<T>(0);
    }
  }
420565
public boolean isIn(HasValueSet<?> hasValueSet){
		Array array = hasValueSet.getArray();
		if(array == null){
			throw new MissingElementException(MissingElementException.formatMessage(XPathUtil.formatElement((Class)hasValueSet.getClass()) + "/" + XPathUtil.formatElement(Array.class)), (PMMLObject)hasValueSet);
		} // End if

		if(array instanceof SetHolder){
			SetHolder setHolder = (SetHolder)array;

			return setHolder.contains(getDataType(), getValue());
		}

		List<?> values = ArrayUtil.getContent(array);

		return values.stream()
			.anyMatch(value -> equalsValue(value));
	}
380325
function immutableSet(source, exprPaths, pathsStart, pathsLen, value, data) {
    if (pathsStart >= pathsLen) {
        return value;
    }

    if (source == null) {
        source = {};
    }

    var pathExpr = exprPaths[pathsStart];
    var prop = evalExpr(pathExpr, data);
    var result = source;

    if (source instanceof Array) {
        var index = +prop;
        prop = isNaN(index) ? prop : index;

        result = source.slice(0);
        result[prop] = immutableSet(source[prop], exprPaths, pathsStart + 1, pathsLen, value, data);
    }
    else if (typeof source === 'object') {
        result = {};

        for (var key in source) {
            /* istanbul ignore else  */
            if (key !== prop && source.hasOwnProperty(key)) {
                result[key] = source[key];
            }
        }

        result[prop] = immutableSet(source[prop], exprPaths, pathsStart + 1, pathsLen, value, data);
    }

    if (pathExpr.value == null) {
        exprPaths[pathsStart] = {
            type: typeof prop === 'string' ? ExprType.STRING : ExprType.NUMBER,
            value: prop
        };
    }

    return result;
}
371701
def infer_set(values: GenericSet) -> Set:
    """"""
    if not values:
        return Set(null)
    return Set(highest_precedence(map(infer, values)))
1249427
public static <T> Set<T> arrayToSet(final T[] array) {
        if (null == array) {
            return Collections.emptySet();
        }

        final Set<T> ret = new HashSet<T>();

        for (int i = 0; i < array.length; i++) {
            final T object = array[i];

            ret.add(object);
        }

        return ret;
    }
326267
public static Set<String> getSet(AbstractConfig config, String key) {
    List<String> value = config.getList(key);
    return ImmutableSet.copyOf(value);
  }
60676
function createSet(values) {
    var set = new Set();
    Lazy(values || []).flatten().each(function(e) {
      set.add(e);
    });
    return set;
  }
87659
function(set) {
    for(var i=0; i < set.length; i++) {
      if(set[i]) return true;
    }
    return false;
  }
1024382
public Optional<Set<String>> getSet(String key) {
    return this.get(key).map(v -> ImmutableSet.copyOf(Splitter.on(',').split(v)));
  }
564376
@SafeVarargs
  public static <E> Set<E> of(E... elements) {
    Set<E> result = new HashSet<>();
    Collections.addAll(result, elements);
    return Collections.unmodifiableSet(result);
  }
1324598
public static final <T> Set<T> union(Collection<Set<T>> sets)
    {
        Set<T> set = new HashSet<>();
        for (Set<T> s : sets)
        {
            set.addAll(s);
        }
        return set;
    }
1345541
public static <T> Set<T> intersection(Collection<Set<T>> sets) {
		Set<T> result = new HashSet<>();
		if (sets.isEmpty()) {
			return result;
		}
		Iterator<Set<T>> iter = sets.iterator();
		result.addAll(iter.next());
		while (iter.hasNext()) {
			result.retainAll(iter.next());
		}
		return result;
	}
245177
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
923189
public static IntSet and (IntSet... sets)
    {
        checkNotNull(sets);
        IntSet result = create();
        int len = sets.length;
        if (len > 0) {
            OUTER:
            for (Interator it = sets[0].interator(); it.hasNext(); ) {
                int val = it.nextInt();
                for (int ii = 1; ii < len; ii++) {
                    if (!sets[ii].contains(val)) {
                        continue OUTER;
                    }
                }
                result.add(val);
            }
        }
        return result;
    }