original_string: public function is_allowed_in_context($typeid, $courseid) {
          global $DB;
  
          // Check if it is a Course tool for this course or a Site tool.
          $type = $DB->get_record('lti_types', array('id' => $typeid));
  
          return $type && ($type->course == $courseid || $type->course == SITEID);
      }
code: public function is_allowed_in_context($typeid, $courseid) {
          global $DB;
  
          // Check if it is a Course tool for this course or a Site tool.
          $type = $DB->get_record('lti_types', array('id' => $typeid));
  
          return $type && ($type->course == $courseid || $type->course == SITEID);
      }
code_tokens: public function is_allowed_in_context ( $ typeid , $ courseid ) { global $ DB ; // Check if it is a Course tool for this course or a Site tool. $ type = $ DB -> get_record ( 'lti_types' , array ( 'id' => $ typeid ) ) ; return $ type && ( $ type -> course == $ courseid || $ type -> course == SITEID ) ; }
docstring: Checks if there is a site tool or a course tool for this site.
  
  @param int $typeid The tool lti type id.
  @param int $courseid The course id.
  @return bool returns True if tool is allowed in context, false otherwise.
docstring_tokens: Checks if there is a site tool or a course tool for this site .