class_docstr: This class deals with all model-related storage requirements, from setting status to storing artifacts.
class_docstr_tok: ["This","class","deals","with","all","model-related","storage","requirements",",","from","setting","status","to","storing","artifacts","."]
docstr: Get model record by id
  
  Args:
      model_id (int): model id
      check_exists (bool): true if need to check that model exists
  
  Returns:
      Union[db.Predictor, None]: model record
  
  Raises:
      KeyError: if `check_exists` is True and model does not exists
docstr_tok: ["Get","model","record","by","id","Args",":","model_id","(","int",")",":","model","id","check_exists","(","bool",")",":","true","if","need","to","check","that","model","exists","Returns",":","Union","[","db.Predictor",",","None","]",":","model","record","Raises",":","KeyError",":","if","`","check_exists","`","is","True","and","model","does","not","exists"]
code: def _get_model_record(
      self, model_id: int, check_exists: bool = False
  ) -> Union[db.Predictor, None]:
      """Get model record by id
  
      Args:
          model_id (int): model id
          check_exists (bool): true if need to check that model exists
  
      Returns:
          Union[db.Predictor, None]: model record
  
      Raises:
          KeyError: if `check_exists` is True and model does not exists
      """
      model_record = db.Predictor.query.get(self.predictor_id)
      if check_exists is True and model_record is None:
          raise KeyError("Model does not exists")
      return model_record
  
imports: import os
  import re
  import io
  import zipfile
  from typing import Union
  import mindsdb.interfaces.storage.db
  from .fs import RESOURCE_GROUP, FileStorageFactory, SERVICE_FILES_NAMES
  from .json import get_json_storage
label_desc: Use image node_id 2 for calling the ModelStorage obj's underlying member method code with example usage: obj._get_model_record(model_id, check_exists) and returns: model_record