run layer specific checks
342950
def _check(self):
        
        if conf.contribs['LLDP'].strict_mode() and self._length != 2:
            raise LLDPInvalidLengthField('length must be 2 - got '
                                         '{}'.format(self._length))
641209
function checkDeprecatedProps(layerName, propsInstance, deprecatedProps) {
  if (!propsInstance) {
    return;
  }

  for (const name in deprecatedProps) {
    if (hasOwnProperty(propsInstance, name)) {
      const nameStr = `${layerName || 'Layer'}: ${name}`;

      for (const newPropName of deprecatedProps[name]) {
        if (!hasOwnProperty(propsInstance, newPropName)) {
          propsInstance[newPropName] = propsInstance[name];
        }
      }

      log.deprecated(nameStr, deprecatedProps[name].join('/'))();
    }
  }
}
1127514
def run(self, call, num_alts):
        
        for key, value in call.data.items():
            self._check_count(call, key, value, num_alts)
1080723
function(context, node) {
        var layerContext = {
            visibility: (node.getAttribute("hidden") != "1"),
            queryable: (node.getAttribute("queryable") == "1"),
            formats: [],
             styles: [],
             metadata: {}
        };

        this.runChildNodes(layerContext, node);
        // set properties common to multiple objects on layer options/params
        context.layersContext.push(layerContext);
    }
910900
def _run_check(self, check_method, ds, max_level):
        
        val = check_method(ds)
        if isinstance(val, list):
            check_val = []
            for v in val:
                res = fix_return_value(v, check_method.__func__.__name__,
                                       check_method, check_method.__self__)
                if max_level is None or res.weight > max_level:
                    check_val.append(res)

            return check_val
        else:
            check_val = fix_return_value(val, check_method.__func__.__name__,
                                         check_method, check_method.__self__)
            if max_level is None or check_val.weight > max_level:
                return [check_val]
            else:
                return []
481920
def _run_callbacks(kind, *args) #:nodoc:
      options = args.last # Last callback arg MUST be a Hash

      send("_#{kind}").each do |callback, conditions|
        invalid = conditions.find do |key, value|
          value.is_a?(Array) ? !value.include?(options[key]) : (value != options[key])
        end

        callback.call(*args) unless invalid
      end
    end
154776
function () {
		var hash = window.location.hash;
		var filterIndex = hash.indexOf('filter=');
		if (filterIndex !== -1) {
			var filterString = hash.substr(filterIndex + 7).trim();
			var visible = layersControl.filter(filterString);

			// enable first layer as actual layer.
			var first = Object.keys(visible)[0];
			if (first in baseLayers) {
				map.addLayer(baseLayers[first]);
				map.eachLayer(function (layer) {
					if (layer._providerName !== first) {
						map.removeLayer(layer);
					}
				});
				layersControl.filter(filterString);
			}
		}
	}
289913
def run_work(self):
    """"""
    if os.path.exists(LOCAL_EVAL_ROOT_DIR):
      sudo_remove_dirtree(LOCAL_EVAL_ROOT_DIR)
    self.run_attacks()
    self.run_defenses()
429463
def verifyInputs(self):
        
        for layer in self.layers:
            if (layer.verify and
                layer.type == 'Input' and
                layer.kind != 'Context' and
                layer.active and
                not layer.activationSet):
                raise LayerError("Inputs are not set and verifyInputs() was called on layer '%s'." % layer.name)
            else:
                layer.resetActivationFlag()
676257
def check(
    state,
    unused=False,
    style=False,
    ignore=None,
    args=None,
    **kwargs
):
    """"""
    from ..core import do_check

    do_check(
        three=state.three,
        python=state.python,
        system=state.system,
        unused=unused,
        ignore=ignore,
        args=args,
        pypi_mirror=state.pypi_mirror,
    )
