original_string: public static function get_blockids_from_moduleid($moduleid) {
          global $DB;
  
          // Get the context of the module
          $contextid = context_module::instance($moduleid)->id;
  
          // Get all the block instances which parentcontextid is the module contextid
          $blockids = array();
          $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
          foreach ($instances as $instance) {
              $blockids[] = $instance->id;
          }
          return $blockids;
      }
code: public static function get_blockids_from_moduleid($moduleid) {
          global $DB;
  
          // Get the context of the module
          $contextid = context_module::instance($moduleid)->id;
  
          // Get all the block instances which parentcontextid is the module contextid
          $blockids = array();
          $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
          foreach ($instances as $instance) {
              $blockids[] = $instance->id;
          }
          return $blockids;
      }
code_tokens: public static function get_blockids_from_moduleid ( $ moduleid ) { global $ DB ; // Get the context of the module $ contextid = context_module :: instance ( $ moduleid ) -> id ; // Get all the block instances which parentcontextid is the module contextid $ blockids = array ( ) ; $ instances = $ DB -> get_records ( 'block_instances' , array ( 'parentcontextid' => $ contextid ) , '' , 'id' ) ; foreach ( $ instances as $ instance ) { $ blockids [ ] = $ instance -> id ; } return $ blockids ; }
docstring: Given one course module id, return one array with all the block intances that belong to it
docstring_tokens: Given one course module id return one array with all the block intances that belong to it