Drop side-effect-free elements from an array of expressions. Returns an array of expressions with side-effects or null if all elements were dropped. Note: original array may be returned if nothing changed.
977441
function trim(nodes, compressor, first_in_statement$$1) {
              var len = nodes.length;
              if (!len) return null;
              var ret = [], changed = false;
              for (var i = 0; i < len; i++) {
                  var node = nodes[i].drop_side_effect_free(compressor, first_in_statement$$1);
                  changed |= node !== nodes[i];
                  if (node) {
                      ret.push(node);
                      first_in_statement$$1 = false;
                  }
              }
              return changed ? ret.length ? ret : null : nodes;
          }
853105
public static <T> T[] filter(T[] array, Editor<T> editor) {
		ArrayList<T> list = new ArrayList<T>(array.length);
		T modified;
		for (T t : array) {
			modified = editor.edit(t);
			if (null != modified) {
				list.add(modified);
			}
		}
		return list.toArray(Arrays.copyOf(array, list.size()));
	}
170443
def array_elements(buffer = '')
      if (term = expression)
        buffer += term[@value]
        # If there is an array_terminator ",", recursively gather the next
        # array element into the buffer
        if (terminator = accept_stripped :comma)
          accept_newline
          buffer += array_elements terminator
        end
      end

      # Array ended prematurely with a trailing comma, therefore the current
      # parsing process will stop
      error :array_elements_terminator if buffer.strip[-1] == ','

      buffer
    end
1185913
public static Expression arrayRemove(Expression expression, Expression value) {
        return x("ARRAY_REMOVE(" + expression.toString() + ", " + value.toString() + ")");
    }
333657
private String[] determineSuppressions() {
        String[] suppressions = suppressionFiles;
        if (suppressionFile != null) {
            if (suppressions == null) {
                suppressions = new String[]{suppressionFile};
            } else {
                suppressions = Arrays.copyOf(suppressions, suppressions.length + 1);
                suppressions[suppressions.length - 1] = suppressionFile;
            }
        }
        return suppressions;
    }
346157
def drop(n)
      filter("drop") do |yielder|
        each_with_index do |element, index|
          next if index < n
          yielder.call(element)
        end
      end
    end
451396
function(array, n, step) {
      step = (step != null) ? step : n;

      var p = function(array, n, step) {
        if (_.isEmpty(array)) return [];

        return _.cons(_.take(array, n),
                      p(_.drop(array, step), n, step));
      };

      return p(array, n, step);
    }
632621
public static int[] getIndexesOfFreeVariable(Expression2 expression, String variableName) {
    List<Integer> indexes = Lists.newArrayList();
    ScopeSet scopes = getScopes(expression);
    for (int i = 0; i < expression.size(); i++) {
      Scope scope = scopes.getScope(i);
      String varName = getFreeVariable(expression, i, scope);
      if (varName != null && varName.equals(variableName)) {
        indexes.add(i);
      }
    }
    return Ints.toArray(indexes);
  }
799896
@SafeVarargs
    public static boolean[] removeAll(final boolean[] a, final boolean... elements) {
        if (N.isNullOrEmpty(a)) {
            return N.EMPTY_BOOLEAN_ARRAY;
        } else if (N.isNullOrEmpty(elements)) {
            return a.clone();
        } else if (elements.length == 1) {
            return removeAllOccurrences(a, elements[0]);
        }

        final BooleanList list = BooleanList.of(a.clone());
        list.removeAll(BooleanList.of(elements));
        return list.trimToSize().array();
    }
1354475
@Override
    public List<AbstractExpression> bindingToIndexedExpression(AbstractExpression expr) {
        if (equals(expr)) {
            return s_reusableImmutableEmptyBinding;
        }
        return null;
    }
643975
public static <T> Optional<T[]> getOptional(T[] array) {
        return Optional.ofNullable(array).filter(a -> a.length > 0);
    }
29589
@SafeVarargs
    public static <V> V getLast(V... array) {
        return JMArrays.isNullOrEmpty(array) ? null : array[array.length - 1];
    }
502143
public <T> T[] notEmpty(final T[] array, final String message) {
        if (array == null) {
            failNull(message);
        }
        if (array.length == 0) {
            fail(message);
        }
        return array;
    }
505756
def to_nullable_array(value):
        
        # Shortcuts
        if value == None:
            return None
        if type(value) == list:
            return value 

        if type(value) in [tuple, set]:
            return list(value)
            
        return [value]
1753
function() {
                    var args = [], arg;

                    arg = $(this.expression);
                    while (arg) {
                        args.push(arg);
                        if (! $(',')) { break; }
                        arg = $(this.expression);
                    }

                    return args;
                }
779147
public static Expression arrayRemove(JsonArray array, Expression value) {
        return arrayRemove(x(array), value);
    }
587863
function drop(list,dropCount=1,direction="left",fn=null) {

    // If the first argument is not kind of `array`-like.
    if (!(list && Array.isArray(list))) {
      // Manually currying
      let args = arguments;
      return (list) => drop(list, ...args);
    }

    if(dropCount === 0 && !fn) {
      return Array.prototype.slice.call(list, 0)
    };

    if(arguments.length === 1 || direction === "left") {
      if (!fn) {
        return Array.prototype.slice.call(list, +dropCount);
      }

      return (Array.prototype.slice.call(list, +dropCount)).filter(x=>fn(x));
    }
    if(direction === "right"){
      if(!fn) {
        return Array.prototype.slice.call(list, 0, list.length-(+dropCount));
      }
      if(dropCount === 0) {return (Array.prototype.slice.call(list, 0)).filter(x=>fn(x))};

      return (Array.prototype.slice.call(list, 0, list.length-(+dropCount))).filter(x=>fn(x));
    }
  }