Filter leaks with the given globals flagged as `ok`.

@param {Array} ok
@param {Array} globals
@return {Array}
@api private
330975
function filterLeaks(ok, globals) {
  return filter(globals, function(key){
    var matched = filter(ok, function(ok){
      if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]);
      // Opera and IE expose global variables for HTML element IDs (issue #243)
      if (/^mocha-/.test(key)) return true;
      return key == ok;
    });
    return matched.length == 0 && (!global.navigator || 'onerror' !== key);
  });
}
1257305
function parseOptions(globals, data, options) {
    if (_.isString(options.filter)) {
        options.filter = resolvePaths(globals, data, options.filter);
    }

    return options;
}
771845
private function sanitizeGlobals() {
		// It would be "wrong" to unset any of these GLOBALS.
		$protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN');
		
		// Unset globals for securiy.
		// This is effectively the same as register_globals = off
		foreach (array($_GET, $_POST, $_COOKIE) as $global) {
			if (!is_array($global)) {
				if (!in_array($global, $protected)) {
					global $$global;
					$$global = NULL;
				}
			} else {
				foreach ($global as $key => $val) {
					if (!in_array($key, $protected)) {
						global $$key;
						$$key = NULL;
					}
				}
			}
		}
		
		// Is $_GET data allowed? If not we'll set the $_GET to an empty array
		if (is_array($_GET) and count($_GET) > 0) {
			foreach ($_GET as $key => $val) {
				$_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
			}
		}
		
		// Clean $_POST Data
		if (is_array($_POST) and count($_POST) > 0) {
			foreach ($_POST as $key => $val) {
				$_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
			}
		}
		
		// Clean $_COOKIE Data
		if (is_array($_COOKIE) and count($_COOKIE) > 0) {
			// Also get rid of specially treated cookies that might be set by a
			// server
			// or silly application, that are of no use to a CI application
			// anyway
			// but that when present will trip our 'Disallowed Key Characters'
			// alarm
			// http://www.ietf.org/rfc/rfc2109.txt
			// note that the key names below are single quoted strings, and are
			// not PHP variables
			unset($_COOKIE['$Version']);
			unset($_COOKIE['$Path']);
			unset($_COOKIE['$Domain']);
			
			foreach ($_COOKIE as $key => $val) {
				$_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
			}
		}
		
		// Sanitize PHP_SELF
		$_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
		
		// CSRF Protection check
		if ($this->_enable_csrf == TRUE) {
			Security::csrf_verify();
		}
		
	}
1203443
function filterFiles (filters) {
  return (files, metalsmith, done) => {
    filter(files, filters, metalsmith.metadata(), done)
  }
}
929340
function globalVarCheck(node, parent) {
            if (!isVarOnTop(node, parent.body)) {
                context.report({ node, messageId: "top" });
            }
        }
1312403
def p_include_once_ok(p):
    
    global CURRENT_DIR
    p[0] = [p[1] + p[2]] + p[3] + [p[4]]
    CURRENT_FILE.pop()  # Remove top of the stack
    CURRENT_DIR = os.path.dirname(CURRENT_FILE[-1])
432362
function getGlobal(value) {
        if (!value) {
            return value;
        }
        var g = global;
        each(value.split('.'), function (part) {
            g = g[part];
        });
        return g;
    }
916598
def process_user_pipes(result, global_opt)
      pipes_to_process(global_opt).each {|e|
        args = [pipe(e)[:pipe], result]
        args << global_opt[e] unless pipe(e)[:type] == :boolean
        args << get_env(e, global_opt) if pipe(e)[:env]
        pipe_result = Boson.invoke(*args)
        result = pipe_result if pipe(e)[:filter]
      }
      result
    end
651178
function applyGlobals (obj, target, key) {
            let prop;

            // Check for previously applied global substitution
            if (target != null && typeof target === 'object' && target._global_prop && target._global_prop[key]) {
                prop = target._global_prop[key];
            }
            // Check string for new global substitution
            else if (typeof obj === 'string' && obj.slice(0, 7) === 'global.') {
                prop = obj;
            }

            // Found global property to substitute
            if (prop) {
                // Mark property as global substitution
                if (target._global_prop == null) {
                    Object.defineProperty(target, '_global_prop', { value: {} });
                }
                target._global_prop[key] = prop;

                // Get current global value
                let val = globals[prop];
                let stack;
                while (typeof val === 'string' && val.slice(0, 7) === 'global.') {
                    // handle globals that refer to other globals, detecting any cyclical references
                    stack = stack || [prop];
                    if (stack.indexOf(val) > -1) {
                        log({ level: 'warn', once: true }, 'Global properties: cyclical reference detected', stack);
                        val = null;
                        break;
                    }
                    stack.push(val);
                    val = globals[val];
                }

                // Create getter/setter
                Object.defineProperty(target, key, {
                    enumerable: true,
                    get: function () {
                        return val; // return substituted value
                    },
                    set: function (v) {
                        // clear the global substitution and remove the getter/setter
                        delete target._global_prop[key];
                        delete target[key];
                        target[key] = v; // save the new value
                    }
                });
            }
            // Loop through object keys or array indices
            else if (Array.isArray(obj)) {
                for (let p=0; p < obj.length; p++) {
                    applyGlobals(obj[p], obj, p);
                }
            }
            else if (typeof obj === 'object') {
                for (let p in obj) {
                    applyGlobals(obj[p], obj, p);
                }
            }
            return obj;
        }
