/* Spam Reporting Resources
514759
@Override
    public void reportSpam(final long userId) {
        getDispatcher().invokeLater(new AsyncTask(REPORT_SPAM, listeners) {
            @Override
            public void invoke(List<TwitterListener> listeners) throws TwitterException {
                User user = twitter.reportSpam(userId);
                for (TwitterListener listener : listeners) {
                    try {
                        listener.reportedSpam(user);
                    } catch (Exception e) {
                        logger.warn("Exception at reportSpam", e);
                    }
                }
            }
        });
    }
684966
function showUsage(req, res) {
	var egPayload = {
		"username": "soandso",
		"message": "Hello bot",
		"vars": {
			"name": "Soandso"
		}
	};
	res.writeHead(200, {"Content-Type": "text/plain"});
	res.write("Usage: curl -i \\\n");
	res.write("   -H \"Content-Type: application/json\" \\\n");
	res.write("   -X POST -d '" + JSON.stringify(egPayload) + "' \\\n");
	res.write("   http://localhost:2001/reply");
	res.end();
}
1099279
function(invokeId, errType, resultStr) {
    if (!invoked) return
    var diffMs = hrTimeMs(process.hrtime(start))
    var billedMs = Math.min(100 * (Math.floor(diffMs / 100) + 1), TIMEOUT * 1000)
    systemLog('END RequestId: ' + invokeId)
    systemLog([
      'REPORT RequestId: ' + invokeId,
      'Duration: ' + diffMs.toFixed(2) + ' ms',
      'Billed Duration: ' + billedMs + ' ms',
      'Memory Size: ' + MEM_SIZE + ' MB',
      'Max Memory Used: ' + Math.round(process.memoryUsage().rss / (1024 * 1024)) + ' MB',
      '',
    ].join('\t'))

    var exitCode = errored || errType ? 1 : 0
    if (typeof resultStr === 'string') {
      handleResult(resultStr, function() { process.exit(exitCode) })
    } else {
      process.exit(exitCode)
    }
  }
799792
function reportSuccess(message) {
    const chalk = require('chalk');
    console.log(chalk.green(message));
    console.log('');
}
863663
function report(stream, metrics, thresholds) {
  const target = (!elv(thresholds)) ? -1 : thresholds.target;
  const dimensions = tableDimensions(metrics);
  const border = divider(dimensions);
  let value = header(dimensions);

  for (let i = 0; i < metrics.length; i++) {
    if (i > 0) value += border;
    const metric = metrics[i];
    value += row(metric, dimensions, i === target);
  }

  value += divider(dimensions, 'bottom');
  value += '\n';

  stream.write(value);
}
562732
function runReports(err) {
    if (err) { console.log(chalk.red('Error running reports: %s'), err); }

    var excludes = filesets.platoExcludes();

    if (excludes) {
        platoOptions.exclude = excludes;
    }

    jsHintOptions.ignore = filesets.jshintExcludes();
    jsHintOptions.reporter = reporter.reporter;

    console.log(chalk.blue('Building plato reports...'));
    console.log(chalk.gray('(Ignore any output about being unable to parse ' +
        'JSON files)'));

    plato.inspect(filesets.platoIncludes(), outputDir, platoOptions,
        function() {
            console.log(chalk.blue('\nPlato reports have been built to: ') +
                chalk.magenta(outputDir));
            console.log(chalk.blue('\nJSHint Report\n=============\n'));
            buildJSHint(filesets.jshintIncludes(), jsHintOptions,
                reporter.callback);
        }
    );
}
766594
private function getSpamIndexReport($msgString, $report = 'long')
    {
        // check if cURL is loaded/available
        if (!function_exists('curl_init')) {
            // @codeCoverageIgnoreStart
            return array('success' => false,
                            'curlHttpCode' => '-',
                            'curlError' => '-',
                            'message' => 'No Spam-Check done. cURL module is not available.',
                    );
            // @codeCoverageIgnoreEnd
        }

        $ch = curl_init('http://spamcheck.postmarkapp.com/filter');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        $data = array('email' => $msgString, 'options' => $report);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
        curl_setopt($ch, CURLOPT_TIMEOUT, 5); // max wait for 5sec for reply

        $result = json_decode(curl_exec($ch), true);
        $error = curl_error($ch);
        $result['curlHttpCode'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        if (strlen($error) > 0) {
            $result['curlError'] = $error;
        }

        if (!array_key_exists('message', $result)) {
            $result['message'] = '-';
        }

        if (!array_key_exists('success', $result)) {
            $result['message'] = "Something went wrong! Here's the content of the curl-reply:\n\n".nl2br(print_r($result, true));
        } elseif (!$result['success'] && false !== strpos($msgString, 'Content-Transfer-Encoding: base64')) {
            $result['message'] = $result['message']."\n\nRemoving the base64-Encoded Mime-Parts might help.";
        }

        return $result;
    }
52147
public ArrayList<OvhSpamStats> ip_spam_ipSpamming_stats_GET(String ip, String ipSpamming, Date from, Date to) throws IOException {
		String qPath = "/ip/{ip}/spam/{ipSpamming}/stats";
		StringBuilder sb = path(qPath, ip, ipSpamming);
		query(sb, "from", from);
		query(sb, "to", to);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t3);
	}
669025
function Report(source){
	this.name = null;
	this.parameters = [];
	this.template = null;
	this.datasource = null;
	this.progressUpdateUrl = null;

	if (typeof source == 'object') {
		console.log('setting report from object...');
		for(var property in source) {			
			console.log('property -> (' + property + ') == ' + typeof source[property]);
			console.log(source[property]); 
			if (property == 'datasource') {
				this[property] = DataSource.create(source[property]);
			} else if (property == 'parameters') {
				this[property] = ReportParameter.create(source[property]);
			} else {
				this[property] = source[property];	
			}		

		}
	} else {
		this.name = source;
	}

	console.log('report initialized ==>');
	console.log(this);
}
1105053
public function request_is_spam()
    {
        $salt = $this->get_session_salt();

        $today_fieldname     = SecurityTool::get_today_fieldname($salt);
        $yesterday_fieldname = SecurityTool::get_yesterday_fieldname($salt);

        $is_spam = true;

        $today_fieldname_data     = $this->controller->getRequest()->getData($today_fieldname);
        $yesterday_fieldname_data = $this->controller->getRequest()->getData($yesterday_fieldname);

        if(!empty($today_fieldname_data) && $today_fieldname_data == $today_fieldname)
        {
            $is_spam = false;
        }
        elseif(!empty($yesterday_fieldname_data) && $yesterday_fieldname_data == $yesterday_fieldname)
        {
            $is_spam = false;
        }

        return $is_spam;
    }
1137387
public static function is_spam( array $values = [] ){
		$query_string = self::make_request( $values );
		// If Akismet is not active, always return error
		if( !class_exists('Akismet') || ! \Akismet::get_api_key() ){
			return new \WP_Error(500, 'Akismet is not active.');
		}
		// Make request
		add_filter('akismet_ua', [static::class, 'get_ua'], 9);
		$response = \Akismet::http_post($query_string, 'comment-check');
		remove_filter('akismet_ua', [static::class, 'get_ua'], 9);
		// Parse result
		switch( $response[1] ){
			case 'true':
				return true; // This is spam.
				break;
			case 'false':
				return false; // This is not spam.
				break;
			default:
				// Something is wrong
				if( isset( $response[0]['x-akismet-debug-help'] ) && !empty($response[0]['x-akismet-debug-help']) ){
					$message = $response[0]['x-akismet-debug-help'];
				}else{
					$message = 'Akismet return the invalid result. Something is wrong.';
				}
				return new \WP_Error(500, $message);
				break;
		}
	}
1088300
public function Spam($Page = '') {
      $this->Permission('Garden.Moderation.Manage');
      list($Offset, $Limit) = OffsetLimit($Page, 10);
      $this->SetData('Title', T('Spam Queue'));

      $Where = array('Operation' => array('Spam'));

      $RecordCount = $this->LogModel->GetCountWhere($Where);
      $this->SetData('RecordCount', $RecordCount);
      if ($Offset >= $RecordCount)
         $Offset = $RecordCount - $Limit;

      $Log = $this->LogModel->GetWhere($Where, 'LogID', 'Desc', $Offset, $Limit);
      $this->SetData('Log', $Log);

      if ($this->DeliveryType() == DELIVERY_TYPE_VIEW)
         $this->View = 'Table';

      $this->AddSideMenu('dashboard/log/spam');
      $this->Render();
   }
115706
function(id_string) {

		id_string = id_string.trim();
		var match = this._locator_regex.exec(id_string),
			result;

		if (!match || match[2].indexOf('$') != -1) Lava.t("Malformed resource id: " + id_string);

		/** @type {_cResourceId} */
		result = {
			locator_type: this.locator_types[id_string[0]],
			locator: match[1],
			name: match[2]
		};

		return result;

	}
