calculate zone matches and flag settings to determine whether this module should display to customers or not
12640
function update_status() {
    global $order, $db;

    if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0) ) {
      $check_flag = false;
      $check_query = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
      while (!$check_query->EOF) {
        if ($check_query->fields['zone_id'] < 1) {
          $check_flag = true;
          break;
        } elseif ($check_query->fields['zone_id'] == $order->billing['zone_id']) {
          $check_flag = true;
          break;
        }
        $check_query->MoveNext();
      }

      if ($check_flag == false) {
        $this->enabled = false;
      }
    }
  }
708577
public function verifySettings()
    {
        // Creation is done here rather than in isSelected() because some
        // containers may do a validation pass before running isSelected(),
        // but we need to check for the existence of the created class.
        if ($this->dynselector === null) {
            $this->selectorCreate();
        }

        if (empty($this->classname)) {
            $this->setError("The classname attribute is required");
        } elseif ($this->dynselector === null) {
            $this->setError("Internal Error: The custom selector was not created");
        } elseif (!($this->dynselector instanceof ExtendFileSelector) && (count($this->parameters) > 0)) {
            $this->setError(
                "Cannot set parameters on custom selector that does not "
                . "implement ExtendFileSelector."
            );
        }
    }
997695
def _check_modes(self, modes):
        """"""
        if not isinstance(modes, (tuple, list, set)):
            modes = [modes]
        if self.mode not in modes:
            raise ValueError("Image not in suitable mode, expected: %s, got: %s" % (modes, self.mode))
268930
public function verifySettings()
    {
        if ($this->pattern === null && $this->regex === null) {
            $this->setError("The name or regex attribute is required");
        } elseif ($this->pattern !== null && $this->regex !== null) {
            $this->setError("Only one of name and regex attribute is allowed");
        }
    }
353255
private function checkAndRegisterTagMinimumCounts(): void
    {
        $checkedRule = 'min';
        $rulesWithReq = $this->getRulesWithRequirement($checkedRule);

        array_walk(
            $rulesWithReq,
            function (array $tagRule, string $tag) use ($checkedRule): void {
                $minCount = $tagRule[$checkedRule];
                $tagCount = count($this->findTokensForTag($tag));

                if ($minCount > $tagCount) {
                    $fixCallback = $this->hasFixCallback($checkedRule, $tag);
                    $method = $fixCallback ? 'addFixableError' : 'addError';
                    $fixable = $this->file->{$method}(
                        self::MESSAGE_TAG_OCCURRENCE_MIN,
                        $this->getDocCommentPos(),
                        // We use an error code containing the tag name because we can't configure this rules from the
                        // outside and need  specific code to exclude the rule for this special tag.
                        static::CODE_TAG_OCCURRENCE_MIN_PREFIX . ucfirst($tag),
                        [
                            $tag,
                            $minCount,
                            $tagCount
                        ]
                    );

                    if ($fixable && $fixCallback) {
                        $this->{$fixCallback}($this->getDocCommentPos(), $minCount, $tagCount, $tag);
                    }
                }
            }
        );
    }
650949
protected function checkAndSetServerOptions()
    {

        // Specific query port defined
        if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
            $this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
        } else {
            // Do math based on the protocol class
            $this->port_query = $this->protocol->findQueryPort($this->port_client);
        }
    }
436395
def _assign_zones(self):
        """"""
        for zone_id in range(1, 5):
            zone = \
                RainCloudyFaucetZone(
                    parent=self._parent,
                    controller=self._controller,
                    faucet=self,
                    zone_id=zone_id)

            if zone not in self.zones:
                self.zones.append(zone)
1102421
private function checkOs(){
		$data = $this->data[0];
		preg_match($this->_patterns['os'],$data,$matched);
		$matched = explode(';',$matched[0]);
		pr($matched);
		foreach($matched as $index => $value) {
			$value = trim($value);
			if(in_array($value,array('Macintosh','Windows','X11','Linux'))) {
				$this->report['platform'] = $value;	
				continue;
			}
			
			
		}
		//foreach($matched)
	//	foreach($matched as $key=>$val) {
//			$val = trim($val);
//			if(isset($this->_checkLists['os'][$val])){
//				
//				$this->report = $val;
//				continue;
//			};
//			pr($val. " aaaa");
//	  		if($val === 'WOW64'){
//				unset($matched[$key]);
//			}
//			
//			//$this->report[1][] = $key;
//	
//		}
		//$this->data[1] = $matched;
		//$this->isValid = false;

	}