272340
def globals(self):
        """"""
        defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)

        while defglobal != ffi.NULL:
            yield Global(self._env, defglobal)

            defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
1100093
function getLevelsToAudit(options) {
    const auditOptions = getNpmAuditOptions(options);
    const auditLevelOption =
        auditOptions && auditOptions['--audit-level']
            ? auditOptions['--audit-level']
            : auditLevel.low;

    const filteredLevels = [];
    // prettier-ignore
    switch (auditLevelOption) {
    case auditLevel.critical:
        filteredLevels.push(auditLevel.critical);
        break;
    case auditLevel.high:
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
        break;
    case auditLevel.moderate:
        filteredLevels.push(auditLevel.moderate);
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
        break;
    default:
        filteredLevels.push(auditLevel.low);
        filteredLevels.push(auditLevel.moderate);
        filteredLevels.push(auditLevel.high);
        filteredLevels.push(auditLevel.critical);
    }

    return filteredLevels;
}
1065628
def get_globals(self):
        """"""
        if self.shell:
            globals_ = dict(_initial_globals)
        else:
            globals_ = dict(self.current_frame.f_globals)
        globals_['_'] = self.db.last_obj
        if cut is not None:
            globals_.setdefault('cut', cut)
        # For meta debuging purpose
        globals_['___wdb'] = self.db
        # Hack for function scope eval
        globals_.update(self.current_locals)
        for var, val in self.db.extra_vars.items():
            globals_[var] = val
        self.db.extra_items = {}
        return globals_
985256
def find_all_globals(node, globs):
    """"""
    for n in node:
        if isinstance(n, SyntaxTree):
            globs = find_all_globals(n, globs)
        elif n.kind in read_write_global_ops:
            globs.add(n.pattr)
    return globs
401472
function checkForGlobal(node) {
				var scope = context.getScope(),
					parserOptions = context.parserOptions,
					ecmaFeatures = parserOptions.ecmaFeatures || {};

				// Nodejs env or modules has a special scope.
				if (ecmaFeatures.globalReturn || node.sourceType === "module") {
					findVariablesInScope(scope.childScopes[0]);
				} else {
					findVariablesInScope(scope);
				}
			}
302166
def filter!(keys, params, options={:recursive => true})  # :nodoc:
      case params
      when Hash, ParamsHash
        params.keys.each do |k, v|
          unless (keys.include?(k) or Github::Validations::VALID_API_KEYS.include?(k))
            params.delete(k)
          else
            filter!(keys, params[k]) if options[:recursive]
          end
        end
      when Array
        params.map! do |el|
          filter!(keys, el) if options[:recursive]
        end
      else
        params
      end
      return params
    end
192852
function resolvePaths(globals, data, value) {
    var regex = /\{\{(.*?)\}\}/g;

    value = value.replace(regex, function (match, path) {
        var result;

        // Handle aliases
        path = pathAliases[path] ? pathAliases[path] : path;
        // Handle Handlebars .[] style arrays
        path = path.replace(/\.\[/g, '[');

        if (path.charAt(0) === '@') {
            result = jsonpath.query(globals, path.substr(1));
        } else {
            // Do the query, which always returns an array of matches
            result = jsonpath.query(data, path);
        }

        // Handle the case where the single data property we return is a Date
        // Data.toString() is not DB compatible, so use `toISOString()` instead
        if (_.isDate(result[0])) {
            result[0] = result[0].toISOString();
        }

        // Concatenate the results with a comma, handles common case of multiple tag slugs
        return result.join(',');
    });

    return value;
}
418091
function o2s(obj) {
    var s = "";
    for (key in obj) {
        var line = key + "->" + obj[key];
        line.replace("\n", " ");
        s += line + "\n";
    }
    return s;
}