How to call module function in template file? I have one custom function in .module file. Need to call that function .template file. Below is my code snnipet:

function non_login_preprocess_page(&amp;$vars) {

  if(module_exists('test') &amp;&amp; function_exists('test_get_rnd_data')){
    $vars['rnd_data'] = test_get_rnd_data();
    print_r("callled"); exit;
  }
}


the function exists does not return true. Is anything thing missing?
Please try bellow code and use module_load_include() function. 

function non_login_preprocess_page(&amp;$vars) {

  module_load_include('module', 'module', 'test');   // **add this line**

  if(module_exists('test') &amp;&amp; function_exists('test_get_rnd_data')){
    $vars['rnd_data'] = test_get_rnd_data();
    print_r("callled"); exit;
  }
}