172633
def spammer_view(request):
    """"""

    # Permits use of CSRF middleware
    context = RequestContext(request, {})
    template = Template("")

    response = HttpResponse(template.render(context))
    # Sets a cookie with a 10 years lifetime, accessible only via HTTP:
    response.set_cookie(COOKIE_KEY, value=COOKIE_SPAM, httponly=True,
                        expires=datetime.now()+timedelta(days=3650))
    
    if DJANGOSPAM_LOG:
        log("BLOCK RESPONSE", request.method, request.path_info,
            request.META.get("HTTP_USER_AGENT", "undefined"))

    return response
312345
def check_is_spam(content, content_object, request,
                  backends=None):
    
    if backends is None:
        backends = SPAM_CHECKER_BACKENDS

    for backend_path in backends:
        spam_checker = get_spam_checker(backend_path)
        if spam_checker is not None:
            is_spam = spam_checker(content, content_object, request)
            if is_spam:
                return True

    return False
704926
def spam(self, msg, *args, **kw):
        """"""
        if self.isEnabledFor(SPAM):
            self._log(SPAM, msg, args, **kw)
617955
function reportIfTooManyStatements(node, count, max) {
            if (count > max) {
                const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node));

                context.report({
                    node,
                    messageId: "exceed",
                    data: { name, count, max }
                });
            }
        }