Helper function to determine which collapseRequests function to use
        from L{_collapseRequests}, or None for no merging
773799
def getCollapseRequestsFn(self):
        """"""
        # first, seek through builder, global, and the default
        collapseRequests_fn = self.config.collapseRequests
        if collapseRequests_fn is None:
            collapseRequests_fn = self.master.config.collapseRequests
        if collapseRequests_fn is None:
            collapseRequests_fn = True

        # then translate False and True properly
        if collapseRequests_fn is False:
            collapseRequests_fn = None
        elif collapseRequests_fn is True:
            collapseRequests_fn = self._defaultCollapseRequestFn

        return collapseRequests_fn
360576
def fetch_closed_pull_requests
      pull_requests = []
      options = { state: "closed" }

      page_i      = 0
      count_pages = calculate_pages(@client, "pull_requests", options)

      iterate_pages(@client, "pull_requests", options) do |new_pr|
        page_i += PER_PAGE_NUMBER
        log_string = "Fetching merged dates... #{page_i}/#{count_pages * PER_PAGE_NUMBER}"
        print_in_same_line(log_string)
        pull_requests.concat(new_pr)
      end
      print_empty_line

      Helper.log.info "Pull Request count: #{pull_requests.count}"
      pull_requests.map { |pull_request| stringify_keys_deep(pull_request.to_hash) }
    end
548902
function merge (src, dest) {
  if (src != null &&
        dest != null &&
        !Array.isArray(src) &&
        !Array.isArray(dest) &&
        typeof src === 'object' &&
        typeof dest === 'object') {
    Object.getOwnPropertyNames(src)
            .forEach(function (prop) {
              var descriptor = Object.getOwnPropertyDescriptor(src, prop);
              descriptor.value = merge(descriptor.value, dest[prop]);
              Object.defineProperty(dest, prop, descriptor);
            });

    return dest;
  }

  return src;
}
447972
function (req, res) {
        return function (err) {
            if (err) {
                res.writeHead(500);
                res.end(err.toString());
            } else {
                res.writeHead(404);
                res.end();
            }
        };
    }
413884
def _and_collapser(container: ShapeAnd, containee: shapeExpr) -> None:
        
        if isinstance(containee, ShapeAnd):
            for expr in containee.shapeExprs:
                container.shapeExprs.append(expr)
        else:
            container.shapeExprs.append(containee)
1239377
function merge() {
  var res = {};
  for (var i = 0; i < arguments.length; i++) {
    if (arguments[i]) {
      Object.assign(res, arguments[i]);
    } else {
      if (typeof arguments[i] === 'undefined') {
        throw new Error('m(): argument ' + i + ' undefined');
      }
    }
  }

  return res;
}
1280920
function getRawRequest (
  { resource, loaderIndex, loaders },
  excludedPreLoaders = /eslint-loader/
) {
  return loaderUtils.getRemainingRequest({
    resource: resource,
    loaderIndex: loaderIndex,
    loaders: loaders.filter(loader => !excludedPreLoaders.test(loader.path))
  })
}
940762
function canMerge (m1, m2) {
  return (
    m1.type === m2.type &&
    m1.href === m2.href &&
    m1.end >= m2.start
  )
}
534113
def collapse_times():
    
    orig_ts = f.timer_stack
    orig_ls = f.loop_stack
    copy_ts = _copy_timer_stack()
    copy_ls = copy.deepcopy(f.loop_stack)
    f.timer_stack = copy_ts
    f.loop_stack = copy_ls
    f.refresh_shortcuts()
    while (len(f.timer_stack) > 1) or f.t.in_loop:
        _collapse_subdivision()
    timer_pub.stop()
    collapsed_times = f.r
    f.timer_stack = orig_ts  # (loops throw error if not same object!)
    f.loop_stack = orig_ls
    f.refresh_shortcuts()
    return collapsed_times
1348945
private void checkNavigationMenuState(final HttpServletRequest req) {
		if (req == null)
			return;

		if (req.getSession().getAttribute(ATTR_IS_NAV_MENU_COLLAPSED) != null)
			return;

		// here we can specify default collapse value
		req.getSession().setAttribute(ATTR_IS_NAV_MENU_COLLAPSED, false);
	}
87942
function(request, options){
                if(typeof options == "undefined") options = {}; // define options if not yet defined
                options.relative_path_root = relative_path_root; // overwrite user defined rel path root - TODO - make this a private property
                return require_function(request, options);
            }
