code: def get_logs(
      min_timestamp, max_timestamp, context, level, log_from, limit
  ):
      logs = db.session.query(db.Log).filter(
          db.Log.company_id == ctx.company_id,
          db.Log.created_at > min_timestamp,
      )
  
      if max_timestamp is not None:
          logs = logs.filter(db.Log.created_at < max_timestamp)
  
      if context is not None:
          # e.g. datasource/predictor and assoicated id
          pass
  
      if level is not None:
          logs = logs.filter(db.Log.log_type == level)
  
      if log_from is not None:
          # mindsdb/native/lightwood/all
          pass
  
      if limit is not None:
          logs = logs.limit(limit)
  
      logs = [fmt_log_record(x) for x in logs]
      return logs
  
imports: from mindsdb.interfaces.storage import db
  from mindsdb.utilities.context import context
label_desc: Use image node_id 2 for calling a global function with example usage: get_logs(min_timestamp, max_timestamp, context, level, log_from, limit) and returns: logs