<commit_before><?php

class Mailgun
{
  const BASE_URL = 'https://api.mailgun.net/v3';

  const LIST_GENERAL = '<EMAIL>';

  public static function unsubscribeFromMailingList($listAddress, $email)
  {
    list($status, $headers, $body) = static::put('/lists/' . $listAddress . '/members/' . $email, [
      'subscribed' => 'no',
    ]);

    if ($status == 200)
    {
      return true;
    }

    $data = json_decode($body, true);
    $message = $data['error'] ?? $data['message'] ?? false;

    if (strpos($message, 'Member '.$email) === 0 && strrpos($message, ' not found') === (strlen($message) - strlen(' not found')))
    {
      // message says "Member $email ... not found", so email is not on list. that's the same as unsubscribing, right?
      return true;
    }

    return $message;
  }

  public static function sendDmcaReport($data)
  {
    list($status, $headers, $body) = static::post('/lbry.io/messages', [
      'from'              => 'LBRY <<EMAIL>>',
      'to'                => '<EMAIL>',
      'subject'           => 'DMCA Report #' . $data['report_id'],
      'html'              => '<pre>' . var_export($data, true) . '</pre>',
      'o:tracking-clicks' => 'no',
      'o:tracking-opens'  => 'no'
    ]);

    return $status == 200;
  }

  public static function sendYouTubeWarmLead($data)
  {
    list($status, $headers, $body) = static::post('/lbry.io/messages', [
      'from'              => 'LBRY <<EMAIL>>',
      'to'                => '<EMAIL>',
      'subject'           => 'Interested YouTuber',
      'html'              => '<pre>' . var_export($data, true) . '</pre>',
      'o:tracking-clicks' => 'no',
      'o:tracking-opens'  => 'no'
    ]);

    return $status == 200;<commit_msg>change reilly to /youtube contact<commit_after><?php

class Mailgun
{
  const BASE_URL = 'https://api.mailgun.net/v3';

  const LIST_GENERAL = '<EMAIL>';

  public static function unsubscribeFromMailingList($listAddress, $email)
  {
    list($status, $headers, $body) = static::put('/lists/' . $listAddress . '/members/' . $email, [
      'subscribed' => 'no',
    ]);

    if ($status == 200)
    {
      return true;
    }

    $data = json_decode($body, true);
    $message = $data['error'] ?? $data['message'] ?? false;

    if (strpos($message, 'Member '.$email) === 0 && strrpos($message, ' not found') === (strlen($message) - strlen(' not found')))
    {
      // message says "Member $email ... not found", so email is not on list. that's the same as unsubscribing, right?
      return true;
    }

    return $message;
  }

  public static function sendDmcaReport($data)
  {
    list($status, $headers, $body) = static::post('/lbry.io/messages', [
      'from'              => 'LBRY <<EMAIL>>',
      'to'                => '<EMAIL>',
      'subject'           => 'DMCA Report #' . $data['report_id'],
      'html'              => '<pre>' . var_export($data, true) . '</pre>',
      'o:tracking-clicks' => 'no',
      'o:tracking-opens'  => 'no'
    ]);

    return $status == 200;
  }

  public static function sendYouTubeWarmLead($data)
  {
    list($status, $headers, $body) = static::post('/lbry.io/messages', [
      'from'              => 'LBRY <<EMAIL>>',
      'to'                => '<EMAIL>',
      'subject'           => 'Interested YouTuber',
      'html'              => '<pre>' . var_export($data, true) . '</pre>',
      'o:tracking-clicks' => 'no',
      'o:tracking-opens'  => 'no'
    ]);

    return $status == 200;
{'fraction_non_alphanumeric': 0.19821119446047317, 'fraction_numerical': 0.006347374495095211, 'mean_word_length': 2.3272552783109406, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 51, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1057440', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1139, 'n_words': 255}