original_string: protected function get_cohort_file($draftid) {
          global $USER;
          // We can not use moodleform::get_file_content() method because we need the content before the form is validated.
          if (!$draftid) {
              return null;
          }
          $fs = get_file_storage();
          $context = context_user::instance($USER->id);
          if (!$files = $fs->get_area_files($context->id, 'user', 'draft', $draftid, 'id DESC', false)) {
              return null;
          }
          $file = reset($files);
  
          return $file;
  
      }
code: protected function get_cohort_file($draftid) {
          global $USER;
          // We can not use moodleform::get_file_content() method because we need the content before the form is validated.
          if (!$draftid) {
              return null;
          }
          $fs = get_file_storage();
          $context = context_user::instance($USER->id);
          if (!$files = $fs->get_area_files($context->id, 'user', 'draft', $draftid, 'id DESC', false)) {
              return null;
          }
          $file = reset($files);
  
          return $file;
  
      }
code_tokens: protected function get_cohort_file ( $ draftid ) { global $ USER ; // We can not use moodleform::get_file_content() method because we need the content before the form is validated. if ( ! $ draftid ) { return null ; } $ fs = get_file_storage ( ) ; $ context = context_user :: instance ( $ USER -> id ) ; if ( ! $ files = $ fs -> get_area_files ( $ context -> id , 'user' , 'draft' , $ draftid , 'id DESC' , false ) ) { return null ; } $ file = reset ( $ files ) ; return $ file ; }
docstring: Returns the uploaded file if it is present.
  
  @param int $draftid
  @return stored_file|null
docstring_tokens: Returns the uploaded file if it is present .