1083450
function (req, res, err) {
    if (isResHeaderSent(res)) { //request has already been closed
        //console.log('cannot throw error on an already closed request')
        return;
    }
    if (typeof (err.stack) == 'string') {
        err.stack = err.stack.split(' at '); //stack string to array
    }
    var isHtml = new reqres(res, req).isHtml();
    if (isHtml) {
        ack.router().htmlCloseError({ debug: isProductionMode })(err, req, res);
    }
    else {
        ack.router().jsonCloseError({ debug: isProductionMode })(err, req, res);
    }
    resMarkClosed(res);
}
777551
function mergeHelpers(engine, options) {
  if (!options || typeof options !== 'object') {
    throw new TypeError('expected an object');
  }

  var opts = extend({}, options);
  var helpers = merge({}, engine.helpers.cache, opts.helpers);
  var keys = Object.keys(helpers);
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    engine.asyncHelpers.set(key, helpers[key]);
  }

  opts.helpers = engine.asyncHelpers.get({wrap: opts.async});
  return opts;
}
833754
function getClosestHandle ( proposal ) {

            var closest = 100;
            var handleNumber = false;

            scope_Handles.forEach(function(handle, index){

                // Disabled handles are ignored
                if ( handle.hasAttribute('disabled') ) {
                    return;
                }

                var pos = Math.abs(scope_Locations[index] - proposal);

                if ( pos < closest ) {
                    handleNumber = index;
                    closest = pos;
                }
            });

            return handleNumber;
        }
1288244
function collapseItem(data) {
    let parentExpansions = findExpansion.call(this, data.parent).expansions;

    let index = parentExpansions.findIndex((expansion) => {
        return expansion.id === data.id;
    });

    parentExpansions.splice(index, 1);
}
603698
function mergeInner(base, mixin, mergeArrays) {
    if (base === null || typeof base !== 'object' || Array.isArray(base)) {
        throw new Error('base must be object');
    }
    if (mixin === null || typeof mixin !== 'object' || Array.isArray(mixin)) {
        throw new Error('mixin must be object');
    }
    Object.keys(mixin).forEach((name) => {
        mergeHelper(base, mixin, name, mergeArrays);
    });
}
1308963
function (requestV1) {
        var queryParams = [],
            pathVariables = [],
            traversedVars = {},
            queryParamAltered,
            traversedQueryParams = {},
            parsed = util.urlparse(requestV1.url),
            retainEmpty = this.options.retainEmptyValues;

        // Merge query params
        _.forEach(requestV1.queryParams, function (queryParam) {
            (queryParam.enabled === false) && (queryParam.disabled = true);

            delete queryParam.enabled;

            util.cleanEmptyValue(queryParam, 'description', retainEmpty);

            if (_.has(queryParam, 'equals')) {
                if (queryParam.equals) {
                    (queryParam.value === null) && (queryParam.value = '');
                    queryParamAltered = true;
                }
                else {
                    // = is not appended when the value is null
                    (queryParam.value === '') && (queryParam.value = null);
                    queryParamAltered = true;
                }
                delete queryParam.equals;
            }

            queryParams.push(queryParam);
            traversedQueryParams[queryParam.key] = true;
        });
        // parsed query params are taken from the url, so no descriptions are available from them
        _.forEach(parsed.query, function (queryParam) {
            !traversedQueryParams[queryParam.key] && queryParams.push(queryParam);
        });

        // Merge path variables
        _.forEach(requestV1.pathVariableData, function (pathVariable) {
            pathVariable = _.clone(pathVariable);
            util.cleanEmptyValue(pathVariable, 'description', retainEmpty);

            pathVariables.push(pathVariable);
            traversedVars[pathVariable.key] = true;
        });
        // pathVariables in v1 are of the form  {foo: bar}, so no descriptions can be obtained from them
        _.forEach(requestV1.pathVariables, function (value, id) {
            !traversedVars[id] && pathVariables.push({
                value: value,
                id: id
            });
        });

        !_.isEmpty(queryParams) && (parsed.query = queryParams);
        !_.isEmpty(pathVariables) && (parsed.variable = pathVariables);

        // If the query params have been altered, update the raw stringified URL
        queryParamAltered && (parsed.raw = util.urlunparse(parsed));

        // return the objectified URL only if query param or path variable descriptions are present, string otherwise
        return (parsed.query || parsed.variable) ? parsed : (parsed.raw || requestV1.url);
    }