<commit_before><?php

require_once('core/twitteroauth.php');
require_once('core/settings.php');
require_once('util/url.php');
require_once('util/tweet.php');

// environment
global $content;

// settings
global $settings, $theme, $access_token, $conn;

function dispatch_url() {
  global $access_token;

  // pharse URI
  $base = join_path(preg_replace('/^\w+:\/+s*/' , '' , BASE_URL), '/');
  $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

  // remove the query string
  $url = preg_replace('/\?.*$/','',$url);

  // get the relative URI based on the BASE URL
  $r_uri = str_ireplace($base , '' , $url);

  $uri = explode('/' , $r_uri);

  if (!isset($_SESSION['status']) || $_SESSION['status'] != 'verified') {
    $controller = 'login.php';
  } else {
    $controller = 'tweet.php';

    if (isset($uri[0]) && !empty($uri[0]))
      $controller = $uri[0] . ".php";
  }
  include 'controller/' . $controller;

  $action = 'default';
  if (isset($uri[1]) && !empty($uri[1]))
    $action = $uri[1];

  $args = '';
  if (isset($uri[2]) && !empty($uri[2]))
    $args = $uri[2];

  array_get($controller_router, $action, 'default')($args);
}

function init_environment() {
  global $theme, $settings, $access_token, $conn, $content;

  session_start();

  $settings = new Settings(cookie_get('config'));
  $theme = new Theme($settings->theme);
  $access_token = load_access_token();
  $content = array();
  if (isset($access_token))
    return $conn = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
  else
    $conn = null;
}

?>
<commit_msg>fix code<commit_after><?php

require_once('core/twitteroauth.php');
require_once('core/settings.php');
require_once('util/url.php');
require_once('util/tweet.php');

// environment
global $content;

// settings
global $settings, $theme, $access_token, $conn;

function dispatch_url() {
  global $access_token;

  // pharse URI
  $base = join_path(preg_replace('/^\w+:\/+s*/' , '' , BASE_URL), '/');
  $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

  // remove the query string
  $url = preg_replace('/\?.*$/','',$url);

  // get the relative URI based on the BASE URL
  $r_uri = str_ireplace($base , '' , $url);

  $uri = explode('/' , $r_uri);

  if (!isset($_SESSION['status']) || $_SESSION['status'] != 'verified') {
    $controller = 'login.php';
  } else {
    $controller = 'tweet.php';

    if (isset($uri[0]) && !empty($uri[0]))
      $controller = $uri[0] . ".php";
  }
  include 'controller/' . $controller;

  $action = 'default';
  if (isset($uri[1]) && !empty($uri[1]))
    $action = $uri[1];

  $args = '';
  if (isset($uri[2]) && !empty($uri[2]))
    $args = $uri[2];

  $func = array_get($controller_router, $action, 'default');
  $func($args);
}

function init_environment() {
  global $theme, $settings, $access_token, $conn, $content;

  session_start();

  $settings = new Settings(cookie_get('config'));
  $theme = new Theme($settings->theme);
  $access_token = load_access_token();
  $content = array();
  if (isset($access_token))
    return $conn = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
  else
    $conn = null;
}

?>

{'fraction_non_alphanumeric': 0.21279212792127922, 'fraction_numerical': 0.005535055350553505, 'mean_word_length': 4.341543513957307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '6846003', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1147, 'n_words': 227}