287334
def run(self, files, working_area):
        

        # Ensure that dictionary is ordered by check declaration order (via self.check_names)
        # NOTE: Requires CPython 3.6. If we need to support older versions of Python, replace with OrderedDict.
        results = {name: None for name in self.check_names}
        checks_root = working_area.parent
        with futures.ProcessPoolExecutor() as executor:

            # Start all checks that have no dependencies
            not_done = set(executor.submit(run_check(name, self.checks_spec, checks_root))
                           for name, _ in self.child_map[None])
            not_passed = []

            while not_done:
                done, not_done = futures.wait(not_done, return_when=futures.FIRST_COMPLETED)
                for future in done:
                    # Get result from completed check
                    result, state = future.result()
                    results[result.name] = result
                    if result.passed:
                        # Dispatch dependent checks
                        for child_name, _ in self.child_map[result.name]:
                            not_done.add(executor.submit(
                                run_check(child_name, self.checks_spec, checks_root, state)))
                    else:
                        not_passed.append(result.name)

        for name in not_passed:
            self._skip_children(name, results)

        return results.values()
522047
function _triggerLayerEvent($canvas, data, layer, eventType, arg) {
	// If layer can legally fire this event type
	if (_layerCanFireEvent(layer, eventType)) {

		// Do not set a custom cursor on layer mouseout
		if (eventType !== 'mouseout') {
			// Update cursor if one is defined for this event
			_setCursor($canvas, layer, eventType);
		}

		// Trigger the user-defined event callback
		_runEventCallback($canvas, layer, eventType, layer, arg);
		// Trigger the canvas-bound event hook
		_runEventCallback($canvas, layer, eventType, data.eventHooks, arg);
		// Trigger the global event hook
		_runEventCallback($canvas, layer, eventType, jCanvas.eventHooks, arg);

	}
}
637863
function runSuite() {
    execFile(flow, [ 'status', '--color', 'always' ], (err, stdout) => {
        process.stdout.write('\x1Bc')
        /* eslint-disable no-console */
        console.log(stdout)
        /* eslint-enable no-console */
    })
}
578866
function Runner(checkit, target, context) {
  this.errors         = {};
  this.checkit        = checkit;
  this.conditional    = checkit.conditional;
  this.target         = _.clone(target || {})
  this.context        = _.clone(context || {})
  this.validator      = new Validator(this.target, checkit.language)
}
1050587
def run_checks(self):
        

        result = True
        differences_dict = {}

        if 'tables' not in self.ignore_list:
            tmp_result, differences_dict['tables'] = self.check_tables()
            result = False if not tmp_result else result
        if 'columns' not in self.ignore_list:
            tmp_result, differences_dict['columns'] = self.check_columns(
                'views' not in self.ignore_list)
            result = False if not tmp_result else result
        if 'constraints' not in self.ignore_list:
            tmp_result, differences_dict['constraints'] = \
                self.check_constraints()
            result = False if not tmp_result else result
        if 'views' not in self.ignore_list:
            tmp_result, differences_dict['views'] = self.check_views()
            result = False if not tmp_result else result
        if 'sequences' not in self.ignore_list:
            tmp_result, differences_dict['sequences'] = self.check_sequences()
            result = False if not tmp_result else result
        if 'indexes' not in self.ignore_list:
            tmp_result, differences_dict['indexes'] = self.check_indexes()
            result = False if not tmp_result else result
        if 'triggers' not in self.ignore_list:
            tmp_result, differences_dict['triggers'] = self.check_triggers()
            result = False if not tmp_result else result
        if 'functions' not in self.ignore_list:
            tmp_result, differences_dict['functions'] = self.check_functions()
            result = False if not tmp_result else result
        if 'rules' not in self.ignore_list:
            tmp_result, differences_dict['rules'] = self.check_rules()
            result = False if not tmp_result else result
        if self.verbose_level == 0:
            differences_dict = None
        return result, differences_dict
332038
function shouldProcess (filePath, done) {
        done(!!multimatch(filePath, transform.pattern, transform.opts).length)
      }
85618
def custom_check(cmd, ignore_retcode=False):
    
    p = custom_popen(cmd)
    out, _ = p.communicate()
    if p.returncode and not ignore_retcode:
        raise RarExecError("Check-run failed")
    return out