443388
def _check_backend():
    
    # Django 1.10 does not allow
    # both settings to be set
    middleware = set(
        getattr(settings, 'MIDDLEWARE', None) or
        getattr(settings, 'MIDDLEWARE_CLASSES', None) or
        [])

    # Deprecated alias
    if "djconfig.middleware.DjConfigLocMemMiddleware" in middleware:
        return

    if "djconfig.middleware.DjConfigMiddleware" in middleware:
        return

    raise ValueError(
        "djconfig.middleware.DjConfigMiddleware "
        "is required but it was not found in "
        "MIDDLEWARE_CLASSES nor in MIDDLEWARE")
40269
def width(self, add_quiet_zone=False):
        
        quiet_zone = self.quiet_zone if add_quiet_zone else 0
        return len(self.modules) + 2 * quiet_zone
1164091
def zone(self) -> Optional[str]:
        """"""
        if self._device_category == DC_BASEUNIT:
            return None
        return '{:02x}-{:02x}'.format(self._group_number, self._unit_number)
513499
function isMatch(file, license, rate, srcNLReg) {
        var srcLines = file.contents.toString('utf8').split(/\r?\n/),
                templateLines = license.split(/\r?\n/),
                type = path.extname(file.path),
                matchRates = 0,
                removed = false;

        // after '<?php' has new line, remove it 
        switch (type) {
            case '.php':
                if (srcLines[1].replace(/\s/, '') === '') {
                    srcLines.splice(1, 1);
                    removed = true;
                }
                break;
            default:
                break;
        }

        // count match line
        var minLength = templateLines.length > srcLines.length ? srcLines.length : templateLines.length;
        for (var i = 0; i < minLength; i++) {
            if (templateLines[templateLines.length - 1] === '' && i === templateLines.length - 1) {
                matchRates += 1;
            } else {
                switch (type) {
                    case '.php':
                        matchRates += getMatchRate(srcLines[i + 1], templateLines[i]);
                        break;
                    default:
                        matchRates += getMatchRate(srcLines[i], templateLines[i]);
                        break;
                }
            }
        }

        // has similar license, remove the license.
        var matchPer = matchRates / templateLines.length;

        if (matchPer >= rate && matchPer < 1) {
            // remove
            switch (type) {
                case '.php':
                    if (srcLines[templateLines.length].replace(/\s/, '') === '' && !removed) {
                        // after license, should be have a blank line. if has not, we don't need remove blank line. && after '<?php' has not new line
                        srcLines.splice(1, templateLines.length);
                    } else {
                        srcLines.splice(1, templateLines.length - 1);
                    }
                    file.contents = new Buffer(srcLines.join(srcNLReg));
                    break;
                default:
                    // after license, should be have a blank line. if have not, we don't need remove blank line.
                    if (srcLines[templateLines.length - 1].replace(/\s/, '') === '') {
                        srcLines.splice(0, templateLines.length);
                    } else {
                        srcLines.splice(0, templateLines.length - 1);
                    }
                    file.contents = new Buffer(srcLines.join(srcNLReg));
                    break;
            }
            return false;
        } else if (matchPer === 1) {
            return true;
        }
    }
582923
private boolean matches(String classname, AccessFlags flags) {
        if (options.apiOnly && !flags.is(AccessFlags.ACC_PUBLIC)) {
            return false;
        } else if (options.includePattern != null) {
            return options.includePattern.matcher(classname.replace('/', '.')).matches();
        } else {
            return true;
        }
    }
1048955
def _match_modes(self, remote_path, l_st):
        """"""
        self.sftp.chmod(remote_path, S_IMODE(l_st.st_mode))
        self.sftp.utime(remote_path, (l_st.st_atime, l_st.st_mtime))

        if self.chown:
            self.sftp.chown(remote_path, l_st.st_uid, l_st.st_gid)
899506
def get_modes(self, zone):
        """"""
        self._populate_full_data()
        device = self._get_device(zone)
        return device['thermostat']['allowedModes']
612892
public boolean shouldDisplay(String operationId, PMSecurityUser user) {
        if (operationId == null) {
            return false;
        }
        //First we check permissions
        for (FieldOperationConfig config : getConfigs()) {
            if (config.includes(operationId)) {
                if (config.getPerm() != null && user != null && !user.hasPermission(config.getPerm())) {
                    return false;
                }
            }
        }
        if (getDisplay().equalsIgnoreCase("all")) {
            return true;
        }
        final String[] split = getDisplay().split("[ ]");
        for (String string : split) {
            if (string.equalsIgnoreCase(operationId)) {
                return true;
            }
        }
        return false;
    }
1203389
def include?(value)
      if first.is_a?(TimeWithZone)
        cover?(value)
      elsif last.is_a?(TimeWithZone)
        cover?(value)
      else
        super
      end
    end