/* eslint camelcase: 0 /* eslint no-unused-vars: 0
489802
function buildUpdateByQuery (opts) {
  // eslint-disable-next-line no-unused-vars
  const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
  /**
   * Perform a [update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request
   *
   * @param {list} index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
   * @param {list} type - A comma-separated list of document types to search; leave empty to perform the operation on all types
   * @param {string} analyzer - The analyzer to use for the query string
   * @param {boolean} analyze_wildcard - Specify whether wildcard and prefix queries should be analyzed (default: false)
   * @param {enum} default_operator - The default operator for query string query (AND or OR)
   * @param {string} df - The field to use as default where no field prefix is given in the query string
   * @param {number} from - Starting offset (default: 0)
   * @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
   * @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
   * @param {enum} conflicts - What to do when the update by query hits version conflicts?
   * @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
   * @param {boolean} lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
   * @param {string} pipeline - Ingest pipeline to set on index requests made by this action. (default: none)
   * @param {string} preference - Specify the node or shard the operation should be performed on (default: random)
   * @param {string} q - Query in the Lucene query string syntax
   * @param {list} routing - A comma-separated list of specific routing values
   * @param {time} scroll - Specify how long a consistent view of the index should be maintained for scrolled search
   * @param {enum} search_type - Search operation type
   * @param {time} search_timeout - Explicit timeout for each search request. Defaults to no timeout.
   * @param {number} size - Number of hits to return (default: 10)
   * @param {list} sort - A comma-separated list of <field>:<direction> pairs
   * @param {list} _source - True or false to return the _source field or not, or a list of fields to return
   * @param {list} _source_excludes - A list of fields to exclude from the returned _source field
   * @param {list} _source_includes - A list of fields to extract and return from the _source field
   * @param {number} terminate_after - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
   * @param {list} stats - Specific 'tag' of the request for logging and statistical purposes
   * @param {boolean} version - Specify whether to return document version as part of a hit
   * @param {boolean} version_type - Should the document increment the version number (internal) on hit or not (reindex)
   * @param {boolean} request_cache - Specify if request cache should be used for this request or not, defaults to index level setting
   * @param {boolean} refresh - Should the effected indexes be refreshed?
   * @param {time} timeout - Time each individual bulk request should wait for shards that are unavailable.
   * @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
   * @param {number} scroll_size - Size on the scroll request powering the update by query
   * @param {boolean} wait_for_completion - Should the request should block until the update by query operation is complete.
   * @param {number} requests_per_second - The throttle to set on this request in sub-requests per second. -1 means no throttle.
   * @param {number} slices - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
   * @param {object} body - The search definition using the Query DSL
   */

  const acceptedQuerystring = [
    'analyzer',
    'analyze_wildcard',
    'default_operator',
    'df',
    'from',
    'ignore_unavailable',
    'allow_no_indices',
    'conflicts',
    'expand_wildcards',
    'lenient',
    'pipeline',
    'preference',
    'q',
    'routing',
    'scroll',
    'search_type',
    'search_timeout',
    'size',
    'sort',
    '_source',
    '_source_excludes',
    '_source_includes',
    'terminate_after',
    'stats',
    'version',
    'version_type',
    'request_cache',
    'refresh',
    'timeout',
    'wait_for_active_shards',
    'scroll_size',
    'wait_for_completion',
    'requests_per_second',
    'slices',
    'pretty',
    'human',
    'error_trace',
    'source',
    'filter_path'
  ]

  const snakeCase = {
    analyzeWildcard: 'analyze_wildcard',
    defaultOperator: 'default_operator',
    ignoreUnavailable: 'ignore_unavailable',
    allowNoIndices: 'allow_no_indices',
    expandWildcards: 'expand_wildcards',
    searchType: 'search_type',
    searchTimeout: 'search_timeout',
    _sourceExcludes: '_source_excludes',
    _sourceIncludes: '_source_includes',
    terminateAfter: 'terminate_after',
    versionType: 'version_type',
    requestCache: 'request_cache',
    waitForActiveShards: 'wait_for_active_shards',
    scrollSize: 'scroll_size',
    waitForCompletion: 'wait_for_completion',
    requestsPerSecond: 'requests_per_second',
    errorTrace: 'error_trace',
    filterPath: 'filter_path'
  }

  return function updateByQuery (params, options, callback) {
    options = options || {}
    if (typeof options === 'function') {
      callback = options
      options = {}
    }
    if (typeof params === 'function' || params == null) {
      callback = params
      params = {}
      options = {}
    }

    // check required parameters
    if (params['index'] == null) {
      const err = new ConfigurationError('Missing required parameter: index')
      return handleError(err, callback)
    }

    // check required url components
    if (params['type'] != null && (params['index'] == null)) {
      const err = new ConfigurationError('Missing required parameter of the url: index')
      return handleError(err, callback)
    }

    // validate headers object
    if (options.headers != null && typeof options.headers !== 'object') {
      const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
      return handleError(err, callback)
    }

    var warnings = []
    var { method, body, index, type, ...querystring } = params
    querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)

    if (method == null) {
      method = 'POST'
    }

    var ignore = options.ignore
    if (typeof ignore === 'number') {
      options.ignore = [ignore]
    }

    var path = ''

    if ((index) != null && (type) != null) {
      path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_update_by_query'
    } else {
      path = '/' + encodeURIComponent(index) + '/' + '_update_by_query'
    }

    // build request object
    const request = {
      method,
      path,
      body: body || '',
      querystring
    }

    options.warnings = warnings.length === 0 ? null : warnings
    return makeRequest(request, options, callback)
  }
}
661415
function camelize(obj) {
        var _this = this;

        var _camelize = function _camelize(str) {
            str = stringHelpers.underscore(str);
            str = stringHelpers.slugifyText(str);

            return str.replace(/[_.-\s](\w|$)/g, function (_, x) {
                return x.toUpperCase();
            });
        };

        if (validateHelpers.isDate(obj) || validateHelpers.isRegExp(obj)) {
            return obj;
        }

        if (validateHelpers.isArray(obj)) {
            return obj.map(function (item, index) {
                if (validateHelpers.isObject(item)) {
                    return _this.camelize(item);
                }

                return item;
            });
        }

        if (validateHelpers.isString(obj)) {
            return _camelize(obj);
        }

        return Object.keys(obj).reduce(function (acc, key) {
            var camel = _camelize(key);
            acc[camel] = obj[key];

            if (validateHelpers.isObject(obj[key])) {
                acc[camel] = _this.camelize(obj[key]);
            }

            return acc;
        }, {});
    }
220389
func (e *Expr) EvalInt(context interface{}) (val int, err error) {

	valI, err := e.Eval(context)
	if err != nil {
		return 0, err
	}
	return castInt(valI)
}
972034
func CamelCase(in string) string {
	tokens := strings.Split(in, "_")
	for i := range tokens {
		tokens[i] = strings.Title(strings.Trim(tokens[i], " "))
	}
	return strings.Join(tokens, "")
}
382928
function extractPageVariables(fileName, data, userDefinedVariables, includedVariables) {
  const $ = cheerio.load(data);
  const pageVariables = { };
  $('variable').each(function () {
    const variableElement = $(this);
    const variableName = variableElement.attr('name');
    if (!variableName) {
      // eslint-disable-next-line no-console
      console.warn(`Missing 'name' for variable in ${fileName}\n`);
      return;
    }
    if (!pageVariables[variableName]) {
      const variableValue
        = nunjucks.renderString(md.renderInline(variableElement.html()),
                                { ...pageVariables, ...userDefinedVariables, ...includedVariables });
      pageVariables[variableName] = variableValue;
      if (!VARIABLE_LOOKUP[fileName]) {
        VARIABLE_LOOKUP[fileName] = {};
      }
      VARIABLE_LOOKUP[fileName][variableName] = variableValue;
    }
  });
  return pageVariables;
}
620339
func resolveAllVariables(scope map[string]interface{}, tmplStr string) error {
	var unresolvedErr error
	_, allowAllItemRefs := scope[anyItemMagicValue] // 'item.*' is a magic placeholder value set by addItemsToScope
	fstTmpl := fasttemplate.New(tmplStr, "{{", "}}")

	fstTmpl.ExecuteFuncString(func(w io.Writer, tag string) (int, error) {

		// Skip the custom variable references
		if !checkValidWorkflowVariablePrefix(tag) {
			return 0, nil
		}
		_, ok := scope[tag]
		if !ok && unresolvedErr == nil {
			if (tag == "item" || strings.HasPrefix(tag, "item.")) && allowAllItemRefs {
				// we are *probably* referencing a undetermined item using withParam
				// NOTE: this is far from foolproof.
			} else if strings.HasPrefix(tag, common.GlobalVarWorkflowCreationTimestamp) {
			} else {
				unresolvedErr = fmt.Errorf("failed to resolve {{%s}}", tag)
			}
		}
		return 0, nil
	})
	return unresolvedErr
}
717153
function camelCase(s) {
    // Convert first character to lowercase
    return s.replace(/^\w/, function (match) {
        return match.toLowerCase();
    })
    .replace(/-\w/g, function (match) {
        return match.charAt(1).toUpperCase();
    });
}
680893
func (fs *FlagSet) UintVar(p *uint, names []string, value uint, usage string) {
	fs.Var(newUintValue(value, p), names, usage)
}
895805
function(json) {

    var resArray = [];

    var emitArrayOfObjects = function(json, res) {

        var printValue = function(v) {
            var result = null;
            if (typeof(v) === "function") {
                result = "<![CDATA[";
                result = result + v.toString();
                result = result + "]]>";
            } else {
                result = v;
                if (typeof(v) !== "string") {
                    if (v !== null && typeof(v) !== 'undefined') {
                        result = v.toString();
                    } else {
                        result = "";
                    }
                }
                result = result.replace(/[&]/g, "&amp;");
                result = result.replace(/[<]/g, "&lt;");
                result = result.replace(/[>]/g, "&gt;");
            }
            return result;
        };

        var emitSimple = function(elemName, value, res) {
            res.push(`<${elemName}>`);
            res.push(printValue(value));
            res.push(`</${elemName}>`);
        };

        var emitElement = function(elemName, subElemList, res) {
            if (Array.isArray(subElemList)) {
                subElemList.forEach(function(subElem) {
                    emitElement(elemName, subElem, res);
                });
            } else if (typeof subElemList === 'object' && subElemList !== null) {
                var attrs = [];
                var textValue = "";
                if (subElemList._attrs) {
                    for (var attrName in subElemList._attrs) {
                        if (subElemList._attrs.hasOwnProperty(attrName)) {
                            attrs.push(`${attrName}='${subElemList._attrs[attrName]}'`);
                        }
                    }
                }
                if (subElemList._text) {
                    textValue = subElemList._text;
                } else if (subElemList._cdata) {
                    textValue = `<![CDATA[${subElemList._cdata}]]>`;
                } else if (subElemList.text) {
                    textValue = subElemList.text;
                }
                var attrString = attrs.length > 0 ? attrs.join(" ") : "";
                res.push(attrs.length > 0 ? `<${elemName} ${attrString}>` : `<${elemName}>`);
                emitArrayOfObjects(subElemList, res);
                res.push(textValue);
                res.push(`</${elemName}>`);

            } else {
                emitSimple(elemName, subElemList, res);
            }
        };

        for (var key in json) {
            if (json.hasOwnProperty(key) && key !== '_attrs' && key !== '_cdata' && key !== '_text' && key !== 'text') {
                emitElement(key, json[key], res);
            }
        }
    };

    emitArrayOfObjects(json, resArray);
    return resArray.join("");
}
594317
function getExpressionValue (varName, scssExpression) {
    if (is.undef(scssExpression) || is.args.empty(arguments)) {
        message('Error: Missing arguments');
        return undefined;
    }

    if (!is.string(varName) || !is.string(scssExpression)) {
        message('Error: Check arguments type');
        return undefined;
    }

    if (!~scssExpression.indexOf('$')) {
        message('Warning: Check scssExpression to contain valid code')
    }

    // print the interpolated value in comment string
    // /*#{$varName}*/ --> /*varValue*/
    const scssContent = `${scssExpression}/*#{$${varName}}*/`;

    const sassResult = sass.renderSync({
        data: scssContent
    });

    const cssResult = sassResult.css.toString();

    return extractExpressionValue(cssResult);
}
100288
func Vars(ctx context.Context) map[string]string {
	vars, ok := ctx.Value(varsKey).(map[string]string)
	if !ok {
		return map[string]string{}
	}

	return vars
}
845086
func go_resolve_variables(ctxt unsafe.Pointer, name, ns *C.char) (ret C.xmlXPathObjectPtr) {
	variable := C.GoString(name)
	namespace := C.GoString(ns)

	context := (*VariableScope)(ctxt)
	if context != nil {
		val := (*context).ResolveVariable(variable, namespace)
		ret = ValueToXPathObject(val)
	}
	return
}
836386
function transformPropertiesToCamelCase (object) {
  var output = {}

  for (var _key in object) {
    if (typeof object === 'string') { return object.replace(' !important', '') }
    var key = _key
    var value = object[_key]
    if (~key.indexOf('-')) {
      var splittedKeys = key.split('-')
      splittedKeys = splittedKeys.map(function (v, i) {
        return i > 0
        // UCFIRST if ! first element
        ? v.charAt(0).toUpperCase() + v.substr(1) : v
      })
      key = splittedKeys.join('')
    }
    output[key] = transformPropertiesToCamelCase(value)
  }
  return output
}
1352334
function(str) {
    var camelized = Ember.String.camelize(str);
    return camelized.charAt(0).toUpperCase() + camelized.substr(1);
  }
1121079
func Lint(node ast.Node, e *ErrorWriter) {
	lintingInfo := LintingInfo{
		variables: nil,
	}
	std := variable{
		name:     "std",
		declNode: nil,
		uses:     nil,
		param:    false,
	}
	findVariables(node, &lintingInfo, vScope{"std": &std})
	for _, v := range lintingInfo.variables {
		if len(v.uses) == 0 && !v.param {
			e.writeError(parser.MakeStaticError("Unused variable: "+string(v.name), *v.declNode.Loc()))
		}
	}
}
97200
func DumpClosureEnvFunction(env *Zlisp, name string, args []Sexp) (Sexp, error) {
	if len(args) != 1 {
		return SexpNull, WrongNargs
	}

	switch f := args[0].(type) {
	case *SexpFunction:
		s := ClosureToString(f, env)
		return &SexpStr{S: s}, nil
	default:
		return SexpNull, fmt.Errorf("_closdump needs an *SexpFunction to inspect")
	}
}
278993
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

	console.debug(stripIndent`
		${clr.title}ESlint Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESLintConfig, 2)
	}

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}